Merge pull request #1231 from skriss/k8s-1.12-deps

update kubernetes and azure dependencies to 1.12
pull/1251/head
KubeKween 2019-02-28 15:09:06 -08:00 committed by GitHub
commit e21940bee1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
537 changed files with 54950 additions and 21537 deletions

361
Gopkg.lock generated
View File

@ -2,6 +2,7 @@
[[projects]]
digest = "1:769af0c7dbdc19798e013900cfa855af9a7fda89912e019330a1dbd80a1e9a8c"
name = "cloud.google.com/go"
packages = [
"compute/metadata",
@ -9,22 +10,27 @@
"internal",
"internal/optional",
"internal/version",
"storage"
"storage",
]
pruneopts = "NUT"
revision = "44bcd0b2078ba5e7fedbeb36808d1ed893534750"
version = "v0.11.0"
[[projects]]
digest = "1:5b71d15be52cbb93f5115f51ace93798204f6b4a3df0992d0b6da8644f505984"
name = "github.com/Azure/azure-sdk-for-go"
packages = [
"arm/disk",
"services/storage/mgmt/2017-10-01/storage",
"storage"
"services/compute/mgmt/2018-04-01/compute",
"services/storage/mgmt/2018-02-01/storage",
"storage",
"version",
]
revision = "2d1d76c9013c4feb6695a2346f0e66ea0ef77aa6"
version = "v11.3.0-beta"
pruneopts = "NUT"
revision = "520918e6c8e8e1064154f51d13e02fad92b287b8"
version = "v19.0.0"
[[projects]]
digest = "1:b825d8578481c8877ff3b9a3654d77a48577cc33e65f33c3678d7e3f134bf73d"
name = "github.com/Azure/go-autorest"
packages = [
"autorest",
@ -32,11 +38,15 @@
"autorest/azure",
"autorest/date",
"autorest/to",
"autorest/validation"
"autorest/validation",
"version",
]
revision = "1ff28809256a84bb6966640ff3d0371af82ccba4"
pruneopts = "NUT"
revision = "bca49d5b51a50dc5bb17bbf6204c711c6dbded06"
version = "v10.14.0"
[[projects]]
digest = "1:f41188abdb95b92995643a927f5bdd208389822a8e1aba00d85633ae51b85c85"
name = "github.com/aws/aws-sdk-go"
packages = [
"aws",
@ -69,73 +79,93 @@
"service/s3",
"service/s3/s3iface",
"service/s3/s3manager",
"service/sts"
"service/sts",
]
pruneopts = "NUT"
revision = "1f8fb9d0919e5a58992207db9512a03f76ab0274"
version = "v1.13.12"
[[projects]]
branch = "master"
digest = "1:707ebe952a8b3d00b343c01536c79c73771d100f63ec6babeaed5c79e2b8a8dd"
name = "github.com/beorn7/perks"
packages = ["quantile"]
pruneopts = "NUT"
revision = "3a771d992973f24aa725d07868b467d1ddfceafb"
[[projects]]
digest = "1:a2c1d0e43bd3baaa071d1b9ed72c27d78169b2b269f71c105ac4ba34b1be4a39"
name = "github.com/davecgh/go-spew"
packages = ["spew"]
pruneopts = "NUT"
revision = "346938d642f2ec3594ed81d874461961cd0faa76"
version = "v1.1.0"
[[projects]]
digest = "1:7a6852b35eb5bbc184561443762d225116ae630c26a7c4d90546619f1e7d2ad2"
name = "github.com/dgrijalva/jwt-go"
packages = ["."]
pruneopts = "NUT"
revision = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e"
version = "v3.2.0"
[[projects]]
branch = "master"
digest = "1:da25cf063072a10461c19320e82117d85f9d60be4c95a62bc8d5a49acf7d0ca5"
name = "github.com/docker/spdystream"
packages = [
".",
"spdy"
"spdy",
]
pruneopts = "NUT"
revision = "bc6354cbbc295e925e4c611ffe90c1f287ee54db"
[[projects]]
branch = "master"
digest = "1:e8ffe2fb7368f65afaaf39769207bee2a7aeddf694e94f5bc05cffd750d4d98d"
name = "github.com/evanphx/json-patch"
packages = ["."]
pruneopts = "NUT"
revision = "944e07253867aacae43c04b2e6a239005443f33a"
[[projects]]
digest = "1:81466b4218bf6adddac2572a30ac733a9255919bc2f470b4827a317bd4ee1756"
name = "github.com/ghodss/yaml"
packages = ["."]
pruneopts = "NUT"
revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7"
version = "v1.0.0"
[[projects]]
digest = "1:021d6ee454d87208dd1cd731cd702d3521aa8a51ad2072fa7beffbb3d677d8bb"
name = "github.com/go-ini/ini"
packages = ["."]
pruneopts = "NUT"
revision = "20b96f641a5ea98f2f8619ff4f3e061cff4833bd"
version = "v1.28.2"
[[projects]]
digest = "1:a6afc27b2a73a5506832f3c5a1c19a30772cb69e7bd1ced4639eb36a55db224f"
name = "github.com/gogo/protobuf"
packages = [
"proto",
"sortkeys"
"sortkeys",
]
pruneopts = "NUT"
revision = "100ba4e885062801d56799d78530b73b178a78f3"
version = "v0.4"
[[projects]]
branch = "master"
digest = "1:e2b86e41f3d669fc36b50d31d32d22c8ac656c75aa5ea89717ce7177e134ff2a"
name = "github.com/golang/glog"
packages = ["."]
pruneopts = "NUT"
revision = "23def4e6c14b4da8ac2ed8007337bc5eb5007998"
[[projects]]
branch = "master"
digest = "1:b439521d795bf4b26f6b688f2f9fbed5e57695a08ba3dd62f35a19d2d9b513e7"
name = "github.com/golang/protobuf"
packages = [
"proto",
@ -143,235 +173,312 @@
"ptypes",
"ptypes/any",
"ptypes/duration",
"ptypes/timestamp"
"ptypes/timestamp",
]
pruneopts = "NUT"
revision = "ab9f9a6dab164b7d1246e0e688b0ab7b94d8553e"
[[projects]]
branch = "master"
digest = "1:245bd4eb633039cd66106a5d340ae826d87f4e36a8602fcc940e14176fd26ea7"
name = "github.com/google/btree"
packages = ["."]
pruneopts = "NUT"
revision = "e89373fe6b4a7413d7acd6da1725b83ef713e6e4"
[[projects]]
branch = "master"
digest = "1:52c5834e2bebac9030c97cc0798ac11c3aa8a39f098aeb419f142533da6cd3cc"
name = "github.com/google/gofuzz"
packages = ["."]
pruneopts = "NUT"
revision = "24818f796faf91cd76ec7bddd72458fbced7a6c1"
[[projects]]
branch = "master"
digest = "1:139e03a0b4ef05098c2acb7c081b2d84d9478cae11ac777f7c1f6d550efab1ca"
name = "github.com/googleapis/gax-go"
packages = ["."]
pruneopts = "NUT"
revision = "84ed26760e7f6f80887a2fbfb50db3cc415d2cea"
[[projects]]
digest = "1:3d7c1446fc5c710351b246c0dc6700fae843ca27f5294d0bd9f68bab2a810c44"
name = "github.com/googleapis/gnostic"
packages = [
"OpenAPIv2",
"compiler",
"extensions"
"extensions",
]
pruneopts = "NUT"
revision = "ee43cbb60db7bd22502942cccbc39059117352ab"
version = "v0.1.0"
[[projects]]
branch = "master"
digest = "1:7fdf3223c7372d1ced0b98bf53457c5e89d89aecbad9a77ba9fcc6e01f9e5621"
name = "github.com/gregjones/httpcache"
packages = [
".",
"diskcache"
"diskcache",
]
pruneopts = "NUT"
revision = "9cad4c3443a7200dd6400aef47183728de563a38"
[[projects]]
branch = "master"
digest = "1:32e5a56c443b5581e4bf6e74cdc78b5826d7e4c5df43883e2dc31e4d7f4ae98a"
name = "github.com/hashicorp/go-hclog"
packages = ["."]
pruneopts = "NUT"
revision = "ca137eb4b4389c9bc6f1a6d887f056bf16c00510"
[[projects]]
branch = "master"
digest = "1:f33adf6b54765c5914f2133d1f567ac8c82dbd3723d1d9ebbad16df421c7a148"
name = "github.com/hashicorp/go-plugin"
packages = ["."]
pruneopts = "NUT"
revision = "e2fbc6864d18d3c37b6cde4297ec9fca266d28f1"
[[projects]]
branch = "master"
digest = "1:892e13370cbfcda090d8f7676ef67b50cb2ead5460b72f3a1c2bb1c19e9a57de"
name = "github.com/hashicorp/golang-lru"
packages = [
".",
"simplelru"
"simplelru",
]
pruneopts = "NUT"
revision = "0a025b7e63adc15a622f29b0b2c4c3848243bbf6"
[[projects]]
branch = "master"
digest = "1:73d3d2f8f2bcf510db08576eca6c1d2b87bcea348de26bf1386b291ad1b52296"
name = "github.com/hashicorp/yamux"
packages = ["."]
pruneopts = "NUT"
revision = "f5742cb6b85602e7fa834e9d5d91a7d7fa850824"
[[projects]]
digest = "1:36480ab1ebec17489013e8a69d15451f47d0edbf8a54a45284857d13a0ebf692"
name = "github.com/imdario/mergo"
packages = ["."]
pruneopts = "NUT"
revision = "3e95a51e0639b4cf372f2ccf74c86749d747fbdc"
version = "0.2.2"
[[projects]]
digest = "1:406338ad39ab2e37b7f4452906442a3dbf0eb3379dd1f06aafb5c07e769a5fbb"
name = "github.com/inconshreveable/mousetrap"
packages = ["."]
pruneopts = "NUT"
revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75"
version = "v1.0"
[[projects]]
digest = "1:ac6d01547ec4f7f673311b4663909269bfb8249952de3279799289467837c3cc"
name = "github.com/jmespath/go-jmespath"
packages = ["."]
pruneopts = "NUT"
revision = "0b12d6b5"
[[projects]]
digest = "1:8e36686e8b139f8fe240c1d5cf3a145bc675c22ff8e707857cdd3ae17b00d728"
name = "github.com/json-iterator/go"
packages = ["."]
revision = "f2b4162afba35581b6d4a50d3b8f34e33c144682"
pruneopts = "NUT"
revision = "1624edc4454b8682399def8740d46db5e4362ba4"
version = "v1.1.5"
[[projects]]
digest = "1:13ada91f079028d1b4ca88e10a16439dcfa6541d26ed2e61e770f56d06301933"
name = "github.com/marstr/guid"
packages = ["."]
pruneopts = "NUT"
revision = "8bd9a64bf37eb297b492a4101fb28e80ac0b290f"
version = "v1.1.0"
[[projects]]
digest = "1:5985ef4caf91ece5d54817c11ea25f182697534f8ae6521eadcd628c142ac4b6"
name = "github.com/matttproud/golang_protobuf_extensions"
packages = ["pbutil"]
pruneopts = "NUT"
revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c"
version = "v1.0.1"
[[projects]]
branch = "master"
digest = "1:18b773b92ac82a451c1276bd2776c1e55ce057ee202691ab33c8d6690efcc048"
name = "github.com/mitchellh/go-testing-interface"
packages = ["."]
pruneopts = "NUT"
revision = "a61a99592b77c9ba629d254a693acffaeb4b7e28"
[[projects]]
digest = "1:2f42fa12d6911c7b7659738758631bec870b7e9b4c6be5444f963cdcfccc191f"
name = "github.com/modern-go/concurrent"
packages = ["."]
pruneopts = "NUT"
revision = "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94"
version = "1.0.3"
[[projects]]
digest = "1:c6aca19413b13dc59c220ad7430329e2ec454cc310bc6d8de2c7e2b93c18a0f6"
name = "github.com/modern-go/reflect2"
packages = ["."]
revision = "1df9eeb2bb81f327b96228865c5687bc2194af3f"
version = "1.0.0"
pruneopts = "NUT"
revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd"
version = "1.0.1"
[[projects]]
branch = "master"
digest = "1:3bf17a6e6eaa6ad24152148a631d18662f7212e21637c2699bff3369b7f00fa2"
name = "github.com/petar/GoLLRB"
packages = ["llrb"]
pruneopts = "NUT"
revision = "53be0d36a84c2a886ca057d34b6aa4468df9ccb4"
[[projects]]
digest = "1:6c6d91dc326ed6778783cff869c49fb2f61303cdd2ebbcf90abe53505793f3b6"
name = "github.com/peterbourgon/diskv"
packages = ["."]
pruneopts = "NUT"
revision = "5f041e8faa004a95c88a202771f4cc3e991971e6"
version = "v2.0.1"
[[projects]]
digest = "1:5cf3f025cbee5951a4ee961de067c8a89fc95a5adabead774f82822efabab121"
name = "github.com/pkg/errors"
packages = ["."]
pruneopts = "NUT"
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
version = "v0.8.0"
[[projects]]
digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe"
name = "github.com/pmezard/go-difflib"
packages = ["difflib"]
pruneopts = "NUT"
revision = "792786c7400a136282c1664665ae0a8db921c6c2"
version = "v1.0.0"
[[projects]]
digest = "1:03bca087b180bf24c4f9060775f137775550a0834e18f0bca0520a868679dbd7"
name = "github.com/prometheus/client_golang"
packages = [
"prometheus",
"prometheus/promhttp"
"prometheus/promhttp",
]
pruneopts = "NUT"
revision = "c5b7fccd204277076155f10851dad72b76a49317"
version = "v0.8.0"
[[projects]]
branch = "master"
digest = "1:32d10bdfa8f09ecf13598324dba86ab891f11db3c538b6a34d1c3b5b99d7c36b"
name = "github.com/prometheus/client_model"
packages = ["go"]
pruneopts = "NUT"
revision = "99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c"
[[projects]]
branch = "master"
digest = "1:768b555b86742de2f28beb37f1dedce9a75f91f871d75b5717c96399c1a78c08"
name = "github.com/prometheus/common"
packages = [
"expfmt",
"internal/bitbucket.org/ww/goautoneg",
"model"
"model",
]
pruneopts = "NUT"
revision = "7600349dcfe1abd18d72d3a1770870d9800a7801"
[[projects]]
branch = "master"
digest = "1:c4a213a8d73fbb0b13f717ba7996116602ef18ecb42b91d77405877914cb0349"
name = "github.com/prometheus/procfs"
packages = [
".",
"internal/util",
"nfs",
"xfs"
"xfs",
]
pruneopts = "NUT"
revision = "94663424ae5ae9856b40a9f170762b4197024661"
[[projects]]
digest = "1:f53493533f0689ff978122bb36801af47fe549828ce786af9166694394c3fa0d"
name = "github.com/robfig/cron"
packages = ["."]
pruneopts = "NUT"
revision = "df38d32658d8788cd446ba74db4bb5375c4b0cb3"
[[projects]]
name = "github.com/satori/uuid"
digest = "1:6bc0652ea6e39e22ccd522458b8bdd8665bf23bdc5a20eec90056e4dc7e273ca"
name = "github.com/satori/go.uuid"
packages = ["."]
revision = "879c5887cd475cd7864858769793b2ceb0d44feb"
version = "v1.1.0"
pruneopts = "NUT"
revision = "f58768cc1a7a7e77a3bd49e98cdd21419399b6a3"
version = "v1.2.0"
[[projects]]
digest = "1:31c5d934770c8b0698c28eb8576cb39b14e2fcf3c5f2a6e8449116884cd92e3f"
name = "github.com/sirupsen/logrus"
packages = ["."]
pruneopts = "NUT"
revision = "f006c2ac4710855cf0f916dd6b77acf6b048dc6e"
version = "v1.0.3"
[[projects]]
branch = "master"
digest = "1:7e6f7748181bd6004ace3f6ccd389a088bac357714364152fde0e5f9e0b588d7"
name = "github.com/spf13/afero"
packages = [
".",
"mem"
"mem",
]
pruneopts = "NUT"
revision = "9be650865eab0c12963d8753212f4f9c66cdcf12"
[[projects]]
digest = "1:343d44e06621142ab09ae0c76c1799104cdfddd3ffb445d78b1adf8dc3ffaf3d"
name = "github.com/spf13/cobra"
packages = ["."]
pruneopts = "NUT"
revision = "ef82de70bb3f60c65fb8eebacbb2d122ef517385"
version = "v0.0.3"
[[projects]]
digest = "1:e3707aeaccd2adc89eba6c062fec72116fe1fc1ba71097da85b4d8ae1668a675"
name = "github.com/spf13/pflag"
packages = ["."]
pruneopts = "NUT"
revision = "9a97c102cda95a86cec2345a6f09f55a939babf5"
version = "v1.0.2"
[[projects]]
digest = "1:60a46e2410edbf02b419f833372dd1d24d7aa1b916a990a7370e792fada1eadd"
name = "github.com/stretchr/objx"
packages = ["."]
pruneopts = "NUT"
revision = "477a77ecc69700c7cdeb1fa9e129548e1c1c393c"
version = "v0.1.1"
[[projects]]
digest = "1:72cea38d2957d95d18be2287ef9d4b06b89796d2e3070bc7f796bea3a4844381"
name = "github.com/stretchr/testify"
packages = [
"assert",
"mock",
"require"
"require",
]
pruneopts = "NUT"
revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686"
version = "v1.2.2"
[[projects]]
digest = "1:2f977d7025e73f05091f406514f1d2cca36cc649d2af08d5f5223ebc6c475863"
name = "go.opencensus.io"
packages = [
".",
@ -386,19 +493,23 @@
"trace",
"trace/internal",
"trace/propagation",
"trace/tracestate"
"trace/tracestate",
]
pruneopts = "NUT"
revision = "79993219becaa7e29e3b60cb67f5b8e82dee11d6"
version = "v0.17.0"
[[projects]]
branch = "master"
digest = "1:624a05c7c6ed502bf77364cd3d54631383dafc169982fddd8ee77b53c3d9cccf"
name = "golang.org/x/crypto"
packages = ["ssh/terminal"]
pruneopts = "NUT"
revision = "eb71ad9bd329b5ac0fd0148dd99bd62e8be8e035"
[[projects]]
branch = "master"
digest = "1:ce8a4c0642d5e3881d1970f39008477671a2a5157d051c36d1618cf6bb669556"
name = "golang.org/x/net"
packages = [
"context",
@ -408,33 +519,39 @@
"idna",
"internal/timeseries",
"lex/httplex",
"trace"
"trace",
]
pruneopts = "NUT"
revision = "1c05540f6879653db88113bc4a2b70aec4bd491f"
[[projects]]
branch = "master"
digest = "1:b0fef33b00740f7eeb5198f67ee1642d8d2560e9b428df7fb5f69fb140f5c4d0"
name = "golang.org/x/oauth2"
packages = [
".",
"google",
"internal",
"jws",
"jwt"
"jwt",
]
pruneopts = "NUT"
revision = "9dcd33a902f40452422c2367fefcb95b54f9f8f8"
[[projects]]
branch = "master"
digest = "1:b367d0d9c19817e2a2511428a6f98d5e2a7a07d3fbc2583b81b125503c59e0ec"
name = "golang.org/x/sys"
packages = [
"unix",
"windows"
"windows",
]
pruneopts = "NUT"
revision = "43e60d72a8e2bd92ee98319ba9a384a0e9837c08"
[[projects]]
branch = "master"
digest = "1:0f6792185947c44cd78bc6a2f4399c44c7e85d406b3229a27d41f6cd0a8e982b"
name = "golang.org/x/text"
packages = [
"encoding",
@ -451,18 +568,22 @@
"unicode/bidi",
"unicode/cldr",
"unicode/norm",
"unicode/rangetable"
"unicode/rangetable",
]
pruneopts = "NUT"
revision = "e56139fd9c5bc7244c76116c68e500765bb6db6b"
[[projects]]
branch = "master"
digest = "1:51a479a09b7ed06b7be5a854e27fcc328718ae0e5ad159f9ddeef12d0326c2e7"
name = "golang.org/x/time"
packages = ["rate"]
pruneopts = "NUT"
revision = "26559e0f760e39c24d730d3224364aef164ee23f"
[[projects]]
branch = "master"
digest = "1:a602f48d6caf1bcb3a082346459de0e0dbc6ea9aeabc3cb88255794980644001"
name = "google.golang.org/api"
packages = [
"compute/v1",
@ -475,11 +596,13 @@
"option",
"storage/v1",
"transport/http",
"transport/http/internal/propagation"
"transport/http/internal/propagation",
]
pruneopts = "NUT"
revision = "3f6e8463aa1d824abe11b439d178c02220079da5"
[[projects]]
digest = "1:7206d98ec77c90c72ec2c405181a1dcf86965803b6dbc4f98ceab7a5047c37a9"
name = "google.golang.org/appengine"
packages = [
".",
@ -491,22 +614,26 @@
"internal/modules",
"internal/remote_api",
"internal/urlfetch",
"urlfetch"
"urlfetch",
]
pruneopts = "NUT"
revision = "150dc57a1b433e64154302bdc40b6bb8aefa313a"
version = "v1.0.0"
[[projects]]
branch = "master"
digest = "1:a2059631b54cdc40db08f8c4dfb39d3c5ec442003506327df2c675a9384b7115"
name = "google.golang.org/genproto"
packages = [
"googleapis/api/annotations",
"googleapis/iam/v1",
"googleapis/rpc/status"
"googleapis/rpc/status",
]
pruneopts = "NUT"
revision = "ee236bd376b077c7a89f260c026c4735b195e459"
[[projects]]
digest = "1:40cc9fb049d68488fbbd75edec7010cf85ce1e27617c52958ff0f6a030c1a0d0"
name = "google.golang.org/grpc"
packages = [
".",
@ -525,24 +652,30 @@
"stats",
"status",
"tap",
"transport"
"transport",
]
pruneopts = "NUT"
revision = "b3ddf786825de56a4178401b7e174ee332173b66"
version = "v1.5.2"
[[projects]]
digest = "1:ef72505cf098abdd34efeea032103377bec06abb61d8a06f002d5d296a4b1185"
name = "gopkg.in/inf.v0"
packages = ["."]
pruneopts = "NUT"
revision = "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4"
version = "v0.9.0"
[[projects]]
branch = "v2"
digest = "1:c85dc78b3426641ebf2a0bbf5b731b5c4613ddb5987dbe218f7e75468dcd56f5"
name = "gopkg.in/yaml.v2"
packages = ["."]
pruneopts = "NUT"
revision = "eb3733d160e74a9c7e442f435eb3bea458e1d19f"
[[projects]]
digest = "1:93e9a6515f47aaaf7f1c84617fc8c82db9216f7290c4d4149afeaf6936d9aa5e"
name = "k8s.io/api"
packages = [
"admission/v1beta1",
@ -557,10 +690,12 @@
"authorization/v1beta1",
"autoscaling/v1",
"autoscaling/v2beta1",
"autoscaling/v2beta2",
"batch/v1",
"batch/v1beta1",
"batch/v2alpha1",
"certificates/v1beta1",
"coordination/v1beta1",
"core/v1",
"events/v1beta1",
"extensions/v1beta1",
@ -575,22 +710,25 @@
"settings/v1alpha1",
"storage/v1",
"storage/v1alpha1",
"storage/v1beta1"
"storage/v1beta1",
]
revision = "072894a440bdee3a891dea811fe42902311cd2a3"
version = "kubernetes-1.11.0"
pruneopts = "NUT"
revision = "fd83cbc87e7632ccd8bbab63d2b673d4e0c631cc"
version = "kubernetes-1.12.0"
[[projects]]
branch = "master"
digest = "1:b8a1dcc5f4e559b7af185ba12dd341cb8c175ea3d36227a02699b251ae5fde05"
name = "k8s.io/apiextensions-apiserver"
packages = [
"pkg/apis/apiextensions",
"pkg/apis/apiextensions/v1beta1"
"pkg/apis/apiextensions/v1beta1",
]
revision = "07bbbb7a28a34c56bf9d1b192a88cc9b2350095e"
pruneopts = "NUT"
revision = "1748dfb29e8a4432b78514bc88a1b07937a9805a"
version = "kubernetes-1.12.0"
[[projects]]
branch = "release-1.11"
digest = "1:ca279c0bb7a72618aff5b77440d5a5e2f92857fdb7e0e4c7a1a77a7895929c49"
name = "k8s.io/apimachinery"
packages = [
"pkg/api/equality",
@ -627,6 +765,7 @@
"pkg/util/intstr",
"pkg/util/json",
"pkg/util/mergepatch",
"pkg/util/naming",
"pkg/util/net",
"pkg/util/remotecommand",
"pkg/util/runtime",
@ -640,11 +779,26 @@
"pkg/watch",
"third_party/forked/golang/json",
"third_party/forked/golang/netutil",
"third_party/forked/golang/reflect"
"third_party/forked/golang/reflect",
]
revision = "103fd098999dc9c0c88536f5c9ad2e5da39373ae"
pruneopts = "NUT"
revision = "6dd46049f39503a1fc8d65de4bd566829e95faff"
version = "kubernetes-1.12.0"
[[projects]]
branch = "release-1.12"
digest = "1:7991e5074de01462e0cf6ef77060895b50e9026d16152a6e925cb99b67a1f8ae"
name = "k8s.io/cli-runtime"
packages = [
"pkg/genericclioptions",
"pkg/genericclioptions/printers",
"pkg/genericclioptions/resource",
]
pruneopts = "NUT"
revision = "11047e25a94a7eaa541b92a8bbfd3e1243607219"
[[projects]]
digest = "1:5d9f76731330e62bede1e4eb9d519b282a26621a5368e5db1a18a8eb1ccda1ff"
name = "k8s.io/client-go"
packages = [
"discovery",
@ -661,12 +815,15 @@
"informers/autoscaling",
"informers/autoscaling/v1",
"informers/autoscaling/v2beta1",
"informers/autoscaling/v2beta2",
"informers/batch",
"informers/batch/v1",
"informers/batch/v1beta1",
"informers/batch/v2alpha1",
"informers/certificates",
"informers/certificates/v1beta1",
"informers/coordination",
"informers/coordination/v1beta1",
"informers/core",
"informers/core/v1",
"informers/events",
@ -704,10 +861,12 @@
"kubernetes/typed/authorization/v1beta1",
"kubernetes/typed/autoscaling/v1",
"kubernetes/typed/autoscaling/v2beta1",
"kubernetes/typed/autoscaling/v2beta2",
"kubernetes/typed/batch/v1",
"kubernetes/typed/batch/v1beta1",
"kubernetes/typed/batch/v2alpha1",
"kubernetes/typed/certificates/v1beta1",
"kubernetes/typed/coordination/v1beta1",
"kubernetes/typed/core/v1",
"kubernetes/typed/events/v1beta1",
"kubernetes/typed/extensions/v1beta1",
@ -729,10 +888,12 @@
"listers/apps/v1beta2",
"listers/autoscaling/v1",
"listers/autoscaling/v2beta1",
"listers/autoscaling/v2beta2",
"listers/batch/v1",
"listers/batch/v1beta1",
"listers/batch/v2alpha1",
"listers/certificates/v1beta1",
"listers/coordination/v1beta1",
"listers/core/v1",
"listers/events/v1beta1",
"listers/extensions/v1beta1",
@ -781,32 +942,124 @@
"util/integer",
"util/jsonpath",
"util/retry",
"util/workqueue"
"util/workqueue",
]
revision = "7d04d0e2a0a1a4d4a1cd6baa432a2301492e4e65"
version = "v8.0.0"
pruneopts = "NUT"
revision = "1638f8970cefaa404ff3a62950f88b08292b2696"
version = "v9.0.0"
[[projects]]
branch = "master"
digest = "1:a2c842a1e0aed96fd732b535514556323a6f5edfded3b63e5e0ab1bce188aa54"
name = "k8s.io/kube-openapi"
packages = ["pkg/util/proto"]
pruneopts = "NUT"
revision = "d83b052f768a50a309c692a9c271da3f3276ff88"
[[projects]]
digest = "1:8a9b1e755afd7ea778cd451a955977eb3fe0abcc4e32079644b6b7afc42d7ff8"
name = "k8s.io/kubernetes"
packages = [
"pkg/kubectl/genericclioptions",
"pkg/kubectl/genericclioptions/printers",
"pkg/kubectl/genericclioptions/resource",
"pkg/kubectl/scheme",
"pkg/printers"
"pkg/printers",
]
revision = "91e7b4fd31fcd3d5f436da26c980becec37ceefe"
version = "v1.11.0"
pruneopts = "NUT"
revision = "51dd616cdd25d6ee22c83a858773b607328a18ec"
version = "v1.12.5"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "7979aebee2c67e7fa68bddf050ef32b75a2f51145d26d00a54f6bf489af635a2"
input-imports = [
"cloud.google.com/go/storage",
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute",
"github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-02-01/storage",
"github.com/Azure/azure-sdk-for-go/storage",
"github.com/Azure/go-autorest/autorest",
"github.com/Azure/go-autorest/autorest/adal",
"github.com/Azure/go-autorest/autorest/azure",
"github.com/Azure/go-autorest/autorest/to",
"github.com/aws/aws-sdk-go/aws",
"github.com/aws/aws-sdk-go/aws/awserr",
"github.com/aws/aws-sdk-go/aws/credentials",
"github.com/aws/aws-sdk-go/aws/endpoints",
"github.com/aws/aws-sdk-go/aws/request",
"github.com/aws/aws-sdk-go/aws/session",
"github.com/aws/aws-sdk-go/aws/signer/v4",
"github.com/aws/aws-sdk-go/service/ec2",
"github.com/aws/aws-sdk-go/service/s3",
"github.com/aws/aws-sdk-go/service/s3/s3manager",
"github.com/evanphx/json-patch",
"github.com/golang/glog",
"github.com/golang/protobuf/proto",
"github.com/hashicorp/go-hclog",
"github.com/hashicorp/go-plugin",
"github.com/pkg/errors",
"github.com/prometheus/client_golang/prometheus",
"github.com/prometheus/client_golang/prometheus/promhttp",
"github.com/robfig/cron",
"github.com/satori/go.uuid",
"github.com/sirupsen/logrus",
"github.com/spf13/afero",
"github.com/spf13/cobra",
"github.com/spf13/pflag",
"github.com/stretchr/testify/assert",
"github.com/stretchr/testify/mock",
"github.com/stretchr/testify/require",
"golang.org/x/net/context",
"golang.org/x/oauth2",
"golang.org/x/oauth2/google",
"google.golang.org/api/compute/v1",
"google.golang.org/api/googleapi",
"google.golang.org/api/iterator",
"google.golang.org/api/option",
"google.golang.org/grpc",
"k8s.io/api/apps/v1",
"k8s.io/api/apps/v1beta1",
"k8s.io/api/core/v1",
"k8s.io/api/rbac/v1",
"k8s.io/api/rbac/v1beta1",
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1",
"k8s.io/apimachinery/pkg/api/equality",
"k8s.io/apimachinery/pkg/api/errors",
"k8s.io/apimachinery/pkg/api/meta",
"k8s.io/apimachinery/pkg/apis/meta/v1",
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"k8s.io/apimachinery/pkg/labels",
"k8s.io/apimachinery/pkg/runtime",
"k8s.io/apimachinery/pkg/runtime/schema",
"k8s.io/apimachinery/pkg/runtime/serializer",
"k8s.io/apimachinery/pkg/types",
"k8s.io/apimachinery/pkg/util/clock",
"k8s.io/apimachinery/pkg/util/duration",
"k8s.io/apimachinery/pkg/util/errors",
"k8s.io/apimachinery/pkg/util/runtime",
"k8s.io/apimachinery/pkg/util/sets",
"k8s.io/apimachinery/pkg/util/wait",
"k8s.io/apimachinery/pkg/watch",
"k8s.io/client-go/discovery",
"k8s.io/client-go/discovery/fake",
"k8s.io/client-go/dynamic",
"k8s.io/client-go/informers",
"k8s.io/client-go/informers/core/v1",
"k8s.io/client-go/kubernetes",
"k8s.io/client-go/kubernetes/scheme",
"k8s.io/client-go/kubernetes/typed/core/v1",
"k8s.io/client-go/kubernetes/typed/rbac/v1",
"k8s.io/client-go/kubernetes/typed/rbac/v1beta1",
"k8s.io/client-go/listers/core/v1",
"k8s.io/client-go/plugin/pkg/client/auth/azure",
"k8s.io/client-go/plugin/pkg/client/auth/gcp",
"k8s.io/client-go/plugin/pkg/client/auth/oidc",
"k8s.io/client-go/rest",
"k8s.io/client-go/restmapper",
"k8s.io/client-go/testing",
"k8s.io/client-go/tools/cache",
"k8s.io/client-go/tools/clientcmd",
"k8s.io/client-go/tools/remotecommand",
"k8s.io/client-go/util/flowcontrol",
"k8s.io/client-go/util/workqueue",
"k8s.io/kubernetes/pkg/printers",
]
solver-name = "gps-cdcl"
solver-version = 1

View File

@ -31,31 +31,28 @@
[[constraint]]
name = "k8s.io/kubernetes"
version = "~1.11"
version = "~1.12"
[[constraint]]
name = "k8s.io/client-go"
version = "~8.0"
version = "~9.0"
[[constraint]]
name = "k8s.io/apimachinery"
version = "kubernetes-1.11.0"
version = "kubernetes-1.12.0"
[[constraint]]
name = "k8s.io/api"
version = "kubernetes-1.11.0"
version = "kubernetes-1.12.0"
# vendor/k8s.io/apimachinery/pkg/runtime/serializer/json/json.go:104:16:
# unknown field 'CaseSensitive' in struct literal of type jsoniter.Config
[[constraint]]
name = "k8s.io/apiextensions-apiserver"
version = "kubernetes-1.12.0"
# k8s.io/client-go v9.0 uses f2b4162afba35581b6d4a50d3b8f34e33c144682 (released in v1.1.4)
[[override]]
name = "github.com/json-iterator/go"
revision = "f2b4162afba35581b6d4a50d3b8f34e33c144682"
# vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go:300:25:
# cannot call non-function spt.Token (type adal.Token)
[[override]]
name = "github.com/Azure/go-autorest"
revision = "1ff28809256a84bb6966640ff3d0371af82ccba4"
version = "~1.1.4"
#
# Cloud provider packages
@ -66,7 +63,12 @@
[[constraint]]
name = "github.com/Azure/azure-sdk-for-go"
version = "~11.3.0-beta"
version = "~19.0.0"
# k8s.io/client-go v9.0 uses bca49d5b51a50dc5bb17bbf6204c711c6dbded06 (v10.14.0)
[[constraint]]
name = "github.com/Azure/go-autorest"
version = "~10.14.0"
[[constraint]]
name = "cloud.google.com/go"
@ -91,15 +93,9 @@
name = "github.com/robfig/cron"
revision = "df38d32658d8788cd446ba74db4bb5375c4b0cb3"
# TODO(1.0) this repo is a redirect to github.com/satori/go.uuid. Our
# current version of azure-sdk-for-go references this redirect, so
# use it so we don't get a duplicate copy of this dependency.
# Once our azure-sdk-for-go is updated to a newer version (where
# their dependency has changed to .../go.uuid), switch this to
# github.com/satori/go.uuid
[[constraint]]
name = "github.com/satori/uuid"
version = "1.1.0"
name = "github.com/satori/go.uuid"
version = "~1.2.0"
[[constraint]]
name = "github.com/spf13/afero"

View File

@ -0,0 +1 @@
update Kubernetes dependencies to match v1.12, and update Azure SDK to v19.0.0 (GA)

View File

@ -18,8 +18,8 @@ RUN apk add --update --no-cache git bash && \
mkdir -p /go/src/k8s.io && \
cd /go/src/k8s.io && \
git config --global advice.detachedHead false && \
git clone -b kubernetes-1.11.0 https://github.com/kubernetes/code-generator && \
git clone -b kubernetes-1.11.0 https://github.com/kubernetes/apimachinery && \
git clone -b kubernetes-1.12.0 https://github.com/kubernetes/code-generator && \
git clone -b kubernetes-1.12.0 https://github.com/kubernetes/apimachinery && \
go get golang.org/x/tools/cmd/goimports && \
cd /go/src/golang.org/x/tools && \
git checkout 40a48ad93fbe707101afb2099b738471f70594ec && \

View File

@ -21,7 +21,7 @@ limitations under the License.
package v1
import (
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
@ -114,12 +114,8 @@ func (in *BackupResourceHook) DeepCopyInto(out *BackupResourceHook) {
*out = *in
if in.Exec != nil {
in, out := &in.Exec, &out.Exec
if *in == nil {
*out = nil
} else {
*out = new(ExecHook)
(*in).DeepCopyInto(*out)
}
*out = new(ExecHook)
(*in).DeepCopyInto(*out)
}
return
}
@ -159,12 +155,8 @@ func (in *BackupResourceHookSpec) DeepCopyInto(out *BackupResourceHookSpec) {
}
if in.LabelSelector != nil {
in, out := &in.LabelSelector, &out.LabelSelector
if *in == nil {
*out = nil
} else {
*out = new(meta_v1.LabelSelector)
(*in).DeepCopyInto(*out)
}
*out = new(metav1.LabelSelector)
(*in).DeepCopyInto(*out)
}
if in.Hooks != nil {
in, out := &in.Hooks, &out.Hooks
@ -225,31 +217,19 @@ func (in *BackupSpec) DeepCopyInto(out *BackupSpec) {
}
if in.LabelSelector != nil {
in, out := &in.LabelSelector, &out.LabelSelector
if *in == nil {
*out = nil
} else {
*out = new(meta_v1.LabelSelector)
(*in).DeepCopyInto(*out)
}
*out = new(metav1.LabelSelector)
(*in).DeepCopyInto(*out)
}
if in.SnapshotVolumes != nil {
in, out := &in.SnapshotVolumes, &out.SnapshotVolumes
if *in == nil {
*out = nil
} else {
*out = new(bool)
**out = **in
}
*out = new(bool)
**out = **in
}
out.TTL = in.TTL
if in.IncludeClusterResources != nil {
in, out := &in.IncludeClusterResources, &out.IncludeClusterResources
if *in == nil {
*out = nil
} else {
*out = new(bool)
**out = **in
}
*out = new(bool)
**out = **in
}
in.Hooks.DeepCopyInto(&out.Hooks)
if in.VolumeSnapshotLocations != nil {
@ -278,12 +258,15 @@ func (in *BackupStatus) DeepCopyInto(out *BackupStatus) {
in, out := &in.VolumeBackups, &out.VolumeBackups
*out = make(map[string]*VolumeBackupInfo, len(*in))
for key, val := range *in {
var outVal *VolumeBackupInfo
if val == nil {
(*out)[key] = nil
} else {
(*out)[key] = new(VolumeBackupInfo)
val.DeepCopyInto((*out)[key])
in, out := &val, &outVal
*out = new(VolumeBackupInfo)
(*in).DeepCopyInto(*out)
}
(*out)[key] = outVal
}
}
if in.ValidationErrors != nil {
@ -1023,12 +1006,15 @@ func (in *RestoreResult) DeepCopyInto(out *RestoreResult) {
in, out := &in.Namespaces, &out.Namespaces
*out = make(map[string][]string, len(*in))
for key, val := range *in {
var outVal []string
if val == nil {
(*out)[key] = nil
} else {
(*out)[key] = make([]string, len(val))
copy((*out)[key], val)
in, out := &val, &outVal
*out = make([]string, len(*in))
copy(*out, *in)
}
(*out)[key] = outVal
}
}
return
@ -1076,30 +1062,18 @@ func (in *RestoreSpec) DeepCopyInto(out *RestoreSpec) {
}
if in.LabelSelector != nil {
in, out := &in.LabelSelector, &out.LabelSelector
if *in == nil {
*out = nil
} else {
*out = new(meta_v1.LabelSelector)
(*in).DeepCopyInto(*out)
}
*out = new(metav1.LabelSelector)
(*in).DeepCopyInto(*out)
}
if in.RestorePVs != nil {
in, out := &in.RestorePVs, &out.RestorePVs
if *in == nil {
*out = nil
} else {
*out = new(bool)
**out = **in
}
*out = new(bool)
**out = **in
}
if in.IncludeClusterResources != nil {
in, out := &in.IncludeClusterResources, &out.IncludeClusterResources
if *in == nil {
*out = nil
} else {
*out = new(bool)
**out = **in
}
*out = new(bool)
**out = **in
}
return
}
@ -1334,12 +1308,8 @@ func (in *StorageType) DeepCopyInto(out *StorageType) {
*out = *in
if in.ObjectStorage != nil {
in, out := &in.ObjectStorage, &out.ObjectStorage
if *in == nil {
*out = nil
} else {
*out = new(ObjectStorageLocation)
**out = **in
}
*out = new(ObjectStorageLocation)
**out = **in
}
return
}
@ -1359,12 +1329,8 @@ func (in *VolumeBackupInfo) DeepCopyInto(out *VolumeBackupInfo) {
*out = *in
if in.Iops != nil {
in, out := &in.Iops, &out.Iops
if *in == nil {
*out = nil
} else {
*out = new(int64)
**out = **in
}
*out = new(int64)
**out = **in
}
return
}

View File

@ -21,7 +21,7 @@ limitations under the License.
package v1
import (
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
@ -114,12 +114,8 @@ func (in *BackupResourceHook) DeepCopyInto(out *BackupResourceHook) {
*out = *in
if in.Exec != nil {
in, out := &in.Exec, &out.Exec
if *in == nil {
*out = nil
} else {
*out = new(ExecHook)
(*in).DeepCopyInto(*out)
}
*out = new(ExecHook)
(*in).DeepCopyInto(*out)
}
return
}
@ -159,12 +155,8 @@ func (in *BackupResourceHookSpec) DeepCopyInto(out *BackupResourceHookSpec) {
}
if in.LabelSelector != nil {
in, out := &in.LabelSelector, &out.LabelSelector
if *in == nil {
*out = nil
} else {
*out = new(meta_v1.LabelSelector)
(*in).DeepCopyInto(*out)
}
*out = new(metav1.LabelSelector)
(*in).DeepCopyInto(*out)
}
if in.Hooks != nil {
in, out := &in.Hooks, &out.Hooks
@ -225,31 +217,19 @@ func (in *BackupSpec) DeepCopyInto(out *BackupSpec) {
}
if in.LabelSelector != nil {
in, out := &in.LabelSelector, &out.LabelSelector
if *in == nil {
*out = nil
} else {
*out = new(meta_v1.LabelSelector)
(*in).DeepCopyInto(*out)
}
*out = new(metav1.LabelSelector)
(*in).DeepCopyInto(*out)
}
if in.SnapshotVolumes != nil {
in, out := &in.SnapshotVolumes, &out.SnapshotVolumes
if *in == nil {
*out = nil
} else {
*out = new(bool)
**out = **in
}
*out = new(bool)
**out = **in
}
out.TTL = in.TTL
if in.IncludeClusterResources != nil {
in, out := &in.IncludeClusterResources, &out.IncludeClusterResources
if *in == nil {
*out = nil
} else {
*out = new(bool)
**out = **in
}
*out = new(bool)
**out = **in
}
in.Hooks.DeepCopyInto(&out.Hooks)
if in.VolumeSnapshotLocations != nil {
@ -278,12 +258,15 @@ func (in *BackupStatus) DeepCopyInto(out *BackupStatus) {
in, out := &in.VolumeBackups, &out.VolumeBackups
*out = make(map[string]*VolumeBackupInfo, len(*in))
for key, val := range *in {
var outVal *VolumeBackupInfo
if val == nil {
(*out)[key] = nil
} else {
(*out)[key] = new(VolumeBackupInfo)
val.DeepCopyInto((*out)[key])
in, out := &val, &outVal
*out = new(VolumeBackupInfo)
(*in).DeepCopyInto(*out)
}
(*out)[key] = outVal
}
}
if in.ValidationErrors != nil {
@ -1028,12 +1011,15 @@ func (in *RestoreResult) DeepCopyInto(out *RestoreResult) {
in, out := &in.Namespaces, &out.Namespaces
*out = make(map[string][]string, len(*in))
for key, val := range *in {
var outVal []string
if val == nil {
(*out)[key] = nil
} else {
(*out)[key] = make([]string, len(val))
copy((*out)[key], val)
in, out := &val, &outVal
*out = make([]string, len(*in))
copy(*out, *in)
}
(*out)[key] = outVal
}
}
return
@ -1081,30 +1067,18 @@ func (in *RestoreSpec) DeepCopyInto(out *RestoreSpec) {
}
if in.LabelSelector != nil {
in, out := &in.LabelSelector, &out.LabelSelector
if *in == nil {
*out = nil
} else {
*out = new(meta_v1.LabelSelector)
(*in).DeepCopyInto(*out)
}
*out = new(metav1.LabelSelector)
(*in).DeepCopyInto(*out)
}
if in.RestorePVs != nil {
in, out := &in.RestorePVs, &out.RestorePVs
if *in == nil {
*out = nil
} else {
*out = new(bool)
**out = **in
}
*out = new(bool)
**out = **in
}
if in.IncludeClusterResources != nil {
in, out := &in.IncludeClusterResources, &out.IncludeClusterResources
if *in == nil {
*out = nil
} else {
*out = new(bool)
**out = **in
}
*out = new(bool)
**out = **in
}
return
}
@ -1339,12 +1313,8 @@ func (in *StorageType) DeepCopyInto(out *StorageType) {
*out = *in
if in.ObjectStorage != nil {
in, out := &in.ObjectStorage, &out.ObjectStorage
if *in == nil {
*out = nil
} else {
*out = new(ObjectStorageLocation)
**out = **in
}
*out = new(ObjectStorageLocation)
**out = **in
}
return
}
@ -1364,12 +1334,8 @@ func (in *VolumeBackupInfo) DeepCopyInto(out *VolumeBackupInfo) {
*out = *in
if in.Iops != nil {
in, out := &in.Iops, &out.Iops
if *in == nil {
*out = nil
} else {
*out = new(int64)
**out = **in
}
*out = new(int64)
**out = **in
}
return
}

View File

@ -98,7 +98,7 @@ type dynamicResourceClient struct {
var _ Dynamic = &dynamicResourceClient{}
func (d *dynamicResourceClient) Create(obj *unstructured.Unstructured) (*unstructured.Unstructured, error) {
return d.resourceClient.Create(obj)
return d.resourceClient.Create(obj, metav1.CreateOptions{})
}
func (d *dynamicResourceClient) List(options metav1.ListOptions) (runtime.Object, error) {
@ -114,5 +114,5 @@ func (d *dynamicResourceClient) Get(name string, opts metav1.GetOptions) (*unstr
}
func (d *dynamicResourceClient) Patch(name string, data []byte) (*unstructured.Unstructured, error) {
return d.resourceClient.Patch(name, types.MergePatchType, data)
return d.resourceClient.Patch(name, types.MergePatchType, data, metav1.UpdateOptions{})
}

View File

@ -25,11 +25,11 @@ import (
"strings"
"time"
"github.com/Azure/azure-sdk-for-go/arm/disk"
disk "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/pkg/errors"
"github.com/satori/uuid"
uuid "github.com/satori/go.uuid"
"github.com/sirupsen/logrus"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
@ -131,22 +131,24 @@ func (b *blockStore) CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ s
}
// Lookup snapshot info for its Location & Tags so we can apply them to the volume
snapshotInfo, err := b.snaps.Get(snapshotIdentifier.resourceGroup, snapshotIdentifier.name)
snapshotInfo, err := b.snaps.Get(context.TODO(), snapshotIdentifier.resourceGroup, snapshotIdentifier.name)
if err != nil {
return "", errors.WithStack(err)
}
diskName := "restore-" + uuid.NewV4().String()
disk := disk.Model{
disk := disk.Disk{
Name: &diskName,
Location: snapshotInfo.Location,
Properties: &disk.Properties{
DiskProperties: &disk.DiskProperties{
CreationData: &disk.CreationData{
CreateOption: disk.Copy,
SourceResourceID: stringPtr(snapshotIdentifier.String()),
},
AccountType: disk.StorageAccountTypes(volumeType),
},
Sku: &disk.DiskSku{
Name: disk.StorageAccountTypes(volumeType),
},
Tags: snapshotInfo.Tags,
}
@ -154,28 +156,36 @@ func (b *blockStore) CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ s
ctx, cancel := context.WithTimeout(context.Background(), b.apiTimeout)
defer cancel()
_, errChan := b.disks.CreateOrUpdate(b.disksResourceGroup, *disk.Name, disk, ctx.Done())
err = <-errChan
future, err := b.disks.CreateOrUpdate(ctx, b.disksResourceGroup, *disk.Name, disk)
if err != nil {
return "", errors.WithStack(err)
}
if err = future.WaitForCompletionRef(ctx, b.disks.Client); err != nil {
return "", errors.WithStack(err)
}
if _, err = future.Result(*b.disks); err != nil {
return "", errors.WithStack(err)
}
return diskName, nil
}
func (b *blockStore) GetVolumeInfo(volumeID, volumeAZ string) (string, *int64, error) {
res, err := b.disks.Get(b.disksResourceGroup, volumeID)
res, err := b.disks.Get(context.TODO(), b.disksResourceGroup, volumeID)
if err != nil {
return "", nil, errors.WithStack(err)
}
return string(res.AccountType), nil, nil
if res.Sku == nil {
return "", nil, errors.New("disk has a nil SKU")
}
return string(res.Sku.Name), nil, nil
}
func (b *blockStore) CreateSnapshot(volumeID, volumeAZ string, tags map[string]string) (string, error) {
// Lookup disk info for its Location
diskInfo, err := b.disks.Get(b.disksResourceGroup, volumeID)
diskInfo, err := b.disks.Get(context.TODO(), b.disksResourceGroup, volumeID)
if err != nil {
return "", errors.WithStack(err)
}
@ -193,7 +203,7 @@ func (b *blockStore) CreateSnapshot(volumeID, volumeAZ string, tags map[string]s
snap := disk.Snapshot{
Name: &snapshotName,
Properties: &disk.Properties{
DiskProperties: &disk.DiskProperties{
CreationData: &disk.CreationData{
CreateOption: disk.Copy,
SourceResourceID: &fullDiskName,
@ -206,17 +216,21 @@ func (b *blockStore) CreateSnapshot(volumeID, volumeAZ string, tags map[string]s
ctx, cancel := context.WithTimeout(context.Background(), b.apiTimeout)
defer cancel()
_, errChan := b.snaps.CreateOrUpdate(b.snapsResourceGroup, *snap.Name, snap, ctx.Done())
err = <-errChan
future, err := b.snaps.CreateOrUpdate(ctx, b.snapsResourceGroup, *snap.Name, snap)
if err != nil {
return "", errors.WithStack(err)
}
if err = future.WaitForCompletionRef(ctx, b.snaps.Client); err != nil {
return "", errors.WithStack(err)
}
if _, err = future.Result(*b.snaps); err != nil {
return "", errors.WithStack(err)
}
return getComputeResourceName(b.subscription, b.snapsResourceGroup, snapshotsResource, snapshotName), nil
}
func getSnapshotTags(veleroTags map[string]string, diskTags *map[string]*string) *map[string]*string {
func getSnapshotTags(veleroTags map[string]string, diskTags map[string]*string) map[string]*string {
if diskTags == nil && len(veleroTags) == 0 {
return nil
}
@ -225,7 +239,7 @@ func getSnapshotTags(veleroTags map[string]string, diskTags *map[string]*string)
// copy tags from disk to snapshot
if diskTags != nil {
for k, v := range *diskTags {
for k, v := range diskTags {
snapshotTags[k] = stringPtr(*v)
}
}
@ -240,7 +254,7 @@ func getSnapshotTags(veleroTags map[string]string, diskTags *map[string]*string)
snapshotTags[key] = stringPtr(v)
}
return &snapshotTags
return snapshotTags
}
func stringPtr(s string) *string {
@ -256,15 +270,24 @@ func (b *blockStore) DeleteSnapshot(snapshotID string) error {
ctx, cancel := context.WithTimeout(context.Background(), b.apiTimeout)
defer cancel()
_, errChan := b.snaps.Delete(snapshotInfo.resourceGroup, snapshotInfo.name, ctx.Done())
err = <-errChan
// if it's a 404 (not found) error, we don't need to return an error
// since the snapshot is not there.
// we don't want to return an error if the snapshot doesn't exist, and
// the Delete(..) call does not return a clear error if that's the case,
// so first try to get it and return early if we get a 404.
_, err = b.snaps.Get(ctx, snapshotInfo.resourceGroup, snapshotInfo.name)
if azureErr, ok := err.(autorest.DetailedError); ok && azureErr.StatusCode == http.StatusNotFound {
b.log.WithField("snapshotID", snapshotID).Debug("Snapshot not found")
return nil
}
future, err := b.snaps.Delete(ctx, snapshotInfo.resourceGroup, snapshotInfo.name)
if err != nil {
return errors.WithStack(err)
}
if err = future.WaitForCompletionRef(ctx, b.snaps.Client); err != nil {
b.log.WithError(err).Errorf("Error waiting for completion ref")
return errors.WithStack(err)
}
_, err = future.Result(*b.snaps)
if err != nil {
return errors.WithStack(err)
}

View File

@ -138,8 +138,8 @@ func TestGetSnapshotTags(t *testing.T) {
tests := []struct {
name string
veleroTags map[string]string
diskTags *map[string]*string
expected *map[string]*string
diskTags map[string]*string
expected map[string]*string
}{
{
name: "degenerate case (no tags)",
@ -154,7 +154,7 @@ func TestGetSnapshotTags(t *testing.T) {
"velero-key2": "velero-val2",
},
diskTags: nil,
expected: &map[string]*string{
expected: map[string]*string{
"velero-key1": stringPtr("velero-val1"),
"velero-key2": stringPtr("velero-val2"),
},
@ -166,7 +166,7 @@ func TestGetSnapshotTags(t *testing.T) {
"velero/key/2": "velero-val2",
},
diskTags: nil,
expected: &map[string]*string{
expected: map[string]*string{
"velero-key1": stringPtr("velero-val1"),
"velero-key-2": stringPtr("velero-val2"),
},
@ -174,11 +174,11 @@ func TestGetSnapshotTags(t *testing.T) {
{
name: "volume tags only get applied",
veleroTags: nil,
diskTags: &map[string]*string{
diskTags: map[string]*string{
"azure-key1": stringPtr("azure-val1"),
"azure-key2": stringPtr("azure-val2"),
},
expected: &map[string]*string{
expected: map[string]*string{
"azure-key1": stringPtr("azure-val1"),
"azure-key2": stringPtr("azure-val2"),
},
@ -186,8 +186,8 @@ func TestGetSnapshotTags(t *testing.T) {
{
name: "non-overlapping velero and volume tags both get applied",
veleroTags: map[string]string{"velero-key": "velero-val"},
diskTags: &map[string]*string{"azure-key": stringPtr("azure-val")},
expected: &map[string]*string{
diskTags: map[string]*string{"azure-key": stringPtr("azure-val")},
expected: map[string]*string{
"velero-key": stringPtr("velero-val"),
"azure-key": stringPtr("azure-val"),
},
@ -198,11 +198,11 @@ func TestGetSnapshotTags(t *testing.T) {
"velero-key": "velero-val",
"overlapping-key": "velero-val",
},
diskTags: &map[string]*string{
diskTags: map[string]*string{
"azure-key": stringPtr("azure-val"),
"overlapping-key": stringPtr("azure-val"),
},
expected: &map[string]*string{
expected: map[string]*string{
"velero-key": stringPtr("velero-val"),
"azure-key": stringPtr("azure-val"),
"overlapping-key": stringPtr("velero-val"),
@ -219,9 +219,9 @@ func TestGetSnapshotTags(t *testing.T) {
return
}
assert.Equal(t, len(*test.expected), len(*res))
for k, v := range *test.expected {
assert.Equal(t, v, (*res)[k])
assert.Equal(t, len(test.expected), len(res))
for k, v := range test.expected {
assert.Equal(t, v, res[k])
}
})
}

View File

@ -17,12 +17,13 @@ limitations under the License.
package azure
import (
"context"
"io"
"os"
"strings"
"time"
storagemgmt "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage"
storagemgmt "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-02-01/storage"
"github.com/Azure/azure-sdk-for-go/storage"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
@ -68,7 +69,7 @@ func getStorageAccountKey(config map[string]string) (string, error) {
storageAccountsClient.Authorizer = autorest.NewBearerAuthorizer(spt)
// 5. get storage key
res, err := storageAccountsClient.ListKeys(config[resourceGroupConfigKey], config[storageAccountConfigKey])
res, err := storageAccountsClient.ListKeys(context.TODO(), config[resourceGroupConfigKey], config[storageAccountConfigKey])
if err != nil {
return "", errors.WithStack(err)
}

View File

@ -24,7 +24,7 @@ import (
"strings"
"github.com/pkg/errors"
"github.com/satori/uuid"
uuid "github.com/satori/go.uuid"
"github.com/sirupsen/logrus"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"

View File

@ -25,15 +25,15 @@ import (
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)
func init() {
v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"})
AddToScheme(scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
arkv1.AddToScheme,
velerov1.AddToScheme,
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
@ -46,11 +46,13 @@ func init() {
// )
//
// kclientset, _ := kubernetes.NewForConfig(c)
// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
func AddToScheme(scheme *runtime.Scheme) {
arkv1.AddToScheme(scheme)
velerov1.AddToScheme(scheme)
var AddToScheme = localSchemeBuilder.AddToScheme
func init() {
v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"})
utilruntime.Must(AddToScheme(scheme))
}

View File

@ -25,15 +25,15 @@ import (
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)
func init() {
v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"})
AddToScheme(Scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
arkv1.AddToScheme,
velerov1.AddToScheme,
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
@ -46,11 +46,13 @@ func init() {
// )
//
// kclientset, _ := kubernetes.NewForConfig(c)
// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
func AddToScheme(scheme *runtime.Scheme) {
arkv1.AddToScheme(scheme)
velerov1.AddToScheme(scheme)
var AddToScheme = localSchemeBuilder.AddToScheme
func init() {
v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"})
utilruntime.Must(AddToScheme(Scheme))
}

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type BackupInterface interface {
Create(*v1.Backup) (*v1.Backup, error)
Update(*v1.Backup) (*v1.Backup, error)
UpdateStatus(*v1.Backup) (*v1.Backup, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.Backup, error)
List(opts meta_v1.ListOptions) (*v1.BackupList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.Backup, error)
List(opts metav1.ListOptions) (*v1.BackupList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Backup, err error)
BackupExpansion
}
@ -62,7 +62,7 @@ func newBackups(c *ArkV1Client, namespace string) *backups {
}
// Get takes name of the backup, and returns the corresponding backup object, and an error if there is any.
func (c *backups) Get(name string, options meta_v1.GetOptions) (result *v1.Backup, err error) {
func (c *backups) Get(name string, options metav1.GetOptions) (result *v1.Backup, err error) {
result = &v1.Backup{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *backups) Get(name string, options meta_v1.GetOptions) (result *v1.Backu
}
// List takes label and field selectors, and returns the list of Backups that match those selectors.
func (c *backups) List(opts meta_v1.ListOptions) (result *v1.BackupList, err error) {
func (c *backups) List(opts metav1.ListOptions) (result *v1.BackupList, err error) {
result = &v1.BackupList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *backups) List(opts meta_v1.ListOptions) (result *v1.BackupList, err err
}
// Watch returns a watch.Interface that watches the requested backups.
func (c *backups) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *backups) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *backups) UpdateStatus(backup *v1.Backup) (result *v1.Backup, err error)
}
// Delete takes name of the backup and deletes it. Returns an error if one occurs.
func (c *backups) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *backups) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("backups").
@ -149,7 +149,7 @@ func (c *backups) Delete(name string, options *meta_v1.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *backups) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *backups) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("backups").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type BackupStorageLocationInterface interface {
Create(*v1.BackupStorageLocation) (*v1.BackupStorageLocation, error)
Update(*v1.BackupStorageLocation) (*v1.BackupStorageLocation, error)
UpdateStatus(*v1.BackupStorageLocation) (*v1.BackupStorageLocation, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.BackupStorageLocation, error)
List(opts meta_v1.ListOptions) (*v1.BackupStorageLocationList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.BackupStorageLocation, error)
List(opts metav1.ListOptions) (*v1.BackupStorageLocationList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.BackupStorageLocation, err error)
BackupStorageLocationExpansion
}
@ -62,7 +62,7 @@ func newBackupStorageLocations(c *ArkV1Client, namespace string) *backupStorageL
}
// Get takes name of the backupStorageLocation, and returns the corresponding backupStorageLocation object, and an error if there is any.
func (c *backupStorageLocations) Get(name string, options meta_v1.GetOptions) (result *v1.BackupStorageLocation, err error) {
func (c *backupStorageLocations) Get(name string, options metav1.GetOptions) (result *v1.BackupStorageLocation, err error) {
result = &v1.BackupStorageLocation{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *backupStorageLocations) Get(name string, options meta_v1.GetOptions) (r
}
// List takes label and field selectors, and returns the list of BackupStorageLocations that match those selectors.
func (c *backupStorageLocations) List(opts meta_v1.ListOptions) (result *v1.BackupStorageLocationList, err error) {
func (c *backupStorageLocations) List(opts metav1.ListOptions) (result *v1.BackupStorageLocationList, err error) {
result = &v1.BackupStorageLocationList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *backupStorageLocations) List(opts meta_v1.ListOptions) (result *v1.Back
}
// Watch returns a watch.Interface that watches the requested backupStorageLocations.
func (c *backupStorageLocations) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *backupStorageLocations) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *backupStorageLocations) UpdateStatus(backupStorageLocation *v1.BackupSt
}
// Delete takes name of the backupStorageLocation and deletes it. Returns an error if one occurs.
func (c *backupStorageLocations) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *backupStorageLocations) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("backupstoragelocations").
@ -149,7 +149,7 @@ func (c *backupStorageLocations) Delete(name string, options *meta_v1.DeleteOpti
}
// DeleteCollection deletes a collection of objects.
func (c *backupStorageLocations) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *backupStorageLocations) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("backupstoragelocations").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type DeleteBackupRequestInterface interface {
Create(*v1.DeleteBackupRequest) (*v1.DeleteBackupRequest, error)
Update(*v1.DeleteBackupRequest) (*v1.DeleteBackupRequest, error)
UpdateStatus(*v1.DeleteBackupRequest) (*v1.DeleteBackupRequest, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.DeleteBackupRequest, error)
List(opts meta_v1.ListOptions) (*v1.DeleteBackupRequestList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.DeleteBackupRequest, error)
List(opts metav1.ListOptions) (*v1.DeleteBackupRequestList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.DeleteBackupRequest, err error)
DeleteBackupRequestExpansion
}
@ -62,7 +62,7 @@ func newDeleteBackupRequests(c *ArkV1Client, namespace string) *deleteBackupRequ
}
// Get takes name of the deleteBackupRequest, and returns the corresponding deleteBackupRequest object, and an error if there is any.
func (c *deleteBackupRequests) Get(name string, options meta_v1.GetOptions) (result *v1.DeleteBackupRequest, err error) {
func (c *deleteBackupRequests) Get(name string, options metav1.GetOptions) (result *v1.DeleteBackupRequest, err error) {
result = &v1.DeleteBackupRequest{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *deleteBackupRequests) Get(name string, options meta_v1.GetOptions) (res
}
// List takes label and field selectors, and returns the list of DeleteBackupRequests that match those selectors.
func (c *deleteBackupRequests) List(opts meta_v1.ListOptions) (result *v1.DeleteBackupRequestList, err error) {
func (c *deleteBackupRequests) List(opts metav1.ListOptions) (result *v1.DeleteBackupRequestList, err error) {
result = &v1.DeleteBackupRequestList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *deleteBackupRequests) List(opts meta_v1.ListOptions) (result *v1.Delete
}
// Watch returns a watch.Interface that watches the requested deleteBackupRequests.
func (c *deleteBackupRequests) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *deleteBackupRequests) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *deleteBackupRequests) UpdateStatus(deleteBackupRequest *v1.DeleteBackup
}
// Delete takes name of the deleteBackupRequest and deletes it. Returns an error if one occurs.
func (c *deleteBackupRequests) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *deleteBackupRequests) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("deletebackuprequests").
@ -149,7 +149,7 @@ func (c *deleteBackupRequests) Delete(name string, options *meta_v1.DeleteOption
}
// DeleteCollection deletes a collection of objects.
func (c *deleteBackupRequests) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *deleteBackupRequests) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("deletebackuprequests").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type DownloadRequestInterface interface {
Create(*v1.DownloadRequest) (*v1.DownloadRequest, error)
Update(*v1.DownloadRequest) (*v1.DownloadRequest, error)
UpdateStatus(*v1.DownloadRequest) (*v1.DownloadRequest, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.DownloadRequest, error)
List(opts meta_v1.ListOptions) (*v1.DownloadRequestList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.DownloadRequest, error)
List(opts metav1.ListOptions) (*v1.DownloadRequestList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.DownloadRequest, err error)
DownloadRequestExpansion
}
@ -62,7 +62,7 @@ func newDownloadRequests(c *ArkV1Client, namespace string) *downloadRequests {
}
// Get takes name of the downloadRequest, and returns the corresponding downloadRequest object, and an error if there is any.
func (c *downloadRequests) Get(name string, options meta_v1.GetOptions) (result *v1.DownloadRequest, err error) {
func (c *downloadRequests) Get(name string, options metav1.GetOptions) (result *v1.DownloadRequest, err error) {
result = &v1.DownloadRequest{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *downloadRequests) Get(name string, options meta_v1.GetOptions) (result
}
// List takes label and field selectors, and returns the list of DownloadRequests that match those selectors.
func (c *downloadRequests) List(opts meta_v1.ListOptions) (result *v1.DownloadRequestList, err error) {
func (c *downloadRequests) List(opts metav1.ListOptions) (result *v1.DownloadRequestList, err error) {
result = &v1.DownloadRequestList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *downloadRequests) List(opts meta_v1.ListOptions) (result *v1.DownloadRe
}
// Watch returns a watch.Interface that watches the requested downloadRequests.
func (c *downloadRequests) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *downloadRequests) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *downloadRequests) UpdateStatus(downloadRequest *v1.DownloadRequest) (re
}
// Delete takes name of the downloadRequest and deletes it. Returns an error if one occurs.
func (c *downloadRequests) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *downloadRequests) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("downloadrequests").
@ -149,7 +149,7 @@ func (c *downloadRequests) Delete(name string, options *meta_v1.DeleteOptions) e
}
// DeleteCollection deletes a collection of objects.
func (c *downloadRequests) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *downloadRequests) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("downloadrequests").

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var backupsResource = schema.GroupVersionResource{Group: "ark.heptio.com", Versi
var backupsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "Backup"}
// Get takes name of the backup, and returns the corresponding backup object, and an error if there is any.
func (c *FakeBackups) Get(name string, options v1.GetOptions) (result *ark_v1.Backup, err error) {
func (c *FakeBackups) Get(name string, options v1.GetOptions) (result *arkv1.Backup, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(backupsResource, c.ns, name), &ark_v1.Backup{})
Invokes(testing.NewGetAction(backupsResource, c.ns, name), &arkv1.Backup{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.Backup), err
return obj.(*arkv1.Backup), err
}
// List takes label and field selectors, and returns the list of Backups that match those selectors.
func (c *FakeBackups) List(opts v1.ListOptions) (result *ark_v1.BackupList, err error) {
func (c *FakeBackups) List(opts v1.ListOptions) (result *arkv1.BackupList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(backupsResource, backupsKind, c.ns, opts), &ark_v1.BackupList{})
Invokes(testing.NewListAction(backupsResource, backupsKind, c.ns, opts), &arkv1.BackupList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeBackups) List(opts v1.ListOptions) (result *ark_v1.BackupList, err
if label == nil {
label = labels.Everything()
}
list := &ark_v1.BackupList{ListMeta: obj.(*ark_v1.BackupList).ListMeta}
for _, item := range obj.(*ark_v1.BackupList).Items {
list := &arkv1.BackupList{ListMeta: obj.(*arkv1.BackupList).ListMeta}
for _, item := range obj.(*arkv1.BackupList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeBackups) Watch(opts v1.ListOptions) (watch.Interface, error) {
}
// Create takes the representation of a backup and creates it. Returns the server's representation of the backup, and an error, if there is any.
func (c *FakeBackups) Create(backup *ark_v1.Backup) (result *ark_v1.Backup, err error) {
func (c *FakeBackups) Create(backup *arkv1.Backup) (result *arkv1.Backup, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(backupsResource, c.ns, backup), &ark_v1.Backup{})
Invokes(testing.NewCreateAction(backupsResource, c.ns, backup), &arkv1.Backup{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.Backup), err
return obj.(*arkv1.Backup), err
}
// Update takes the representation of a backup and updates it. Returns the server's representation of the backup, and an error, if there is any.
func (c *FakeBackups) Update(backup *ark_v1.Backup) (result *ark_v1.Backup, err error) {
func (c *FakeBackups) Update(backup *arkv1.Backup) (result *arkv1.Backup, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(backupsResource, c.ns, backup), &ark_v1.Backup{})
Invokes(testing.NewUpdateAction(backupsResource, c.ns, backup), &arkv1.Backup{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.Backup), err
return obj.(*arkv1.Backup), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeBackups) UpdateStatus(backup *ark_v1.Backup) (*ark_v1.Backup, error) {
func (c *FakeBackups) UpdateStatus(backup *arkv1.Backup) (*arkv1.Backup, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(backupsResource, "status", c.ns, backup), &ark_v1.Backup{})
Invokes(testing.NewUpdateSubresourceAction(backupsResource, "status", c.ns, backup), &arkv1.Backup{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.Backup), err
return obj.(*arkv1.Backup), err
}
// Delete takes name of the backup and deletes it. Returns an error if one occurs.
func (c *FakeBackups) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(backupsResource, c.ns, name), &ark_v1.Backup{})
Invokes(testing.NewDeleteAction(backupsResource, c.ns, name), &arkv1.Backup{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeBackups) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeBackups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(backupsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &ark_v1.BackupList{})
_, err := c.Fake.Invokes(action, &arkv1.BackupList{})
return err
}
// Patch applies the patch and returns the patched backup.
func (c *FakeBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *ark_v1.Backup, err error) {
func (c *FakeBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.Backup, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(backupsResource, c.ns, name, data, subresources...), &ark_v1.Backup{})
Invokes(testing.NewPatchSubresourceAction(backupsResource, c.ns, name, data, subresources...), &arkv1.Backup{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.Backup), err
return obj.(*arkv1.Backup), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var backupstoragelocationsResource = schema.GroupVersionResource{Group: "ark.hep
var backupstoragelocationsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "BackupStorageLocation"}
// Get takes name of the backupStorageLocation, and returns the corresponding backupStorageLocation object, and an error if there is any.
func (c *FakeBackupStorageLocations) Get(name string, options v1.GetOptions) (result *ark_v1.BackupStorageLocation, err error) {
func (c *FakeBackupStorageLocations) Get(name string, options v1.GetOptions) (result *arkv1.BackupStorageLocation, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(backupstoragelocationsResource, c.ns, name), &ark_v1.BackupStorageLocation{})
Invokes(testing.NewGetAction(backupstoragelocationsResource, c.ns, name), &arkv1.BackupStorageLocation{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.BackupStorageLocation), err
return obj.(*arkv1.BackupStorageLocation), err
}
// List takes label and field selectors, and returns the list of BackupStorageLocations that match those selectors.
func (c *FakeBackupStorageLocations) List(opts v1.ListOptions) (result *ark_v1.BackupStorageLocationList, err error) {
func (c *FakeBackupStorageLocations) List(opts v1.ListOptions) (result *arkv1.BackupStorageLocationList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(backupstoragelocationsResource, backupstoragelocationsKind, c.ns, opts), &ark_v1.BackupStorageLocationList{})
Invokes(testing.NewListAction(backupstoragelocationsResource, backupstoragelocationsKind, c.ns, opts), &arkv1.BackupStorageLocationList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeBackupStorageLocations) List(opts v1.ListOptions) (result *ark_v1.B
if label == nil {
label = labels.Everything()
}
list := &ark_v1.BackupStorageLocationList{ListMeta: obj.(*ark_v1.BackupStorageLocationList).ListMeta}
for _, item := range obj.(*ark_v1.BackupStorageLocationList).Items {
list := &arkv1.BackupStorageLocationList{ListMeta: obj.(*arkv1.BackupStorageLocationList).ListMeta}
for _, item := range obj.(*arkv1.BackupStorageLocationList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeBackupStorageLocations) Watch(opts v1.ListOptions) (watch.Interface
}
// Create takes the representation of a backupStorageLocation and creates it. Returns the server's representation of the backupStorageLocation, and an error, if there is any.
func (c *FakeBackupStorageLocations) Create(backupStorageLocation *ark_v1.BackupStorageLocation) (result *ark_v1.BackupStorageLocation, err error) {
func (c *FakeBackupStorageLocations) Create(backupStorageLocation *arkv1.BackupStorageLocation) (result *arkv1.BackupStorageLocation, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(backupstoragelocationsResource, c.ns, backupStorageLocation), &ark_v1.BackupStorageLocation{})
Invokes(testing.NewCreateAction(backupstoragelocationsResource, c.ns, backupStorageLocation), &arkv1.BackupStorageLocation{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.BackupStorageLocation), err
return obj.(*arkv1.BackupStorageLocation), err
}
// Update takes the representation of a backupStorageLocation and updates it. Returns the server's representation of the backupStorageLocation, and an error, if there is any.
func (c *FakeBackupStorageLocations) Update(backupStorageLocation *ark_v1.BackupStorageLocation) (result *ark_v1.BackupStorageLocation, err error) {
func (c *FakeBackupStorageLocations) Update(backupStorageLocation *arkv1.BackupStorageLocation) (result *arkv1.BackupStorageLocation, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(backupstoragelocationsResource, c.ns, backupStorageLocation), &ark_v1.BackupStorageLocation{})
Invokes(testing.NewUpdateAction(backupstoragelocationsResource, c.ns, backupStorageLocation), &arkv1.BackupStorageLocation{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.BackupStorageLocation), err
return obj.(*arkv1.BackupStorageLocation), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeBackupStorageLocations) UpdateStatus(backupStorageLocation *ark_v1.BackupStorageLocation) (*ark_v1.BackupStorageLocation, error) {
func (c *FakeBackupStorageLocations) UpdateStatus(backupStorageLocation *arkv1.BackupStorageLocation) (*arkv1.BackupStorageLocation, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(backupstoragelocationsResource, "status", c.ns, backupStorageLocation), &ark_v1.BackupStorageLocation{})
Invokes(testing.NewUpdateSubresourceAction(backupstoragelocationsResource, "status", c.ns, backupStorageLocation), &arkv1.BackupStorageLocation{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.BackupStorageLocation), err
return obj.(*arkv1.BackupStorageLocation), err
}
// Delete takes name of the backupStorageLocation and deletes it. Returns an error if one occurs.
func (c *FakeBackupStorageLocations) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(backupstoragelocationsResource, c.ns, name), &ark_v1.BackupStorageLocation{})
Invokes(testing.NewDeleteAction(backupstoragelocationsResource, c.ns, name), &arkv1.BackupStorageLocation{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeBackupStorageLocations) Delete(name string, options *v1.DeleteOptio
func (c *FakeBackupStorageLocations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(backupstoragelocationsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &ark_v1.BackupStorageLocationList{})
_, err := c.Fake.Invokes(action, &arkv1.BackupStorageLocationList{})
return err
}
// Patch applies the patch and returns the patched backupStorageLocation.
func (c *FakeBackupStorageLocations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *ark_v1.BackupStorageLocation, err error) {
func (c *FakeBackupStorageLocations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.BackupStorageLocation, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(backupstoragelocationsResource, c.ns, name, data, subresources...), &ark_v1.BackupStorageLocation{})
Invokes(testing.NewPatchSubresourceAction(backupstoragelocationsResource, c.ns, name, data, subresources...), &arkv1.BackupStorageLocation{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.BackupStorageLocation), err
return obj.(*arkv1.BackupStorageLocation), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var deletebackuprequestsResource = schema.GroupVersionResource{Group: "ark.hepti
var deletebackuprequestsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "DeleteBackupRequest"}
// Get takes name of the deleteBackupRequest, and returns the corresponding deleteBackupRequest object, and an error if there is any.
func (c *FakeDeleteBackupRequests) Get(name string, options v1.GetOptions) (result *ark_v1.DeleteBackupRequest, err error) {
func (c *FakeDeleteBackupRequests) Get(name string, options v1.GetOptions) (result *arkv1.DeleteBackupRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(deletebackuprequestsResource, c.ns, name), &ark_v1.DeleteBackupRequest{})
Invokes(testing.NewGetAction(deletebackuprequestsResource, c.ns, name), &arkv1.DeleteBackupRequest{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.DeleteBackupRequest), err
return obj.(*arkv1.DeleteBackupRequest), err
}
// List takes label and field selectors, and returns the list of DeleteBackupRequests that match those selectors.
func (c *FakeDeleteBackupRequests) List(opts v1.ListOptions) (result *ark_v1.DeleteBackupRequestList, err error) {
func (c *FakeDeleteBackupRequests) List(opts v1.ListOptions) (result *arkv1.DeleteBackupRequestList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(deletebackuprequestsResource, deletebackuprequestsKind, c.ns, opts), &ark_v1.DeleteBackupRequestList{})
Invokes(testing.NewListAction(deletebackuprequestsResource, deletebackuprequestsKind, c.ns, opts), &arkv1.DeleteBackupRequestList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeDeleteBackupRequests) List(opts v1.ListOptions) (result *ark_v1.Del
if label == nil {
label = labels.Everything()
}
list := &ark_v1.DeleteBackupRequestList{ListMeta: obj.(*ark_v1.DeleteBackupRequestList).ListMeta}
for _, item := range obj.(*ark_v1.DeleteBackupRequestList).Items {
list := &arkv1.DeleteBackupRequestList{ListMeta: obj.(*arkv1.DeleteBackupRequestList).ListMeta}
for _, item := range obj.(*arkv1.DeleteBackupRequestList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeDeleteBackupRequests) Watch(opts v1.ListOptions) (watch.Interface,
}
// Create takes the representation of a deleteBackupRequest and creates it. Returns the server's representation of the deleteBackupRequest, and an error, if there is any.
func (c *FakeDeleteBackupRequests) Create(deleteBackupRequest *ark_v1.DeleteBackupRequest) (result *ark_v1.DeleteBackupRequest, err error) {
func (c *FakeDeleteBackupRequests) Create(deleteBackupRequest *arkv1.DeleteBackupRequest) (result *arkv1.DeleteBackupRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(deletebackuprequestsResource, c.ns, deleteBackupRequest), &ark_v1.DeleteBackupRequest{})
Invokes(testing.NewCreateAction(deletebackuprequestsResource, c.ns, deleteBackupRequest), &arkv1.DeleteBackupRequest{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.DeleteBackupRequest), err
return obj.(*arkv1.DeleteBackupRequest), err
}
// Update takes the representation of a deleteBackupRequest and updates it. Returns the server's representation of the deleteBackupRequest, and an error, if there is any.
func (c *FakeDeleteBackupRequests) Update(deleteBackupRequest *ark_v1.DeleteBackupRequest) (result *ark_v1.DeleteBackupRequest, err error) {
func (c *FakeDeleteBackupRequests) Update(deleteBackupRequest *arkv1.DeleteBackupRequest) (result *arkv1.DeleteBackupRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(deletebackuprequestsResource, c.ns, deleteBackupRequest), &ark_v1.DeleteBackupRequest{})
Invokes(testing.NewUpdateAction(deletebackuprequestsResource, c.ns, deleteBackupRequest), &arkv1.DeleteBackupRequest{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.DeleteBackupRequest), err
return obj.(*arkv1.DeleteBackupRequest), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeDeleteBackupRequests) UpdateStatus(deleteBackupRequest *ark_v1.DeleteBackupRequest) (*ark_v1.DeleteBackupRequest, error) {
func (c *FakeDeleteBackupRequests) UpdateStatus(deleteBackupRequest *arkv1.DeleteBackupRequest) (*arkv1.DeleteBackupRequest, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(deletebackuprequestsResource, "status", c.ns, deleteBackupRequest), &ark_v1.DeleteBackupRequest{})
Invokes(testing.NewUpdateSubresourceAction(deletebackuprequestsResource, "status", c.ns, deleteBackupRequest), &arkv1.DeleteBackupRequest{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.DeleteBackupRequest), err
return obj.(*arkv1.DeleteBackupRequest), err
}
// Delete takes name of the deleteBackupRequest and deletes it. Returns an error if one occurs.
func (c *FakeDeleteBackupRequests) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(deletebackuprequestsResource, c.ns, name), &ark_v1.DeleteBackupRequest{})
Invokes(testing.NewDeleteAction(deletebackuprequestsResource, c.ns, name), &arkv1.DeleteBackupRequest{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeDeleteBackupRequests) Delete(name string, options *v1.DeleteOptions
func (c *FakeDeleteBackupRequests) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(deletebackuprequestsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &ark_v1.DeleteBackupRequestList{})
_, err := c.Fake.Invokes(action, &arkv1.DeleteBackupRequestList{})
return err
}
// Patch applies the patch and returns the patched deleteBackupRequest.
func (c *FakeDeleteBackupRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *ark_v1.DeleteBackupRequest, err error) {
func (c *FakeDeleteBackupRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.DeleteBackupRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deletebackuprequestsResource, c.ns, name, data, subresources...), &ark_v1.DeleteBackupRequest{})
Invokes(testing.NewPatchSubresourceAction(deletebackuprequestsResource, c.ns, name, data, subresources...), &arkv1.DeleteBackupRequest{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.DeleteBackupRequest), err
return obj.(*arkv1.DeleteBackupRequest), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var downloadrequestsResource = schema.GroupVersionResource{Group: "ark.heptio.co
var downloadrequestsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "DownloadRequest"}
// Get takes name of the downloadRequest, and returns the corresponding downloadRequest object, and an error if there is any.
func (c *FakeDownloadRequests) Get(name string, options v1.GetOptions) (result *ark_v1.DownloadRequest, err error) {
func (c *FakeDownloadRequests) Get(name string, options v1.GetOptions) (result *arkv1.DownloadRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(downloadrequestsResource, c.ns, name), &ark_v1.DownloadRequest{})
Invokes(testing.NewGetAction(downloadrequestsResource, c.ns, name), &arkv1.DownloadRequest{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.DownloadRequest), err
return obj.(*arkv1.DownloadRequest), err
}
// List takes label and field selectors, and returns the list of DownloadRequests that match those selectors.
func (c *FakeDownloadRequests) List(opts v1.ListOptions) (result *ark_v1.DownloadRequestList, err error) {
func (c *FakeDownloadRequests) List(opts v1.ListOptions) (result *arkv1.DownloadRequestList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(downloadrequestsResource, downloadrequestsKind, c.ns, opts), &ark_v1.DownloadRequestList{})
Invokes(testing.NewListAction(downloadrequestsResource, downloadrequestsKind, c.ns, opts), &arkv1.DownloadRequestList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeDownloadRequests) List(opts v1.ListOptions) (result *ark_v1.Downloa
if label == nil {
label = labels.Everything()
}
list := &ark_v1.DownloadRequestList{ListMeta: obj.(*ark_v1.DownloadRequestList).ListMeta}
for _, item := range obj.(*ark_v1.DownloadRequestList).Items {
list := &arkv1.DownloadRequestList{ListMeta: obj.(*arkv1.DownloadRequestList).ListMeta}
for _, item := range obj.(*arkv1.DownloadRequestList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeDownloadRequests) Watch(opts v1.ListOptions) (watch.Interface, erro
}
// Create takes the representation of a downloadRequest and creates it. Returns the server's representation of the downloadRequest, and an error, if there is any.
func (c *FakeDownloadRequests) Create(downloadRequest *ark_v1.DownloadRequest) (result *ark_v1.DownloadRequest, err error) {
func (c *FakeDownloadRequests) Create(downloadRequest *arkv1.DownloadRequest) (result *arkv1.DownloadRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(downloadrequestsResource, c.ns, downloadRequest), &ark_v1.DownloadRequest{})
Invokes(testing.NewCreateAction(downloadrequestsResource, c.ns, downloadRequest), &arkv1.DownloadRequest{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.DownloadRequest), err
return obj.(*arkv1.DownloadRequest), err
}
// Update takes the representation of a downloadRequest and updates it. Returns the server's representation of the downloadRequest, and an error, if there is any.
func (c *FakeDownloadRequests) Update(downloadRequest *ark_v1.DownloadRequest) (result *ark_v1.DownloadRequest, err error) {
func (c *FakeDownloadRequests) Update(downloadRequest *arkv1.DownloadRequest) (result *arkv1.DownloadRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(downloadrequestsResource, c.ns, downloadRequest), &ark_v1.DownloadRequest{})
Invokes(testing.NewUpdateAction(downloadrequestsResource, c.ns, downloadRequest), &arkv1.DownloadRequest{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.DownloadRequest), err
return obj.(*arkv1.DownloadRequest), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeDownloadRequests) UpdateStatus(downloadRequest *ark_v1.DownloadRequest) (*ark_v1.DownloadRequest, error) {
func (c *FakeDownloadRequests) UpdateStatus(downloadRequest *arkv1.DownloadRequest) (*arkv1.DownloadRequest, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(downloadrequestsResource, "status", c.ns, downloadRequest), &ark_v1.DownloadRequest{})
Invokes(testing.NewUpdateSubresourceAction(downloadrequestsResource, "status", c.ns, downloadRequest), &arkv1.DownloadRequest{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.DownloadRequest), err
return obj.(*arkv1.DownloadRequest), err
}
// Delete takes name of the downloadRequest and deletes it. Returns an error if one occurs.
func (c *FakeDownloadRequests) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(downloadrequestsResource, c.ns, name), &ark_v1.DownloadRequest{})
Invokes(testing.NewDeleteAction(downloadrequestsResource, c.ns, name), &arkv1.DownloadRequest{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeDownloadRequests) Delete(name string, options *v1.DeleteOptions) er
func (c *FakeDownloadRequests) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(downloadrequestsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &ark_v1.DownloadRequestList{})
_, err := c.Fake.Invokes(action, &arkv1.DownloadRequestList{})
return err
}
// Patch applies the patch and returns the patched downloadRequest.
func (c *FakeDownloadRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *ark_v1.DownloadRequest, err error) {
func (c *FakeDownloadRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.DownloadRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(downloadrequestsResource, c.ns, name, data, subresources...), &ark_v1.DownloadRequest{})
Invokes(testing.NewPatchSubresourceAction(downloadrequestsResource, c.ns, name, data, subresources...), &arkv1.DownloadRequest{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.DownloadRequest), err
return obj.(*arkv1.DownloadRequest), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var podvolumebackupsResource = schema.GroupVersionResource{Group: "ark.heptio.co
var podvolumebackupsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "PodVolumeBackup"}
// Get takes name of the podVolumeBackup, and returns the corresponding podVolumeBackup object, and an error if there is any.
func (c *FakePodVolumeBackups) Get(name string, options v1.GetOptions) (result *ark_v1.PodVolumeBackup, err error) {
func (c *FakePodVolumeBackups) Get(name string, options v1.GetOptions) (result *arkv1.PodVolumeBackup, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(podvolumebackupsResource, c.ns, name), &ark_v1.PodVolumeBackup{})
Invokes(testing.NewGetAction(podvolumebackupsResource, c.ns, name), &arkv1.PodVolumeBackup{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeBackup), err
return obj.(*arkv1.PodVolumeBackup), err
}
// List takes label and field selectors, and returns the list of PodVolumeBackups that match those selectors.
func (c *FakePodVolumeBackups) List(opts v1.ListOptions) (result *ark_v1.PodVolumeBackupList, err error) {
func (c *FakePodVolumeBackups) List(opts v1.ListOptions) (result *arkv1.PodVolumeBackupList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(podvolumebackupsResource, podvolumebackupsKind, c.ns, opts), &ark_v1.PodVolumeBackupList{})
Invokes(testing.NewListAction(podvolumebackupsResource, podvolumebackupsKind, c.ns, opts), &arkv1.PodVolumeBackupList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakePodVolumeBackups) List(opts v1.ListOptions) (result *ark_v1.PodVolu
if label == nil {
label = labels.Everything()
}
list := &ark_v1.PodVolumeBackupList{ListMeta: obj.(*ark_v1.PodVolumeBackupList).ListMeta}
for _, item := range obj.(*ark_v1.PodVolumeBackupList).Items {
list := &arkv1.PodVolumeBackupList{ListMeta: obj.(*arkv1.PodVolumeBackupList).ListMeta}
for _, item := range obj.(*arkv1.PodVolumeBackupList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakePodVolumeBackups) Watch(opts v1.ListOptions) (watch.Interface, erro
}
// Create takes the representation of a podVolumeBackup and creates it. Returns the server's representation of the podVolumeBackup, and an error, if there is any.
func (c *FakePodVolumeBackups) Create(podVolumeBackup *ark_v1.PodVolumeBackup) (result *ark_v1.PodVolumeBackup, err error) {
func (c *FakePodVolumeBackups) Create(podVolumeBackup *arkv1.PodVolumeBackup) (result *arkv1.PodVolumeBackup, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(podvolumebackupsResource, c.ns, podVolumeBackup), &ark_v1.PodVolumeBackup{})
Invokes(testing.NewCreateAction(podvolumebackupsResource, c.ns, podVolumeBackup), &arkv1.PodVolumeBackup{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeBackup), err
return obj.(*arkv1.PodVolumeBackup), err
}
// Update takes the representation of a podVolumeBackup and updates it. Returns the server's representation of the podVolumeBackup, and an error, if there is any.
func (c *FakePodVolumeBackups) Update(podVolumeBackup *ark_v1.PodVolumeBackup) (result *ark_v1.PodVolumeBackup, err error) {
func (c *FakePodVolumeBackups) Update(podVolumeBackup *arkv1.PodVolumeBackup) (result *arkv1.PodVolumeBackup, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(podvolumebackupsResource, c.ns, podVolumeBackup), &ark_v1.PodVolumeBackup{})
Invokes(testing.NewUpdateAction(podvolumebackupsResource, c.ns, podVolumeBackup), &arkv1.PodVolumeBackup{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeBackup), err
return obj.(*arkv1.PodVolumeBackup), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakePodVolumeBackups) UpdateStatus(podVolumeBackup *ark_v1.PodVolumeBackup) (*ark_v1.PodVolumeBackup, error) {
func (c *FakePodVolumeBackups) UpdateStatus(podVolumeBackup *arkv1.PodVolumeBackup) (*arkv1.PodVolumeBackup, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(podvolumebackupsResource, "status", c.ns, podVolumeBackup), &ark_v1.PodVolumeBackup{})
Invokes(testing.NewUpdateSubresourceAction(podvolumebackupsResource, "status", c.ns, podVolumeBackup), &arkv1.PodVolumeBackup{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeBackup), err
return obj.(*arkv1.PodVolumeBackup), err
}
// Delete takes name of the podVolumeBackup and deletes it. Returns an error if one occurs.
func (c *FakePodVolumeBackups) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(podvolumebackupsResource, c.ns, name), &ark_v1.PodVolumeBackup{})
Invokes(testing.NewDeleteAction(podvolumebackupsResource, c.ns, name), &arkv1.PodVolumeBackup{})
return err
}
@ -124,17 +124,17 @@ func (c *FakePodVolumeBackups) Delete(name string, options *v1.DeleteOptions) er
func (c *FakePodVolumeBackups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(podvolumebackupsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &ark_v1.PodVolumeBackupList{})
_, err := c.Fake.Invokes(action, &arkv1.PodVolumeBackupList{})
return err
}
// Patch applies the patch and returns the patched podVolumeBackup.
func (c *FakePodVolumeBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *ark_v1.PodVolumeBackup, err error) {
func (c *FakePodVolumeBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.PodVolumeBackup, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(podvolumebackupsResource, c.ns, name, data, subresources...), &ark_v1.PodVolumeBackup{})
Invokes(testing.NewPatchSubresourceAction(podvolumebackupsResource, c.ns, name, data, subresources...), &arkv1.PodVolumeBackup{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeBackup), err
return obj.(*arkv1.PodVolumeBackup), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var podvolumerestoresResource = schema.GroupVersionResource{Group: "ark.heptio.c
var podvolumerestoresKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "PodVolumeRestore"}
// Get takes name of the podVolumeRestore, and returns the corresponding podVolumeRestore object, and an error if there is any.
func (c *FakePodVolumeRestores) Get(name string, options v1.GetOptions) (result *ark_v1.PodVolumeRestore, err error) {
func (c *FakePodVolumeRestores) Get(name string, options v1.GetOptions) (result *arkv1.PodVolumeRestore, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(podvolumerestoresResource, c.ns, name), &ark_v1.PodVolumeRestore{})
Invokes(testing.NewGetAction(podvolumerestoresResource, c.ns, name), &arkv1.PodVolumeRestore{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeRestore), err
return obj.(*arkv1.PodVolumeRestore), err
}
// List takes label and field selectors, and returns the list of PodVolumeRestores that match those selectors.
func (c *FakePodVolumeRestores) List(opts v1.ListOptions) (result *ark_v1.PodVolumeRestoreList, err error) {
func (c *FakePodVolumeRestores) List(opts v1.ListOptions) (result *arkv1.PodVolumeRestoreList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(podvolumerestoresResource, podvolumerestoresKind, c.ns, opts), &ark_v1.PodVolumeRestoreList{})
Invokes(testing.NewListAction(podvolumerestoresResource, podvolumerestoresKind, c.ns, opts), &arkv1.PodVolumeRestoreList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakePodVolumeRestores) List(opts v1.ListOptions) (result *ark_v1.PodVol
if label == nil {
label = labels.Everything()
}
list := &ark_v1.PodVolumeRestoreList{ListMeta: obj.(*ark_v1.PodVolumeRestoreList).ListMeta}
for _, item := range obj.(*ark_v1.PodVolumeRestoreList).Items {
list := &arkv1.PodVolumeRestoreList{ListMeta: obj.(*arkv1.PodVolumeRestoreList).ListMeta}
for _, item := range obj.(*arkv1.PodVolumeRestoreList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakePodVolumeRestores) Watch(opts v1.ListOptions) (watch.Interface, err
}
// Create takes the representation of a podVolumeRestore and creates it. Returns the server's representation of the podVolumeRestore, and an error, if there is any.
func (c *FakePodVolumeRestores) Create(podVolumeRestore *ark_v1.PodVolumeRestore) (result *ark_v1.PodVolumeRestore, err error) {
func (c *FakePodVolumeRestores) Create(podVolumeRestore *arkv1.PodVolumeRestore) (result *arkv1.PodVolumeRestore, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(podvolumerestoresResource, c.ns, podVolumeRestore), &ark_v1.PodVolumeRestore{})
Invokes(testing.NewCreateAction(podvolumerestoresResource, c.ns, podVolumeRestore), &arkv1.PodVolumeRestore{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeRestore), err
return obj.(*arkv1.PodVolumeRestore), err
}
// Update takes the representation of a podVolumeRestore and updates it. Returns the server's representation of the podVolumeRestore, and an error, if there is any.
func (c *FakePodVolumeRestores) Update(podVolumeRestore *ark_v1.PodVolumeRestore) (result *ark_v1.PodVolumeRestore, err error) {
func (c *FakePodVolumeRestores) Update(podVolumeRestore *arkv1.PodVolumeRestore) (result *arkv1.PodVolumeRestore, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(podvolumerestoresResource, c.ns, podVolumeRestore), &ark_v1.PodVolumeRestore{})
Invokes(testing.NewUpdateAction(podvolumerestoresResource, c.ns, podVolumeRestore), &arkv1.PodVolumeRestore{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeRestore), err
return obj.(*arkv1.PodVolumeRestore), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakePodVolumeRestores) UpdateStatus(podVolumeRestore *ark_v1.PodVolumeRestore) (*ark_v1.PodVolumeRestore, error) {
func (c *FakePodVolumeRestores) UpdateStatus(podVolumeRestore *arkv1.PodVolumeRestore) (*arkv1.PodVolumeRestore, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(podvolumerestoresResource, "status", c.ns, podVolumeRestore), &ark_v1.PodVolumeRestore{})
Invokes(testing.NewUpdateSubresourceAction(podvolumerestoresResource, "status", c.ns, podVolumeRestore), &arkv1.PodVolumeRestore{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeRestore), err
return obj.(*arkv1.PodVolumeRestore), err
}
// Delete takes name of the podVolumeRestore and deletes it. Returns an error if one occurs.
func (c *FakePodVolumeRestores) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(podvolumerestoresResource, c.ns, name), &ark_v1.PodVolumeRestore{})
Invokes(testing.NewDeleteAction(podvolumerestoresResource, c.ns, name), &arkv1.PodVolumeRestore{})
return err
}
@ -124,17 +124,17 @@ func (c *FakePodVolumeRestores) Delete(name string, options *v1.DeleteOptions) e
func (c *FakePodVolumeRestores) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(podvolumerestoresResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &ark_v1.PodVolumeRestoreList{})
_, err := c.Fake.Invokes(action, &arkv1.PodVolumeRestoreList{})
return err
}
// Patch applies the patch and returns the patched podVolumeRestore.
func (c *FakePodVolumeRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *ark_v1.PodVolumeRestore, err error) {
func (c *FakePodVolumeRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.PodVolumeRestore, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(podvolumerestoresResource, c.ns, name, data, subresources...), &ark_v1.PodVolumeRestore{})
Invokes(testing.NewPatchSubresourceAction(podvolumerestoresResource, c.ns, name, data, subresources...), &arkv1.PodVolumeRestore{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeRestore), err
return obj.(*arkv1.PodVolumeRestore), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var resticrepositoriesResource = schema.GroupVersionResource{Group: "ark.heptio.
var resticrepositoriesKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "ResticRepository"}
// Get takes name of the resticRepository, and returns the corresponding resticRepository object, and an error if there is any.
func (c *FakeResticRepositories) Get(name string, options v1.GetOptions) (result *ark_v1.ResticRepository, err error) {
func (c *FakeResticRepositories) Get(name string, options v1.GetOptions) (result *arkv1.ResticRepository, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(resticrepositoriesResource, c.ns, name), &ark_v1.ResticRepository{})
Invokes(testing.NewGetAction(resticrepositoriesResource, c.ns, name), &arkv1.ResticRepository{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.ResticRepository), err
return obj.(*arkv1.ResticRepository), err
}
// List takes label and field selectors, and returns the list of ResticRepositories that match those selectors.
func (c *FakeResticRepositories) List(opts v1.ListOptions) (result *ark_v1.ResticRepositoryList, err error) {
func (c *FakeResticRepositories) List(opts v1.ListOptions) (result *arkv1.ResticRepositoryList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(resticrepositoriesResource, resticrepositoriesKind, c.ns, opts), &ark_v1.ResticRepositoryList{})
Invokes(testing.NewListAction(resticrepositoriesResource, resticrepositoriesKind, c.ns, opts), &arkv1.ResticRepositoryList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeResticRepositories) List(opts v1.ListOptions) (result *ark_v1.Resti
if label == nil {
label = labels.Everything()
}
list := &ark_v1.ResticRepositoryList{ListMeta: obj.(*ark_v1.ResticRepositoryList).ListMeta}
for _, item := range obj.(*ark_v1.ResticRepositoryList).Items {
list := &arkv1.ResticRepositoryList{ListMeta: obj.(*arkv1.ResticRepositoryList).ListMeta}
for _, item := range obj.(*arkv1.ResticRepositoryList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeResticRepositories) Watch(opts v1.ListOptions) (watch.Interface, er
}
// Create takes the representation of a resticRepository and creates it. Returns the server's representation of the resticRepository, and an error, if there is any.
func (c *FakeResticRepositories) Create(resticRepository *ark_v1.ResticRepository) (result *ark_v1.ResticRepository, err error) {
func (c *FakeResticRepositories) Create(resticRepository *arkv1.ResticRepository) (result *arkv1.ResticRepository, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(resticrepositoriesResource, c.ns, resticRepository), &ark_v1.ResticRepository{})
Invokes(testing.NewCreateAction(resticrepositoriesResource, c.ns, resticRepository), &arkv1.ResticRepository{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.ResticRepository), err
return obj.(*arkv1.ResticRepository), err
}
// Update takes the representation of a resticRepository and updates it. Returns the server's representation of the resticRepository, and an error, if there is any.
func (c *FakeResticRepositories) Update(resticRepository *ark_v1.ResticRepository) (result *ark_v1.ResticRepository, err error) {
func (c *FakeResticRepositories) Update(resticRepository *arkv1.ResticRepository) (result *arkv1.ResticRepository, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(resticrepositoriesResource, c.ns, resticRepository), &ark_v1.ResticRepository{})
Invokes(testing.NewUpdateAction(resticrepositoriesResource, c.ns, resticRepository), &arkv1.ResticRepository{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.ResticRepository), err
return obj.(*arkv1.ResticRepository), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeResticRepositories) UpdateStatus(resticRepository *ark_v1.ResticRepository) (*ark_v1.ResticRepository, error) {
func (c *FakeResticRepositories) UpdateStatus(resticRepository *arkv1.ResticRepository) (*arkv1.ResticRepository, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(resticrepositoriesResource, "status", c.ns, resticRepository), &ark_v1.ResticRepository{})
Invokes(testing.NewUpdateSubresourceAction(resticrepositoriesResource, "status", c.ns, resticRepository), &arkv1.ResticRepository{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.ResticRepository), err
return obj.(*arkv1.ResticRepository), err
}
// Delete takes name of the resticRepository and deletes it. Returns an error if one occurs.
func (c *FakeResticRepositories) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(resticrepositoriesResource, c.ns, name), &ark_v1.ResticRepository{})
Invokes(testing.NewDeleteAction(resticrepositoriesResource, c.ns, name), &arkv1.ResticRepository{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeResticRepositories) Delete(name string, options *v1.DeleteOptions)
func (c *FakeResticRepositories) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(resticrepositoriesResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &ark_v1.ResticRepositoryList{})
_, err := c.Fake.Invokes(action, &arkv1.ResticRepositoryList{})
return err
}
// Patch applies the patch and returns the patched resticRepository.
func (c *FakeResticRepositories) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *ark_v1.ResticRepository, err error) {
func (c *FakeResticRepositories) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.ResticRepository, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(resticrepositoriesResource, c.ns, name, data, subresources...), &ark_v1.ResticRepository{})
Invokes(testing.NewPatchSubresourceAction(resticrepositoriesResource, c.ns, name, data, subresources...), &arkv1.ResticRepository{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.ResticRepository), err
return obj.(*arkv1.ResticRepository), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var restoresResource = schema.GroupVersionResource{Group: "ark.heptio.com", Vers
var restoresKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "Restore"}
// Get takes name of the restore, and returns the corresponding restore object, and an error if there is any.
func (c *FakeRestores) Get(name string, options v1.GetOptions) (result *ark_v1.Restore, err error) {
func (c *FakeRestores) Get(name string, options v1.GetOptions) (result *arkv1.Restore, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(restoresResource, c.ns, name), &ark_v1.Restore{})
Invokes(testing.NewGetAction(restoresResource, c.ns, name), &arkv1.Restore{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.Restore), err
return obj.(*arkv1.Restore), err
}
// List takes label and field selectors, and returns the list of Restores that match those selectors.
func (c *FakeRestores) List(opts v1.ListOptions) (result *ark_v1.RestoreList, err error) {
func (c *FakeRestores) List(opts v1.ListOptions) (result *arkv1.RestoreList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(restoresResource, restoresKind, c.ns, opts), &ark_v1.RestoreList{})
Invokes(testing.NewListAction(restoresResource, restoresKind, c.ns, opts), &arkv1.RestoreList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeRestores) List(opts v1.ListOptions) (result *ark_v1.RestoreList, er
if label == nil {
label = labels.Everything()
}
list := &ark_v1.RestoreList{ListMeta: obj.(*ark_v1.RestoreList).ListMeta}
for _, item := range obj.(*ark_v1.RestoreList).Items {
list := &arkv1.RestoreList{ListMeta: obj.(*arkv1.RestoreList).ListMeta}
for _, item := range obj.(*arkv1.RestoreList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeRestores) Watch(opts v1.ListOptions) (watch.Interface, error) {
}
// Create takes the representation of a restore and creates it. Returns the server's representation of the restore, and an error, if there is any.
func (c *FakeRestores) Create(restore *ark_v1.Restore) (result *ark_v1.Restore, err error) {
func (c *FakeRestores) Create(restore *arkv1.Restore) (result *arkv1.Restore, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(restoresResource, c.ns, restore), &ark_v1.Restore{})
Invokes(testing.NewCreateAction(restoresResource, c.ns, restore), &arkv1.Restore{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.Restore), err
return obj.(*arkv1.Restore), err
}
// Update takes the representation of a restore and updates it. Returns the server's representation of the restore, and an error, if there is any.
func (c *FakeRestores) Update(restore *ark_v1.Restore) (result *ark_v1.Restore, err error) {
func (c *FakeRestores) Update(restore *arkv1.Restore) (result *arkv1.Restore, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(restoresResource, c.ns, restore), &ark_v1.Restore{})
Invokes(testing.NewUpdateAction(restoresResource, c.ns, restore), &arkv1.Restore{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.Restore), err
return obj.(*arkv1.Restore), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeRestores) UpdateStatus(restore *ark_v1.Restore) (*ark_v1.Restore, error) {
func (c *FakeRestores) UpdateStatus(restore *arkv1.Restore) (*arkv1.Restore, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(restoresResource, "status", c.ns, restore), &ark_v1.Restore{})
Invokes(testing.NewUpdateSubresourceAction(restoresResource, "status", c.ns, restore), &arkv1.Restore{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.Restore), err
return obj.(*arkv1.Restore), err
}
// Delete takes name of the restore and deletes it. Returns an error if one occurs.
func (c *FakeRestores) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(restoresResource, c.ns, name), &ark_v1.Restore{})
Invokes(testing.NewDeleteAction(restoresResource, c.ns, name), &arkv1.Restore{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeRestores) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeRestores) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(restoresResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &ark_v1.RestoreList{})
_, err := c.Fake.Invokes(action, &arkv1.RestoreList{})
return err
}
// Patch applies the patch and returns the patched restore.
func (c *FakeRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *ark_v1.Restore, err error) {
func (c *FakeRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.Restore, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(restoresResource, c.ns, name, data, subresources...), &ark_v1.Restore{})
Invokes(testing.NewPatchSubresourceAction(restoresResource, c.ns, name, data, subresources...), &arkv1.Restore{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.Restore), err
return obj.(*arkv1.Restore), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var schedulesResource = schema.GroupVersionResource{Group: "ark.heptio.com", Ver
var schedulesKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "Schedule"}
// Get takes name of the schedule, and returns the corresponding schedule object, and an error if there is any.
func (c *FakeSchedules) Get(name string, options v1.GetOptions) (result *ark_v1.Schedule, err error) {
func (c *FakeSchedules) Get(name string, options v1.GetOptions) (result *arkv1.Schedule, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(schedulesResource, c.ns, name), &ark_v1.Schedule{})
Invokes(testing.NewGetAction(schedulesResource, c.ns, name), &arkv1.Schedule{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.Schedule), err
return obj.(*arkv1.Schedule), err
}
// List takes label and field selectors, and returns the list of Schedules that match those selectors.
func (c *FakeSchedules) List(opts v1.ListOptions) (result *ark_v1.ScheduleList, err error) {
func (c *FakeSchedules) List(opts v1.ListOptions) (result *arkv1.ScheduleList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(schedulesResource, schedulesKind, c.ns, opts), &ark_v1.ScheduleList{})
Invokes(testing.NewListAction(schedulesResource, schedulesKind, c.ns, opts), &arkv1.ScheduleList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeSchedules) List(opts v1.ListOptions) (result *ark_v1.ScheduleList,
if label == nil {
label = labels.Everything()
}
list := &ark_v1.ScheduleList{ListMeta: obj.(*ark_v1.ScheduleList).ListMeta}
for _, item := range obj.(*ark_v1.ScheduleList).Items {
list := &arkv1.ScheduleList{ListMeta: obj.(*arkv1.ScheduleList).ListMeta}
for _, item := range obj.(*arkv1.ScheduleList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeSchedules) Watch(opts v1.ListOptions) (watch.Interface, error) {
}
// Create takes the representation of a schedule and creates it. Returns the server's representation of the schedule, and an error, if there is any.
func (c *FakeSchedules) Create(schedule *ark_v1.Schedule) (result *ark_v1.Schedule, err error) {
func (c *FakeSchedules) Create(schedule *arkv1.Schedule) (result *arkv1.Schedule, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(schedulesResource, c.ns, schedule), &ark_v1.Schedule{})
Invokes(testing.NewCreateAction(schedulesResource, c.ns, schedule), &arkv1.Schedule{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.Schedule), err
return obj.(*arkv1.Schedule), err
}
// Update takes the representation of a schedule and updates it. Returns the server's representation of the schedule, and an error, if there is any.
func (c *FakeSchedules) Update(schedule *ark_v1.Schedule) (result *ark_v1.Schedule, err error) {
func (c *FakeSchedules) Update(schedule *arkv1.Schedule) (result *arkv1.Schedule, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(schedulesResource, c.ns, schedule), &ark_v1.Schedule{})
Invokes(testing.NewUpdateAction(schedulesResource, c.ns, schedule), &arkv1.Schedule{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.Schedule), err
return obj.(*arkv1.Schedule), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeSchedules) UpdateStatus(schedule *ark_v1.Schedule) (*ark_v1.Schedule, error) {
func (c *FakeSchedules) UpdateStatus(schedule *arkv1.Schedule) (*arkv1.Schedule, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(schedulesResource, "status", c.ns, schedule), &ark_v1.Schedule{})
Invokes(testing.NewUpdateSubresourceAction(schedulesResource, "status", c.ns, schedule), &arkv1.Schedule{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.Schedule), err
return obj.(*arkv1.Schedule), err
}
// Delete takes name of the schedule and deletes it. Returns an error if one occurs.
func (c *FakeSchedules) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(schedulesResource, c.ns, name), &ark_v1.Schedule{})
Invokes(testing.NewDeleteAction(schedulesResource, c.ns, name), &arkv1.Schedule{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeSchedules) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeSchedules) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(schedulesResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &ark_v1.ScheduleList{})
_, err := c.Fake.Invokes(action, &arkv1.ScheduleList{})
return err
}
// Patch applies the patch and returns the patched schedule.
func (c *FakeSchedules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *ark_v1.Schedule, err error) {
func (c *FakeSchedules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.Schedule, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(schedulesResource, c.ns, name, data, subresources...), &ark_v1.Schedule{})
Invokes(testing.NewPatchSubresourceAction(schedulesResource, c.ns, name, data, subresources...), &arkv1.Schedule{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.Schedule), err
return obj.(*arkv1.Schedule), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var serverstatusrequestsResource = schema.GroupVersionResource{Group: "ark.hepti
var serverstatusrequestsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "ServerStatusRequest"}
// Get takes name of the serverStatusRequest, and returns the corresponding serverStatusRequest object, and an error if there is any.
func (c *FakeServerStatusRequests) Get(name string, options v1.GetOptions) (result *ark_v1.ServerStatusRequest, err error) {
func (c *FakeServerStatusRequests) Get(name string, options v1.GetOptions) (result *arkv1.ServerStatusRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(serverstatusrequestsResource, c.ns, name), &ark_v1.ServerStatusRequest{})
Invokes(testing.NewGetAction(serverstatusrequestsResource, c.ns, name), &arkv1.ServerStatusRequest{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.ServerStatusRequest), err
return obj.(*arkv1.ServerStatusRequest), err
}
// List takes label and field selectors, and returns the list of ServerStatusRequests that match those selectors.
func (c *FakeServerStatusRequests) List(opts v1.ListOptions) (result *ark_v1.ServerStatusRequestList, err error) {
func (c *FakeServerStatusRequests) List(opts v1.ListOptions) (result *arkv1.ServerStatusRequestList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(serverstatusrequestsResource, serverstatusrequestsKind, c.ns, opts), &ark_v1.ServerStatusRequestList{})
Invokes(testing.NewListAction(serverstatusrequestsResource, serverstatusrequestsKind, c.ns, opts), &arkv1.ServerStatusRequestList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeServerStatusRequests) List(opts v1.ListOptions) (result *ark_v1.Ser
if label == nil {
label = labels.Everything()
}
list := &ark_v1.ServerStatusRequestList{ListMeta: obj.(*ark_v1.ServerStatusRequestList).ListMeta}
for _, item := range obj.(*ark_v1.ServerStatusRequestList).Items {
list := &arkv1.ServerStatusRequestList{ListMeta: obj.(*arkv1.ServerStatusRequestList).ListMeta}
for _, item := range obj.(*arkv1.ServerStatusRequestList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeServerStatusRequests) Watch(opts v1.ListOptions) (watch.Interface,
}
// Create takes the representation of a serverStatusRequest and creates it. Returns the server's representation of the serverStatusRequest, and an error, if there is any.
func (c *FakeServerStatusRequests) Create(serverStatusRequest *ark_v1.ServerStatusRequest) (result *ark_v1.ServerStatusRequest, err error) {
func (c *FakeServerStatusRequests) Create(serverStatusRequest *arkv1.ServerStatusRequest) (result *arkv1.ServerStatusRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(serverstatusrequestsResource, c.ns, serverStatusRequest), &ark_v1.ServerStatusRequest{})
Invokes(testing.NewCreateAction(serverstatusrequestsResource, c.ns, serverStatusRequest), &arkv1.ServerStatusRequest{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.ServerStatusRequest), err
return obj.(*arkv1.ServerStatusRequest), err
}
// Update takes the representation of a serverStatusRequest and updates it. Returns the server's representation of the serverStatusRequest, and an error, if there is any.
func (c *FakeServerStatusRequests) Update(serverStatusRequest *ark_v1.ServerStatusRequest) (result *ark_v1.ServerStatusRequest, err error) {
func (c *FakeServerStatusRequests) Update(serverStatusRequest *arkv1.ServerStatusRequest) (result *arkv1.ServerStatusRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(serverstatusrequestsResource, c.ns, serverStatusRequest), &ark_v1.ServerStatusRequest{})
Invokes(testing.NewUpdateAction(serverstatusrequestsResource, c.ns, serverStatusRequest), &arkv1.ServerStatusRequest{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.ServerStatusRequest), err
return obj.(*arkv1.ServerStatusRequest), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeServerStatusRequests) UpdateStatus(serverStatusRequest *ark_v1.ServerStatusRequest) (*ark_v1.ServerStatusRequest, error) {
func (c *FakeServerStatusRequests) UpdateStatus(serverStatusRequest *arkv1.ServerStatusRequest) (*arkv1.ServerStatusRequest, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(serverstatusrequestsResource, "status", c.ns, serverStatusRequest), &ark_v1.ServerStatusRequest{})
Invokes(testing.NewUpdateSubresourceAction(serverstatusrequestsResource, "status", c.ns, serverStatusRequest), &arkv1.ServerStatusRequest{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.ServerStatusRequest), err
return obj.(*arkv1.ServerStatusRequest), err
}
// Delete takes name of the serverStatusRequest and deletes it. Returns an error if one occurs.
func (c *FakeServerStatusRequests) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(serverstatusrequestsResource, c.ns, name), &ark_v1.ServerStatusRequest{})
Invokes(testing.NewDeleteAction(serverstatusrequestsResource, c.ns, name), &arkv1.ServerStatusRequest{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeServerStatusRequests) Delete(name string, options *v1.DeleteOptions
func (c *FakeServerStatusRequests) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(serverstatusrequestsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &ark_v1.ServerStatusRequestList{})
_, err := c.Fake.Invokes(action, &arkv1.ServerStatusRequestList{})
return err
}
// Patch applies the patch and returns the patched serverStatusRequest.
func (c *FakeServerStatusRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *ark_v1.ServerStatusRequest, err error) {
func (c *FakeServerStatusRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.ServerStatusRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(serverstatusrequestsResource, c.ns, name, data, subresources...), &ark_v1.ServerStatusRequest{})
Invokes(testing.NewPatchSubresourceAction(serverstatusrequestsResource, c.ns, name, data, subresources...), &arkv1.ServerStatusRequest{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.ServerStatusRequest), err
return obj.(*arkv1.ServerStatusRequest), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var volumesnapshotlocationsResource = schema.GroupVersionResource{Group: "ark.he
var volumesnapshotlocationsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "VolumeSnapshotLocation"}
// Get takes name of the volumeSnapshotLocation, and returns the corresponding volumeSnapshotLocation object, and an error if there is any.
func (c *FakeVolumeSnapshotLocations) Get(name string, options v1.GetOptions) (result *ark_v1.VolumeSnapshotLocation, err error) {
func (c *FakeVolumeSnapshotLocations) Get(name string, options v1.GetOptions) (result *arkv1.VolumeSnapshotLocation, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(volumesnapshotlocationsResource, c.ns, name), &ark_v1.VolumeSnapshotLocation{})
Invokes(testing.NewGetAction(volumesnapshotlocationsResource, c.ns, name), &arkv1.VolumeSnapshotLocation{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.VolumeSnapshotLocation), err
return obj.(*arkv1.VolumeSnapshotLocation), err
}
// List takes label and field selectors, and returns the list of VolumeSnapshotLocations that match those selectors.
func (c *FakeVolumeSnapshotLocations) List(opts v1.ListOptions) (result *ark_v1.VolumeSnapshotLocationList, err error) {
func (c *FakeVolumeSnapshotLocations) List(opts v1.ListOptions) (result *arkv1.VolumeSnapshotLocationList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(volumesnapshotlocationsResource, volumesnapshotlocationsKind, c.ns, opts), &ark_v1.VolumeSnapshotLocationList{})
Invokes(testing.NewListAction(volumesnapshotlocationsResource, volumesnapshotlocationsKind, c.ns, opts), &arkv1.VolumeSnapshotLocationList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeVolumeSnapshotLocations) List(opts v1.ListOptions) (result *ark_v1.
if label == nil {
label = labels.Everything()
}
list := &ark_v1.VolumeSnapshotLocationList{ListMeta: obj.(*ark_v1.VolumeSnapshotLocationList).ListMeta}
for _, item := range obj.(*ark_v1.VolumeSnapshotLocationList).Items {
list := &arkv1.VolumeSnapshotLocationList{ListMeta: obj.(*arkv1.VolumeSnapshotLocationList).ListMeta}
for _, item := range obj.(*arkv1.VolumeSnapshotLocationList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeVolumeSnapshotLocations) Watch(opts v1.ListOptions) (watch.Interfac
}
// Create takes the representation of a volumeSnapshotLocation and creates it. Returns the server's representation of the volumeSnapshotLocation, and an error, if there is any.
func (c *FakeVolumeSnapshotLocations) Create(volumeSnapshotLocation *ark_v1.VolumeSnapshotLocation) (result *ark_v1.VolumeSnapshotLocation, err error) {
func (c *FakeVolumeSnapshotLocations) Create(volumeSnapshotLocation *arkv1.VolumeSnapshotLocation) (result *arkv1.VolumeSnapshotLocation, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(volumesnapshotlocationsResource, c.ns, volumeSnapshotLocation), &ark_v1.VolumeSnapshotLocation{})
Invokes(testing.NewCreateAction(volumesnapshotlocationsResource, c.ns, volumeSnapshotLocation), &arkv1.VolumeSnapshotLocation{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.VolumeSnapshotLocation), err
return obj.(*arkv1.VolumeSnapshotLocation), err
}
// Update takes the representation of a volumeSnapshotLocation and updates it. Returns the server's representation of the volumeSnapshotLocation, and an error, if there is any.
func (c *FakeVolumeSnapshotLocations) Update(volumeSnapshotLocation *ark_v1.VolumeSnapshotLocation) (result *ark_v1.VolumeSnapshotLocation, err error) {
func (c *FakeVolumeSnapshotLocations) Update(volumeSnapshotLocation *arkv1.VolumeSnapshotLocation) (result *arkv1.VolumeSnapshotLocation, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(volumesnapshotlocationsResource, c.ns, volumeSnapshotLocation), &ark_v1.VolumeSnapshotLocation{})
Invokes(testing.NewUpdateAction(volumesnapshotlocationsResource, c.ns, volumeSnapshotLocation), &arkv1.VolumeSnapshotLocation{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.VolumeSnapshotLocation), err
return obj.(*arkv1.VolumeSnapshotLocation), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeVolumeSnapshotLocations) UpdateStatus(volumeSnapshotLocation *ark_v1.VolumeSnapshotLocation) (*ark_v1.VolumeSnapshotLocation, error) {
func (c *FakeVolumeSnapshotLocations) UpdateStatus(volumeSnapshotLocation *arkv1.VolumeSnapshotLocation) (*arkv1.VolumeSnapshotLocation, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(volumesnapshotlocationsResource, "status", c.ns, volumeSnapshotLocation), &ark_v1.VolumeSnapshotLocation{})
Invokes(testing.NewUpdateSubresourceAction(volumesnapshotlocationsResource, "status", c.ns, volumeSnapshotLocation), &arkv1.VolumeSnapshotLocation{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.VolumeSnapshotLocation), err
return obj.(*arkv1.VolumeSnapshotLocation), err
}
// Delete takes name of the volumeSnapshotLocation and deletes it. Returns an error if one occurs.
func (c *FakeVolumeSnapshotLocations) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(volumesnapshotlocationsResource, c.ns, name), &ark_v1.VolumeSnapshotLocation{})
Invokes(testing.NewDeleteAction(volumesnapshotlocationsResource, c.ns, name), &arkv1.VolumeSnapshotLocation{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeVolumeSnapshotLocations) Delete(name string, options *v1.DeleteOpti
func (c *FakeVolumeSnapshotLocations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(volumesnapshotlocationsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &ark_v1.VolumeSnapshotLocationList{})
_, err := c.Fake.Invokes(action, &arkv1.VolumeSnapshotLocationList{})
return err
}
// Patch applies the patch and returns the patched volumeSnapshotLocation.
func (c *FakeVolumeSnapshotLocations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *ark_v1.VolumeSnapshotLocation, err error) {
func (c *FakeVolumeSnapshotLocations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *arkv1.VolumeSnapshotLocation, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(volumesnapshotlocationsResource, c.ns, name, data, subresources...), &ark_v1.VolumeSnapshotLocation{})
Invokes(testing.NewPatchSubresourceAction(volumesnapshotlocationsResource, c.ns, name, data, subresources...), &arkv1.VolumeSnapshotLocation{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.VolumeSnapshotLocation), err
return obj.(*arkv1.VolumeSnapshotLocation), err
}

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type PodVolumeBackupInterface interface {
Create(*v1.PodVolumeBackup) (*v1.PodVolumeBackup, error)
Update(*v1.PodVolumeBackup) (*v1.PodVolumeBackup, error)
UpdateStatus(*v1.PodVolumeBackup) (*v1.PodVolumeBackup, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.PodVolumeBackup, error)
List(opts meta_v1.ListOptions) (*v1.PodVolumeBackupList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.PodVolumeBackup, error)
List(opts metav1.ListOptions) (*v1.PodVolumeBackupList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodVolumeBackup, err error)
PodVolumeBackupExpansion
}
@ -62,7 +62,7 @@ func newPodVolumeBackups(c *ArkV1Client, namespace string) *podVolumeBackups {
}
// Get takes name of the podVolumeBackup, and returns the corresponding podVolumeBackup object, and an error if there is any.
func (c *podVolumeBackups) Get(name string, options meta_v1.GetOptions) (result *v1.PodVolumeBackup, err error) {
func (c *podVolumeBackups) Get(name string, options metav1.GetOptions) (result *v1.PodVolumeBackup, err error) {
result = &v1.PodVolumeBackup{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *podVolumeBackups) Get(name string, options meta_v1.GetOptions) (result
}
// List takes label and field selectors, and returns the list of PodVolumeBackups that match those selectors.
func (c *podVolumeBackups) List(opts meta_v1.ListOptions) (result *v1.PodVolumeBackupList, err error) {
func (c *podVolumeBackups) List(opts metav1.ListOptions) (result *v1.PodVolumeBackupList, err error) {
result = &v1.PodVolumeBackupList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *podVolumeBackups) List(opts meta_v1.ListOptions) (result *v1.PodVolumeB
}
// Watch returns a watch.Interface that watches the requested podVolumeBackups.
func (c *podVolumeBackups) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *podVolumeBackups) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *podVolumeBackups) UpdateStatus(podVolumeBackup *v1.PodVolumeBackup) (re
}
// Delete takes name of the podVolumeBackup and deletes it. Returns an error if one occurs.
func (c *podVolumeBackups) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *podVolumeBackups) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("podvolumebackups").
@ -149,7 +149,7 @@ func (c *podVolumeBackups) Delete(name string, options *meta_v1.DeleteOptions) e
}
// DeleteCollection deletes a collection of objects.
func (c *podVolumeBackups) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *podVolumeBackups) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("podvolumebackups").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type PodVolumeRestoreInterface interface {
Create(*v1.PodVolumeRestore) (*v1.PodVolumeRestore, error)
Update(*v1.PodVolumeRestore) (*v1.PodVolumeRestore, error)
UpdateStatus(*v1.PodVolumeRestore) (*v1.PodVolumeRestore, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.PodVolumeRestore, error)
List(opts meta_v1.ListOptions) (*v1.PodVolumeRestoreList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.PodVolumeRestore, error)
List(opts metav1.ListOptions) (*v1.PodVolumeRestoreList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodVolumeRestore, err error)
PodVolumeRestoreExpansion
}
@ -62,7 +62,7 @@ func newPodVolumeRestores(c *ArkV1Client, namespace string) *podVolumeRestores {
}
// Get takes name of the podVolumeRestore, and returns the corresponding podVolumeRestore object, and an error if there is any.
func (c *podVolumeRestores) Get(name string, options meta_v1.GetOptions) (result *v1.PodVolumeRestore, err error) {
func (c *podVolumeRestores) Get(name string, options metav1.GetOptions) (result *v1.PodVolumeRestore, err error) {
result = &v1.PodVolumeRestore{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *podVolumeRestores) Get(name string, options meta_v1.GetOptions) (result
}
// List takes label and field selectors, and returns the list of PodVolumeRestores that match those selectors.
func (c *podVolumeRestores) List(opts meta_v1.ListOptions) (result *v1.PodVolumeRestoreList, err error) {
func (c *podVolumeRestores) List(opts metav1.ListOptions) (result *v1.PodVolumeRestoreList, err error) {
result = &v1.PodVolumeRestoreList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *podVolumeRestores) List(opts meta_v1.ListOptions) (result *v1.PodVolume
}
// Watch returns a watch.Interface that watches the requested podVolumeRestores.
func (c *podVolumeRestores) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *podVolumeRestores) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *podVolumeRestores) UpdateStatus(podVolumeRestore *v1.PodVolumeRestore)
}
// Delete takes name of the podVolumeRestore and deletes it. Returns an error if one occurs.
func (c *podVolumeRestores) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *podVolumeRestores) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("podvolumerestores").
@ -149,7 +149,7 @@ func (c *podVolumeRestores) Delete(name string, options *meta_v1.DeleteOptions)
}
// DeleteCollection deletes a collection of objects.
func (c *podVolumeRestores) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *podVolumeRestores) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("podvolumerestores").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type ResticRepositoryInterface interface {
Create(*v1.ResticRepository) (*v1.ResticRepository, error)
Update(*v1.ResticRepository) (*v1.ResticRepository, error)
UpdateStatus(*v1.ResticRepository) (*v1.ResticRepository, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.ResticRepository, error)
List(opts meta_v1.ListOptions) (*v1.ResticRepositoryList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.ResticRepository, error)
List(opts metav1.ListOptions) (*v1.ResticRepositoryList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ResticRepository, err error)
ResticRepositoryExpansion
}
@ -62,7 +62,7 @@ func newResticRepositories(c *ArkV1Client, namespace string) *resticRepositories
}
// Get takes name of the resticRepository, and returns the corresponding resticRepository object, and an error if there is any.
func (c *resticRepositories) Get(name string, options meta_v1.GetOptions) (result *v1.ResticRepository, err error) {
func (c *resticRepositories) Get(name string, options metav1.GetOptions) (result *v1.ResticRepository, err error) {
result = &v1.ResticRepository{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *resticRepositories) Get(name string, options meta_v1.GetOptions) (resul
}
// List takes label and field selectors, and returns the list of ResticRepositories that match those selectors.
func (c *resticRepositories) List(opts meta_v1.ListOptions) (result *v1.ResticRepositoryList, err error) {
func (c *resticRepositories) List(opts metav1.ListOptions) (result *v1.ResticRepositoryList, err error) {
result = &v1.ResticRepositoryList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *resticRepositories) List(opts meta_v1.ListOptions) (result *v1.ResticRe
}
// Watch returns a watch.Interface that watches the requested resticRepositories.
func (c *resticRepositories) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *resticRepositories) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *resticRepositories) UpdateStatus(resticRepository *v1.ResticRepository)
}
// Delete takes name of the resticRepository and deletes it. Returns an error if one occurs.
func (c *resticRepositories) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *resticRepositories) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("resticrepositories").
@ -149,7 +149,7 @@ func (c *resticRepositories) Delete(name string, options *meta_v1.DeleteOptions)
}
// DeleteCollection deletes a collection of objects.
func (c *resticRepositories) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *resticRepositories) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("resticrepositories").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type RestoreInterface interface {
Create(*v1.Restore) (*v1.Restore, error)
Update(*v1.Restore) (*v1.Restore, error)
UpdateStatus(*v1.Restore) (*v1.Restore, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.Restore, error)
List(opts meta_v1.ListOptions) (*v1.RestoreList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.Restore, error)
List(opts metav1.ListOptions) (*v1.RestoreList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Restore, err error)
RestoreExpansion
}
@ -62,7 +62,7 @@ func newRestores(c *ArkV1Client, namespace string) *restores {
}
// Get takes name of the restore, and returns the corresponding restore object, and an error if there is any.
func (c *restores) Get(name string, options meta_v1.GetOptions) (result *v1.Restore, err error) {
func (c *restores) Get(name string, options metav1.GetOptions) (result *v1.Restore, err error) {
result = &v1.Restore{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *restores) Get(name string, options meta_v1.GetOptions) (result *v1.Rest
}
// List takes label and field selectors, and returns the list of Restores that match those selectors.
func (c *restores) List(opts meta_v1.ListOptions) (result *v1.RestoreList, err error) {
func (c *restores) List(opts metav1.ListOptions) (result *v1.RestoreList, err error) {
result = &v1.RestoreList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *restores) List(opts meta_v1.ListOptions) (result *v1.RestoreList, err e
}
// Watch returns a watch.Interface that watches the requested restores.
func (c *restores) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *restores) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *restores) UpdateStatus(restore *v1.Restore) (result *v1.Restore, err er
}
// Delete takes name of the restore and deletes it. Returns an error if one occurs.
func (c *restores) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *restores) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("restores").
@ -149,7 +149,7 @@ func (c *restores) Delete(name string, options *meta_v1.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *restores) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *restores) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("restores").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type ScheduleInterface interface {
Create(*v1.Schedule) (*v1.Schedule, error)
Update(*v1.Schedule) (*v1.Schedule, error)
UpdateStatus(*v1.Schedule) (*v1.Schedule, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.Schedule, error)
List(opts meta_v1.ListOptions) (*v1.ScheduleList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.Schedule, error)
List(opts metav1.ListOptions) (*v1.ScheduleList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Schedule, err error)
ScheduleExpansion
}
@ -62,7 +62,7 @@ func newSchedules(c *ArkV1Client, namespace string) *schedules {
}
// Get takes name of the schedule, and returns the corresponding schedule object, and an error if there is any.
func (c *schedules) Get(name string, options meta_v1.GetOptions) (result *v1.Schedule, err error) {
func (c *schedules) Get(name string, options metav1.GetOptions) (result *v1.Schedule, err error) {
result = &v1.Schedule{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *schedules) Get(name string, options meta_v1.GetOptions) (result *v1.Sch
}
// List takes label and field selectors, and returns the list of Schedules that match those selectors.
func (c *schedules) List(opts meta_v1.ListOptions) (result *v1.ScheduleList, err error) {
func (c *schedules) List(opts metav1.ListOptions) (result *v1.ScheduleList, err error) {
result = &v1.ScheduleList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *schedules) List(opts meta_v1.ListOptions) (result *v1.ScheduleList, err
}
// Watch returns a watch.Interface that watches the requested schedules.
func (c *schedules) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *schedules) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *schedules) UpdateStatus(schedule *v1.Schedule) (result *v1.Schedule, er
}
// Delete takes name of the schedule and deletes it. Returns an error if one occurs.
func (c *schedules) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *schedules) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("schedules").
@ -149,7 +149,7 @@ func (c *schedules) Delete(name string, options *meta_v1.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *schedules) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *schedules) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("schedules").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type ServerStatusRequestInterface interface {
Create(*v1.ServerStatusRequest) (*v1.ServerStatusRequest, error)
Update(*v1.ServerStatusRequest) (*v1.ServerStatusRequest, error)
UpdateStatus(*v1.ServerStatusRequest) (*v1.ServerStatusRequest, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.ServerStatusRequest, error)
List(opts meta_v1.ListOptions) (*v1.ServerStatusRequestList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.ServerStatusRequest, error)
List(opts metav1.ListOptions) (*v1.ServerStatusRequestList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServerStatusRequest, err error)
ServerStatusRequestExpansion
}
@ -62,7 +62,7 @@ func newServerStatusRequests(c *ArkV1Client, namespace string) *serverStatusRequ
}
// Get takes name of the serverStatusRequest, and returns the corresponding serverStatusRequest object, and an error if there is any.
func (c *serverStatusRequests) Get(name string, options meta_v1.GetOptions) (result *v1.ServerStatusRequest, err error) {
func (c *serverStatusRequests) Get(name string, options metav1.GetOptions) (result *v1.ServerStatusRequest, err error) {
result = &v1.ServerStatusRequest{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *serverStatusRequests) Get(name string, options meta_v1.GetOptions) (res
}
// List takes label and field selectors, and returns the list of ServerStatusRequests that match those selectors.
func (c *serverStatusRequests) List(opts meta_v1.ListOptions) (result *v1.ServerStatusRequestList, err error) {
func (c *serverStatusRequests) List(opts metav1.ListOptions) (result *v1.ServerStatusRequestList, err error) {
result = &v1.ServerStatusRequestList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *serverStatusRequests) List(opts meta_v1.ListOptions) (result *v1.Server
}
// Watch returns a watch.Interface that watches the requested serverStatusRequests.
func (c *serverStatusRequests) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *serverStatusRequests) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *serverStatusRequests) UpdateStatus(serverStatusRequest *v1.ServerStatus
}
// Delete takes name of the serverStatusRequest and deletes it. Returns an error if one occurs.
func (c *serverStatusRequests) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *serverStatusRequests) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("serverstatusrequests").
@ -149,7 +149,7 @@ func (c *serverStatusRequests) Delete(name string, options *meta_v1.DeleteOption
}
// DeleteCollection deletes a collection of objects.
func (c *serverStatusRequests) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *serverStatusRequests) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("serverstatusrequests").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type VolumeSnapshotLocationInterface interface {
Create(*v1.VolumeSnapshotLocation) (*v1.VolumeSnapshotLocation, error)
Update(*v1.VolumeSnapshotLocation) (*v1.VolumeSnapshotLocation, error)
UpdateStatus(*v1.VolumeSnapshotLocation) (*v1.VolumeSnapshotLocation, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.VolumeSnapshotLocation, error)
List(opts meta_v1.ListOptions) (*v1.VolumeSnapshotLocationList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.VolumeSnapshotLocation, error)
List(opts metav1.ListOptions) (*v1.VolumeSnapshotLocationList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.VolumeSnapshotLocation, err error)
VolumeSnapshotLocationExpansion
}
@ -62,7 +62,7 @@ func newVolumeSnapshotLocations(c *ArkV1Client, namespace string) *volumeSnapsho
}
// Get takes name of the volumeSnapshotLocation, and returns the corresponding volumeSnapshotLocation object, and an error if there is any.
func (c *volumeSnapshotLocations) Get(name string, options meta_v1.GetOptions) (result *v1.VolumeSnapshotLocation, err error) {
func (c *volumeSnapshotLocations) Get(name string, options metav1.GetOptions) (result *v1.VolumeSnapshotLocation, err error) {
result = &v1.VolumeSnapshotLocation{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *volumeSnapshotLocations) Get(name string, options meta_v1.GetOptions) (
}
// List takes label and field selectors, and returns the list of VolumeSnapshotLocations that match those selectors.
func (c *volumeSnapshotLocations) List(opts meta_v1.ListOptions) (result *v1.VolumeSnapshotLocationList, err error) {
func (c *volumeSnapshotLocations) List(opts metav1.ListOptions) (result *v1.VolumeSnapshotLocationList, err error) {
result = &v1.VolumeSnapshotLocationList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *volumeSnapshotLocations) List(opts meta_v1.ListOptions) (result *v1.Vol
}
// Watch returns a watch.Interface that watches the requested volumeSnapshotLocations.
func (c *volumeSnapshotLocations) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *volumeSnapshotLocations) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *volumeSnapshotLocations) UpdateStatus(volumeSnapshotLocation *v1.Volume
}
// Delete takes name of the volumeSnapshotLocation and deletes it. Returns an error if one occurs.
func (c *volumeSnapshotLocations) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *volumeSnapshotLocations) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("volumesnapshotlocations").
@ -149,7 +149,7 @@ func (c *volumeSnapshotLocations) Delete(name string, options *meta_v1.DeleteOpt
}
// DeleteCollection deletes a collection of objects.
func (c *volumeSnapshotLocations) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *volumeSnapshotLocations) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("volumesnapshotlocations").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type BackupInterface interface {
Create(*v1.Backup) (*v1.Backup, error)
Update(*v1.Backup) (*v1.Backup, error)
UpdateStatus(*v1.Backup) (*v1.Backup, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.Backup, error)
List(opts meta_v1.ListOptions) (*v1.BackupList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.Backup, error)
List(opts metav1.ListOptions) (*v1.BackupList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Backup, err error)
BackupExpansion
}
@ -62,7 +62,7 @@ func newBackups(c *VeleroV1Client, namespace string) *backups {
}
// Get takes name of the backup, and returns the corresponding backup object, and an error if there is any.
func (c *backups) Get(name string, options meta_v1.GetOptions) (result *v1.Backup, err error) {
func (c *backups) Get(name string, options metav1.GetOptions) (result *v1.Backup, err error) {
result = &v1.Backup{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *backups) Get(name string, options meta_v1.GetOptions) (result *v1.Backu
}
// List takes label and field selectors, and returns the list of Backups that match those selectors.
func (c *backups) List(opts meta_v1.ListOptions) (result *v1.BackupList, err error) {
func (c *backups) List(opts metav1.ListOptions) (result *v1.BackupList, err error) {
result = &v1.BackupList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *backups) List(opts meta_v1.ListOptions) (result *v1.BackupList, err err
}
// Watch returns a watch.Interface that watches the requested backups.
func (c *backups) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *backups) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *backups) UpdateStatus(backup *v1.Backup) (result *v1.Backup, err error)
}
// Delete takes name of the backup and deletes it. Returns an error if one occurs.
func (c *backups) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *backups) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("backups").
@ -149,7 +149,7 @@ func (c *backups) Delete(name string, options *meta_v1.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *backups) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *backups) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("backups").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type BackupStorageLocationInterface interface {
Create(*v1.BackupStorageLocation) (*v1.BackupStorageLocation, error)
Update(*v1.BackupStorageLocation) (*v1.BackupStorageLocation, error)
UpdateStatus(*v1.BackupStorageLocation) (*v1.BackupStorageLocation, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.BackupStorageLocation, error)
List(opts meta_v1.ListOptions) (*v1.BackupStorageLocationList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.BackupStorageLocation, error)
List(opts metav1.ListOptions) (*v1.BackupStorageLocationList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.BackupStorageLocation, err error)
BackupStorageLocationExpansion
}
@ -62,7 +62,7 @@ func newBackupStorageLocations(c *VeleroV1Client, namespace string) *backupStora
}
// Get takes name of the backupStorageLocation, and returns the corresponding backupStorageLocation object, and an error if there is any.
func (c *backupStorageLocations) Get(name string, options meta_v1.GetOptions) (result *v1.BackupStorageLocation, err error) {
func (c *backupStorageLocations) Get(name string, options metav1.GetOptions) (result *v1.BackupStorageLocation, err error) {
result = &v1.BackupStorageLocation{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *backupStorageLocations) Get(name string, options meta_v1.GetOptions) (r
}
// List takes label and field selectors, and returns the list of BackupStorageLocations that match those selectors.
func (c *backupStorageLocations) List(opts meta_v1.ListOptions) (result *v1.BackupStorageLocationList, err error) {
func (c *backupStorageLocations) List(opts metav1.ListOptions) (result *v1.BackupStorageLocationList, err error) {
result = &v1.BackupStorageLocationList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *backupStorageLocations) List(opts meta_v1.ListOptions) (result *v1.Back
}
// Watch returns a watch.Interface that watches the requested backupStorageLocations.
func (c *backupStorageLocations) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *backupStorageLocations) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *backupStorageLocations) UpdateStatus(backupStorageLocation *v1.BackupSt
}
// Delete takes name of the backupStorageLocation and deletes it. Returns an error if one occurs.
func (c *backupStorageLocations) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *backupStorageLocations) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("backupstoragelocations").
@ -149,7 +149,7 @@ func (c *backupStorageLocations) Delete(name string, options *meta_v1.DeleteOpti
}
// DeleteCollection deletes a collection of objects.
func (c *backupStorageLocations) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *backupStorageLocations) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("backupstoragelocations").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type DeleteBackupRequestInterface interface {
Create(*v1.DeleteBackupRequest) (*v1.DeleteBackupRequest, error)
Update(*v1.DeleteBackupRequest) (*v1.DeleteBackupRequest, error)
UpdateStatus(*v1.DeleteBackupRequest) (*v1.DeleteBackupRequest, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.DeleteBackupRequest, error)
List(opts meta_v1.ListOptions) (*v1.DeleteBackupRequestList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.DeleteBackupRequest, error)
List(opts metav1.ListOptions) (*v1.DeleteBackupRequestList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.DeleteBackupRequest, err error)
DeleteBackupRequestExpansion
}
@ -62,7 +62,7 @@ func newDeleteBackupRequests(c *VeleroV1Client, namespace string) *deleteBackupR
}
// Get takes name of the deleteBackupRequest, and returns the corresponding deleteBackupRequest object, and an error if there is any.
func (c *deleteBackupRequests) Get(name string, options meta_v1.GetOptions) (result *v1.DeleteBackupRequest, err error) {
func (c *deleteBackupRequests) Get(name string, options metav1.GetOptions) (result *v1.DeleteBackupRequest, err error) {
result = &v1.DeleteBackupRequest{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *deleteBackupRequests) Get(name string, options meta_v1.GetOptions) (res
}
// List takes label and field selectors, and returns the list of DeleteBackupRequests that match those selectors.
func (c *deleteBackupRequests) List(opts meta_v1.ListOptions) (result *v1.DeleteBackupRequestList, err error) {
func (c *deleteBackupRequests) List(opts metav1.ListOptions) (result *v1.DeleteBackupRequestList, err error) {
result = &v1.DeleteBackupRequestList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *deleteBackupRequests) List(opts meta_v1.ListOptions) (result *v1.Delete
}
// Watch returns a watch.Interface that watches the requested deleteBackupRequests.
func (c *deleteBackupRequests) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *deleteBackupRequests) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *deleteBackupRequests) UpdateStatus(deleteBackupRequest *v1.DeleteBackup
}
// Delete takes name of the deleteBackupRequest and deletes it. Returns an error if one occurs.
func (c *deleteBackupRequests) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *deleteBackupRequests) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("deletebackuprequests").
@ -149,7 +149,7 @@ func (c *deleteBackupRequests) Delete(name string, options *meta_v1.DeleteOption
}
// DeleteCollection deletes a collection of objects.
func (c *deleteBackupRequests) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *deleteBackupRequests) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("deletebackuprequests").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type DownloadRequestInterface interface {
Create(*v1.DownloadRequest) (*v1.DownloadRequest, error)
Update(*v1.DownloadRequest) (*v1.DownloadRequest, error)
UpdateStatus(*v1.DownloadRequest) (*v1.DownloadRequest, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.DownloadRequest, error)
List(opts meta_v1.ListOptions) (*v1.DownloadRequestList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.DownloadRequest, error)
List(opts metav1.ListOptions) (*v1.DownloadRequestList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.DownloadRequest, err error)
DownloadRequestExpansion
}
@ -62,7 +62,7 @@ func newDownloadRequests(c *VeleroV1Client, namespace string) *downloadRequests
}
// Get takes name of the downloadRequest, and returns the corresponding downloadRequest object, and an error if there is any.
func (c *downloadRequests) Get(name string, options meta_v1.GetOptions) (result *v1.DownloadRequest, err error) {
func (c *downloadRequests) Get(name string, options metav1.GetOptions) (result *v1.DownloadRequest, err error) {
result = &v1.DownloadRequest{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *downloadRequests) Get(name string, options meta_v1.GetOptions) (result
}
// List takes label and field selectors, and returns the list of DownloadRequests that match those selectors.
func (c *downloadRequests) List(opts meta_v1.ListOptions) (result *v1.DownloadRequestList, err error) {
func (c *downloadRequests) List(opts metav1.ListOptions) (result *v1.DownloadRequestList, err error) {
result = &v1.DownloadRequestList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *downloadRequests) List(opts meta_v1.ListOptions) (result *v1.DownloadRe
}
// Watch returns a watch.Interface that watches the requested downloadRequests.
func (c *downloadRequests) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *downloadRequests) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *downloadRequests) UpdateStatus(downloadRequest *v1.DownloadRequest) (re
}
// Delete takes name of the downloadRequest and deletes it. Returns an error if one occurs.
func (c *downloadRequests) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *downloadRequests) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("downloadrequests").
@ -149,7 +149,7 @@ func (c *downloadRequests) Delete(name string, options *meta_v1.DeleteOptions) e
}
// DeleteCollection deletes a collection of objects.
func (c *downloadRequests) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *downloadRequests) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("downloadrequests").

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var backupsResource = schema.GroupVersionResource{Group: "velero.io", Version: "
var backupsKind = schema.GroupVersionKind{Group: "velero.io", Version: "v1", Kind: "Backup"}
// Get takes name of the backup, and returns the corresponding backup object, and an error if there is any.
func (c *FakeBackups) Get(name string, options v1.GetOptions) (result *velero_v1.Backup, err error) {
func (c *FakeBackups) Get(name string, options v1.GetOptions) (result *velerov1.Backup, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(backupsResource, c.ns, name), &velero_v1.Backup{})
Invokes(testing.NewGetAction(backupsResource, c.ns, name), &velerov1.Backup{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.Backup), err
return obj.(*velerov1.Backup), err
}
// List takes label and field selectors, and returns the list of Backups that match those selectors.
func (c *FakeBackups) List(opts v1.ListOptions) (result *velero_v1.BackupList, err error) {
func (c *FakeBackups) List(opts v1.ListOptions) (result *velerov1.BackupList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(backupsResource, backupsKind, c.ns, opts), &velero_v1.BackupList{})
Invokes(testing.NewListAction(backupsResource, backupsKind, c.ns, opts), &velerov1.BackupList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeBackups) List(opts v1.ListOptions) (result *velero_v1.BackupList, e
if label == nil {
label = labels.Everything()
}
list := &velero_v1.BackupList{ListMeta: obj.(*velero_v1.BackupList).ListMeta}
for _, item := range obj.(*velero_v1.BackupList).Items {
list := &velerov1.BackupList{ListMeta: obj.(*velerov1.BackupList).ListMeta}
for _, item := range obj.(*velerov1.BackupList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeBackups) Watch(opts v1.ListOptions) (watch.Interface, error) {
}
// Create takes the representation of a backup and creates it. Returns the server's representation of the backup, and an error, if there is any.
func (c *FakeBackups) Create(backup *velero_v1.Backup) (result *velero_v1.Backup, err error) {
func (c *FakeBackups) Create(backup *velerov1.Backup) (result *velerov1.Backup, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(backupsResource, c.ns, backup), &velero_v1.Backup{})
Invokes(testing.NewCreateAction(backupsResource, c.ns, backup), &velerov1.Backup{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.Backup), err
return obj.(*velerov1.Backup), err
}
// Update takes the representation of a backup and updates it. Returns the server's representation of the backup, and an error, if there is any.
func (c *FakeBackups) Update(backup *velero_v1.Backup) (result *velero_v1.Backup, err error) {
func (c *FakeBackups) Update(backup *velerov1.Backup) (result *velerov1.Backup, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(backupsResource, c.ns, backup), &velero_v1.Backup{})
Invokes(testing.NewUpdateAction(backupsResource, c.ns, backup), &velerov1.Backup{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.Backup), err
return obj.(*velerov1.Backup), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeBackups) UpdateStatus(backup *velero_v1.Backup) (*velero_v1.Backup, error) {
func (c *FakeBackups) UpdateStatus(backup *velerov1.Backup) (*velerov1.Backup, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(backupsResource, "status", c.ns, backup), &velero_v1.Backup{})
Invokes(testing.NewUpdateSubresourceAction(backupsResource, "status", c.ns, backup), &velerov1.Backup{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.Backup), err
return obj.(*velerov1.Backup), err
}
// Delete takes name of the backup and deletes it. Returns an error if one occurs.
func (c *FakeBackups) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(backupsResource, c.ns, name), &velero_v1.Backup{})
Invokes(testing.NewDeleteAction(backupsResource, c.ns, name), &velerov1.Backup{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeBackups) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeBackups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(backupsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &velero_v1.BackupList{})
_, err := c.Fake.Invokes(action, &velerov1.BackupList{})
return err
}
// Patch applies the patch and returns the patched backup.
func (c *FakeBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velero_v1.Backup, err error) {
func (c *FakeBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.Backup, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(backupsResource, c.ns, name, data, subresources...), &velero_v1.Backup{})
Invokes(testing.NewPatchSubresourceAction(backupsResource, c.ns, name, data, subresources...), &velerov1.Backup{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.Backup), err
return obj.(*velerov1.Backup), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var backupstoragelocationsResource = schema.GroupVersionResource{Group: "velero.
var backupstoragelocationsKind = schema.GroupVersionKind{Group: "velero.io", Version: "v1", Kind: "BackupStorageLocation"}
// Get takes name of the backupStorageLocation, and returns the corresponding backupStorageLocation object, and an error if there is any.
func (c *FakeBackupStorageLocations) Get(name string, options v1.GetOptions) (result *velero_v1.BackupStorageLocation, err error) {
func (c *FakeBackupStorageLocations) Get(name string, options v1.GetOptions) (result *velerov1.BackupStorageLocation, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(backupstoragelocationsResource, c.ns, name), &velero_v1.BackupStorageLocation{})
Invokes(testing.NewGetAction(backupstoragelocationsResource, c.ns, name), &velerov1.BackupStorageLocation{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.BackupStorageLocation), err
return obj.(*velerov1.BackupStorageLocation), err
}
// List takes label and field selectors, and returns the list of BackupStorageLocations that match those selectors.
func (c *FakeBackupStorageLocations) List(opts v1.ListOptions) (result *velero_v1.BackupStorageLocationList, err error) {
func (c *FakeBackupStorageLocations) List(opts v1.ListOptions) (result *velerov1.BackupStorageLocationList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(backupstoragelocationsResource, backupstoragelocationsKind, c.ns, opts), &velero_v1.BackupStorageLocationList{})
Invokes(testing.NewListAction(backupstoragelocationsResource, backupstoragelocationsKind, c.ns, opts), &velerov1.BackupStorageLocationList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeBackupStorageLocations) List(opts v1.ListOptions) (result *velero_v
if label == nil {
label = labels.Everything()
}
list := &velero_v1.BackupStorageLocationList{ListMeta: obj.(*velero_v1.BackupStorageLocationList).ListMeta}
for _, item := range obj.(*velero_v1.BackupStorageLocationList).Items {
list := &velerov1.BackupStorageLocationList{ListMeta: obj.(*velerov1.BackupStorageLocationList).ListMeta}
for _, item := range obj.(*velerov1.BackupStorageLocationList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeBackupStorageLocations) Watch(opts v1.ListOptions) (watch.Interface
}
// Create takes the representation of a backupStorageLocation and creates it. Returns the server's representation of the backupStorageLocation, and an error, if there is any.
func (c *FakeBackupStorageLocations) Create(backupStorageLocation *velero_v1.BackupStorageLocation) (result *velero_v1.BackupStorageLocation, err error) {
func (c *FakeBackupStorageLocations) Create(backupStorageLocation *velerov1.BackupStorageLocation) (result *velerov1.BackupStorageLocation, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(backupstoragelocationsResource, c.ns, backupStorageLocation), &velero_v1.BackupStorageLocation{})
Invokes(testing.NewCreateAction(backupstoragelocationsResource, c.ns, backupStorageLocation), &velerov1.BackupStorageLocation{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.BackupStorageLocation), err
return obj.(*velerov1.BackupStorageLocation), err
}
// Update takes the representation of a backupStorageLocation and updates it. Returns the server's representation of the backupStorageLocation, and an error, if there is any.
func (c *FakeBackupStorageLocations) Update(backupStorageLocation *velero_v1.BackupStorageLocation) (result *velero_v1.BackupStorageLocation, err error) {
func (c *FakeBackupStorageLocations) Update(backupStorageLocation *velerov1.BackupStorageLocation) (result *velerov1.BackupStorageLocation, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(backupstoragelocationsResource, c.ns, backupStorageLocation), &velero_v1.BackupStorageLocation{})
Invokes(testing.NewUpdateAction(backupstoragelocationsResource, c.ns, backupStorageLocation), &velerov1.BackupStorageLocation{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.BackupStorageLocation), err
return obj.(*velerov1.BackupStorageLocation), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeBackupStorageLocations) UpdateStatus(backupStorageLocation *velero_v1.BackupStorageLocation) (*velero_v1.BackupStorageLocation, error) {
func (c *FakeBackupStorageLocations) UpdateStatus(backupStorageLocation *velerov1.BackupStorageLocation) (*velerov1.BackupStorageLocation, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(backupstoragelocationsResource, "status", c.ns, backupStorageLocation), &velero_v1.BackupStorageLocation{})
Invokes(testing.NewUpdateSubresourceAction(backupstoragelocationsResource, "status", c.ns, backupStorageLocation), &velerov1.BackupStorageLocation{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.BackupStorageLocation), err
return obj.(*velerov1.BackupStorageLocation), err
}
// Delete takes name of the backupStorageLocation and deletes it. Returns an error if one occurs.
func (c *FakeBackupStorageLocations) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(backupstoragelocationsResource, c.ns, name), &velero_v1.BackupStorageLocation{})
Invokes(testing.NewDeleteAction(backupstoragelocationsResource, c.ns, name), &velerov1.BackupStorageLocation{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeBackupStorageLocations) Delete(name string, options *v1.DeleteOptio
func (c *FakeBackupStorageLocations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(backupstoragelocationsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &velero_v1.BackupStorageLocationList{})
_, err := c.Fake.Invokes(action, &velerov1.BackupStorageLocationList{})
return err
}
// Patch applies the patch and returns the patched backupStorageLocation.
func (c *FakeBackupStorageLocations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velero_v1.BackupStorageLocation, err error) {
func (c *FakeBackupStorageLocations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.BackupStorageLocation, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(backupstoragelocationsResource, c.ns, name, data, subresources...), &velero_v1.BackupStorageLocation{})
Invokes(testing.NewPatchSubresourceAction(backupstoragelocationsResource, c.ns, name, data, subresources...), &velerov1.BackupStorageLocation{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.BackupStorageLocation), err
return obj.(*velerov1.BackupStorageLocation), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var deletebackuprequestsResource = schema.GroupVersionResource{Group: "velero.io
var deletebackuprequestsKind = schema.GroupVersionKind{Group: "velero.io", Version: "v1", Kind: "DeleteBackupRequest"}
// Get takes name of the deleteBackupRequest, and returns the corresponding deleteBackupRequest object, and an error if there is any.
func (c *FakeDeleteBackupRequests) Get(name string, options v1.GetOptions) (result *velero_v1.DeleteBackupRequest, err error) {
func (c *FakeDeleteBackupRequests) Get(name string, options v1.GetOptions) (result *velerov1.DeleteBackupRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(deletebackuprequestsResource, c.ns, name), &velero_v1.DeleteBackupRequest{})
Invokes(testing.NewGetAction(deletebackuprequestsResource, c.ns, name), &velerov1.DeleteBackupRequest{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.DeleteBackupRequest), err
return obj.(*velerov1.DeleteBackupRequest), err
}
// List takes label and field selectors, and returns the list of DeleteBackupRequests that match those selectors.
func (c *FakeDeleteBackupRequests) List(opts v1.ListOptions) (result *velero_v1.DeleteBackupRequestList, err error) {
func (c *FakeDeleteBackupRequests) List(opts v1.ListOptions) (result *velerov1.DeleteBackupRequestList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(deletebackuprequestsResource, deletebackuprequestsKind, c.ns, opts), &velero_v1.DeleteBackupRequestList{})
Invokes(testing.NewListAction(deletebackuprequestsResource, deletebackuprequestsKind, c.ns, opts), &velerov1.DeleteBackupRequestList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeDeleteBackupRequests) List(opts v1.ListOptions) (result *velero_v1.
if label == nil {
label = labels.Everything()
}
list := &velero_v1.DeleteBackupRequestList{ListMeta: obj.(*velero_v1.DeleteBackupRequestList).ListMeta}
for _, item := range obj.(*velero_v1.DeleteBackupRequestList).Items {
list := &velerov1.DeleteBackupRequestList{ListMeta: obj.(*velerov1.DeleteBackupRequestList).ListMeta}
for _, item := range obj.(*velerov1.DeleteBackupRequestList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeDeleteBackupRequests) Watch(opts v1.ListOptions) (watch.Interface,
}
// Create takes the representation of a deleteBackupRequest and creates it. Returns the server's representation of the deleteBackupRequest, and an error, if there is any.
func (c *FakeDeleteBackupRequests) Create(deleteBackupRequest *velero_v1.DeleteBackupRequest) (result *velero_v1.DeleteBackupRequest, err error) {
func (c *FakeDeleteBackupRequests) Create(deleteBackupRequest *velerov1.DeleteBackupRequest) (result *velerov1.DeleteBackupRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(deletebackuprequestsResource, c.ns, deleteBackupRequest), &velero_v1.DeleteBackupRequest{})
Invokes(testing.NewCreateAction(deletebackuprequestsResource, c.ns, deleteBackupRequest), &velerov1.DeleteBackupRequest{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.DeleteBackupRequest), err
return obj.(*velerov1.DeleteBackupRequest), err
}
// Update takes the representation of a deleteBackupRequest and updates it. Returns the server's representation of the deleteBackupRequest, and an error, if there is any.
func (c *FakeDeleteBackupRequests) Update(deleteBackupRequest *velero_v1.DeleteBackupRequest) (result *velero_v1.DeleteBackupRequest, err error) {
func (c *FakeDeleteBackupRequests) Update(deleteBackupRequest *velerov1.DeleteBackupRequest) (result *velerov1.DeleteBackupRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(deletebackuprequestsResource, c.ns, deleteBackupRequest), &velero_v1.DeleteBackupRequest{})
Invokes(testing.NewUpdateAction(deletebackuprequestsResource, c.ns, deleteBackupRequest), &velerov1.DeleteBackupRequest{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.DeleteBackupRequest), err
return obj.(*velerov1.DeleteBackupRequest), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeDeleteBackupRequests) UpdateStatus(deleteBackupRequest *velero_v1.DeleteBackupRequest) (*velero_v1.DeleteBackupRequest, error) {
func (c *FakeDeleteBackupRequests) UpdateStatus(deleteBackupRequest *velerov1.DeleteBackupRequest) (*velerov1.DeleteBackupRequest, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(deletebackuprequestsResource, "status", c.ns, deleteBackupRequest), &velero_v1.DeleteBackupRequest{})
Invokes(testing.NewUpdateSubresourceAction(deletebackuprequestsResource, "status", c.ns, deleteBackupRequest), &velerov1.DeleteBackupRequest{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.DeleteBackupRequest), err
return obj.(*velerov1.DeleteBackupRequest), err
}
// Delete takes name of the deleteBackupRequest and deletes it. Returns an error if one occurs.
func (c *FakeDeleteBackupRequests) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(deletebackuprequestsResource, c.ns, name), &velero_v1.DeleteBackupRequest{})
Invokes(testing.NewDeleteAction(deletebackuprequestsResource, c.ns, name), &velerov1.DeleteBackupRequest{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeDeleteBackupRequests) Delete(name string, options *v1.DeleteOptions
func (c *FakeDeleteBackupRequests) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(deletebackuprequestsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &velero_v1.DeleteBackupRequestList{})
_, err := c.Fake.Invokes(action, &velerov1.DeleteBackupRequestList{})
return err
}
// Patch applies the patch and returns the patched deleteBackupRequest.
func (c *FakeDeleteBackupRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velero_v1.DeleteBackupRequest, err error) {
func (c *FakeDeleteBackupRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.DeleteBackupRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deletebackuprequestsResource, c.ns, name, data, subresources...), &velero_v1.DeleteBackupRequest{})
Invokes(testing.NewPatchSubresourceAction(deletebackuprequestsResource, c.ns, name, data, subresources...), &velerov1.DeleteBackupRequest{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.DeleteBackupRequest), err
return obj.(*velerov1.DeleteBackupRequest), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var downloadrequestsResource = schema.GroupVersionResource{Group: "velero.io", V
var downloadrequestsKind = schema.GroupVersionKind{Group: "velero.io", Version: "v1", Kind: "DownloadRequest"}
// Get takes name of the downloadRequest, and returns the corresponding downloadRequest object, and an error if there is any.
func (c *FakeDownloadRequests) Get(name string, options v1.GetOptions) (result *velero_v1.DownloadRequest, err error) {
func (c *FakeDownloadRequests) Get(name string, options v1.GetOptions) (result *velerov1.DownloadRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(downloadrequestsResource, c.ns, name), &velero_v1.DownloadRequest{})
Invokes(testing.NewGetAction(downloadrequestsResource, c.ns, name), &velerov1.DownloadRequest{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.DownloadRequest), err
return obj.(*velerov1.DownloadRequest), err
}
// List takes label and field selectors, and returns the list of DownloadRequests that match those selectors.
func (c *FakeDownloadRequests) List(opts v1.ListOptions) (result *velero_v1.DownloadRequestList, err error) {
func (c *FakeDownloadRequests) List(opts v1.ListOptions) (result *velerov1.DownloadRequestList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(downloadrequestsResource, downloadrequestsKind, c.ns, opts), &velero_v1.DownloadRequestList{})
Invokes(testing.NewListAction(downloadrequestsResource, downloadrequestsKind, c.ns, opts), &velerov1.DownloadRequestList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeDownloadRequests) List(opts v1.ListOptions) (result *velero_v1.Down
if label == nil {
label = labels.Everything()
}
list := &velero_v1.DownloadRequestList{ListMeta: obj.(*velero_v1.DownloadRequestList).ListMeta}
for _, item := range obj.(*velero_v1.DownloadRequestList).Items {
list := &velerov1.DownloadRequestList{ListMeta: obj.(*velerov1.DownloadRequestList).ListMeta}
for _, item := range obj.(*velerov1.DownloadRequestList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeDownloadRequests) Watch(opts v1.ListOptions) (watch.Interface, erro
}
// Create takes the representation of a downloadRequest and creates it. Returns the server's representation of the downloadRequest, and an error, if there is any.
func (c *FakeDownloadRequests) Create(downloadRequest *velero_v1.DownloadRequest) (result *velero_v1.DownloadRequest, err error) {
func (c *FakeDownloadRequests) Create(downloadRequest *velerov1.DownloadRequest) (result *velerov1.DownloadRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(downloadrequestsResource, c.ns, downloadRequest), &velero_v1.DownloadRequest{})
Invokes(testing.NewCreateAction(downloadrequestsResource, c.ns, downloadRequest), &velerov1.DownloadRequest{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.DownloadRequest), err
return obj.(*velerov1.DownloadRequest), err
}
// Update takes the representation of a downloadRequest and updates it. Returns the server's representation of the downloadRequest, and an error, if there is any.
func (c *FakeDownloadRequests) Update(downloadRequest *velero_v1.DownloadRequest) (result *velero_v1.DownloadRequest, err error) {
func (c *FakeDownloadRequests) Update(downloadRequest *velerov1.DownloadRequest) (result *velerov1.DownloadRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(downloadrequestsResource, c.ns, downloadRequest), &velero_v1.DownloadRequest{})
Invokes(testing.NewUpdateAction(downloadrequestsResource, c.ns, downloadRequest), &velerov1.DownloadRequest{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.DownloadRequest), err
return obj.(*velerov1.DownloadRequest), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeDownloadRequests) UpdateStatus(downloadRequest *velero_v1.DownloadRequest) (*velero_v1.DownloadRequest, error) {
func (c *FakeDownloadRequests) UpdateStatus(downloadRequest *velerov1.DownloadRequest) (*velerov1.DownloadRequest, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(downloadrequestsResource, "status", c.ns, downloadRequest), &velero_v1.DownloadRequest{})
Invokes(testing.NewUpdateSubresourceAction(downloadrequestsResource, "status", c.ns, downloadRequest), &velerov1.DownloadRequest{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.DownloadRequest), err
return obj.(*velerov1.DownloadRequest), err
}
// Delete takes name of the downloadRequest and deletes it. Returns an error if one occurs.
func (c *FakeDownloadRequests) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(downloadrequestsResource, c.ns, name), &velero_v1.DownloadRequest{})
Invokes(testing.NewDeleteAction(downloadrequestsResource, c.ns, name), &velerov1.DownloadRequest{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeDownloadRequests) Delete(name string, options *v1.DeleteOptions) er
func (c *FakeDownloadRequests) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(downloadrequestsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &velero_v1.DownloadRequestList{})
_, err := c.Fake.Invokes(action, &velerov1.DownloadRequestList{})
return err
}
// Patch applies the patch and returns the patched downloadRequest.
func (c *FakeDownloadRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velero_v1.DownloadRequest, err error) {
func (c *FakeDownloadRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.DownloadRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(downloadrequestsResource, c.ns, name, data, subresources...), &velero_v1.DownloadRequest{})
Invokes(testing.NewPatchSubresourceAction(downloadrequestsResource, c.ns, name, data, subresources...), &velerov1.DownloadRequest{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.DownloadRequest), err
return obj.(*velerov1.DownloadRequest), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var podvolumebackupsResource = schema.GroupVersionResource{Group: "velero.io", V
var podvolumebackupsKind = schema.GroupVersionKind{Group: "velero.io", Version: "v1", Kind: "PodVolumeBackup"}
// Get takes name of the podVolumeBackup, and returns the corresponding podVolumeBackup object, and an error if there is any.
func (c *FakePodVolumeBackups) Get(name string, options v1.GetOptions) (result *velero_v1.PodVolumeBackup, err error) {
func (c *FakePodVolumeBackups) Get(name string, options v1.GetOptions) (result *velerov1.PodVolumeBackup, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(podvolumebackupsResource, c.ns, name), &velero_v1.PodVolumeBackup{})
Invokes(testing.NewGetAction(podvolumebackupsResource, c.ns, name), &velerov1.PodVolumeBackup{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.PodVolumeBackup), err
return obj.(*velerov1.PodVolumeBackup), err
}
// List takes label and field selectors, and returns the list of PodVolumeBackups that match those selectors.
func (c *FakePodVolumeBackups) List(opts v1.ListOptions) (result *velero_v1.PodVolumeBackupList, err error) {
func (c *FakePodVolumeBackups) List(opts v1.ListOptions) (result *velerov1.PodVolumeBackupList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(podvolumebackupsResource, podvolumebackupsKind, c.ns, opts), &velero_v1.PodVolumeBackupList{})
Invokes(testing.NewListAction(podvolumebackupsResource, podvolumebackupsKind, c.ns, opts), &velerov1.PodVolumeBackupList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakePodVolumeBackups) List(opts v1.ListOptions) (result *velero_v1.PodV
if label == nil {
label = labels.Everything()
}
list := &velero_v1.PodVolumeBackupList{ListMeta: obj.(*velero_v1.PodVolumeBackupList).ListMeta}
for _, item := range obj.(*velero_v1.PodVolumeBackupList).Items {
list := &velerov1.PodVolumeBackupList{ListMeta: obj.(*velerov1.PodVolumeBackupList).ListMeta}
for _, item := range obj.(*velerov1.PodVolumeBackupList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakePodVolumeBackups) Watch(opts v1.ListOptions) (watch.Interface, erro
}
// Create takes the representation of a podVolumeBackup and creates it. Returns the server's representation of the podVolumeBackup, and an error, if there is any.
func (c *FakePodVolumeBackups) Create(podVolumeBackup *velero_v1.PodVolumeBackup) (result *velero_v1.PodVolumeBackup, err error) {
func (c *FakePodVolumeBackups) Create(podVolumeBackup *velerov1.PodVolumeBackup) (result *velerov1.PodVolumeBackup, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(podvolumebackupsResource, c.ns, podVolumeBackup), &velero_v1.PodVolumeBackup{})
Invokes(testing.NewCreateAction(podvolumebackupsResource, c.ns, podVolumeBackup), &velerov1.PodVolumeBackup{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.PodVolumeBackup), err
return obj.(*velerov1.PodVolumeBackup), err
}
// Update takes the representation of a podVolumeBackup and updates it. Returns the server's representation of the podVolumeBackup, and an error, if there is any.
func (c *FakePodVolumeBackups) Update(podVolumeBackup *velero_v1.PodVolumeBackup) (result *velero_v1.PodVolumeBackup, err error) {
func (c *FakePodVolumeBackups) Update(podVolumeBackup *velerov1.PodVolumeBackup) (result *velerov1.PodVolumeBackup, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(podvolumebackupsResource, c.ns, podVolumeBackup), &velero_v1.PodVolumeBackup{})
Invokes(testing.NewUpdateAction(podvolumebackupsResource, c.ns, podVolumeBackup), &velerov1.PodVolumeBackup{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.PodVolumeBackup), err
return obj.(*velerov1.PodVolumeBackup), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakePodVolumeBackups) UpdateStatus(podVolumeBackup *velero_v1.PodVolumeBackup) (*velero_v1.PodVolumeBackup, error) {
func (c *FakePodVolumeBackups) UpdateStatus(podVolumeBackup *velerov1.PodVolumeBackup) (*velerov1.PodVolumeBackup, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(podvolumebackupsResource, "status", c.ns, podVolumeBackup), &velero_v1.PodVolumeBackup{})
Invokes(testing.NewUpdateSubresourceAction(podvolumebackupsResource, "status", c.ns, podVolumeBackup), &velerov1.PodVolumeBackup{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.PodVolumeBackup), err
return obj.(*velerov1.PodVolumeBackup), err
}
// Delete takes name of the podVolumeBackup and deletes it. Returns an error if one occurs.
func (c *FakePodVolumeBackups) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(podvolumebackupsResource, c.ns, name), &velero_v1.PodVolumeBackup{})
Invokes(testing.NewDeleteAction(podvolumebackupsResource, c.ns, name), &velerov1.PodVolumeBackup{})
return err
}
@ -124,17 +124,17 @@ func (c *FakePodVolumeBackups) Delete(name string, options *v1.DeleteOptions) er
func (c *FakePodVolumeBackups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(podvolumebackupsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &velero_v1.PodVolumeBackupList{})
_, err := c.Fake.Invokes(action, &velerov1.PodVolumeBackupList{})
return err
}
// Patch applies the patch and returns the patched podVolumeBackup.
func (c *FakePodVolumeBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velero_v1.PodVolumeBackup, err error) {
func (c *FakePodVolumeBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.PodVolumeBackup, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(podvolumebackupsResource, c.ns, name, data, subresources...), &velero_v1.PodVolumeBackup{})
Invokes(testing.NewPatchSubresourceAction(podvolumebackupsResource, c.ns, name, data, subresources...), &velerov1.PodVolumeBackup{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.PodVolumeBackup), err
return obj.(*velerov1.PodVolumeBackup), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var podvolumerestoresResource = schema.GroupVersionResource{Group: "velero.io",
var podvolumerestoresKind = schema.GroupVersionKind{Group: "velero.io", Version: "v1", Kind: "PodVolumeRestore"}
// Get takes name of the podVolumeRestore, and returns the corresponding podVolumeRestore object, and an error if there is any.
func (c *FakePodVolumeRestores) Get(name string, options v1.GetOptions) (result *velero_v1.PodVolumeRestore, err error) {
func (c *FakePodVolumeRestores) Get(name string, options v1.GetOptions) (result *velerov1.PodVolumeRestore, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(podvolumerestoresResource, c.ns, name), &velero_v1.PodVolumeRestore{})
Invokes(testing.NewGetAction(podvolumerestoresResource, c.ns, name), &velerov1.PodVolumeRestore{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.PodVolumeRestore), err
return obj.(*velerov1.PodVolumeRestore), err
}
// List takes label and field selectors, and returns the list of PodVolumeRestores that match those selectors.
func (c *FakePodVolumeRestores) List(opts v1.ListOptions) (result *velero_v1.PodVolumeRestoreList, err error) {
func (c *FakePodVolumeRestores) List(opts v1.ListOptions) (result *velerov1.PodVolumeRestoreList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(podvolumerestoresResource, podvolumerestoresKind, c.ns, opts), &velero_v1.PodVolumeRestoreList{})
Invokes(testing.NewListAction(podvolumerestoresResource, podvolumerestoresKind, c.ns, opts), &velerov1.PodVolumeRestoreList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakePodVolumeRestores) List(opts v1.ListOptions) (result *velero_v1.Pod
if label == nil {
label = labels.Everything()
}
list := &velero_v1.PodVolumeRestoreList{ListMeta: obj.(*velero_v1.PodVolumeRestoreList).ListMeta}
for _, item := range obj.(*velero_v1.PodVolumeRestoreList).Items {
list := &velerov1.PodVolumeRestoreList{ListMeta: obj.(*velerov1.PodVolumeRestoreList).ListMeta}
for _, item := range obj.(*velerov1.PodVolumeRestoreList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakePodVolumeRestores) Watch(opts v1.ListOptions) (watch.Interface, err
}
// Create takes the representation of a podVolumeRestore and creates it. Returns the server's representation of the podVolumeRestore, and an error, if there is any.
func (c *FakePodVolumeRestores) Create(podVolumeRestore *velero_v1.PodVolumeRestore) (result *velero_v1.PodVolumeRestore, err error) {
func (c *FakePodVolumeRestores) Create(podVolumeRestore *velerov1.PodVolumeRestore) (result *velerov1.PodVolumeRestore, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(podvolumerestoresResource, c.ns, podVolumeRestore), &velero_v1.PodVolumeRestore{})
Invokes(testing.NewCreateAction(podvolumerestoresResource, c.ns, podVolumeRestore), &velerov1.PodVolumeRestore{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.PodVolumeRestore), err
return obj.(*velerov1.PodVolumeRestore), err
}
// Update takes the representation of a podVolumeRestore and updates it. Returns the server's representation of the podVolumeRestore, and an error, if there is any.
func (c *FakePodVolumeRestores) Update(podVolumeRestore *velero_v1.PodVolumeRestore) (result *velero_v1.PodVolumeRestore, err error) {
func (c *FakePodVolumeRestores) Update(podVolumeRestore *velerov1.PodVolumeRestore) (result *velerov1.PodVolumeRestore, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(podvolumerestoresResource, c.ns, podVolumeRestore), &velero_v1.PodVolumeRestore{})
Invokes(testing.NewUpdateAction(podvolumerestoresResource, c.ns, podVolumeRestore), &velerov1.PodVolumeRestore{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.PodVolumeRestore), err
return obj.(*velerov1.PodVolumeRestore), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakePodVolumeRestores) UpdateStatus(podVolumeRestore *velero_v1.PodVolumeRestore) (*velero_v1.PodVolumeRestore, error) {
func (c *FakePodVolumeRestores) UpdateStatus(podVolumeRestore *velerov1.PodVolumeRestore) (*velerov1.PodVolumeRestore, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(podvolumerestoresResource, "status", c.ns, podVolumeRestore), &velero_v1.PodVolumeRestore{})
Invokes(testing.NewUpdateSubresourceAction(podvolumerestoresResource, "status", c.ns, podVolumeRestore), &velerov1.PodVolumeRestore{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.PodVolumeRestore), err
return obj.(*velerov1.PodVolumeRestore), err
}
// Delete takes name of the podVolumeRestore and deletes it. Returns an error if one occurs.
func (c *FakePodVolumeRestores) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(podvolumerestoresResource, c.ns, name), &velero_v1.PodVolumeRestore{})
Invokes(testing.NewDeleteAction(podvolumerestoresResource, c.ns, name), &velerov1.PodVolumeRestore{})
return err
}
@ -124,17 +124,17 @@ func (c *FakePodVolumeRestores) Delete(name string, options *v1.DeleteOptions) e
func (c *FakePodVolumeRestores) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(podvolumerestoresResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &velero_v1.PodVolumeRestoreList{})
_, err := c.Fake.Invokes(action, &velerov1.PodVolumeRestoreList{})
return err
}
// Patch applies the patch and returns the patched podVolumeRestore.
func (c *FakePodVolumeRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velero_v1.PodVolumeRestore, err error) {
func (c *FakePodVolumeRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.PodVolumeRestore, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(podvolumerestoresResource, c.ns, name, data, subresources...), &velero_v1.PodVolumeRestore{})
Invokes(testing.NewPatchSubresourceAction(podvolumerestoresResource, c.ns, name, data, subresources...), &velerov1.PodVolumeRestore{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.PodVolumeRestore), err
return obj.(*velerov1.PodVolumeRestore), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var resticrepositoriesResource = schema.GroupVersionResource{Group: "velero.io",
var resticrepositoriesKind = schema.GroupVersionKind{Group: "velero.io", Version: "v1", Kind: "ResticRepository"}
// Get takes name of the resticRepository, and returns the corresponding resticRepository object, and an error if there is any.
func (c *FakeResticRepositories) Get(name string, options v1.GetOptions) (result *velero_v1.ResticRepository, err error) {
func (c *FakeResticRepositories) Get(name string, options v1.GetOptions) (result *velerov1.ResticRepository, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(resticrepositoriesResource, c.ns, name), &velero_v1.ResticRepository{})
Invokes(testing.NewGetAction(resticrepositoriesResource, c.ns, name), &velerov1.ResticRepository{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.ResticRepository), err
return obj.(*velerov1.ResticRepository), err
}
// List takes label and field selectors, and returns the list of ResticRepositories that match those selectors.
func (c *FakeResticRepositories) List(opts v1.ListOptions) (result *velero_v1.ResticRepositoryList, err error) {
func (c *FakeResticRepositories) List(opts v1.ListOptions) (result *velerov1.ResticRepositoryList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(resticrepositoriesResource, resticrepositoriesKind, c.ns, opts), &velero_v1.ResticRepositoryList{})
Invokes(testing.NewListAction(resticrepositoriesResource, resticrepositoriesKind, c.ns, opts), &velerov1.ResticRepositoryList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeResticRepositories) List(opts v1.ListOptions) (result *velero_v1.Re
if label == nil {
label = labels.Everything()
}
list := &velero_v1.ResticRepositoryList{ListMeta: obj.(*velero_v1.ResticRepositoryList).ListMeta}
for _, item := range obj.(*velero_v1.ResticRepositoryList).Items {
list := &velerov1.ResticRepositoryList{ListMeta: obj.(*velerov1.ResticRepositoryList).ListMeta}
for _, item := range obj.(*velerov1.ResticRepositoryList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeResticRepositories) Watch(opts v1.ListOptions) (watch.Interface, er
}
// Create takes the representation of a resticRepository and creates it. Returns the server's representation of the resticRepository, and an error, if there is any.
func (c *FakeResticRepositories) Create(resticRepository *velero_v1.ResticRepository) (result *velero_v1.ResticRepository, err error) {
func (c *FakeResticRepositories) Create(resticRepository *velerov1.ResticRepository) (result *velerov1.ResticRepository, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(resticrepositoriesResource, c.ns, resticRepository), &velero_v1.ResticRepository{})
Invokes(testing.NewCreateAction(resticrepositoriesResource, c.ns, resticRepository), &velerov1.ResticRepository{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.ResticRepository), err
return obj.(*velerov1.ResticRepository), err
}
// Update takes the representation of a resticRepository and updates it. Returns the server's representation of the resticRepository, and an error, if there is any.
func (c *FakeResticRepositories) Update(resticRepository *velero_v1.ResticRepository) (result *velero_v1.ResticRepository, err error) {
func (c *FakeResticRepositories) Update(resticRepository *velerov1.ResticRepository) (result *velerov1.ResticRepository, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(resticrepositoriesResource, c.ns, resticRepository), &velero_v1.ResticRepository{})
Invokes(testing.NewUpdateAction(resticrepositoriesResource, c.ns, resticRepository), &velerov1.ResticRepository{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.ResticRepository), err
return obj.(*velerov1.ResticRepository), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeResticRepositories) UpdateStatus(resticRepository *velero_v1.ResticRepository) (*velero_v1.ResticRepository, error) {
func (c *FakeResticRepositories) UpdateStatus(resticRepository *velerov1.ResticRepository) (*velerov1.ResticRepository, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(resticrepositoriesResource, "status", c.ns, resticRepository), &velero_v1.ResticRepository{})
Invokes(testing.NewUpdateSubresourceAction(resticrepositoriesResource, "status", c.ns, resticRepository), &velerov1.ResticRepository{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.ResticRepository), err
return obj.(*velerov1.ResticRepository), err
}
// Delete takes name of the resticRepository and deletes it. Returns an error if one occurs.
func (c *FakeResticRepositories) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(resticrepositoriesResource, c.ns, name), &velero_v1.ResticRepository{})
Invokes(testing.NewDeleteAction(resticrepositoriesResource, c.ns, name), &velerov1.ResticRepository{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeResticRepositories) Delete(name string, options *v1.DeleteOptions)
func (c *FakeResticRepositories) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(resticrepositoriesResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &velero_v1.ResticRepositoryList{})
_, err := c.Fake.Invokes(action, &velerov1.ResticRepositoryList{})
return err
}
// Patch applies the patch and returns the patched resticRepository.
func (c *FakeResticRepositories) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velero_v1.ResticRepository, err error) {
func (c *FakeResticRepositories) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.ResticRepository, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(resticrepositoriesResource, c.ns, name, data, subresources...), &velero_v1.ResticRepository{})
Invokes(testing.NewPatchSubresourceAction(resticrepositoriesResource, c.ns, name, data, subresources...), &velerov1.ResticRepository{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.ResticRepository), err
return obj.(*velerov1.ResticRepository), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var restoresResource = schema.GroupVersionResource{Group: "velero.io", Version:
var restoresKind = schema.GroupVersionKind{Group: "velero.io", Version: "v1", Kind: "Restore"}
// Get takes name of the restore, and returns the corresponding restore object, and an error if there is any.
func (c *FakeRestores) Get(name string, options v1.GetOptions) (result *velero_v1.Restore, err error) {
func (c *FakeRestores) Get(name string, options v1.GetOptions) (result *velerov1.Restore, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(restoresResource, c.ns, name), &velero_v1.Restore{})
Invokes(testing.NewGetAction(restoresResource, c.ns, name), &velerov1.Restore{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.Restore), err
return obj.(*velerov1.Restore), err
}
// List takes label and field selectors, and returns the list of Restores that match those selectors.
func (c *FakeRestores) List(opts v1.ListOptions) (result *velero_v1.RestoreList, err error) {
func (c *FakeRestores) List(opts v1.ListOptions) (result *velerov1.RestoreList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(restoresResource, restoresKind, c.ns, opts), &velero_v1.RestoreList{})
Invokes(testing.NewListAction(restoresResource, restoresKind, c.ns, opts), &velerov1.RestoreList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeRestores) List(opts v1.ListOptions) (result *velero_v1.RestoreList,
if label == nil {
label = labels.Everything()
}
list := &velero_v1.RestoreList{ListMeta: obj.(*velero_v1.RestoreList).ListMeta}
for _, item := range obj.(*velero_v1.RestoreList).Items {
list := &velerov1.RestoreList{ListMeta: obj.(*velerov1.RestoreList).ListMeta}
for _, item := range obj.(*velerov1.RestoreList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeRestores) Watch(opts v1.ListOptions) (watch.Interface, error) {
}
// Create takes the representation of a restore and creates it. Returns the server's representation of the restore, and an error, if there is any.
func (c *FakeRestores) Create(restore *velero_v1.Restore) (result *velero_v1.Restore, err error) {
func (c *FakeRestores) Create(restore *velerov1.Restore) (result *velerov1.Restore, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(restoresResource, c.ns, restore), &velero_v1.Restore{})
Invokes(testing.NewCreateAction(restoresResource, c.ns, restore), &velerov1.Restore{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.Restore), err
return obj.(*velerov1.Restore), err
}
// Update takes the representation of a restore and updates it. Returns the server's representation of the restore, and an error, if there is any.
func (c *FakeRestores) Update(restore *velero_v1.Restore) (result *velero_v1.Restore, err error) {
func (c *FakeRestores) Update(restore *velerov1.Restore) (result *velerov1.Restore, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(restoresResource, c.ns, restore), &velero_v1.Restore{})
Invokes(testing.NewUpdateAction(restoresResource, c.ns, restore), &velerov1.Restore{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.Restore), err
return obj.(*velerov1.Restore), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeRestores) UpdateStatus(restore *velero_v1.Restore) (*velero_v1.Restore, error) {
func (c *FakeRestores) UpdateStatus(restore *velerov1.Restore) (*velerov1.Restore, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(restoresResource, "status", c.ns, restore), &velero_v1.Restore{})
Invokes(testing.NewUpdateSubresourceAction(restoresResource, "status", c.ns, restore), &velerov1.Restore{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.Restore), err
return obj.(*velerov1.Restore), err
}
// Delete takes name of the restore and deletes it. Returns an error if one occurs.
func (c *FakeRestores) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(restoresResource, c.ns, name), &velero_v1.Restore{})
Invokes(testing.NewDeleteAction(restoresResource, c.ns, name), &velerov1.Restore{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeRestores) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeRestores) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(restoresResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &velero_v1.RestoreList{})
_, err := c.Fake.Invokes(action, &velerov1.RestoreList{})
return err
}
// Patch applies the patch and returns the patched restore.
func (c *FakeRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velero_v1.Restore, err error) {
func (c *FakeRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.Restore, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(restoresResource, c.ns, name, data, subresources...), &velero_v1.Restore{})
Invokes(testing.NewPatchSubresourceAction(restoresResource, c.ns, name, data, subresources...), &velerov1.Restore{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.Restore), err
return obj.(*velerov1.Restore), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var schedulesResource = schema.GroupVersionResource{Group: "velero.io", Version:
var schedulesKind = schema.GroupVersionKind{Group: "velero.io", Version: "v1", Kind: "Schedule"}
// Get takes name of the schedule, and returns the corresponding schedule object, and an error if there is any.
func (c *FakeSchedules) Get(name string, options v1.GetOptions) (result *velero_v1.Schedule, err error) {
func (c *FakeSchedules) Get(name string, options v1.GetOptions) (result *velerov1.Schedule, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(schedulesResource, c.ns, name), &velero_v1.Schedule{})
Invokes(testing.NewGetAction(schedulesResource, c.ns, name), &velerov1.Schedule{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.Schedule), err
return obj.(*velerov1.Schedule), err
}
// List takes label and field selectors, and returns the list of Schedules that match those selectors.
func (c *FakeSchedules) List(opts v1.ListOptions) (result *velero_v1.ScheduleList, err error) {
func (c *FakeSchedules) List(opts v1.ListOptions) (result *velerov1.ScheduleList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(schedulesResource, schedulesKind, c.ns, opts), &velero_v1.ScheduleList{})
Invokes(testing.NewListAction(schedulesResource, schedulesKind, c.ns, opts), &velerov1.ScheduleList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeSchedules) List(opts v1.ListOptions) (result *velero_v1.ScheduleLis
if label == nil {
label = labels.Everything()
}
list := &velero_v1.ScheduleList{ListMeta: obj.(*velero_v1.ScheduleList).ListMeta}
for _, item := range obj.(*velero_v1.ScheduleList).Items {
list := &velerov1.ScheduleList{ListMeta: obj.(*velerov1.ScheduleList).ListMeta}
for _, item := range obj.(*velerov1.ScheduleList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeSchedules) Watch(opts v1.ListOptions) (watch.Interface, error) {
}
// Create takes the representation of a schedule and creates it. Returns the server's representation of the schedule, and an error, if there is any.
func (c *FakeSchedules) Create(schedule *velero_v1.Schedule) (result *velero_v1.Schedule, err error) {
func (c *FakeSchedules) Create(schedule *velerov1.Schedule) (result *velerov1.Schedule, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(schedulesResource, c.ns, schedule), &velero_v1.Schedule{})
Invokes(testing.NewCreateAction(schedulesResource, c.ns, schedule), &velerov1.Schedule{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.Schedule), err
return obj.(*velerov1.Schedule), err
}
// Update takes the representation of a schedule and updates it. Returns the server's representation of the schedule, and an error, if there is any.
func (c *FakeSchedules) Update(schedule *velero_v1.Schedule) (result *velero_v1.Schedule, err error) {
func (c *FakeSchedules) Update(schedule *velerov1.Schedule) (result *velerov1.Schedule, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(schedulesResource, c.ns, schedule), &velero_v1.Schedule{})
Invokes(testing.NewUpdateAction(schedulesResource, c.ns, schedule), &velerov1.Schedule{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.Schedule), err
return obj.(*velerov1.Schedule), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeSchedules) UpdateStatus(schedule *velero_v1.Schedule) (*velero_v1.Schedule, error) {
func (c *FakeSchedules) UpdateStatus(schedule *velerov1.Schedule) (*velerov1.Schedule, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(schedulesResource, "status", c.ns, schedule), &velero_v1.Schedule{})
Invokes(testing.NewUpdateSubresourceAction(schedulesResource, "status", c.ns, schedule), &velerov1.Schedule{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.Schedule), err
return obj.(*velerov1.Schedule), err
}
// Delete takes name of the schedule and deletes it. Returns an error if one occurs.
func (c *FakeSchedules) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(schedulesResource, c.ns, name), &velero_v1.Schedule{})
Invokes(testing.NewDeleteAction(schedulesResource, c.ns, name), &velerov1.Schedule{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeSchedules) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeSchedules) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(schedulesResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &velero_v1.ScheduleList{})
_, err := c.Fake.Invokes(action, &velerov1.ScheduleList{})
return err
}
// Patch applies the patch and returns the patched schedule.
func (c *FakeSchedules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velero_v1.Schedule, err error) {
func (c *FakeSchedules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.Schedule, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(schedulesResource, c.ns, name, data, subresources...), &velero_v1.Schedule{})
Invokes(testing.NewPatchSubresourceAction(schedulesResource, c.ns, name, data, subresources...), &velerov1.Schedule{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.Schedule), err
return obj.(*velerov1.Schedule), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var serverstatusrequestsResource = schema.GroupVersionResource{Group: "velero.io
var serverstatusrequestsKind = schema.GroupVersionKind{Group: "velero.io", Version: "v1", Kind: "ServerStatusRequest"}
// Get takes name of the serverStatusRequest, and returns the corresponding serverStatusRequest object, and an error if there is any.
func (c *FakeServerStatusRequests) Get(name string, options v1.GetOptions) (result *velero_v1.ServerStatusRequest, err error) {
func (c *FakeServerStatusRequests) Get(name string, options v1.GetOptions) (result *velerov1.ServerStatusRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(serverstatusrequestsResource, c.ns, name), &velero_v1.ServerStatusRequest{})
Invokes(testing.NewGetAction(serverstatusrequestsResource, c.ns, name), &velerov1.ServerStatusRequest{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.ServerStatusRequest), err
return obj.(*velerov1.ServerStatusRequest), err
}
// List takes label and field selectors, and returns the list of ServerStatusRequests that match those selectors.
func (c *FakeServerStatusRequests) List(opts v1.ListOptions) (result *velero_v1.ServerStatusRequestList, err error) {
func (c *FakeServerStatusRequests) List(opts v1.ListOptions) (result *velerov1.ServerStatusRequestList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(serverstatusrequestsResource, serverstatusrequestsKind, c.ns, opts), &velero_v1.ServerStatusRequestList{})
Invokes(testing.NewListAction(serverstatusrequestsResource, serverstatusrequestsKind, c.ns, opts), &velerov1.ServerStatusRequestList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeServerStatusRequests) List(opts v1.ListOptions) (result *velero_v1.
if label == nil {
label = labels.Everything()
}
list := &velero_v1.ServerStatusRequestList{ListMeta: obj.(*velero_v1.ServerStatusRequestList).ListMeta}
for _, item := range obj.(*velero_v1.ServerStatusRequestList).Items {
list := &velerov1.ServerStatusRequestList{ListMeta: obj.(*velerov1.ServerStatusRequestList).ListMeta}
for _, item := range obj.(*velerov1.ServerStatusRequestList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeServerStatusRequests) Watch(opts v1.ListOptions) (watch.Interface,
}
// Create takes the representation of a serverStatusRequest and creates it. Returns the server's representation of the serverStatusRequest, and an error, if there is any.
func (c *FakeServerStatusRequests) Create(serverStatusRequest *velero_v1.ServerStatusRequest) (result *velero_v1.ServerStatusRequest, err error) {
func (c *FakeServerStatusRequests) Create(serverStatusRequest *velerov1.ServerStatusRequest) (result *velerov1.ServerStatusRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(serverstatusrequestsResource, c.ns, serverStatusRequest), &velero_v1.ServerStatusRequest{})
Invokes(testing.NewCreateAction(serverstatusrequestsResource, c.ns, serverStatusRequest), &velerov1.ServerStatusRequest{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.ServerStatusRequest), err
return obj.(*velerov1.ServerStatusRequest), err
}
// Update takes the representation of a serverStatusRequest and updates it. Returns the server's representation of the serverStatusRequest, and an error, if there is any.
func (c *FakeServerStatusRequests) Update(serverStatusRequest *velero_v1.ServerStatusRequest) (result *velero_v1.ServerStatusRequest, err error) {
func (c *FakeServerStatusRequests) Update(serverStatusRequest *velerov1.ServerStatusRequest) (result *velerov1.ServerStatusRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(serverstatusrequestsResource, c.ns, serverStatusRequest), &velero_v1.ServerStatusRequest{})
Invokes(testing.NewUpdateAction(serverstatusrequestsResource, c.ns, serverStatusRequest), &velerov1.ServerStatusRequest{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.ServerStatusRequest), err
return obj.(*velerov1.ServerStatusRequest), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeServerStatusRequests) UpdateStatus(serverStatusRequest *velero_v1.ServerStatusRequest) (*velero_v1.ServerStatusRequest, error) {
func (c *FakeServerStatusRequests) UpdateStatus(serverStatusRequest *velerov1.ServerStatusRequest) (*velerov1.ServerStatusRequest, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(serverstatusrequestsResource, "status", c.ns, serverStatusRequest), &velero_v1.ServerStatusRequest{})
Invokes(testing.NewUpdateSubresourceAction(serverstatusrequestsResource, "status", c.ns, serverStatusRequest), &velerov1.ServerStatusRequest{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.ServerStatusRequest), err
return obj.(*velerov1.ServerStatusRequest), err
}
// Delete takes name of the serverStatusRequest and deletes it. Returns an error if one occurs.
func (c *FakeServerStatusRequests) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(serverstatusrequestsResource, c.ns, name), &velero_v1.ServerStatusRequest{})
Invokes(testing.NewDeleteAction(serverstatusrequestsResource, c.ns, name), &velerov1.ServerStatusRequest{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeServerStatusRequests) Delete(name string, options *v1.DeleteOptions
func (c *FakeServerStatusRequests) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(serverstatusrequestsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &velero_v1.ServerStatusRequestList{})
_, err := c.Fake.Invokes(action, &velerov1.ServerStatusRequestList{})
return err
}
// Patch applies the patch and returns the patched serverStatusRequest.
func (c *FakeServerStatusRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velero_v1.ServerStatusRequest, err error) {
func (c *FakeServerStatusRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.ServerStatusRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(serverstatusrequestsResource, c.ns, name, data, subresources...), &velero_v1.ServerStatusRequest{})
Invokes(testing.NewPatchSubresourceAction(serverstatusrequestsResource, c.ns, name, data, subresources...), &velerov1.ServerStatusRequest{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.ServerStatusRequest), err
return obj.(*velerov1.ServerStatusRequest), err
}

View File

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -39,20 +39,20 @@ var volumesnapshotlocationsResource = schema.GroupVersionResource{Group: "velero
var volumesnapshotlocationsKind = schema.GroupVersionKind{Group: "velero.io", Version: "v1", Kind: "VolumeSnapshotLocation"}
// Get takes name of the volumeSnapshotLocation, and returns the corresponding volumeSnapshotLocation object, and an error if there is any.
func (c *FakeVolumeSnapshotLocations) Get(name string, options v1.GetOptions) (result *velero_v1.VolumeSnapshotLocation, err error) {
func (c *FakeVolumeSnapshotLocations) Get(name string, options v1.GetOptions) (result *velerov1.VolumeSnapshotLocation, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(volumesnapshotlocationsResource, c.ns, name), &velero_v1.VolumeSnapshotLocation{})
Invokes(testing.NewGetAction(volumesnapshotlocationsResource, c.ns, name), &velerov1.VolumeSnapshotLocation{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.VolumeSnapshotLocation), err
return obj.(*velerov1.VolumeSnapshotLocation), err
}
// List takes label and field selectors, and returns the list of VolumeSnapshotLocations that match those selectors.
func (c *FakeVolumeSnapshotLocations) List(opts v1.ListOptions) (result *velero_v1.VolumeSnapshotLocationList, err error) {
func (c *FakeVolumeSnapshotLocations) List(opts v1.ListOptions) (result *velerov1.VolumeSnapshotLocationList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(volumesnapshotlocationsResource, volumesnapshotlocationsKind, c.ns, opts), &velero_v1.VolumeSnapshotLocationList{})
Invokes(testing.NewListAction(volumesnapshotlocationsResource, volumesnapshotlocationsKind, c.ns, opts), &velerov1.VolumeSnapshotLocationList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeVolumeSnapshotLocations) List(opts v1.ListOptions) (result *velero_
if label == nil {
label = labels.Everything()
}
list := &velero_v1.VolumeSnapshotLocationList{ListMeta: obj.(*velero_v1.VolumeSnapshotLocationList).ListMeta}
for _, item := range obj.(*velero_v1.VolumeSnapshotLocationList).Items {
list := &velerov1.VolumeSnapshotLocationList{ListMeta: obj.(*velerov1.VolumeSnapshotLocationList).ListMeta}
for _, item := range obj.(*velerov1.VolumeSnapshotLocationList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeVolumeSnapshotLocations) Watch(opts v1.ListOptions) (watch.Interfac
}
// Create takes the representation of a volumeSnapshotLocation and creates it. Returns the server's representation of the volumeSnapshotLocation, and an error, if there is any.
func (c *FakeVolumeSnapshotLocations) Create(volumeSnapshotLocation *velero_v1.VolumeSnapshotLocation) (result *velero_v1.VolumeSnapshotLocation, err error) {
func (c *FakeVolumeSnapshotLocations) Create(volumeSnapshotLocation *velerov1.VolumeSnapshotLocation) (result *velerov1.VolumeSnapshotLocation, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(volumesnapshotlocationsResource, c.ns, volumeSnapshotLocation), &velero_v1.VolumeSnapshotLocation{})
Invokes(testing.NewCreateAction(volumesnapshotlocationsResource, c.ns, volumeSnapshotLocation), &velerov1.VolumeSnapshotLocation{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.VolumeSnapshotLocation), err
return obj.(*velerov1.VolumeSnapshotLocation), err
}
// Update takes the representation of a volumeSnapshotLocation and updates it. Returns the server's representation of the volumeSnapshotLocation, and an error, if there is any.
func (c *FakeVolumeSnapshotLocations) Update(volumeSnapshotLocation *velero_v1.VolumeSnapshotLocation) (result *velero_v1.VolumeSnapshotLocation, err error) {
func (c *FakeVolumeSnapshotLocations) Update(volumeSnapshotLocation *velerov1.VolumeSnapshotLocation) (result *velerov1.VolumeSnapshotLocation, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(volumesnapshotlocationsResource, c.ns, volumeSnapshotLocation), &velero_v1.VolumeSnapshotLocation{})
Invokes(testing.NewUpdateAction(volumesnapshotlocationsResource, c.ns, volumeSnapshotLocation), &velerov1.VolumeSnapshotLocation{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.VolumeSnapshotLocation), err
return obj.(*velerov1.VolumeSnapshotLocation), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeVolumeSnapshotLocations) UpdateStatus(volumeSnapshotLocation *velero_v1.VolumeSnapshotLocation) (*velero_v1.VolumeSnapshotLocation, error) {
func (c *FakeVolumeSnapshotLocations) UpdateStatus(volumeSnapshotLocation *velerov1.VolumeSnapshotLocation) (*velerov1.VolumeSnapshotLocation, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(volumesnapshotlocationsResource, "status", c.ns, volumeSnapshotLocation), &velero_v1.VolumeSnapshotLocation{})
Invokes(testing.NewUpdateSubresourceAction(volumesnapshotlocationsResource, "status", c.ns, volumeSnapshotLocation), &velerov1.VolumeSnapshotLocation{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.VolumeSnapshotLocation), err
return obj.(*velerov1.VolumeSnapshotLocation), err
}
// Delete takes name of the volumeSnapshotLocation and deletes it. Returns an error if one occurs.
func (c *FakeVolumeSnapshotLocations) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(volumesnapshotlocationsResource, c.ns, name), &velero_v1.VolumeSnapshotLocation{})
Invokes(testing.NewDeleteAction(volumesnapshotlocationsResource, c.ns, name), &velerov1.VolumeSnapshotLocation{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeVolumeSnapshotLocations) Delete(name string, options *v1.DeleteOpti
func (c *FakeVolumeSnapshotLocations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(volumesnapshotlocationsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &velero_v1.VolumeSnapshotLocationList{})
_, err := c.Fake.Invokes(action, &velerov1.VolumeSnapshotLocationList{})
return err
}
// Patch applies the patch and returns the patched volumeSnapshotLocation.
func (c *FakeVolumeSnapshotLocations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velero_v1.VolumeSnapshotLocation, err error) {
func (c *FakeVolumeSnapshotLocations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.VolumeSnapshotLocation, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(volumesnapshotlocationsResource, c.ns, name, data, subresources...), &velero_v1.VolumeSnapshotLocation{})
Invokes(testing.NewPatchSubresourceAction(volumesnapshotlocationsResource, c.ns, name, data, subresources...), &velerov1.VolumeSnapshotLocation{})
if obj == nil {
return nil, err
}
return obj.(*velero_v1.VolumeSnapshotLocation), err
return obj.(*velerov1.VolumeSnapshotLocation), err
}

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type PodVolumeBackupInterface interface {
Create(*v1.PodVolumeBackup) (*v1.PodVolumeBackup, error)
Update(*v1.PodVolumeBackup) (*v1.PodVolumeBackup, error)
UpdateStatus(*v1.PodVolumeBackup) (*v1.PodVolumeBackup, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.PodVolumeBackup, error)
List(opts meta_v1.ListOptions) (*v1.PodVolumeBackupList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.PodVolumeBackup, error)
List(opts metav1.ListOptions) (*v1.PodVolumeBackupList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodVolumeBackup, err error)
PodVolumeBackupExpansion
}
@ -62,7 +62,7 @@ func newPodVolumeBackups(c *VeleroV1Client, namespace string) *podVolumeBackups
}
// Get takes name of the podVolumeBackup, and returns the corresponding podVolumeBackup object, and an error if there is any.
func (c *podVolumeBackups) Get(name string, options meta_v1.GetOptions) (result *v1.PodVolumeBackup, err error) {
func (c *podVolumeBackups) Get(name string, options metav1.GetOptions) (result *v1.PodVolumeBackup, err error) {
result = &v1.PodVolumeBackup{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *podVolumeBackups) Get(name string, options meta_v1.GetOptions) (result
}
// List takes label and field selectors, and returns the list of PodVolumeBackups that match those selectors.
func (c *podVolumeBackups) List(opts meta_v1.ListOptions) (result *v1.PodVolumeBackupList, err error) {
func (c *podVolumeBackups) List(opts metav1.ListOptions) (result *v1.PodVolumeBackupList, err error) {
result = &v1.PodVolumeBackupList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *podVolumeBackups) List(opts meta_v1.ListOptions) (result *v1.PodVolumeB
}
// Watch returns a watch.Interface that watches the requested podVolumeBackups.
func (c *podVolumeBackups) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *podVolumeBackups) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *podVolumeBackups) UpdateStatus(podVolumeBackup *v1.PodVolumeBackup) (re
}
// Delete takes name of the podVolumeBackup and deletes it. Returns an error if one occurs.
func (c *podVolumeBackups) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *podVolumeBackups) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("podvolumebackups").
@ -149,7 +149,7 @@ func (c *podVolumeBackups) Delete(name string, options *meta_v1.DeleteOptions) e
}
// DeleteCollection deletes a collection of objects.
func (c *podVolumeBackups) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *podVolumeBackups) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("podvolumebackups").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type PodVolumeRestoreInterface interface {
Create(*v1.PodVolumeRestore) (*v1.PodVolumeRestore, error)
Update(*v1.PodVolumeRestore) (*v1.PodVolumeRestore, error)
UpdateStatus(*v1.PodVolumeRestore) (*v1.PodVolumeRestore, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.PodVolumeRestore, error)
List(opts meta_v1.ListOptions) (*v1.PodVolumeRestoreList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.PodVolumeRestore, error)
List(opts metav1.ListOptions) (*v1.PodVolumeRestoreList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodVolumeRestore, err error)
PodVolumeRestoreExpansion
}
@ -62,7 +62,7 @@ func newPodVolumeRestores(c *VeleroV1Client, namespace string) *podVolumeRestore
}
// Get takes name of the podVolumeRestore, and returns the corresponding podVolumeRestore object, and an error if there is any.
func (c *podVolumeRestores) Get(name string, options meta_v1.GetOptions) (result *v1.PodVolumeRestore, err error) {
func (c *podVolumeRestores) Get(name string, options metav1.GetOptions) (result *v1.PodVolumeRestore, err error) {
result = &v1.PodVolumeRestore{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *podVolumeRestores) Get(name string, options meta_v1.GetOptions) (result
}
// List takes label and field selectors, and returns the list of PodVolumeRestores that match those selectors.
func (c *podVolumeRestores) List(opts meta_v1.ListOptions) (result *v1.PodVolumeRestoreList, err error) {
func (c *podVolumeRestores) List(opts metav1.ListOptions) (result *v1.PodVolumeRestoreList, err error) {
result = &v1.PodVolumeRestoreList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *podVolumeRestores) List(opts meta_v1.ListOptions) (result *v1.PodVolume
}
// Watch returns a watch.Interface that watches the requested podVolumeRestores.
func (c *podVolumeRestores) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *podVolumeRestores) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *podVolumeRestores) UpdateStatus(podVolumeRestore *v1.PodVolumeRestore)
}
// Delete takes name of the podVolumeRestore and deletes it. Returns an error if one occurs.
func (c *podVolumeRestores) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *podVolumeRestores) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("podvolumerestores").
@ -149,7 +149,7 @@ func (c *podVolumeRestores) Delete(name string, options *meta_v1.DeleteOptions)
}
// DeleteCollection deletes a collection of objects.
func (c *podVolumeRestores) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *podVolumeRestores) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("podvolumerestores").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type ResticRepositoryInterface interface {
Create(*v1.ResticRepository) (*v1.ResticRepository, error)
Update(*v1.ResticRepository) (*v1.ResticRepository, error)
UpdateStatus(*v1.ResticRepository) (*v1.ResticRepository, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.ResticRepository, error)
List(opts meta_v1.ListOptions) (*v1.ResticRepositoryList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.ResticRepository, error)
List(opts metav1.ListOptions) (*v1.ResticRepositoryList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ResticRepository, err error)
ResticRepositoryExpansion
}
@ -62,7 +62,7 @@ func newResticRepositories(c *VeleroV1Client, namespace string) *resticRepositor
}
// Get takes name of the resticRepository, and returns the corresponding resticRepository object, and an error if there is any.
func (c *resticRepositories) Get(name string, options meta_v1.GetOptions) (result *v1.ResticRepository, err error) {
func (c *resticRepositories) Get(name string, options metav1.GetOptions) (result *v1.ResticRepository, err error) {
result = &v1.ResticRepository{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *resticRepositories) Get(name string, options meta_v1.GetOptions) (resul
}
// List takes label and field selectors, and returns the list of ResticRepositories that match those selectors.
func (c *resticRepositories) List(opts meta_v1.ListOptions) (result *v1.ResticRepositoryList, err error) {
func (c *resticRepositories) List(opts metav1.ListOptions) (result *v1.ResticRepositoryList, err error) {
result = &v1.ResticRepositoryList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *resticRepositories) List(opts meta_v1.ListOptions) (result *v1.ResticRe
}
// Watch returns a watch.Interface that watches the requested resticRepositories.
func (c *resticRepositories) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *resticRepositories) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *resticRepositories) UpdateStatus(resticRepository *v1.ResticRepository)
}
// Delete takes name of the resticRepository and deletes it. Returns an error if one occurs.
func (c *resticRepositories) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *resticRepositories) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("resticrepositories").
@ -149,7 +149,7 @@ func (c *resticRepositories) Delete(name string, options *meta_v1.DeleteOptions)
}
// DeleteCollection deletes a collection of objects.
func (c *resticRepositories) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *resticRepositories) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("resticrepositories").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type RestoreInterface interface {
Create(*v1.Restore) (*v1.Restore, error)
Update(*v1.Restore) (*v1.Restore, error)
UpdateStatus(*v1.Restore) (*v1.Restore, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.Restore, error)
List(opts meta_v1.ListOptions) (*v1.RestoreList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.Restore, error)
List(opts metav1.ListOptions) (*v1.RestoreList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Restore, err error)
RestoreExpansion
}
@ -62,7 +62,7 @@ func newRestores(c *VeleroV1Client, namespace string) *restores {
}
// Get takes name of the restore, and returns the corresponding restore object, and an error if there is any.
func (c *restores) Get(name string, options meta_v1.GetOptions) (result *v1.Restore, err error) {
func (c *restores) Get(name string, options metav1.GetOptions) (result *v1.Restore, err error) {
result = &v1.Restore{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *restores) Get(name string, options meta_v1.GetOptions) (result *v1.Rest
}
// List takes label and field selectors, and returns the list of Restores that match those selectors.
func (c *restores) List(opts meta_v1.ListOptions) (result *v1.RestoreList, err error) {
func (c *restores) List(opts metav1.ListOptions) (result *v1.RestoreList, err error) {
result = &v1.RestoreList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *restores) List(opts meta_v1.ListOptions) (result *v1.RestoreList, err e
}
// Watch returns a watch.Interface that watches the requested restores.
func (c *restores) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *restores) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *restores) UpdateStatus(restore *v1.Restore) (result *v1.Restore, err er
}
// Delete takes name of the restore and deletes it. Returns an error if one occurs.
func (c *restores) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *restores) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("restores").
@ -149,7 +149,7 @@ func (c *restores) Delete(name string, options *meta_v1.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *restores) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *restores) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("restores").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type ScheduleInterface interface {
Create(*v1.Schedule) (*v1.Schedule, error)
Update(*v1.Schedule) (*v1.Schedule, error)
UpdateStatus(*v1.Schedule) (*v1.Schedule, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.Schedule, error)
List(opts meta_v1.ListOptions) (*v1.ScheduleList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.Schedule, error)
List(opts metav1.ListOptions) (*v1.ScheduleList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Schedule, err error)
ScheduleExpansion
}
@ -62,7 +62,7 @@ func newSchedules(c *VeleroV1Client, namespace string) *schedules {
}
// Get takes name of the schedule, and returns the corresponding schedule object, and an error if there is any.
func (c *schedules) Get(name string, options meta_v1.GetOptions) (result *v1.Schedule, err error) {
func (c *schedules) Get(name string, options metav1.GetOptions) (result *v1.Schedule, err error) {
result = &v1.Schedule{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *schedules) Get(name string, options meta_v1.GetOptions) (result *v1.Sch
}
// List takes label and field selectors, and returns the list of Schedules that match those selectors.
func (c *schedules) List(opts meta_v1.ListOptions) (result *v1.ScheduleList, err error) {
func (c *schedules) List(opts metav1.ListOptions) (result *v1.ScheduleList, err error) {
result = &v1.ScheduleList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *schedules) List(opts meta_v1.ListOptions) (result *v1.ScheduleList, err
}
// Watch returns a watch.Interface that watches the requested schedules.
func (c *schedules) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *schedules) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *schedules) UpdateStatus(schedule *v1.Schedule) (result *v1.Schedule, er
}
// Delete takes name of the schedule and deletes it. Returns an error if one occurs.
func (c *schedules) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *schedules) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("schedules").
@ -149,7 +149,7 @@ func (c *schedules) Delete(name string, options *meta_v1.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *schedules) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *schedules) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("schedules").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type ServerStatusRequestInterface interface {
Create(*v1.ServerStatusRequest) (*v1.ServerStatusRequest, error)
Update(*v1.ServerStatusRequest) (*v1.ServerStatusRequest, error)
UpdateStatus(*v1.ServerStatusRequest) (*v1.ServerStatusRequest, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.ServerStatusRequest, error)
List(opts meta_v1.ListOptions) (*v1.ServerStatusRequestList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.ServerStatusRequest, error)
List(opts metav1.ListOptions) (*v1.ServerStatusRequestList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServerStatusRequest, err error)
ServerStatusRequestExpansion
}
@ -62,7 +62,7 @@ func newServerStatusRequests(c *VeleroV1Client, namespace string) *serverStatusR
}
// Get takes name of the serverStatusRequest, and returns the corresponding serverStatusRequest object, and an error if there is any.
func (c *serverStatusRequests) Get(name string, options meta_v1.GetOptions) (result *v1.ServerStatusRequest, err error) {
func (c *serverStatusRequests) Get(name string, options metav1.GetOptions) (result *v1.ServerStatusRequest, err error) {
result = &v1.ServerStatusRequest{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *serverStatusRequests) Get(name string, options meta_v1.GetOptions) (res
}
// List takes label and field selectors, and returns the list of ServerStatusRequests that match those selectors.
func (c *serverStatusRequests) List(opts meta_v1.ListOptions) (result *v1.ServerStatusRequestList, err error) {
func (c *serverStatusRequests) List(opts metav1.ListOptions) (result *v1.ServerStatusRequestList, err error) {
result = &v1.ServerStatusRequestList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *serverStatusRequests) List(opts meta_v1.ListOptions) (result *v1.Server
}
// Watch returns a watch.Interface that watches the requested serverStatusRequests.
func (c *serverStatusRequests) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *serverStatusRequests) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *serverStatusRequests) UpdateStatus(serverStatusRequest *v1.ServerStatus
}
// Delete takes name of the serverStatusRequest and deletes it. Returns an error if one occurs.
func (c *serverStatusRequests) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *serverStatusRequests) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("serverstatusrequests").
@ -149,7 +149,7 @@ func (c *serverStatusRequests) Delete(name string, options *meta_v1.DeleteOption
}
// DeleteCollection deletes a collection of objects.
func (c *serverStatusRequests) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *serverStatusRequests) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("serverstatusrequests").

View File

@ -21,7 +21,7 @@ package v1
import (
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
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"
@ -38,11 +38,11 @@ type VolumeSnapshotLocationInterface interface {
Create(*v1.VolumeSnapshotLocation) (*v1.VolumeSnapshotLocation, error)
Update(*v1.VolumeSnapshotLocation) (*v1.VolumeSnapshotLocation, error)
UpdateStatus(*v1.VolumeSnapshotLocation) (*v1.VolumeSnapshotLocation, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.VolumeSnapshotLocation, error)
List(opts meta_v1.ListOptions) (*v1.VolumeSnapshotLocationList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.VolumeSnapshotLocation, error)
List(opts metav1.ListOptions) (*v1.VolumeSnapshotLocationList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.VolumeSnapshotLocation, err error)
VolumeSnapshotLocationExpansion
}
@ -62,7 +62,7 @@ func newVolumeSnapshotLocations(c *VeleroV1Client, namespace string) *volumeSnap
}
// Get takes name of the volumeSnapshotLocation, and returns the corresponding volumeSnapshotLocation object, and an error if there is any.
func (c *volumeSnapshotLocations) Get(name string, options meta_v1.GetOptions) (result *v1.VolumeSnapshotLocation, err error) {
func (c *volumeSnapshotLocations) Get(name string, options metav1.GetOptions) (result *v1.VolumeSnapshotLocation, err error) {
result = &v1.VolumeSnapshotLocation{}
err = c.client.Get().
Namespace(c.ns).
@ -75,7 +75,7 @@ func (c *volumeSnapshotLocations) Get(name string, options meta_v1.GetOptions) (
}
// List takes label and field selectors, and returns the list of VolumeSnapshotLocations that match those selectors.
func (c *volumeSnapshotLocations) List(opts meta_v1.ListOptions) (result *v1.VolumeSnapshotLocationList, err error) {
func (c *volumeSnapshotLocations) List(opts metav1.ListOptions) (result *v1.VolumeSnapshotLocationList, err error) {
result = &v1.VolumeSnapshotLocationList{}
err = c.client.Get().
Namespace(c.ns).
@ -87,7 +87,7 @@ func (c *volumeSnapshotLocations) List(opts meta_v1.ListOptions) (result *v1.Vol
}
// Watch returns a watch.Interface that watches the requested volumeSnapshotLocations.
func (c *volumeSnapshotLocations) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
func (c *volumeSnapshotLocations) Watch(opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
@ -138,7 +138,7 @@ func (c *volumeSnapshotLocations) UpdateStatus(volumeSnapshotLocation *v1.Volume
}
// Delete takes name of the volumeSnapshotLocation and deletes it. Returns an error if one occurs.
func (c *volumeSnapshotLocations) Delete(name string, options *meta_v1.DeleteOptions) error {
func (c *volumeSnapshotLocations) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("volumesnapshotlocations").
@ -149,7 +149,7 @@ func (c *volumeSnapshotLocations) Delete(name string, options *meta_v1.DeleteOpt
}
// DeleteCollection deletes a collection of objects.
func (c *volumeSnapshotLocations) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
func (c *volumeSnapshotLocations) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("volumesnapshotlocations").

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewBackupInformer(client versioned.Interface, namespace string, resyncPerio
func NewFilteredBackupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().Backups(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().Backups(namespace).Watch(options)
},
},
&ark_v1.Backup{},
&arkv1.Backup{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *backupInformer) defaultInformer(client versioned.Interface, resyncPerio
}
func (f *backupInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&ark_v1.Backup{}, f.defaultInformer)
return f.factory.InformerFor(&arkv1.Backup{}, f.defaultInformer)
}
func (f *backupInformer) Lister() v1.BackupLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewBackupStorageLocationInformer(client versioned.Interface, namespace stri
func NewFilteredBackupStorageLocationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().BackupStorageLocations(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().BackupStorageLocations(namespace).Watch(options)
},
},
&ark_v1.BackupStorageLocation{},
&arkv1.BackupStorageLocation{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *backupStorageLocationInformer) defaultInformer(client versioned.Interfa
}
func (f *backupStorageLocationInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&ark_v1.BackupStorageLocation{}, f.defaultInformer)
return f.factory.InformerFor(&arkv1.BackupStorageLocation{}, f.defaultInformer)
}
func (f *backupStorageLocationInformer) Lister() v1.BackupStorageLocationLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewDeleteBackupRequestInformer(client versioned.Interface, namespace string
func NewFilteredDeleteBackupRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().DeleteBackupRequests(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().DeleteBackupRequests(namespace).Watch(options)
},
},
&ark_v1.DeleteBackupRequest{},
&arkv1.DeleteBackupRequest{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *deleteBackupRequestInformer) defaultInformer(client versioned.Interface
}
func (f *deleteBackupRequestInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&ark_v1.DeleteBackupRequest{}, f.defaultInformer)
return f.factory.InformerFor(&arkv1.DeleteBackupRequest{}, f.defaultInformer)
}
func (f *deleteBackupRequestInformer) Lister() v1.DeleteBackupRequestLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewDownloadRequestInformer(client versioned.Interface, namespace string, re
func NewFilteredDownloadRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().DownloadRequests(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().DownloadRequests(namespace).Watch(options)
},
},
&ark_v1.DownloadRequest{},
&arkv1.DownloadRequest{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *downloadRequestInformer) defaultInformer(client versioned.Interface, re
}
func (f *downloadRequestInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&ark_v1.DownloadRequest{}, f.defaultInformer)
return f.factory.InformerFor(&arkv1.DownloadRequest{}, f.defaultInformer)
}
func (f *downloadRequestInformer) Lister() v1.DownloadRequestLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewPodVolumeBackupInformer(client versioned.Interface, namespace string, re
func NewFilteredPodVolumeBackupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().PodVolumeBackups(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().PodVolumeBackups(namespace).Watch(options)
},
},
&ark_v1.PodVolumeBackup{},
&arkv1.PodVolumeBackup{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *podVolumeBackupInformer) defaultInformer(client versioned.Interface, re
}
func (f *podVolumeBackupInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&ark_v1.PodVolumeBackup{}, f.defaultInformer)
return f.factory.InformerFor(&arkv1.PodVolumeBackup{}, f.defaultInformer)
}
func (f *podVolumeBackupInformer) Lister() v1.PodVolumeBackupLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewPodVolumeRestoreInformer(client versioned.Interface, namespace string, r
func NewFilteredPodVolumeRestoreInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().PodVolumeRestores(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().PodVolumeRestores(namespace).Watch(options)
},
},
&ark_v1.PodVolumeRestore{},
&arkv1.PodVolumeRestore{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *podVolumeRestoreInformer) defaultInformer(client versioned.Interface, r
}
func (f *podVolumeRestoreInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&ark_v1.PodVolumeRestore{}, f.defaultInformer)
return f.factory.InformerFor(&arkv1.PodVolumeRestore{}, f.defaultInformer)
}
func (f *podVolumeRestoreInformer) Lister() v1.PodVolumeRestoreLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewResticRepositoryInformer(client versioned.Interface, namespace string, r
func NewFilteredResticRepositoryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().ResticRepositories(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().ResticRepositories(namespace).Watch(options)
},
},
&ark_v1.ResticRepository{},
&arkv1.ResticRepository{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *resticRepositoryInformer) defaultInformer(client versioned.Interface, r
}
func (f *resticRepositoryInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&ark_v1.ResticRepository{}, f.defaultInformer)
return f.factory.InformerFor(&arkv1.ResticRepository{}, f.defaultInformer)
}
func (f *resticRepositoryInformer) Lister() v1.ResticRepositoryLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewRestoreInformer(client versioned.Interface, namespace string, resyncPeri
func NewFilteredRestoreInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().Restores(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().Restores(namespace).Watch(options)
},
},
&ark_v1.Restore{},
&arkv1.Restore{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *restoreInformer) defaultInformer(client versioned.Interface, resyncPeri
}
func (f *restoreInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&ark_v1.Restore{}, f.defaultInformer)
return f.factory.InformerFor(&arkv1.Restore{}, f.defaultInformer)
}
func (f *restoreInformer) Lister() v1.RestoreLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewScheduleInformer(client versioned.Interface, namespace string, resyncPer
func NewFilteredScheduleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().Schedules(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().Schedules(namespace).Watch(options)
},
},
&ark_v1.Schedule{},
&arkv1.Schedule{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *scheduleInformer) defaultInformer(client versioned.Interface, resyncPer
}
func (f *scheduleInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&ark_v1.Schedule{}, f.defaultInformer)
return f.factory.InformerFor(&arkv1.Schedule{}, f.defaultInformer)
}
func (f *scheduleInformer) Lister() v1.ScheduleLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewServerStatusRequestInformer(client versioned.Interface, namespace string
func NewFilteredServerStatusRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().ServerStatusRequests(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().ServerStatusRequests(namespace).Watch(options)
},
},
&ark_v1.ServerStatusRequest{},
&arkv1.ServerStatusRequest{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *serverStatusRequestInformer) defaultInformer(client versioned.Interface
}
func (f *serverStatusRequestInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&ark_v1.ServerStatusRequest{}, f.defaultInformer)
return f.factory.InformerFor(&arkv1.ServerStatusRequest{}, f.defaultInformer)
}
func (f *serverStatusRequestInformer) Lister() v1.ServerStatusRequestLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
ark_v1 "github.com/heptio/velero/pkg/apis/ark/v1"
arkv1 "github.com/heptio/velero/pkg/apis/ark/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/ark/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewVolumeSnapshotLocationInformer(client versioned.Interface, namespace str
func NewFilteredVolumeSnapshotLocationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().VolumeSnapshotLocations(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().VolumeSnapshotLocations(namespace).Watch(options)
},
},
&ark_v1.VolumeSnapshotLocation{},
&arkv1.VolumeSnapshotLocation{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *volumeSnapshotLocationInformer) defaultInformer(client versioned.Interf
}
func (f *volumeSnapshotLocationInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&ark_v1.VolumeSnapshotLocation{}, f.defaultInformer)
return f.factory.InformerFor(&arkv1.VolumeSnapshotLocation{}, f.defaultInformer)
}
func (f *volumeSnapshotLocationInformer) Lister() v1.VolumeSnapshotLocationLister {

View File

@ -22,7 +22,7 @@ import (
"fmt"
v1 "github.com/heptio/velero/pkg/apis/ark/v1"
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"
)
@ -78,27 +78,27 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().VolumeSnapshotLocations().Informer()}, nil
// Group=velero.io, Version=v1
case velero_v1.SchemeGroupVersion.WithResource("backups"):
case velerov1.SchemeGroupVersion.WithResource("backups"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().Backups().Informer()}, nil
case velero_v1.SchemeGroupVersion.WithResource("backupstoragelocations"):
case velerov1.SchemeGroupVersion.WithResource("backupstoragelocations"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().BackupStorageLocations().Informer()}, nil
case velero_v1.SchemeGroupVersion.WithResource("deletebackuprequests"):
case velerov1.SchemeGroupVersion.WithResource("deletebackuprequests"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().DeleteBackupRequests().Informer()}, nil
case velero_v1.SchemeGroupVersion.WithResource("downloadrequests"):
case velerov1.SchemeGroupVersion.WithResource("downloadrequests"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().DownloadRequests().Informer()}, nil
case velero_v1.SchemeGroupVersion.WithResource("podvolumebackups"):
case velerov1.SchemeGroupVersion.WithResource("podvolumebackups"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().PodVolumeBackups().Informer()}, nil
case velero_v1.SchemeGroupVersion.WithResource("podvolumerestores"):
case velerov1.SchemeGroupVersion.WithResource("podvolumerestores"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().PodVolumeRestores().Informer()}, nil
case velero_v1.SchemeGroupVersion.WithResource("resticrepositories"):
case velerov1.SchemeGroupVersion.WithResource("resticrepositories"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().ResticRepositories().Informer()}, nil
case velero_v1.SchemeGroupVersion.WithResource("restores"):
case velerov1.SchemeGroupVersion.WithResource("restores"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().Restores().Informer()}, nil
case velero_v1.SchemeGroupVersion.WithResource("schedules"):
case velerov1.SchemeGroupVersion.WithResource("schedules"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().Schedules().Informer()}, nil
case velero_v1.SchemeGroupVersion.WithResource("serverstatusrequests"):
case velerov1.SchemeGroupVersion.WithResource("serverstatusrequests"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().ServerStatusRequests().Informer()}, nil
case velero_v1.SchemeGroupVersion.WithResource("volumesnapshotlocations"):
case velerov1.SchemeGroupVersion.WithResource("volumesnapshotlocations"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Velero().V1().VolumeSnapshotLocations().Informer()}, nil
}

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/velero/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewBackupInformer(client versioned.Interface, namespace string, resyncPerio
func NewFilteredBackupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().Backups(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().Backups(namespace).Watch(options)
},
},
&velero_v1.Backup{},
&velerov1.Backup{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *backupInformer) defaultInformer(client versioned.Interface, resyncPerio
}
func (f *backupInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&velero_v1.Backup{}, f.defaultInformer)
return f.factory.InformerFor(&velerov1.Backup{}, f.defaultInformer)
}
func (f *backupInformer) Lister() v1.BackupLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/velero/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewBackupStorageLocationInformer(client versioned.Interface, namespace stri
func NewFilteredBackupStorageLocationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().BackupStorageLocations(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().BackupStorageLocations(namespace).Watch(options)
},
},
&velero_v1.BackupStorageLocation{},
&velerov1.BackupStorageLocation{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *backupStorageLocationInformer) defaultInformer(client versioned.Interfa
}
func (f *backupStorageLocationInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&velero_v1.BackupStorageLocation{}, f.defaultInformer)
return f.factory.InformerFor(&velerov1.BackupStorageLocation{}, f.defaultInformer)
}
func (f *backupStorageLocationInformer) Lister() v1.BackupStorageLocationLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/velero/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewDeleteBackupRequestInformer(client versioned.Interface, namespace string
func NewFilteredDeleteBackupRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().DeleteBackupRequests(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().DeleteBackupRequests(namespace).Watch(options)
},
},
&velero_v1.DeleteBackupRequest{},
&velerov1.DeleteBackupRequest{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *deleteBackupRequestInformer) defaultInformer(client versioned.Interface
}
func (f *deleteBackupRequestInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&velero_v1.DeleteBackupRequest{}, f.defaultInformer)
return f.factory.InformerFor(&velerov1.DeleteBackupRequest{}, f.defaultInformer)
}
func (f *deleteBackupRequestInformer) Lister() v1.DeleteBackupRequestLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/velero/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewDownloadRequestInformer(client versioned.Interface, namespace string, re
func NewFilteredDownloadRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().DownloadRequests(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().DownloadRequests(namespace).Watch(options)
},
},
&velero_v1.DownloadRequest{},
&velerov1.DownloadRequest{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *downloadRequestInformer) defaultInformer(client versioned.Interface, re
}
func (f *downloadRequestInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&velero_v1.DownloadRequest{}, f.defaultInformer)
return f.factory.InformerFor(&velerov1.DownloadRequest{}, f.defaultInformer)
}
func (f *downloadRequestInformer) Lister() v1.DownloadRequestLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/velero/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewPodVolumeBackupInformer(client versioned.Interface, namespace string, re
func NewFilteredPodVolumeBackupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().PodVolumeBackups(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().PodVolumeBackups(namespace).Watch(options)
},
},
&velero_v1.PodVolumeBackup{},
&velerov1.PodVolumeBackup{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *podVolumeBackupInformer) defaultInformer(client versioned.Interface, re
}
func (f *podVolumeBackupInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&velero_v1.PodVolumeBackup{}, f.defaultInformer)
return f.factory.InformerFor(&velerov1.PodVolumeBackup{}, f.defaultInformer)
}
func (f *podVolumeBackupInformer) Lister() v1.PodVolumeBackupLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/velero/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewPodVolumeRestoreInformer(client versioned.Interface, namespace string, r
func NewFilteredPodVolumeRestoreInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().PodVolumeRestores(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().PodVolumeRestores(namespace).Watch(options)
},
},
&velero_v1.PodVolumeRestore{},
&velerov1.PodVolumeRestore{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *podVolumeRestoreInformer) defaultInformer(client versioned.Interface, r
}
func (f *podVolumeRestoreInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&velero_v1.PodVolumeRestore{}, f.defaultInformer)
return f.factory.InformerFor(&velerov1.PodVolumeRestore{}, f.defaultInformer)
}
func (f *podVolumeRestoreInformer) Lister() v1.PodVolumeRestoreLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/velero/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewResticRepositoryInformer(client versioned.Interface, namespace string, r
func NewFilteredResticRepositoryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().ResticRepositories(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().ResticRepositories(namespace).Watch(options)
},
},
&velero_v1.ResticRepository{},
&velerov1.ResticRepository{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *resticRepositoryInformer) defaultInformer(client versioned.Interface, r
}
func (f *resticRepositoryInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&velero_v1.ResticRepository{}, f.defaultInformer)
return f.factory.InformerFor(&velerov1.ResticRepository{}, f.defaultInformer)
}
func (f *resticRepositoryInformer) Lister() v1.ResticRepositoryLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/velero/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewRestoreInformer(client versioned.Interface, namespace string, resyncPeri
func NewFilteredRestoreInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().Restores(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().Restores(namespace).Watch(options)
},
},
&velero_v1.Restore{},
&velerov1.Restore{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *restoreInformer) defaultInformer(client versioned.Interface, resyncPeri
}
func (f *restoreInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&velero_v1.Restore{}, f.defaultInformer)
return f.factory.InformerFor(&velerov1.Restore{}, f.defaultInformer)
}
func (f *restoreInformer) Lister() v1.RestoreLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/velero/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewScheduleInformer(client versioned.Interface, namespace string, resyncPer
func NewFilteredScheduleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().Schedules(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().Schedules(namespace).Watch(options)
},
},
&velero_v1.Schedule{},
&velerov1.Schedule{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *scheduleInformer) defaultInformer(client versioned.Interface, resyncPer
}
func (f *scheduleInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&velero_v1.Schedule{}, f.defaultInformer)
return f.factory.InformerFor(&velerov1.Schedule{}, f.defaultInformer)
}
func (f *scheduleInformer) Lister() v1.ScheduleLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/velero/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewServerStatusRequestInformer(client versioned.Interface, namespace string
func NewFilteredServerStatusRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().ServerStatusRequests(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().ServerStatusRequests(namespace).Watch(options)
},
},
&velero_v1.ServerStatusRequest{},
&velerov1.ServerStatusRequest{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *serverStatusRequestInformer) defaultInformer(client versioned.Interface
}
func (f *serverStatusRequestInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&velero_v1.ServerStatusRequest{}, f.defaultInformer)
return f.factory.InformerFor(&velerov1.ServerStatusRequest{}, f.defaultInformer)
}
func (f *serverStatusRequestInformer) Lister() v1.ServerStatusRequestLister {

View File

@ -21,11 +21,11 @@ package v1
import (
time "time"
velero_v1 "github.com/heptio/velero/pkg/apis/velero/v1"
velerov1 "github.com/heptio/velero/pkg/apis/velero/v1"
versioned "github.com/heptio/velero/pkg/generated/clientset/versioned"
internalinterfaces "github.com/heptio/velero/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/velero/pkg/generated/listers/velero/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
@ -57,20 +57,20 @@ func NewVolumeSnapshotLocationInformer(client versioned.Interface, namespace str
func NewFilteredVolumeSnapshotLocationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().VolumeSnapshotLocations(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.VeleroV1().VolumeSnapshotLocations(namespace).Watch(options)
},
},
&velero_v1.VolumeSnapshotLocation{},
&velerov1.VolumeSnapshotLocation{},
resyncPeriod,
indexers,
)
@ -81,7 +81,7 @@ func (f *volumeSnapshotLocationInformer) defaultInformer(client versioned.Interf
}
func (f *volumeSnapshotLocationInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&velero_v1.VolumeSnapshotLocation{}, f.defaultInformer)
return f.factory.InformerFor(&velerov1.VolumeSnapshotLocation{}, f.defaultInformer)
}
func (f *volumeSnapshotLocationInformer) Lister() v1.VolumeSnapshotLocationLister {

View File

@ -25,7 +25,7 @@ import (
"time"
"github.com/pkg/errors"
"github.com/satori/uuid"
uuid "github.com/satori/go.uuid"
"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"

View File

@ -1,728 +0,0 @@
package disk
// 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 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
"net/http"
)
// DisksClient is the the Disk Resource Provider Client.
type DisksClient struct {
ManagementClient
}
// NewDisksClient creates an instance of the DisksClient client.
func NewDisksClient(subscriptionID string) DisksClient {
return NewDisksClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewDisksClientWithBaseURI creates an instance of the DisksClient client.
func NewDisksClientWithBaseURI(baseURI string, subscriptionID string) DisksClient {
return DisksClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate creates or updates a disk. This method may poll for
// completion. Polling can be canceled by passing the cancel channel argument.
// The channel will be used to cancel polling and any outstanding HTTP
// requests.
//
// resourceGroupName is the name of the resource group. diskName is the name of
// the disk within the given subscription and resource group. diskParameter is
// disk object supplied in the body of the Put disk operation.
func (client DisksClient) CreateOrUpdate(resourceGroupName string, diskName string, diskParameter Model, cancel <-chan struct{}) (<-chan Model, <-chan error) {
resultChan := make(chan Model, 1)
errChan := make(chan error, 1)
if err := validation.Validate([]validation.Validation{
{TargetValue: diskParameter,
Constraints: []validation.Constraint{{Target: "diskParameter.Properties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "diskParameter.Properties.CreationData", Name: validation.Null, Rule: true,
Chain: []validation.Constraint{{Target: "diskParameter.Properties.CreationData.ImageReference", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "diskParameter.Properties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}},
}},
{Target: "diskParameter.Properties.EncryptionSettings", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "diskParameter.Properties.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "diskParameter.Properties.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
{Target: "diskParameter.Properties.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil},
}},
{Target: "diskParameter.Properties.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "diskParameter.Properties.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
{Target: "diskParameter.Properties.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil},
}},
}},
}}}}}); err != nil {
errChan <- validation.NewErrorWithValidationError(err, "disk.DisksClient", "CreateOrUpdate")
close(errChan)
close(resultChan)
return resultChan, errChan
}
go func() {
var err error
var result Model
defer func() {
resultChan <- result
errChan <- err
close(resultChan)
close(errChan)
}()
req, err := client.CreateOrUpdatePreparer(resourceGroupName, diskName, diskParameter, cancel)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.DisksClient", "CreateOrUpdate", nil, "Failure preparing request")
return
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "disk.DisksClient", "CreateOrUpdate", resp, "Failure sending request")
return
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.DisksClient", "CreateOrUpdate", resp, "Failure responding to request")
}
}()
return resultChan, errChan
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client DisksClient) CreateOrUpdatePreparer(resourceGroupName string, diskName string, diskParameter Model, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"diskName": autorest.Encode("path", diskName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-04-30-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters),
autorest.WithJSON(diskParameter),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client DisksClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client DisksClient) CreateOrUpdateResponder(resp *http.Response) (result Model, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Delete deletes a disk. This method may poll for completion. Polling can be
// canceled by passing the cancel channel argument. The channel will be used to
// cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. diskName is the name of
// the disk within the given subscription and resource group.
func (client DisksClient) Delete(resourceGroupName string, diskName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) {
resultChan := make(chan OperationStatusResponse, 1)
errChan := make(chan error, 1)
go func() {
var err error
var result OperationStatusResponse
defer func() {
resultChan <- result
errChan <- err
close(resultChan)
close(errChan)
}()
req, err := client.DeletePreparer(resourceGroupName, diskName, cancel)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.DisksClient", "Delete", nil, "Failure preparing request")
return
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "disk.DisksClient", "Delete", resp, "Failure sending request")
return
}
result, err = client.DeleteResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.DisksClient", "Delete", resp, "Failure responding to request")
}
}()
return resultChan, errChan
}
// DeletePreparer prepares the Delete request.
func (client DisksClient) DeletePreparer(resourceGroupName string, diskName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"diskName": autorest.Encode("path", diskName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-04-30-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client DisksClient) DeleteSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client DisksClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Get gets information about a disk.
//
// resourceGroupName is the name of the resource group. diskName is the name of
// the disk within the given subscription and resource group.
func (client DisksClient) Get(resourceGroupName string, diskName string) (result Model, err error) {
req, err := client.GetPreparer(resourceGroupName, diskName)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.DisksClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "disk.DisksClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.DisksClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client DisksClient) GetPreparer(resourceGroupName string, diskName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"diskName": autorest.Encode("path", diskName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-04-30-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client DisksClient) GetSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client DisksClient) GetResponder(resp *http.Response) (result Model, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GrantAccess grants access to a disk. This method may poll for completion.
// Polling can be canceled by passing the cancel channel argument. The channel
// will be used to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. diskName is the name of
// the disk within the given subscription and resource group. grantAccessData
// is access data object supplied in the body of the get disk access operation.
func (client DisksClient) GrantAccess(resourceGroupName string, diskName string, grantAccessData GrantAccessData, cancel <-chan struct{}) (<-chan AccessURI, <-chan error) {
resultChan := make(chan AccessURI, 1)
errChan := make(chan error, 1)
if err := validation.Validate([]validation.Validation{
{TargetValue: grantAccessData,
Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
errChan <- validation.NewErrorWithValidationError(err, "disk.DisksClient", "GrantAccess")
close(errChan)
close(resultChan)
return resultChan, errChan
}
go func() {
var err error
var result AccessURI
defer func() {
resultChan <- result
errChan <- err
close(resultChan)
close(errChan)
}()
req, err := client.GrantAccessPreparer(resourceGroupName, diskName, grantAccessData, cancel)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.DisksClient", "GrantAccess", nil, "Failure preparing request")
return
}
resp, err := client.GrantAccessSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "disk.DisksClient", "GrantAccess", resp, "Failure sending request")
return
}
result, err = client.GrantAccessResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.DisksClient", "GrantAccess", resp, "Failure responding to request")
}
}()
return resultChan, errChan
}
// GrantAccessPreparer prepares the GrantAccess request.
func (client DisksClient) GrantAccessPreparer(resourceGroupName string, diskName string, grantAccessData GrantAccessData, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"diskName": autorest.Encode("path", diskName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-04-30-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess", pathParameters),
autorest.WithJSON(grantAccessData),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// GrantAccessSender sends the GrantAccess request. The method will close the
// http.Response Body if it receives an error.
func (client DisksClient) GrantAccessSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// GrantAccessResponder handles the response to the GrantAccess request. The method always
// closes the http.Response Body.
func (client DisksClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// List lists all the disks under a subscription.
func (client DisksClient) List() (result ListType, err error) {
req, err := client.ListPreparer()
if err != nil {
err = autorest.NewErrorWithError(err, "disk.DisksClient", "List", nil, "Failure preparing request")
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "disk.DisksClient", "List", resp, "Failure sending request")
return
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.DisksClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client DisksClient) ListPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-04-30-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client DisksClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client DisksClient) ListResponder(resp *http.Response) (result ListType, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListNextResults retrieves the next set of results, if any.
func (client DisksClient) ListNextResults(lastResults ListType) (result ListType, err error) {
req, err := lastResults.ListTypePreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "disk.DisksClient", "List", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "disk.DisksClient", "List", resp, "Failure sending next results request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.DisksClient", "List", resp, "Failure responding to next results request")
}
return
}
// ListByResourceGroup lists all the disks under a resource group.
//
// resourceGroupName is the name of the resource group.
func (client DisksClient) ListByResourceGroup(resourceGroupName string) (result ListType, err error) {
req, err := client.ListByResourceGroupPreparer(resourceGroupName)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.DisksClient", "ListByResourceGroup", nil, "Failure preparing request")
return
}
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "disk.DisksClient", "ListByResourceGroup", resp, "Failure sending request")
return
}
result, err = client.ListByResourceGroupResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.DisksClient", "ListByResourceGroup", resp, "Failure responding to request")
}
return
}
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
func (client DisksClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-04-30-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
// http.Response Body if it receives an error.
func (client DisksClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
// closes the http.Response Body.
func (client DisksClient) ListByResourceGroupResponder(resp *http.Response) (result ListType, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListByResourceGroupNextResults retrieves the next set of results, if any.
func (client DisksClient) ListByResourceGroupNextResults(lastResults ListType) (result ListType, err error) {
req, err := lastResults.ListTypePreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "disk.DisksClient", "ListByResourceGroup", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "disk.DisksClient", "ListByResourceGroup", resp, "Failure sending next results request")
}
result, err = client.ListByResourceGroupResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.DisksClient", "ListByResourceGroup", resp, "Failure responding to next results request")
}
return
}
// RevokeAccess revokes access to a disk. This method may poll for completion.
// Polling can be canceled by passing the cancel channel argument. The channel
// will be used to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. diskName is the name of
// the disk within the given subscription and resource group.
func (client DisksClient) RevokeAccess(resourceGroupName string, diskName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) {
resultChan := make(chan OperationStatusResponse, 1)
errChan := make(chan error, 1)
go func() {
var err error
var result OperationStatusResponse
defer func() {
resultChan <- result
errChan <- err
close(resultChan)
close(errChan)
}()
req, err := client.RevokeAccessPreparer(resourceGroupName, diskName, cancel)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.DisksClient", "RevokeAccess", nil, "Failure preparing request")
return
}
resp, err := client.RevokeAccessSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "disk.DisksClient", "RevokeAccess", resp, "Failure sending request")
return
}
result, err = client.RevokeAccessResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.DisksClient", "RevokeAccess", resp, "Failure responding to request")
}
}()
return resultChan, errChan
}
// RevokeAccessPreparer prepares the RevokeAccess request.
func (client DisksClient) RevokeAccessPreparer(resourceGroupName string, diskName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"diskName": autorest.Encode("path", diskName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-04-30-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// RevokeAccessSender sends the RevokeAccess request. The method will close the
// http.Response Body if it receives an error.
func (client DisksClient) RevokeAccessSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// RevokeAccessResponder handles the response to the RevokeAccess request. The method always
// closes the http.Response Body.
func (client DisksClient) RevokeAccessResponder(resp *http.Response) (result OperationStatusResponse, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Update updates (patches) a disk. This method may poll for completion.
// Polling can be canceled by passing the cancel channel argument. The channel
// will be used to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. diskName is the name of
// the disk within the given subscription and resource group. diskParameter is
// disk object supplied in the body of the Patch disk operation.
func (client DisksClient) Update(resourceGroupName string, diskName string, diskParameter UpdateType, cancel <-chan struct{}) (<-chan Model, <-chan error) {
resultChan := make(chan Model, 1)
errChan := make(chan error, 1)
go func() {
var err error
var result Model
defer func() {
resultChan <- result
errChan <- err
close(resultChan)
close(errChan)
}()
req, err := client.UpdatePreparer(resourceGroupName, diskName, diskParameter, cancel)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.DisksClient", "Update", nil, "Failure preparing request")
return
}
resp, err := client.UpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "disk.DisksClient", "Update", resp, "Failure sending request")
return
}
result, err = client.UpdateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.DisksClient", "Update", resp, "Failure responding to request")
}
}()
return resultChan, errChan
}
// UpdatePreparer prepares the Update request.
func (client DisksClient) UpdatePreparer(resourceGroupName string, diskName string, diskParameter UpdateType, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"diskName": autorest.Encode("path", diskName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-04-30-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters),
autorest.WithJSON(diskParameter),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client DisksClient) UpdateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// UpdateResponder handles the response to the Update request. The method always
// closes the http.Response Body.
func (client DisksClient) UpdateResponder(resp *http.Response) (result Model, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}

View File

@ -1,278 +0,0 @@
package disk
// 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 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
"net/http"
)
// AccessLevel enumerates the values for access level.
type AccessLevel string
const (
// None specifies the none state for access level.
None AccessLevel = "None"
// Read specifies the read state for access level.
Read AccessLevel = "Read"
)
// CreateOption enumerates the values for create option.
type CreateOption string
const (
// Attach specifies the attach state for create option.
Attach CreateOption = "Attach"
// Copy specifies the copy state for create option.
Copy CreateOption = "Copy"
// Empty specifies the empty state for create option.
Empty CreateOption = "Empty"
// FromImage specifies the from image state for create option.
FromImage CreateOption = "FromImage"
// Import specifies the import state for create option.
Import CreateOption = "Import"
// Restore specifies the restore state for create option.
Restore CreateOption = "Restore"
)
// OperatingSystemTypes enumerates the values for operating system types.
type OperatingSystemTypes string
const (
// Linux specifies the linux state for operating system types.
Linux OperatingSystemTypes = "Linux"
// Windows specifies the windows state for operating system types.
Windows OperatingSystemTypes = "Windows"
)
// StorageAccountTypes enumerates the values for storage account types.
type StorageAccountTypes string
const (
// PremiumLRS specifies the premium lrs state for storage account types.
PremiumLRS StorageAccountTypes = "Premium_LRS"
// StandardLRS specifies the standard lrs state for storage account types.
StandardLRS StorageAccountTypes = "Standard_LRS"
)
// AccessURI is a disk access SAS uri.
type AccessURI struct {
autorest.Response `json:"-"`
*AccessURIOutput `json:"properties,omitempty"`
}
// AccessURIOutput is azure properties, including output.
type AccessURIOutput struct {
*AccessURIRaw `json:"output,omitempty"`
}
// AccessURIRaw is this object gets 'bubbled up' through flattening.
type AccessURIRaw struct {
AccessSAS *string `json:"accessSAS,omitempty"`
}
// APIError is api error.
type APIError struct {
Details *[]APIErrorBase `json:"details,omitempty"`
Innererror *InnerError `json:"innererror,omitempty"`
Code *string `json:"code,omitempty"`
Target *string `json:"target,omitempty"`
Message *string `json:"message,omitempty"`
}
// APIErrorBase is api error base.
type APIErrorBase struct {
Code *string `json:"code,omitempty"`
Target *string `json:"target,omitempty"`
Message *string `json:"message,omitempty"`
}
// CreationData is data used when creating a disk.
type CreationData struct {
CreateOption CreateOption `json:"createOption,omitempty"`
StorageAccountID *string `json:"storageAccountId,omitempty"`
ImageReference *ImageDiskReference `json:"imageReference,omitempty"`
SourceURI *string `json:"sourceUri,omitempty"`
SourceResourceID *string `json:"sourceResourceId,omitempty"`
}
// EncryptionSettings is encryption settings for disk or snapshot
type EncryptionSettings struct {
Enabled *bool `json:"enabled,omitempty"`
DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"`
KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"`
}
// GrantAccessData is data used for requesting a SAS.
type GrantAccessData struct {
Access AccessLevel `json:"access,omitempty"`
DurationInSeconds *int32 `json:"durationInSeconds,omitempty"`
}
// ImageDiskReference is the source image used for creating the disk.
type ImageDiskReference struct {
ID *string `json:"id,omitempty"`
Lun *int32 `json:"lun,omitempty"`
}
// InnerError is inner error details.
type InnerError struct {
Exceptiontype *string `json:"exceptiontype,omitempty"`
Errordetail *string `json:"errordetail,omitempty"`
}
// KeyVaultAndKeyReference is 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 *SourceVault `json:"sourceVault,omitempty"`
KeyURL *string `json:"keyUrl,omitempty"`
}
// KeyVaultAndSecretReference is key Vault Secret Url and vault id of the
// encryption key
type KeyVaultAndSecretReference struct {
SourceVault *SourceVault `json:"sourceVault,omitempty"`
SecretURL *string `json:"secretUrl,omitempty"`
}
// ListType is the List Disks operation response.
type ListType struct {
autorest.Response `json:"-"`
Value *[]Model `json:"value,omitempty"`
NextLink *string `json:"nextLink,omitempty"`
}
// ListTypePreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client ListType) ListTypePreparer() (*http.Request, error) {
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(client.NextLink)))
}
// Model is disk resource.
type Model struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
*Properties `json:"properties,omitempty"`
}
// OperationStatusResponse is operation status response
type OperationStatusResponse struct {
autorest.Response `json:"-"`
Name *string `json:"name,omitempty"`
Status *string `json:"status,omitempty"`
StartTime *date.Time `json:"startTime,omitempty"`
EndTime *date.Time `json:"endTime,omitempty"`
Error *APIError `json:"error,omitempty"`
}
// Properties is disk resource properties.
type Properties struct {
AccountType StorageAccountTypes `json:"accountType,omitempty"`
TimeCreated *date.Time `json:"timeCreated,omitempty"`
OsType OperatingSystemTypes `json:"osType,omitempty"`
CreationData *CreationData `json:"creationData,omitempty"`
DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"`
OwnerID *string `json:"ownerId,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
// Resource is the Resource model definition.
type Resource struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
}
// ResourceUpdate is the Resource model definition.
type ResourceUpdate struct {
Tags *map[string]*string `json:"tags,omitempty"`
}
// Snapshot is snapshot resource.
type Snapshot struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
*Properties `json:"properties,omitempty"`
}
// SnapshotList is the List Snapshots operation response.
type SnapshotList struct {
autorest.Response `json:"-"`
Value *[]Snapshot `json:"value,omitempty"`
NextLink *string `json:"nextLink,omitempty"`
}
// SnapshotListPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client SnapshotList) SnapshotListPreparer() (*http.Request, error) {
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(client.NextLink)))
}
// SnapshotUpdate is snapshot update resource.
type SnapshotUpdate struct {
Tags *map[string]*string `json:"tags,omitempty"`
*UpdateProperties `json:"properties,omitempty"`
}
// SourceVault is the vault id is an Azure Resource Manager Resoure id in the
// form
// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}
type SourceVault struct {
ID *string `json:"id,omitempty"`
}
// UpdateProperties is disk resource update properties.
type UpdateProperties struct {
AccountType StorageAccountTypes `json:"accountType,omitempty"`
OsType OperatingSystemTypes `json:"osType,omitempty"`
CreationData *CreationData `json:"creationData,omitempty"`
DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"`
}
// UpdateType is disk update resource.
type UpdateType struct {
Tags *map[string]*string `json:"tags,omitempty"`
*UpdateProperties `json:"properties,omitempty"`
}

View File

@ -1,733 +0,0 @@
package disk
// 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 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
"net/http"
)
// SnapshotsClient is the the Disk Resource Provider Client.
type SnapshotsClient struct {
ManagementClient
}
// NewSnapshotsClient creates an instance of the SnapshotsClient client.
func NewSnapshotsClient(subscriptionID string) SnapshotsClient {
return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewSnapshotsClientWithBaseURI creates an instance of the SnapshotsClient
// client.
func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient {
return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate creates or updates a snapshot. This method may poll for
// completion. Polling can be canceled by passing the cancel channel argument.
// The channel will be used to cancel polling and any outstanding HTTP
// requests.
//
// resourceGroupName is the name of the resource group. snapshotName is the
// name of the snapshot within the given subscription and resource group.
// snapshot is snapshot object supplied in the body of the Put disk operation.
func (client SnapshotsClient) CreateOrUpdate(resourceGroupName string, snapshotName string, snapshot Snapshot, cancel <-chan struct{}) (<-chan Snapshot, <-chan error) {
resultChan := make(chan Snapshot, 1)
errChan := make(chan error, 1)
if err := validation.Validate([]validation.Validation{
{TargetValue: snapshot,
Constraints: []validation.Constraint{{Target: "snapshot.Properties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "snapshot.Properties.CreationData", Name: validation.Null, Rule: true,
Chain: []validation.Constraint{{Target: "snapshot.Properties.CreationData.ImageReference", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "snapshot.Properties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}},
}},
{Target: "snapshot.Properties.EncryptionSettings", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "snapshot.Properties.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "snapshot.Properties.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
{Target: "snapshot.Properties.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil},
}},
{Target: "snapshot.Properties.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "snapshot.Properties.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
{Target: "snapshot.Properties.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil},
}},
}},
}}}}}); err != nil {
errChan <- validation.NewErrorWithValidationError(err, "disk.SnapshotsClient", "CreateOrUpdate")
close(errChan)
close(resultChan)
return resultChan, errChan
}
go func() {
var err error
var result Snapshot
defer func() {
resultChan <- result
errChan <- err
close(resultChan)
close(errChan)
}()
req, err := client.CreateOrUpdatePreparer(resourceGroupName, snapshotName, snapshot, cancel)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "CreateOrUpdate", nil, "Failure preparing request")
return
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "CreateOrUpdate", resp, "Failure sending request")
return
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "CreateOrUpdate", resp, "Failure responding to request")
}
}()
return resultChan, errChan
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client SnapshotsClient) CreateOrUpdatePreparer(resourceGroupName string, snapshotName string, snapshot Snapshot, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"snapshotName": autorest.Encode("path", snapshotName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-04-30-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters),
autorest.WithJSON(snapshot),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client SnapshotsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client SnapshotsClient) CreateOrUpdateResponder(resp *http.Response) (result Snapshot, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Delete deletes a snapshot. This method may poll for completion. Polling can
// be canceled by passing the cancel channel argument. The channel will be used
// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. snapshotName is the
// name of the snapshot within the given subscription and resource group.
func (client SnapshotsClient) Delete(resourceGroupName string, snapshotName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) {
resultChan := make(chan OperationStatusResponse, 1)
errChan := make(chan error, 1)
go func() {
var err error
var result OperationStatusResponse
defer func() {
resultChan <- result
errChan <- err
close(resultChan)
close(errChan)
}()
req, err := client.DeletePreparer(resourceGroupName, snapshotName, cancel)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "Delete", nil, "Failure preparing request")
return
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "Delete", resp, "Failure sending request")
return
}
result, err = client.DeleteResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "Delete", resp, "Failure responding to request")
}
}()
return resultChan, errChan
}
// DeletePreparer prepares the Delete request.
func (client SnapshotsClient) DeletePreparer(resourceGroupName string, snapshotName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"snapshotName": autorest.Encode("path", snapshotName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-04-30-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client SnapshotsClient) DeleteSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Get gets information about a snapshot.
//
// resourceGroupName is the name of the resource group. snapshotName is the
// name of the snapshot within the given subscription and resource group.
func (client SnapshotsClient) Get(resourceGroupName string, snapshotName string) (result Snapshot, err error) {
req, err := client.GetPreparer(resourceGroupName, snapshotName)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client SnapshotsClient) GetPreparer(resourceGroupName string, snapshotName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"snapshotName": autorest.Encode("path", snapshotName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-04-30-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client SnapshotsClient) GetSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GrantAccess grants access to a snapshot. This method may poll for
// completion. Polling can be canceled by passing the cancel channel argument.
// The channel will be used to cancel polling and any outstanding HTTP
// requests.
//
// resourceGroupName is the name of the resource group. snapshotName is the
// name of the snapshot within the given subscription and resource group.
// grantAccessData is access data object supplied in the body of the get
// snapshot access operation.
func (client SnapshotsClient) GrantAccess(resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, cancel <-chan struct{}) (<-chan AccessURI, <-chan error) {
resultChan := make(chan AccessURI, 1)
errChan := make(chan error, 1)
if err := validation.Validate([]validation.Validation{
{TargetValue: grantAccessData,
Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
errChan <- validation.NewErrorWithValidationError(err, "disk.SnapshotsClient", "GrantAccess")
close(errChan)
close(resultChan)
return resultChan, errChan
}
go func() {
var err error
var result AccessURI
defer func() {
resultChan <- result
errChan <- err
close(resultChan)
close(errChan)
}()
req, err := client.GrantAccessPreparer(resourceGroupName, snapshotName, grantAccessData, cancel)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "GrantAccess", nil, "Failure preparing request")
return
}
resp, err := client.GrantAccessSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "GrantAccess", resp, "Failure sending request")
return
}
result, err = client.GrantAccessResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "GrantAccess", resp, "Failure responding to request")
}
}()
return resultChan, errChan
}
// GrantAccessPreparer prepares the GrantAccess request.
func (client SnapshotsClient) GrantAccessPreparer(resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"snapshotName": autorest.Encode("path", snapshotName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-04-30-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess", pathParameters),
autorest.WithJSON(grantAccessData),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// GrantAccessSender sends the GrantAccess request. The method will close the
// http.Response Body if it receives an error.
func (client SnapshotsClient) GrantAccessSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// GrantAccessResponder handles the response to the GrantAccess request. The method always
// closes the http.Response Body.
func (client SnapshotsClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// List lists snapshots under a subscription.
func (client SnapshotsClient) List() (result SnapshotList, err error) {
req, err := client.ListPreparer()
if err != nil {
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "List", nil, "Failure preparing request")
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "List", resp, "Failure sending request")
return
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client SnapshotsClient) ListPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-04-30-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client SnapshotsClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotList, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListNextResults retrieves the next set of results, if any.
func (client SnapshotsClient) ListNextResults(lastResults SnapshotList) (result SnapshotList, err error) {
req, err := lastResults.SnapshotListPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "List", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "List", resp, "Failure sending next results request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "List", resp, "Failure responding to next results request")
}
return
}
// ListByResourceGroup lists snapshots under a resource group.
//
// resourceGroupName is the name of the resource group.
func (client SnapshotsClient) ListByResourceGroup(resourceGroupName string) (result SnapshotList, err error) {
req, err := client.ListByResourceGroupPreparer(resourceGroupName)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "ListByResourceGroup", nil, "Failure preparing request")
return
}
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "ListByResourceGroup", resp, "Failure sending request")
return
}
result, err = client.ListByResourceGroupResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to request")
}
return
}
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
func (client SnapshotsClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-04-30-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
// http.Response Body if it receives an error.
func (client SnapshotsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
// closes the http.Response Body.
func (client SnapshotsClient) ListByResourceGroupResponder(resp *http.Response) (result SnapshotList, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListByResourceGroupNextResults retrieves the next set of results, if any.
func (client SnapshotsClient) ListByResourceGroupNextResults(lastResults SnapshotList) (result SnapshotList, err error) {
req, err := lastResults.SnapshotListPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "ListByResourceGroup", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "disk.SnapshotsClient", "ListByResourceGroup", resp, "Failure sending next results request")
}
result, err = client.ListByResourceGroupResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to next results request")
}
return
}
// RevokeAccess revokes access to a snapshot. This method may poll for
// completion. Polling can be canceled by passing the cancel channel argument.
// The channel will be used to cancel polling and any outstanding HTTP
// requests.
//
// resourceGroupName is the name of the resource group. snapshotName is the
// name of the snapshot within the given subscription and resource group.
func (client SnapshotsClient) RevokeAccess(resourceGroupName string, snapshotName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) {
resultChan := make(chan OperationStatusResponse, 1)
errChan := make(chan error, 1)
go func() {
var err error
var result OperationStatusResponse
defer func() {
resultChan <- result
errChan <- err
close(resultChan)
close(errChan)
}()
req, err := client.RevokeAccessPreparer(resourceGroupName, snapshotName, cancel)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "RevokeAccess", nil, "Failure preparing request")
return
}
resp, err := client.RevokeAccessSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "RevokeAccess", resp, "Failure sending request")
return
}
result, err = client.RevokeAccessResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "RevokeAccess", resp, "Failure responding to request")
}
}()
return resultChan, errChan
}
// RevokeAccessPreparer prepares the RevokeAccess request.
func (client SnapshotsClient) RevokeAccessPreparer(resourceGroupName string, snapshotName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"snapshotName": autorest.Encode("path", snapshotName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-04-30-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// RevokeAccessSender sends the RevokeAccess request. The method will close the
// http.Response Body if it receives an error.
func (client SnapshotsClient) RevokeAccessSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// RevokeAccessResponder handles the response to the RevokeAccess request. The method always
// closes the http.Response Body.
func (client SnapshotsClient) RevokeAccessResponder(resp *http.Response) (result OperationStatusResponse, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Update updates (patches) a snapshot. This method may poll for completion.
// Polling can be canceled by passing the cancel channel argument. The channel
// will be used to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. snapshotName is the
// name of the snapshot within the given subscription and resource group.
// snapshot is snapshot object supplied in the body of the Patch snapshot
// operation.
func (client SnapshotsClient) Update(resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, cancel <-chan struct{}) (<-chan Snapshot, <-chan error) {
resultChan := make(chan Snapshot, 1)
errChan := make(chan error, 1)
go func() {
var err error
var result Snapshot
defer func() {
resultChan <- result
errChan <- err
close(resultChan)
close(errChan)
}()
req, err := client.UpdatePreparer(resourceGroupName, snapshotName, snapshot, cancel)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "Update", nil, "Failure preparing request")
return
}
resp, err := client.UpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "Update", resp, "Failure sending request")
return
}
result, err = client.UpdateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "disk.SnapshotsClient", "Update", resp, "Failure responding to request")
}
}()
return resultChan, errChan
}
// UpdatePreparer prepares the Update request.
func (client SnapshotsClient) UpdatePreparer(resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"snapshotName": autorest.Encode("path", snapshotName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-04-30-preview"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters),
autorest.WithJSON(snapshot),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client SnapshotsClient) UpdateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// UpdateResponder handles the response to the Update request. The method always
// closes the http.Response Body.
func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}

View File

@ -0,0 +1,564 @@
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.
import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
)
// AvailabilitySetsClient is the compute Client
type AvailabilitySetsClient struct {
BaseClient
}
// NewAvailabilitySetsClient creates an instance of the AvailabilitySetsClient client.
func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient {
return NewAvailabilitySetsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewAvailabilitySetsClientWithBaseURI creates an instance of the AvailabilitySetsClient client.
func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) AvailabilitySetsClient {
return AvailabilitySetsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate create or update an availability set.
// Parameters:
// resourceGroupName - the name of the resource group.
// availabilitySetName - the name of the availability set.
// parameters - parameters supplied to the Create Availability Set operation.
func (client AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (result AvailabilitySet, err error) {
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, availabilitySetName, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", nil, "Failure preparing request")
return
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure sending request")
return
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client AvailabilitySetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (*http.Request, error) {
pathParameters := map[string]interface{}{
"availabilitySetName": autorest.Encode("path", availabilitySetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client AvailabilitySetsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client AvailabilitySetsClient) CreateOrUpdateResponder(resp *http.Response) (result AvailabilitySet, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Delete delete an availability set.
// Parameters:
// resourceGroupName - the name of the resource group.
// availabilitySetName - the name of the availability set.
func (client AvailabilitySetsClient) Delete(ctx context.Context, resourceGroupName string, availabilitySetName string) (result autorest.Response, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, availabilitySetName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", nil, "Failure preparing request")
return
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure sending request")
return
}
result, err = client.DeleteResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
func (client AvailabilitySetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"availabilitySetName": autorest.Encode("path", availabilitySetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client AvailabilitySetsClient) DeleteSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// Get retrieves information about an availability set.
// Parameters:
// resourceGroupName - the name of the resource group.
// availabilitySetName - the name of the availability set.
func (client AvailabilitySetsClient) Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result AvailabilitySet, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, availabilitySetName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client AvailabilitySetsClient) GetPreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"availabilitySetName": autorest.Encode("path", availabilitySetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client AvailabilitySetsClient) GetSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client AvailabilitySetsClient) GetResponder(resp *http.Response) (result AvailabilitySet, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// List lists all availability sets in a resource group.
// Parameters:
// resourceGroupName - the name of the resource group.
func (client AvailabilitySetsClient) List(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResultPage, err error) {
result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", nil, "Failure preparing request")
return
}
resp, err := client.ListSender(req)
if err != nil {
result.aslr.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure sending request")
return
}
result.aslr, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client AvailabilitySetsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client AvailabilitySetsClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client AvailabilitySetsClient) ListResponder(resp *http.Response) (result AvailabilitySetListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// listNextResults retrieves the next set of results, if any.
func (client AvailabilitySetsClient) listNextResults(lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) {
req, err := lastResults.availabilitySetListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", resp, "Failure sending next results request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", resp, "Failure responding to next results request")
}
return
}
// ListComplete enumerates all values, automatically crossing page boundaries as required.
func (client AvailabilitySetsClient) ListComplete(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResultIterator, err error) {
result.page, err = client.List(ctx, resourceGroupName)
return
}
// ListAvailableSizes lists all available virtual machine sizes that can be used to create a new virtual machine in an
// existing availability set.
// Parameters:
// resourceGroupName - the name of the resource group.
// availabilitySetName - the name of the availability set.
func (client AvailabilitySetsClient) ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result VirtualMachineSizeListResult, err error) {
req, err := client.ListAvailableSizesPreparer(ctx, resourceGroupName, availabilitySetName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", nil, "Failure preparing request")
return
}
resp, err := client.ListAvailableSizesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure sending request")
return
}
result, err = client.ListAvailableSizesResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure responding to request")
}
return
}
// ListAvailableSizesPreparer prepares the ListAvailableSizes request.
func (client AvailabilitySetsClient) ListAvailableSizesPreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"availabilitySetName": autorest.Encode("path", availabilitySetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the
// http.Response Body if it receives an error.
func (client AvailabilitySetsClient) ListAvailableSizesSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListAvailableSizesResponder handles the response to the ListAvailableSizes request. The method always
// closes the http.Response Body.
func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListBySubscription lists all availability sets in a subscription.
func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context) (result AvailabilitySetListResultPage, err error) {
result.fn = client.listBySubscriptionNextResults
req, err := client.ListBySubscriptionPreparer(ctx)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request")
return
}
resp, err := client.ListBySubscriptionSender(req)
if err != nil {
result.aslr.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure sending request")
return
}
result.aslr, err = client.ListBySubscriptionResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure responding to request")
}
return
}
// ListBySubscriptionPreparer prepares the ListBySubscription request.
func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListBySubscriptionSender sends the ListBySubscription request. The method will close the
// http.Response Body if it receives an error.
func (client AvailabilitySetsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always
// closes the http.Response Body.
func (client AvailabilitySetsClient) ListBySubscriptionResponder(resp *http.Response) (result AvailabilitySetListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// listBySubscriptionNextResults retrieves the next set of results, if any.
func (client AvailabilitySetsClient) listBySubscriptionNextResults(lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) {
req, err := lastResults.availabilitySetListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListBySubscriptionSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request")
}
result, err = client.ListBySubscriptionResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request")
}
return
}
// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required.
func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context) (result AvailabilitySetListResultIterator, err error) {
result.page, err = client.ListBySubscription(ctx)
return
}
// Update update an availability set.
// Parameters:
// resourceGroupName - the name of the resource group.
// availabilitySetName - the name of the availability set.
// parameters - parameters supplied to the Update Availability Set operation.
func (client AvailabilitySetsClient) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate) (result AvailabilitySet, err error) {
req, err := client.UpdatePreparer(ctx, resourceGroupName, availabilitySetName, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", nil, "Failure preparing request")
return
}
resp, err := client.UpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", resp, "Failure sending request")
return
}
result, err = client.UpdateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", resp, "Failure responding to request")
}
return
}
// UpdatePreparer prepares the Update request.
func (client AvailabilitySetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate) (*http.Request, error) {
pathParameters := map[string]interface{}{
"availabilitySetName": autorest.Encode("path", availabilitySetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client AvailabilitySetsClient) UpdateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// UpdateResponder handles the response to the Update request. The method always
// closes the http.Response Body.
func (client AvailabilitySetsClient) UpdateResponder(resp *http.Response) (result AvailabilitySet, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}

View File

@ -1,8 +1,7 @@
// Package disk implements the Azure ARM Disk service API version
// 2016-04-30-preview.
// Package compute implements the Azure ARM Compute service API version 2018-04-01.
//
// The Disk Resource Provider Client.
package disk
// Compute Client
package compute
// Copyright (c) Microsoft and contributors. All rights reserved.
//
@ -18,34 +17,33 @@ package disk
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"github.com/Azure/go-autorest/autorest"
)
const (
// DefaultBaseURI is the default URI used for the service Disk
// DefaultBaseURI is the default URI used for the service Compute
DefaultBaseURI = "https://management.azure.com"
)
// ManagementClient is the base client for Disk.
type ManagementClient struct {
// BaseClient is the base client for Compute.
type BaseClient struct {
autorest.Client
BaseURI string
SubscriptionID string
}
// New creates an instance of the ManagementClient client.
func New(subscriptionID string) ManagementClient {
// New creates an instance of the BaseClient client.
func New(subscriptionID string) BaseClient {
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewWithBaseURI creates an instance of the ManagementClient client.
func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
return ManagementClient{
// NewWithBaseURI creates an instance of the BaseClient client.
func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
return BaseClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: baseURI,
SubscriptionID: subscriptionID,

View File

@ -0,0 +1,692 @@
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.
import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
"net/http"
)
// DisksClient is the compute Client
type DisksClient struct {
BaseClient
}
// NewDisksClient creates an instance of the DisksClient client.
func NewDisksClient(subscriptionID string) DisksClient {
return NewDisksClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewDisksClientWithBaseURI creates an instance of the DisksClient client.
func NewDisksClientWithBaseURI(baseURI string, subscriptionID string) DisksClient {
return DisksClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate creates or updates a disk.
// Parameters:
// resourceGroupName - the name of the resource group.
// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
// characters.
// disk - disk object supplied in the body of the Put disk operation.
func (client DisksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk Disk) (result DisksCreateOrUpdateFuture, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: disk,
Constraints: []validation.Constraint{{Target: "disk.DiskProperties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData", Name: validation.Null, Rule: true,
Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.ImageReference", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}},
}},
{Target: "disk.DiskProperties.EncryptionSettings", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
{Target: "disk.DiskProperties.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil},
}},
{Target: "disk.DiskProperties.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
{Target: "disk.DiskProperties.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil},
}},
}},
}}}}}); err != nil {
return result, validation.NewError("compute.DisksClient", "CreateOrUpdate", err.Error())
}
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskName, disk)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", nil, "Failure preparing request")
return
}
result, err = client.CreateOrUpdateSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", result.Response(), "Failure sending request")
return
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client DisksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskName string, disk Disk) (*http.Request, error) {
pathParameters := map[string]interface{}{
"diskName": autorest.Encode("path", diskName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters),
autorest.WithJSON(disk),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client DisksClient) CreateOrUpdateSender(req *http.Request) (future DisksCreateOrUpdateFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client DisksClient) CreateOrUpdateResponder(resp *http.Response) (result Disk, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Delete deletes a disk.
// Parameters:
// resourceGroupName - the name of the resource group.
// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
// characters.
func (client DisksClient) Delete(ctx context.Context, resourceGroupName string, diskName string) (result DisksDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, diskName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", nil, "Failure preparing request")
return
}
result, err = client.DeleteSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", result.Response(), "Failure sending request")
return
}
return
}
// DeletePreparer prepares the Delete request.
func (client DisksClient) DeletePreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"diskName": autorest.Encode("path", diskName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client DisksClient) DeleteSender(req *http.Request) (future DisksDeleteFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client DisksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// Get gets information about a disk.
// Parameters:
// resourceGroupName - the name of the resource group.
// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
// characters.
func (client DisksClient) Get(ctx context.Context, resourceGroupName string, diskName string) (result Disk, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, diskName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client DisksClient) GetPreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"diskName": autorest.Encode("path", diskName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client DisksClient) GetSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client DisksClient) GetResponder(resp *http.Response) (result Disk, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GrantAccess grants access to a disk.
// Parameters:
// resourceGroupName - the name of the resource group.
// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
// characters.
// grantAccessData - access data object supplied in the body of the get disk access operation.
func (client DisksClient) GrantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData) (result DisksGrantAccessFuture, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: grantAccessData,
Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
return result, validation.NewError("compute.DisksClient", "GrantAccess", err.Error())
}
req, err := client.GrantAccessPreparer(ctx, resourceGroupName, diskName, grantAccessData)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", nil, "Failure preparing request")
return
}
result, err = client.GrantAccessSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", result.Response(), "Failure sending request")
return
}
return
}
// GrantAccessPreparer prepares the GrantAccess request.
func (client DisksClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData) (*http.Request, error) {
pathParameters := map[string]interface{}{
"diskName": autorest.Encode("path", diskName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess", pathParameters),
autorest.WithJSON(grantAccessData),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// GrantAccessSender sends the GrantAccess request. The method will close the
// http.Response Body if it receives an error.
func (client DisksClient) GrantAccessSender(req *http.Request) (future DisksGrantAccessFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// GrantAccessResponder handles the response to the GrantAccess request. The method always
// closes the http.Response Body.
func (client DisksClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// List lists all the disks under a subscription.
func (client DisksClient) List(ctx context.Context) (result DiskListPage, err error) {
result.fn = client.listNextResults
req, err := client.ListPreparer(ctx)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", nil, "Failure preparing request")
return
}
resp, err := client.ListSender(req)
if err != nil {
result.dl.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure sending request")
return
}
result.dl, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client DisksClient) ListPreparer(ctx context.Context) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client DisksClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client DisksClient) ListResponder(resp *http.Response) (result DiskList, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// listNextResults retrieves the next set of results, if any.
func (client DisksClient) listNextResults(lastResults DiskList) (result DiskList, err error) {
req, err := lastResults.diskListPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", resp, "Failure sending next results request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", resp, "Failure responding to next results request")
}
return
}
// ListComplete enumerates all values, automatically crossing page boundaries as required.
func (client DisksClient) ListComplete(ctx context.Context) (result DiskListIterator, err error) {
result.page, err = client.List(ctx)
return
}
// ListByResourceGroup lists all the disks under a resource group.
// Parameters:
// resourceGroupName - the name of the resource group.
func (client DisksClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskListPage, err error) {
result.fn = client.listByResourceGroupNextResults
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", nil, "Failure preparing request")
return
}
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.dl.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure sending request")
return
}
result.dl, err = client.ListByResourceGroupResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure responding to request")
}
return
}
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
func (client DisksClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
// http.Response Body if it receives an error.
func (client DisksClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
// closes the http.Response Body.
func (client DisksClient) ListByResourceGroupResponder(resp *http.Response) (result DiskList, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// listByResourceGroupNextResults retrieves the next set of results, if any.
func (client DisksClient) listByResourceGroupNextResults(lastResults DiskList) (result DiskList, err error) {
req, err := lastResults.diskListPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
}
result, err = client.ListByResourceGroupResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
}
return
}
// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
func (client DisksClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DiskListIterator, err error) {
result.page, err = client.ListByResourceGroup(ctx, resourceGroupName)
return
}
// RevokeAccess revokes access to a disk.
// Parameters:
// resourceGroupName - the name of the resource group.
// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
// characters.
func (client DisksClient) RevokeAccess(ctx context.Context, resourceGroupName string, diskName string) (result DisksRevokeAccessFuture, err error) {
req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, diskName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", nil, "Failure preparing request")
return
}
result, err = client.RevokeAccessSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", result.Response(), "Failure sending request")
return
}
return
}
// RevokeAccessPreparer prepares the RevokeAccess request.
func (client DisksClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"diskName": autorest.Encode("path", diskName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// RevokeAccessSender sends the RevokeAccess request. The method will close the
// http.Response Body if it receives an error.
func (client DisksClient) RevokeAccessSender(req *http.Request) (future DisksRevokeAccessFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// RevokeAccessResponder handles the response to the RevokeAccess request. The method always
// closes the http.Response Body.
func (client DisksClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
// Update updates (patches) a disk.
// Parameters:
// resourceGroupName - the name of the resource group.
// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
// characters.
// disk - disk object supplied in the body of the Patch disk operation.
func (client DisksClient) Update(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate) (result DisksUpdateFuture, err error) {
req, err := client.UpdatePreparer(ctx, resourceGroupName, diskName, disk)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", nil, "Failure preparing request")
return
}
result, err = client.UpdateSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", result.Response(), "Failure sending request")
return
}
return
}
// UpdatePreparer prepares the Update request.
func (client DisksClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate) (*http.Request, error) {
pathParameters := map[string]interface{}{
"diskName": autorest.Encode("path", diskName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters),
autorest.WithJSON(disk),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client DisksClient) UpdateSender(req *http.Request) (future DisksUpdateFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// UpdateResponder handles the response to the Update request. The method always
// closes the http.Response Body.
func (client DisksClient) UpdateResponder(resp *http.Response) (result Disk, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}

View File

@ -0,0 +1,513 @@
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.
import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
)
// ImagesClient is the compute Client
type ImagesClient struct {
BaseClient
}
// NewImagesClient creates an instance of the ImagesClient client.
func NewImagesClient(subscriptionID string) ImagesClient {
return NewImagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewImagesClientWithBaseURI creates an instance of the ImagesClient client.
func NewImagesClientWithBaseURI(baseURI string, subscriptionID string) ImagesClient {
return ImagesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate create or update an image.
// Parameters:
// resourceGroupName - the name of the resource group.
// imageName - the name of the image.
// parameters - parameters supplied to the Create Image operation.
func (client ImagesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters Image) (result ImagesCreateOrUpdateFuture, err error) {
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, imageName, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "CreateOrUpdate", nil, "Failure preparing request")
return
}
result, err = client.CreateOrUpdateSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "CreateOrUpdate", result.Response(), "Failure sending request")
return
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client ImagesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, imageName string, parameters Image) (*http.Request, error) {
pathParameters := map[string]interface{}{
"imageName": autorest.Encode("path", imageName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client ImagesClient) CreateOrUpdateSender(req *http.Request) (future ImagesCreateOrUpdateFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client ImagesClient) CreateOrUpdateResponder(resp *http.Response) (result Image, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Delete deletes an Image.
// Parameters:
// resourceGroupName - the name of the resource group.
// imageName - the name of the image.
func (client ImagesClient) Delete(ctx context.Context, resourceGroupName string, imageName string) (result ImagesDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, imageName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Delete", nil, "Failure preparing request")
return
}
result, err = client.DeleteSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Delete", result.Response(), "Failure sending request")
return
}
return
}
// DeletePreparer prepares the Delete request.
func (client ImagesClient) DeletePreparer(ctx context.Context, resourceGroupName string, imageName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"imageName": autorest.Encode("path", imageName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client ImagesClient) DeleteSender(req *http.Request) (future ImagesDeleteFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client ImagesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// Get gets an image.
// Parameters:
// resourceGroupName - the name of the resource group.
// imageName - the name of the image.
// expand - the expand expression to apply on the operation.
func (client ImagesClient) Get(ctx context.Context, resourceGroupName string, imageName string, expand string) (result Image, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, imageName, expand)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client ImagesClient) GetPreparer(ctx context.Context, resourceGroupName string, imageName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"imageName": autorest.Encode("path", imageName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = autorest.Encode("query", expand)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client ImagesClient) GetSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client ImagesClient) GetResponder(resp *http.Response) (result Image, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// List gets the list of Images in the subscription. Use nextLink property in the response to get the next page of
// Images. Do this till nextLink is null to fetch all the Images.
func (client ImagesClient) List(ctx context.Context) (result ImageListResultPage, err error) {
result.fn = client.listNextResults
req, err := client.ListPreparer(ctx)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", nil, "Failure preparing request")
return
}
resp, err := client.ListSender(req)
if err != nil {
result.ilr.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure sending request")
return
}
result.ilr, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client ImagesClient) ListPreparer(ctx context.Context) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client ImagesClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client ImagesClient) ListResponder(resp *http.Response) (result ImageListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// listNextResults retrieves the next set of results, if any.
func (client ImagesClient) listNextResults(lastResults ImageListResult) (result ImageListResult, err error) {
req, err := lastResults.imageListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listNextResults", resp, "Failure sending next results request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "listNextResults", resp, "Failure responding to next results request")
}
return
}
// ListComplete enumerates all values, automatically crossing page boundaries as required.
func (client ImagesClient) ListComplete(ctx context.Context) (result ImageListResultIterator, err error) {
result.page, err = client.List(ctx)
return
}
// ListByResourceGroup gets the list of images under a resource group.
// Parameters:
// resourceGroupName - the name of the resource group.
func (client ImagesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ImageListResultPage, err error) {
result.fn = client.listByResourceGroupNextResults
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", nil, "Failure preparing request")
return
}
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.ilr.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure sending request")
return
}
result.ilr, err = client.ListByResourceGroupResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure responding to request")
}
return
}
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
func (client ImagesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
// http.Response Body if it receives an error.
func (client ImagesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
// closes the http.Response Body.
func (client ImagesClient) ListByResourceGroupResponder(resp *http.Response) (result ImageListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// listByResourceGroupNextResults retrieves the next set of results, if any.
func (client ImagesClient) listByResourceGroupNextResults(lastResults ImageListResult) (result ImageListResult, err error) {
req, err := lastResults.imageListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
}
result, err = client.ListByResourceGroupResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
}
return
}
// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
func (client ImagesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ImageListResultIterator, err error) {
result.page, err = client.ListByResourceGroup(ctx, resourceGroupName)
return
}
// Update update an image.
// Parameters:
// resourceGroupName - the name of the resource group.
// imageName - the name of the image.
// parameters - parameters supplied to the Update Image operation.
func (client ImagesClient) Update(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate) (result ImagesUpdateFuture, err error) {
req, err := client.UpdatePreparer(ctx, resourceGroupName, imageName, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Update", nil, "Failure preparing request")
return
}
result, err = client.UpdateSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Update", result.Response(), "Failure sending request")
return
}
return
}
// UpdatePreparer prepares the Update request.
func (client ImagesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate) (*http.Request, error) {
pathParameters := map[string]interface{}{
"imageName": autorest.Encode("path", imageName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client ImagesClient) UpdateSender(req *http.Request) (future ImagesUpdateFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// UpdateResponder handles the response to the Update request. The method always
// closes the http.Response Body.
func (client ImagesClient) UpdateResponder(resp *http.Response) (result Image, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}

View File

@ -0,0 +1,199 @@
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.
import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
"net/http"
)
// LogAnalyticsClient is the compute Client
type LogAnalyticsClient struct {
BaseClient
}
// NewLogAnalyticsClient creates an instance of the LogAnalyticsClient client.
func NewLogAnalyticsClient(subscriptionID string) LogAnalyticsClient {
return NewLogAnalyticsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewLogAnalyticsClientWithBaseURI creates an instance of the LogAnalyticsClient client.
func NewLogAnalyticsClientWithBaseURI(baseURI string, subscriptionID string) LogAnalyticsClient {
return LogAnalyticsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// ExportRequestRateByInterval export logs that show Api requests made by this subscription in the given time window to
// show throttling activities.
// Parameters:
// parameters - parameters supplied to the LogAnalytics getRequestRateByInterval Api.
// location - the location upon which virtual-machine-sizes is queried.
func (client LogAnalyticsClient) ExportRequestRateByInterval(ctx context.Context, parameters RequestRateByIntervalInput, location string) (result LogAnalyticsExportRequestRateByIntervalFuture, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: location,
Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewError("compute.LogAnalyticsClient", "ExportRequestRateByInterval", err.Error())
}
req, err := client.ExportRequestRateByIntervalPreparer(ctx, parameters, location)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportRequestRateByInterval", nil, "Failure preparing request")
return
}
result, err = client.ExportRequestRateByIntervalSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportRequestRateByInterval", result.Response(), "Failure sending request")
return
}
return
}
// ExportRequestRateByIntervalPreparer prepares the ExportRequestRateByInterval request.
func (client LogAnalyticsClient) ExportRequestRateByIntervalPreparer(ctx context.Context, parameters RequestRateByIntervalInput, location string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": autorest.Encode("path", location),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ExportRequestRateByIntervalSender sends the ExportRequestRateByInterval request. The method will close the
// http.Response Body if it receives an error.
func (client LogAnalyticsClient) ExportRequestRateByIntervalSender(req *http.Request) (future LogAnalyticsExportRequestRateByIntervalFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// ExportRequestRateByIntervalResponder handles the response to the ExportRequestRateByInterval request. The method always
// closes the http.Response Body.
func (client LogAnalyticsClient) ExportRequestRateByIntervalResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ExportThrottledRequests export logs that show total throttled Api requests for this subscription in the given time
// window.
// Parameters:
// parameters - parameters supplied to the LogAnalytics getThrottledRequests Api.
// location - the location upon which virtual-machine-sizes is queried.
func (client LogAnalyticsClient) ExportThrottledRequests(ctx context.Context, parameters ThrottledRequestsInput, location string) (result LogAnalyticsExportThrottledRequestsFuture, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: location,
Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewError("compute.LogAnalyticsClient", "ExportThrottledRequests", err.Error())
}
req, err := client.ExportThrottledRequestsPreparer(ctx, parameters, location)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportThrottledRequests", nil, "Failure preparing request")
return
}
result, err = client.ExportThrottledRequestsSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportThrottledRequests", result.Response(), "Failure sending request")
return
}
return
}
// ExportThrottledRequestsPreparer prepares the ExportThrottledRequests request.
func (client LogAnalyticsClient) ExportThrottledRequestsPreparer(ctx context.Context, parameters ThrottledRequestsInput, location string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": autorest.Encode("path", location),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ExportThrottledRequestsSender sends the ExportThrottledRequests request. The method will close the
// http.Response Body if it receives an error.
func (client LogAnalyticsClient) ExportThrottledRequestsSender(req *http.Request) (future LogAnalyticsExportThrottledRequestsFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// ExportThrottledRequestsResponder handles the response to the ExportThrottledRequests request. The method always
// closes the http.Response Body.
func (client LogAnalyticsClient) ExportThrottledRequestsResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
package storage
package compute
// Copyright (c) Microsoft and contributors. All rights reserved.
//
@ -18,56 +18,53 @@ package storage
// 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"
"net/http"
)
// UsageClient is the the Azure Storage Management API.
type UsageClient struct {
ManagementClient
// OperationsClient is the compute Client
type OperationsClient struct {
BaseClient
}
// NewUsageClient creates an instance of the UsageClient client.
func NewUsageClient(subscriptionID string) UsageClient {
return NewUsageClientWithBaseURI(DefaultBaseURI, subscriptionID)
// NewOperationsClient creates an instance of the OperationsClient client.
func NewOperationsClient(subscriptionID string) OperationsClient {
return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewUsageClientWithBaseURI creates an instance of the UsageClient client.
func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClient {
return UsageClient{NewWithBaseURI(baseURI, subscriptionID)}
// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client.
func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// List gets the current usage count and the limit for the resources under the subscription.
func (client UsageClient) List() (result UsageListResult, err error) {
req, err := client.ListPreparer()
// List gets a list of compute operations.
func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) {
req, err := client.ListPreparer(ctx)
if err != nil {
err = autorest.NewErrorWithError(err, "storage.UsageClient", "List", nil, "Failure preparing request")
err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", nil, "Failure preparing request")
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "storage.UsageClient", "List", resp, "Failure sending request")
err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", resp, "Failure sending request")
return
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "storage.UsageClient", "List", resp, "Failure responding to request")
err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client UsageClient) ListPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-10-01"
func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@ -75,22 +72,21 @@ func (client UsageClient) ListPreparer() (*http.Request, error) {
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages", pathParameters),
autorest.WithPath("/providers/Microsoft.Compute/operations"),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client UsageClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoRetryWithRegistration(client.Client))
func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client UsageClient) ListResponder(resp *http.Response) (result UsageListResult, err error) {
func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),

View File

@ -0,0 +1,686 @@
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.
import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
"net/http"
)
// SnapshotsClient is the compute Client
type SnapshotsClient struct {
BaseClient
}
// NewSnapshotsClient creates an instance of the SnapshotsClient client.
func NewSnapshotsClient(subscriptionID string) SnapshotsClient {
return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewSnapshotsClientWithBaseURI creates an instance of the SnapshotsClient client.
func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient {
return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate creates or updates a snapshot.
// Parameters:
// resourceGroupName - the name of the resource group.
// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
// snapshot - snapshot object supplied in the body of the Put disk operation.
func (client SnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot) (result SnapshotsCreateOrUpdateFuture, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: snapshot,
Constraints: []validation.Constraint{{Target: "snapshot.DiskProperties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.CreationData", Name: validation.Null, Rule: true,
Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.CreationData.ImageReference", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}},
}},
{Target: "snapshot.DiskProperties.EncryptionSettings", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
{Target: "snapshot.DiskProperties.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil},
}},
{Target: "snapshot.DiskProperties.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
{Target: "snapshot.DiskProperties.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil},
}},
}},
}}}}}); err != nil {
return result, validation.NewError("compute.SnapshotsClient", "CreateOrUpdate", err.Error())
}
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", nil, "Failure preparing request")
return
}
result, err = client.CreateOrUpdateSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
return
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client SnapshotsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"snapshotName": autorest.Encode("path", snapshotName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters),
autorest.WithJSON(snapshot),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client SnapshotsClient) CreateOrUpdateSender(req *http.Request) (future SnapshotsCreateOrUpdateFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client SnapshotsClient) CreateOrUpdateResponder(resp *http.Response) (result Snapshot, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Delete deletes a snapshot.
// Parameters:
// resourceGroupName - the name of the resource group.
// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, snapshotName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", nil, "Failure preparing request")
return
}
result, err = client.DeleteSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", result.Response(), "Failure sending request")
return
}
return
}
// DeletePreparer prepares the Delete request.
func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"snapshotName": autorest.Encode("path", snapshotName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsDeleteFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// Get gets information about a snapshot.
// Parameters:
// resourceGroupName - the name of the resource group.
// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, snapshotName string) (result Snapshot, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, snapshotName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"snapshotName": autorest.Encode("path", snapshotName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client SnapshotsClient) GetSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GrantAccess grants access to a snapshot.
// Parameters:
// resourceGroupName - the name of the resource group.
// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
// grantAccessData - access data object supplied in the body of the get snapshot access operation.
func (client SnapshotsClient) GrantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData) (result SnapshotsGrantAccessFuture, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: grantAccessData,
Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
return result, validation.NewError("compute.SnapshotsClient", "GrantAccess", err.Error())
}
req, err := client.GrantAccessPreparer(ctx, resourceGroupName, snapshotName, grantAccessData)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", nil, "Failure preparing request")
return
}
result, err = client.GrantAccessSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", result.Response(), "Failure sending request")
return
}
return
}
// GrantAccessPreparer prepares the GrantAccess request.
func (client SnapshotsClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"snapshotName": autorest.Encode("path", snapshotName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess", pathParameters),
autorest.WithJSON(grantAccessData),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// GrantAccessSender sends the GrantAccess request. The method will close the
// http.Response Body if it receives an error.
func (client SnapshotsClient) GrantAccessSender(req *http.Request) (future SnapshotsGrantAccessFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// GrantAccessResponder handles the response to the GrantAccess request. The method always
// closes the http.Response Body.
func (client SnapshotsClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// List lists snapshots under a subscription.
func (client SnapshotsClient) List(ctx context.Context) (result SnapshotListPage, err error) {
result.fn = client.listNextResults
req, err := client.ListPreparer(ctx)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", nil, "Failure preparing request")
return
}
resp, err := client.ListSender(req)
if err != nil {
result.sl.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure sending request")
return
}
result.sl, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client SnapshotsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client SnapshotsClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotList, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// listNextResults retrieves the next set of results, if any.
func (client SnapshotsClient) listNextResults(lastResults SnapshotList) (result SnapshotList, err error) {
req, err := lastResults.snapshotListPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listNextResults", resp, "Failure sending next results request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listNextResults", resp, "Failure responding to next results request")
}
return
}
// ListComplete enumerates all values, automatically crossing page boundaries as required.
func (client SnapshotsClient) ListComplete(ctx context.Context) (result SnapshotListIterator, err error) {
result.page, err = client.List(ctx)
return
}
// ListByResourceGroup lists snapshots under a resource group.
// Parameters:
// resourceGroupName - the name of the resource group.
func (client SnapshotsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SnapshotListPage, err error) {
result.fn = client.listByResourceGroupNextResults
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", nil, "Failure preparing request")
return
}
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.sl.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure sending request")
return
}
result.sl, err = client.ListByResourceGroupResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to request")
}
return
}
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
func (client SnapshotsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
// http.Response Body if it receives an error.
func (client SnapshotsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
// closes the http.Response Body.
func (client SnapshotsClient) ListByResourceGroupResponder(resp *http.Response) (result SnapshotList, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// listByResourceGroupNextResults retrieves the next set of results, if any.
func (client SnapshotsClient) listByResourceGroupNextResults(lastResults SnapshotList) (result SnapshotList, err error) {
req, err := lastResults.snapshotListPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListByResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
}
result, err = client.ListByResourceGroupResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
}
return
}
// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
func (client SnapshotsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SnapshotListIterator, err error) {
result.page, err = client.ListByResourceGroup(ctx, resourceGroupName)
return
}
// RevokeAccess revokes access to a snapshot.
// Parameters:
// resourceGroupName - the name of the resource group.
// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
func (client SnapshotsClient) RevokeAccess(ctx context.Context, resourceGroupName string, snapshotName string) (result SnapshotsRevokeAccessFuture, err error) {
req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, snapshotName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", nil, "Failure preparing request")
return
}
result, err = client.RevokeAccessSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", result.Response(), "Failure sending request")
return
}
return
}
// RevokeAccessPreparer prepares the RevokeAccess request.
func (client SnapshotsClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"snapshotName": autorest.Encode("path", snapshotName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// RevokeAccessSender sends the RevokeAccess request. The method will close the
// http.Response Body if it receives an error.
func (client SnapshotsClient) RevokeAccessSender(req *http.Request) (future SnapshotsRevokeAccessFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// RevokeAccessResponder handles the response to the RevokeAccess request. The method always
// closes the http.Response Body.
func (client SnapshotsClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
// Update updates (patches) a snapshot.
// Parameters:
// resourceGroupName - the name of the resource group.
// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
// snapshot - snapshot object supplied in the body of the Patch snapshot operation.
func (client SnapshotsClient) Update(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate) (result SnapshotsUpdateFuture, err error) {
req, err := client.UpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", nil, "Failure preparing request")
return
}
result, err = client.UpdateSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", result.Response(), "Failure sending request")
return
}
return
}
// UpdatePreparer prepares the Update request.
func (client SnapshotsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"snapshotName": autorest.Encode("path", snapshotName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters),
autorest.WithJSON(snapshot),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsUpdateFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// UpdateResponder handles the response to the Update request. The method always
// closes the http.Response Body.
func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}

View File

@ -0,0 +1,141 @@
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.
import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
"net/http"
)
// UsageClient is the compute Client
type UsageClient struct {
BaseClient
}
// NewUsageClient creates an instance of the UsageClient client.
func NewUsageClient(subscriptionID string) UsageClient {
return NewUsageClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewUsageClientWithBaseURI creates an instance of the UsageClient client.
func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClient {
return UsageClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// List gets, for the specified location, the current compute resource usage information as well as the limits for
// compute resources under the subscription.
// Parameters:
// location - the location for which resource usage is queried.
func (client UsageClient) List(ctx context.Context, location string) (result ListUsagesResultPage, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: location,
Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewError("compute.UsageClient", "List", err.Error())
}
result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, location)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", nil, "Failure preparing request")
return
}
resp, err := client.ListSender(req)
if err != nil {
result.lur.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure sending request")
return
}
result.lur, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client UsageClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": autorest.Encode("path", location),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client UsageClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client UsageClient) ListResponder(resp *http.Response) (result ListUsagesResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// listNextResults retrieves the next set of results, if any.
func (client UsageClient) listNextResults(lastResults ListUsagesResult) (result ListUsagesResult, err error) {
req, err := lastResults.listUsagesResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", resp, "Failure sending next results request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", resp, "Failure responding to next results request")
}
return
}
// ListComplete enumerates all values, automatically crossing page boundaries as required.
func (client UsageClient) ListComplete(ctx context.Context, location string) (result ListUsagesResultIterator, err error) {
result.page, err = client.List(ctx, location)
return
}

View File

@ -1,4 +1,6 @@
package disk
package compute
import "github.com/Azure/azure-sdk-for-go/version"
// Copyright (c) Microsoft and contributors. All rights reserved.
//
@ -14,15 +16,15 @@ package disk
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
return "Azure-SDK-For-Go/v11.3.0-beta arm-disk/2016-04-30-preview"
return "Azure-SDK-For-Go/" + version.Number + " compute/2018-04-01"
}
// Version returns the semantic version (see http://semver.org) of the client.
func Version() string {
return "v11.3.0-beta"
return version.Number
}

View File

@ -0,0 +1,252 @@
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.
import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
)
// VirtualMachineExtensionImagesClient is the compute Client
type VirtualMachineExtensionImagesClient struct {
BaseClient
}
// NewVirtualMachineExtensionImagesClient creates an instance of the VirtualMachineExtensionImagesClient client.
func NewVirtualMachineExtensionImagesClient(subscriptionID string) VirtualMachineExtensionImagesClient {
return NewVirtualMachineExtensionImagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualMachineExtensionImagesClientWithBaseURI creates an instance of the VirtualMachineExtensionImagesClient
// client.
func NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionImagesClient {
return VirtualMachineExtensionImagesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Get gets a virtual machine extension image.
// Parameters:
// location - the name of a supported Azure region.
func (client VirtualMachineExtensionImagesClient) Get(ctx context.Context, location string, publisherName string, typeParameter string, version string) (result VirtualMachineExtensionImage, err error) {
req, err := client.GetPreparer(ctx, location, publisherName, typeParameter, version)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client VirtualMachineExtensionImagesClient) GetPreparer(ctx context.Context, location string, publisherName string, typeParameter string, version string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": autorest.Encode("path", location),
"publisherName": autorest.Encode("path", publisherName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"type": autorest.Encode("path", typeParameter),
"version": autorest.Encode("path", version),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineExtensionImagesClient) GetSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client VirtualMachineExtensionImagesClient) GetResponder(resp *http.Response) (result VirtualMachineExtensionImage, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListTypes gets a list of virtual machine extension image types.
// Parameters:
// location - the name of a supported Azure region.
func (client VirtualMachineExtensionImagesClient) ListTypes(ctx context.Context, location string, publisherName string) (result ListVirtualMachineExtensionImage, err error) {
req, err := client.ListTypesPreparer(ctx, location, publisherName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", nil, "Failure preparing request")
return
}
resp, err := client.ListTypesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure sending request")
return
}
result, err = client.ListTypesResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure responding to request")
}
return
}
// ListTypesPreparer prepares the ListTypes request.
func (client VirtualMachineExtensionImagesClient) ListTypesPreparer(ctx context.Context, location string, publisherName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": autorest.Encode("path", location),
"publisherName": autorest.Encode("path", publisherName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListTypesSender sends the ListTypes request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineExtensionImagesClient) ListTypesSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListTypesResponder handles the response to the ListTypes request. The method always
// closes the http.Response Body.
func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListVersions gets a list of virtual machine extension image versions.
// Parameters:
// location - the name of a supported Azure region.
// filter - the filter to apply on the operation.
func (client VirtualMachineExtensionImagesClient) ListVersions(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (result ListVirtualMachineExtensionImage, err error) {
req, err := client.ListVersionsPreparer(ctx, location, publisherName, typeParameter, filter, top, orderby)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", nil, "Failure preparing request")
return
}
resp, err := client.ListVersionsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure sending request")
return
}
result, err = client.ListVersionsResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure responding to request")
}
return
}
// ListVersionsPreparer prepares the ListVersions request.
func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": autorest.Encode("path", location),
"publisherName": autorest.Encode("path", publisherName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"type": autorest.Encode("path", typeParameter),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = autorest.Encode("query", *top)
}
if len(orderby) > 0 {
queryParameters["$orderby"] = autorest.Encode("query", orderby)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListVersionsSender sends the ListVersions request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineExtensionImagesClient) ListVersionsSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListVersionsResponder handles the response to the ListVersions request. The method always
// closes the http.Response Body.
func (client VirtualMachineExtensionImagesClient) ListVersionsResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}

View File

@ -0,0 +1,408 @@
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.
import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
)
// VirtualMachineExtensionsClient is the compute Client
type VirtualMachineExtensionsClient struct {
BaseClient
}
// NewVirtualMachineExtensionsClient creates an instance of the VirtualMachineExtensionsClient client.
func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient {
return NewVirtualMachineExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualMachineExtensionsClientWithBaseURI creates an instance of the VirtualMachineExtensionsClient client.
func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionsClient {
return VirtualMachineExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the operation to create or update the extension.
// Parameters:
// resourceGroupName - the name of the resource group.
// VMName - the name of the virtual machine where the extension should be created or updated.
// VMExtensionName - the name of the virtual machine extension.
// extensionParameters - parameters supplied to the Create Virtual Machine Extension operation.
func (client VirtualMachineExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension) (result VirtualMachineExtensionsCreateOrUpdateFuture, err error) {
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request")
return
}
result, err = client.CreateOrUpdateSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
return
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmExtensionName": autorest.Encode("path", VMExtensionName),
"vmName": autorest.Encode("path", VMName),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
autorest.WithJSON(extensionParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineExtensionsCreateOrUpdateFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Delete the operation to delete the extension.
// Parameters:
// resourceGroupName - the name of the resource group.
// VMName - the name of the virtual machine where the extension should be deleted.
// VMExtensionName - the name of the virtual machine extension.
func (client VirtualMachineExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (result VirtualMachineExtensionsDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, VMName, VMExtensionName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", nil, "Failure preparing request")
return
}
result, err = client.DeleteSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", result.Response(), "Failure sending request")
return
}
return
}
// DeletePreparer prepares the Delete request.
func (client VirtualMachineExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmExtensionName": autorest.Encode("path", VMExtensionName),
"vmName": autorest.Encode("path", VMName),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineExtensionsDeleteFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client VirtualMachineExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// Get the operation to get the extension.
// Parameters:
// resourceGroupName - the name of the resource group.
// VMName - the name of the virtual machine containing the extension.
// VMExtensionName - the name of the virtual machine extension.
// expand - the expand expression to apply on the operation.
func (client VirtualMachineExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, expand string) (result VirtualMachineExtension, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, VMName, VMExtensionName, expand)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client VirtualMachineExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmExtensionName": autorest.Encode("path", VMExtensionName),
"vmName": autorest.Encode("path", VMName),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = autorest.Encode("query", expand)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineExtensionsClient) GetSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client VirtualMachineExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// List the operation to get all extensions of a Virtual Machine.
// Parameters:
// resourceGroupName - the name of the resource group.
// VMName - the name of the virtual machine containing the extension.
// expand - the expand expression to apply on the operation.
func (client VirtualMachineExtensionsClient) List(ctx context.Context, resourceGroupName string, VMName string, expand string) (result VirtualMachineExtensionsListResult, err error) {
req, err := client.ListPreparer(ctx, resourceGroupName, VMName, expand)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "List", nil, "Failure preparing request")
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "List", resp, "Failure sending request")
return
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client VirtualMachineExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmName": autorest.Encode("path", VMName),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = autorest.Encode("query", expand)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineExtensionsClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client VirtualMachineExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineExtensionsListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Update the operation to update the extension.
// Parameters:
// resourceGroupName - the name of the resource group.
// VMName - the name of the virtual machine where the extension should be updated.
// VMExtensionName - the name of the virtual machine extension.
// extensionParameters - parameters supplied to the Update Virtual Machine Extension operation.
func (client VirtualMachineExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (result VirtualMachineExtensionsUpdateFuture, err error) {
req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", nil, "Failure preparing request")
return
}
result, err = client.UpdateSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", result.Response(), "Failure sending request")
return
}
return
}
// UpdatePreparer prepares the Update request.
func (client VirtualMachineExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmExtensionName": autorest.Encode("path", VMExtensionName),
"vmName": autorest.Encode("path", VMName),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
autorest.WithJSON(extensionParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineExtensionsUpdateFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// UpdateResponder handles the response to the Update request. The method always
// closes the http.Response Body.
func (client VirtualMachineExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}

View File

@ -0,0 +1,395 @@
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.
import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
)
// VirtualMachineImagesClient is the compute Client
type VirtualMachineImagesClient struct {
BaseClient
}
// NewVirtualMachineImagesClient creates an instance of the VirtualMachineImagesClient client.
func NewVirtualMachineImagesClient(subscriptionID string) VirtualMachineImagesClient {
return NewVirtualMachineImagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualMachineImagesClientWithBaseURI creates an instance of the VirtualMachineImagesClient client.
func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesClient {
return VirtualMachineImagesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Get gets a virtual machine image.
// Parameters:
// location - the name of a supported Azure region.
// publisherName - a valid image publisher.
// offer - a valid image publisher offer.
// skus - a valid image SKU.
// version - a valid image SKU version.
func (client VirtualMachineImagesClient) Get(ctx context.Context, location string, publisherName string, offer string, skus string, version string) (result VirtualMachineImage, err error) {
req, err := client.GetPreparer(ctx, location, publisherName, offer, skus, version)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client VirtualMachineImagesClient) GetPreparer(ctx context.Context, location string, publisherName string, offer string, skus string, version string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": autorest.Encode("path", location),
"offer": autorest.Encode("path", offer),
"publisherName": autorest.Encode("path", publisherName),
"skus": autorest.Encode("path", skus),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"version": autorest.Encode("path", version),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineImagesClient) GetSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (result VirtualMachineImage, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// List gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU.
// Parameters:
// location - the name of a supported Azure region.
// publisherName - a valid image publisher.
// offer - a valid image publisher offer.
// skus - a valid image SKU.
// filter - the filter to apply on the operation.
func (client VirtualMachineImagesClient) List(ctx context.Context, location string, publisherName string, offer string, skus string, filter string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListPreparer(ctx, location, publisherName, offer, skus, filter, top, orderby)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", nil, "Failure preparing request")
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", resp, "Failure sending request")
return
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client VirtualMachineImagesClient) ListPreparer(ctx context.Context, location string, publisherName string, offer string, skus string, filter string, top *int32, orderby string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": autorest.Encode("path", location),
"offer": autorest.Encode("path", offer),
"publisherName": autorest.Encode("path", publisherName),
"skus": autorest.Encode("path", skus),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = autorest.Encode("query", *top)
}
if len(orderby) > 0 {
queryParameters["$orderby"] = autorest.Encode("query", orderby)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineImagesClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListOffers gets a list of virtual machine image offers for the specified location and publisher.
// Parameters:
// location - the name of a supported Azure region.
// publisherName - a valid image publisher.
func (client VirtualMachineImagesClient) ListOffers(ctx context.Context, location string, publisherName string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListOffersPreparer(ctx, location, publisherName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", nil, "Failure preparing request")
return
}
resp, err := client.ListOffersSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure sending request")
return
}
result, err = client.ListOffersResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure responding to request")
}
return
}
// ListOffersPreparer prepares the ListOffers request.
func (client VirtualMachineImagesClient) ListOffersPreparer(ctx context.Context, location string, publisherName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": autorest.Encode("path", location),
"publisherName": autorest.Encode("path", publisherName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListOffersSender sends the ListOffers request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineImagesClient) ListOffersSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListOffersResponder handles the response to the ListOffers request. The method always
// closes the http.Response Body.
func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListPublishers gets a list of virtual machine image publishers for the specified Azure location.
// Parameters:
// location - the name of a supported Azure region.
func (client VirtualMachineImagesClient) ListPublishers(ctx context.Context, location string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListPublishersPreparer(ctx, location)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", nil, "Failure preparing request")
return
}
resp, err := client.ListPublishersSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure sending request")
return
}
result, err = client.ListPublishersResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure responding to request")
}
return
}
// ListPublishersPreparer prepares the ListPublishers request.
func (client VirtualMachineImagesClient) ListPublishersPreparer(ctx context.Context, location string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": autorest.Encode("path", location),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListPublishersSender sends the ListPublishers request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineImagesClient) ListPublishersSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListPublishersResponder handles the response to the ListPublishers request. The method always
// closes the http.Response Body.
func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListSkus gets a list of virtual machine image SKUs for the specified location, publisher, and offer.
// Parameters:
// location - the name of a supported Azure region.
// publisherName - a valid image publisher.
// offer - a valid image publisher offer.
func (client VirtualMachineImagesClient) ListSkus(ctx context.Context, location string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListSkusPreparer(ctx, location, publisherName, offer)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", nil, "Failure preparing request")
return
}
resp, err := client.ListSkusSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure sending request")
return
}
result, err = client.ListSkusResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure responding to request")
}
return
}
// ListSkusPreparer prepares the ListSkus request.
func (client VirtualMachineImagesClient) ListSkusPreparer(ctx context.Context, location string, publisherName string, offer string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": autorest.Encode("path", location),
"offer": autorest.Encode("path", offer),
"publisherName": autorest.Encode("path", publisherName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListSkusSender sends the ListSkus request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineImagesClient) ListSkusSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListSkusResponder handles the response to the ListSkus request. The method always
// closes the http.Response Body.
func (client VirtualMachineImagesClient) ListSkusResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result.Value),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}

View File

@ -0,0 +1,213 @@
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.
import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
"net/http"
)
// VirtualMachineRunCommandsClient is the compute Client
type VirtualMachineRunCommandsClient struct {
BaseClient
}
// NewVirtualMachineRunCommandsClient creates an instance of the VirtualMachineRunCommandsClient client.
func NewVirtualMachineRunCommandsClient(subscriptionID string) VirtualMachineRunCommandsClient {
return NewVirtualMachineRunCommandsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualMachineRunCommandsClientWithBaseURI creates an instance of the VirtualMachineRunCommandsClient client.
func NewVirtualMachineRunCommandsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineRunCommandsClient {
return VirtualMachineRunCommandsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Get gets specific run command for a subscription in a location.
// Parameters:
// location - the location upon which run commands is queried.
// commandID - the command id.
func (client VirtualMachineRunCommandsClient) Get(ctx context.Context, location string, commandID string) (result RunCommandDocument, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: location,
Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewError("compute.VirtualMachineRunCommandsClient", "Get", err.Error())
}
req, err := client.GetPreparer(ctx, location, commandID)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client VirtualMachineRunCommandsClient) GetPreparer(ctx context.Context, location string, commandID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"commandId": autorest.Encode("path", commandID),
"location": autorest.Encode("path", location),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineRunCommandsClient) GetSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client VirtualMachineRunCommandsClient) GetResponder(resp *http.Response) (result RunCommandDocument, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// List lists all available run commands for a subscription in a location.
// Parameters:
// location - the location upon which run commands is queried.
func (client VirtualMachineRunCommandsClient) List(ctx context.Context, location string) (result RunCommandListResultPage, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: location,
Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewError("compute.VirtualMachineRunCommandsClient", "List", err.Error())
}
result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, location)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", nil, "Failure preparing request")
return
}
resp, err := client.ListSender(req)
if err != nil {
result.rclr.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure sending request")
return
}
result.rclr, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client VirtualMachineRunCommandsClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": autorest.Encode("path", location),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineRunCommandsClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client VirtualMachineRunCommandsClient) ListResponder(resp *http.Response) (result RunCommandListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// listNextResults retrieves the next set of results, if any.
func (client VirtualMachineRunCommandsClient) listNextResults(lastResults RunCommandListResult) (result RunCommandListResult, err error) {
req, err := lastResults.runCommandListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listNextResults", resp, "Failure sending next results request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listNextResults", resp, "Failure responding to next results request")
}
return
}
// ListComplete enumerates all values, automatically crossing page boundaries as required.
func (client VirtualMachineRunCommandsClient) ListComplete(ctx context.Context, location string) (result RunCommandListResultIterator, err error) {
result.page, err = client.List(ctx, location)
return
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,357 @@
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.
import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
)
// VirtualMachineScaleSetExtensionsClient is the compute Client
type VirtualMachineScaleSetExtensionsClient struct {
BaseClient
}
// NewVirtualMachineScaleSetExtensionsClient creates an instance of the VirtualMachineScaleSetExtensionsClient client.
func NewVirtualMachineScaleSetExtensionsClient(subscriptionID string) VirtualMachineScaleSetExtensionsClient {
return NewVirtualMachineScaleSetExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualMachineScaleSetExtensionsClientWithBaseURI creates an instance of the
// VirtualMachineScaleSetExtensionsClient client.
func NewVirtualMachineScaleSetExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetExtensionsClient {
return VirtualMachineScaleSetExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the operation to create or update an extension.
// Parameters:
// resourceGroupName - the name of the resource group.
// VMScaleSetName - the name of the VM scale set where the extension should be create or updated.
// vmssExtensionName - the name of the VM scale set extension.
// extensionParameters - parameters supplied to the Create VM scale set Extension operation.
func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension) (result VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) {
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, extensionParameters)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request")
return
}
result, err = client.CreateOrUpdateSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
return
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
"vmssExtensionName": autorest.Encode("path", vmssExtensionName),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters),
autorest.WithJSON(extensionParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Delete the operation to delete the extension.
// Parameters:
// resourceGroupName - the name of the resource group.
// VMScaleSetName - the name of the VM scale set where the extension should be deleted.
// vmssExtensionName - the name of the VM scale set extension.
func (client VirtualMachineScaleSetExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (result VirtualMachineScaleSetExtensionsDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", nil, "Failure preparing request")
return
}
result, err = client.DeleteSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", result.Response(), "Failure sending request")
return
}
return
}
// DeletePreparer prepares the Delete request.
func (client VirtualMachineScaleSetExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
"vmssExtensionName": autorest.Encode("path", vmssExtensionName),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetExtensionsDeleteFuture, err error) {
var resp *http.Response
resp, err = autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client VirtualMachineScaleSetExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// Get the operation to get the extension.
// Parameters:
// resourceGroupName - the name of the resource group.
// VMScaleSetName - the name of the VM scale set containing the extension.
// vmssExtensionName - the name of the VM scale set extension.
// expand - the expand expression to apply on the operation.
func (client VirtualMachineScaleSetExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (result VirtualMachineScaleSetExtension, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, expand)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client VirtualMachineScaleSetExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
"vmssExtensionName": autorest.Encode("path", vmssExtensionName),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = autorest.Encode("query", expand)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetExtensionsClient) GetSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client VirtualMachineScaleSetExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// List gets a list of all extensions in a VM scale set.
// Parameters:
// resourceGroupName - the name of the resource group.
// VMScaleSetName - the name of the VM scale set containing the extension.
func (client VirtualMachineScaleSetExtensionsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetExtensionListResultPage, err error) {
result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", nil, "Failure preparing request")
return
}
resp, err := client.ListSender(req)
if err != nil {
result.vmsselr.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure sending request")
return
}
result.vmsselr, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client VirtualMachineScaleSetExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetExtensionsClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client))
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client VirtualMachineScaleSetExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetExtensionListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// listNextResults retrieves the next set of results, if any.
func (client VirtualMachineScaleSetExtensionsClient) listNextResults(lastResults VirtualMachineScaleSetExtensionListResult) (result VirtualMachineScaleSetExtensionListResult, err error) {
req, err := lastResults.virtualMachineScaleSetExtensionListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", resp, "Failure sending next results request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", resp, "Failure responding to next results request")
}
return
}
// ListComplete enumerates all values, automatically crossing page boundaries as required.
func (client VirtualMachineScaleSetExtensionsClient) ListComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetExtensionListResultIterator, err error) {
result.page, err = client.List(ctx, resourceGroupName, VMScaleSetName)
return
}

Some files were not shown because too many files have changed in this diff Show More