diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000000..ef6d2e7625 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +/api/ @AlekSi diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..4bcd9dd8da --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/api/vendor/ +/api/prototool +/api/nginx/*.pem diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..2f2663b60d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,39 @@ +language: go + +go: + - 1.11.x + - master + +matrix: + allow_failures: + - go: master + +before_install: + # install binary protoc release + - curl -L https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip -o ~/protoc.zip + - unzip -q ~/protoc.zip -d ~ + - sudo install -d /usr/local/include/google/protobuf/compiler + - sudo install -m 755 ~/bin/protoc /usr/local/bin/ + - sudo install -m 644 ~/include/google/protobuf/*.proto /usr/local/include/google/protobuf/ + - sudo install -m 644 ~/include/google/protobuf/compiler/*.proto /usr/local/include/google/protobuf/compiler/ + - protoc --version + +install: + # ensure that Gopkg.lock is up-to-date + - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + - make -C api init + - cd api && dep check && cd .. + +script: + - make -C api gen + + # check that generated files are up-to-date + - git status + - git diff --exit-code + +notifications: + slack: + on_success: change + on_failure: always + rooms: + secure: Iy3M4BJaSmkyjwibcEW60i7R+PZJOPTgdvdTB6h7iN5uqqAjhRaA36ujyjyO1swjaP4/t8gJb0IKSd+fYhEedXAReTRPYsYkRDO0Z9MblwT/8XH43eMnRcEjvy1l3ovcOXcfYFCxWv11duBWUpAsnUNexPFsFmEjic7wJvx291iHokrKIq7Ue4TUIqNq0c8ZRmHyTFC+c9RjyO6ouVX64T7h1i4wtDFjlFyrPBipGJenhlJsk93KnuWoSSvmW1Ndz5Mg8Kx09oOrW/JXozjs8Q9sj8GlDQrutv7u8bYX8udL7LG9SHxlBr+ZopKqDA4YlAsZLvq6tEh8cj2w/1hvoU+E/Ei4kP6CIDC0G2iGCsSZGD5lwNHfMZlYav0bMCehB0GsWXFEWz01f7Vkv5rhRL03ODCRjxv3S9o4+OQPIma8W379zYfJ0KeWDUUCraPI7E23RaeyPSzsk2sCzusKlJo3ZQs3sban4uIqjNcN0M44H/of0s+mhF8r/Bnn8QQ2oM7nZASbHKSnuMXtX5+Fht+aC4O1df7E4ICnvRoUdxk0gGtIe1RCKfJc/mcYZZkOaApbyZ+nQLKAs1rCfw0P24QNCsSra4UrtHLX70xs8hR15wJWqCRaDkeCM0Ow2LHjer8/MWwT41wcTih0q4bPtvZlju9X6WgdboYlxA8NSmE= diff --git a/api/Gopkg.lock b/api/Gopkg.lock new file mode 100644 index 0000000000..127acc9292 --- /dev/null +++ b/api/Gopkg.lock @@ -0,0 +1,504 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + digest = "1:352fc094dbd1438593b64251de6788bffdf30f9925cf763c7f62e1fd27142b76" + name = "github.com/PuerkitoBio/purell" + packages = ["."] + pruneopts = "T" + revision = "0bcb03f4b4d0a9428594752bd2a3b9aa0a9d4bd4" + version = "v1.1.0" + +[[projects]] + branch = "master" + digest = "1:c739832d67eb1e9cc478a19cc1a1ccd78df0397bf8a32978b759152e205f644b" + name = "github.com/PuerkitoBio/urlesc" + packages = ["."] + pruneopts = "T" + revision = "de5bf2ad457846296e2031421a34e2568e304e35" + +[[projects]] + digest = "1:297a3c21bf1d3b4695a222e43e982bb52b4b9e156ca2eadbe32b898d0a1ae551" + name = "github.com/asaskevich/govalidator" + packages = ["."] + pruneopts = "T" + revision = "ccb8e960c48f04d6935e72476ae4a51028f9e22f" + version = "v9" + +[[projects]] + digest = "1:7fc160b460a6fc506b37fcca68332464c3f2cd57b6e3f111f26c5bbfd2d5518e" + name = "github.com/fsnotify/fsnotify" + packages = ["."] + pruneopts = "T" + revision = "c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9" + version = "v1.4.7" + +[[projects]] + digest = "1:2cd7915ab26ede7d95b8749e6b1f933f1c6d5398030684e6505940a10f31cfda" + name = "github.com/ghodss/yaml" + packages = ["."] + pruneopts = "T" + revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7" + +[[projects]] + branch = "master" + digest = "1:0ab8d37960557936b3b2ebd497a354d448efe067c42187cfc13549c2bbb0fb5f" + name = "github.com/globalsign/mgo" + packages = [ + "bson", + "internal/json", + ] + pruneopts = "T" + revision = "eeefdecb41b842af6dc652aaea4026e8403e62df" + +[[projects]] + branch = "master" + digest = "1:1aaf46876cac9e95cc5aba95df3f6dd8a22c4c2d41a3e89d82a62123f1714dbd" + name = "github.com/go-openapi/analysis" + packages = [ + ".", + "internal", + ] + pruneopts = "T" + revision = "c701774f4e604d952e4e8c56dee260be696e33c3" + +[[projects]] + branch = "master" + digest = "1:3a139538d237b9aa348ce08037b711de8f1b6077c7d011b100cd5f9e925bfe09" + name = "github.com/go-openapi/errors" + packages = ["."] + pruneopts = "T" + revision = "d9664f9fab8994271e573ed69cf2adfc09b7a800" + +[[projects]] + branch = "master" + digest = "1:8c7cb21f096dc9588be1ce357c0bc7a072873ee424933c5d7a4b40cb7d424830" + name = "github.com/go-openapi/inflect" + packages = ["."] + pruneopts = "T" + revision = "16a898ed1f4943794fb9b0e7afb7376a7619cf21" + +[[projects]] + digest = "1:701ec53dfa0182bf25e5c09e664906f11d697e779b59461a2607dbd4dc75a4f9" + name = "github.com/go-openapi/jsonpointer" + packages = ["."] + pruneopts = "T" + revision = "ef5f0afec364d3b9396b7b77b43dbe26bf1f8004" + version = "v0.17.2" + +[[projects]] + digest = "1:3f17ebd557845adeb347c9e398394e96ebc18e0ec94cc04972be87851a4679e0" + name = "github.com/go-openapi/jsonreference" + packages = ["."] + pruneopts = "T" + revision = "8483a886a90412cd6858df4ea3483dce9c8e35a3" + version = "v0.17.2" + +[[projects]] + branch = "master" + digest = "1:23551234bf38f0ef0c5b62f3934daa3902e8a76a8e9a31e10b0a95f53b494c32" + name = "github.com/go-openapi/loads" + packages = [ + ".", + "fmts", + ] + pruneopts = "T" + revision = "150d36912387ec2f607be674c5be309ddccc0eed" + +[[projects]] + branch = "master" + digest = "1:c89d8f74ab52ebe9a033051fa1b09a33ef106cd2eb7a43fa74b33120aae86de3" + name = "github.com/go-openapi/runtime" + packages = [ + ".", + "client", + "logger", + "middleware", + "middleware/denco", + "middleware/header", + "middleware/untyped", + "security", + ] + pruneopts = "T" + revision = "231d7876b7019dbcbfc97a7ba764379497b67c1d" + +[[projects]] + branch = "master" + digest = "1:76b8b440ca412e287dff607469a5a40a9445fe7168ad1fb85916d87c66011c83" + name = "github.com/go-openapi/spec" + packages = ["."] + pruneopts = "T" + revision = "5bae59e25b21498baea7f9d46e9c147ec106a42e" + +[[projects]] + branch = "master" + digest = "1:9d9d53f7fc98a0a9e1879fa7fead9b7b964cb1a9afd9f74a3e1c0686b47e1af4" + name = "github.com/go-openapi/strfmt" + packages = ["."] + pruneopts = "T" + revision = "edab9990ffc9b4a428f3306ecf4d18a069ca3317" + +[[projects]] + branch = "master" + digest = "1:0d8057a212a27a625bb8e57b1e25fb8e8e4a0feb0b7df543fd46d8d15c31d870" + name = "github.com/go-openapi/swag" + packages = ["."] + pruneopts = "T" + revision = "5899d5c5e619fda5fa86e14795a835f473ca284c" + +[[projects]] + branch = "master" + digest = "1:5ac92b91bd8e0041a5fd9a6309c85557c3e4b47d730be454dea62da21f332c91" + name = "github.com/go-openapi/validate" + packages = ["."] + pruneopts = "T" + revision = "d2eab7d93009e9215fc85b2faa2c2f2a98c2af48" + +[[projects]] + digest = "1:b8960e81a25d4a33a7ee5f1cfe5ebf0412e21d1904eeea6832d00d2f0425e8db" + name = "github.com/go-swagger/go-swagger" + packages = [ + "cmd/swagger", + "cmd/swagger/commands", + "cmd/swagger/commands/generate", + "cmd/swagger/commands/initcmd", + "generator", + "scan", + ] + pruneopts = "T" + revision = "800a3052f0305ab54980f961bd4f1e8b3e5599fe" + version = "v0.17.2" + +[[projects]] + digest = "1:1ba1d79f2810270045c328ae5d674321db34e3aae468eb4233883b473c5c0467" + name = "github.com/golang/glog" + packages = ["."] + pruneopts = "T" + revision = "23def4e6c14b4da8ac2ed8007337bc5eb5007998" + +[[projects]] + digest = "1:a2ecb56e5053d942aafc86738915fb94c9131bac848c543b8b6764365fd69080" + name = "github.com/golang/protobuf" + packages = [ + "jsonpb", + "proto", + "protoc-gen-go", + "protoc-gen-go/descriptor", + "protoc-gen-go/generator", + "protoc-gen-go/generator/internal/remap", + "protoc-gen-go/grpc", + "protoc-gen-go/plugin", + "ptypes", + "ptypes/any", + "ptypes/duration", + "ptypes/struct", + "ptypes/timestamp", + ] + pruneopts = "T" + revision = "aa810b61a9c79d51363740d207bb46cf8e620ed5" + version = "v1.2.0" + +[[projects]] + digest = "1:664d37ea261f0fc73dd17f4a1f5f46d01fbb0b0d75f6375af064824424109b7d" + name = "github.com/gorilla/handlers" + packages = ["."] + pruneopts = "T" + revision = "7e0847f9db758cdebd26c149d0ae9d5d0b9c98ce" + version = "v1.4.0" + +[[projects]] + digest = "1:c4a0b2286ccdfcb4575e19c2bab20d4972ba7fce2ed7cba0941c168708b96f54" + name = "github.com/grpc-ecosystem/grpc-gateway" + packages = [ + "codegenerator", + "protoc-gen-grpc-gateway", + "protoc-gen-grpc-gateway/descriptor", + "protoc-gen-grpc-gateway/generator", + "protoc-gen-grpc-gateway/gengateway", + "protoc-gen-grpc-gateway/httprule", + "protoc-gen-swagger", + "protoc-gen-swagger/genswagger", + "protoc-gen-swagger/options", + "runtime", + "runtime/internal", + "utilities", + ] + pruneopts = "T" + revision = "aeab1d96e0f1368d243e2e5f526aa29d495517bb" + version = "v1.5.1" + +[[projects]] + digest = "1:071bcbf82c289fba4d3f63c876bf4f0ba7eda625cd60795e0a03ccbf949e517a" + name = "github.com/hashicorp/hcl" + packages = [ + ".", + "hcl/ast", + "hcl/parser", + "hcl/printer", + "hcl/scanner", + "hcl/strconv", + "hcl/token", + "json/parser", + "json/scanner", + "json/token", + ] + pruneopts = "T" + revision = "8cb6e5b959231cc1119e43259c4a608f9c51a241" + version = "v1.0.0" + +[[projects]] + digest = "1:3f222a291d2810bdeccb8ba10af58fd087269863c8196f7754cfa0de098a2b56" + name = "github.com/jessevdk/go-flags" + packages = ["."] + pruneopts = "T" + revision = "c6ca198ec95c841fdb89fc0de7496fed11ab854e" + version = "v1.4.0" + +[[projects]] + branch = "master" + digest = "1:ca955a9cd5b50b0f43d2cc3aeb35c951473eeca41b34eb67507f1dbcc0542394" + name = "github.com/kr/pretty" + packages = ["."] + pruneopts = "T" + revision = "73f6ac0b30a98e433b289500d779f50c1a6f0712" + +[[projects]] + digest = "1:d3cea7f1e6ac37e9598c31505121b26aaaccf4fffc58d19c701d3d3725d6553d" + name = "github.com/kr/text" + packages = ["."] + pruneopts = "T" + revision = "e2ffdb16a802fe2bb95e2e35ff34f0e53aeef34f" + version = "v0.1.0" + +[[projects]] + digest = "1:53e8c5c79716437e601696140e8b1801aae4204f4ec54a504333702a49572c4f" + name = "github.com/magiconair/properties" + packages = ["."] + pruneopts = "T" + revision = "c2353362d570a7bfa228149c62842019201cfb71" + version = "v1.8.0" + +[[projects]] + branch = "master" + digest = "1:4be65cb3a11626a0d89fc72b34f62a8768040512d45feb086184ac30fdfbef65" + name = "github.com/mailru/easyjson" + packages = [ + "buffer", + "jlexer", + "jwriter", + ] + pruneopts = "T" + revision = "60711f1a8329503b04e1c88535f419d0bb440bff" + +[[projects]] + digest = "1:53bc4cd4914cd7cd52139990d5170d6dc99067ae31c56530621b18b35fc30318" + name = "github.com/mitchellh/mapstructure" + packages = ["."] + pruneopts = "T" + revision = "3536a929edddb9a5b34bd6861dc4a9647cb459fe" + version = "v1.1.2" + +[[projects]] + digest = "1:ccf9949c9c53e85dcb7e2905fc620571422567040925381e6baa62f0b7b850fe" + name = "github.com/pelletier/go-toml" + packages = ["."] + pruneopts = "T" + revision = "c01d1270ff3e442a8a57cddc1c92dc1138598194" + version = "v1.2.0" + +[[projects]] + digest = "1:b7bf9fd95d38ebe6726a63b7d0320611f7c920c64e2c8313eba0cec51926bf55" + name = "github.com/spf13/afero" + packages = [ + ".", + "mem", + ] + pruneopts = "T" + revision = "d40851caa0d747393da1ffb28f7f9d8b4eeffebd" + version = "v1.1.2" + +[[projects]] + digest = "1:08d65904057412fc0270fc4812a1c90c594186819243160dc779a402d4b6d0bc" + name = "github.com/spf13/cast" + packages = ["."] + pruneopts = "T" + revision = "8c9545af88b134710ab1cd196795e7f2388358d7" + version = "v1.3.0" + +[[projects]] + digest = "1:68ea4e23713989dc20b1bded5d9da2c5f9be14ff9885beef481848edd18c26cb" + name = "github.com/spf13/jwalterweatherman" + packages = ["."] + pruneopts = "T" + revision = "4a4406e478ca629068e7768fc33f3f044173c0a6" + version = "v1.0.0" + +[[projects]] + digest = "1:0f775ea7a72e30d5574267692aaa9ff265aafd15214a7ae7db26bc77f2ca04dc" + name = "github.com/spf13/pflag" + packages = ["."] + pruneopts = "T" + revision = "298182f68c66c05229eb03ac171abe6e309ee79a" + version = "v1.0.3" + +[[projects]] + branch = "master" + digest = "1:0acd3f77907d9a2a9fe9c6b353ff223f92785ab7103d872e8369a8cb1384f420" + name = "github.com/spf13/viper" + packages = ["."] + pruneopts = "T" + revision = "62edee319679b6ceaec16de03b966102d2dea709" + +[[projects]] + digest = "1:e1cd343b3883ced86b6873fe4d2f76799259fba3d1656df6ac0a7fa92644c049" + name = "github.com/toqueteos/webbrowser" + packages = ["."] + pruneopts = "T" + revision = "3232c91b8ede8ca86e8962981d881af78875542f" + version = "v1.1.0" + +[[projects]] + branch = "master" + digest = "1:0c04b2a25e05e53a014eb3329cd9e3759bee811e333cf6db2ec1819d6c2dad31" + name = "golang.org/x/net" + packages = [ + "context", + "http/httpguts", + "http2", + "http2/hpack", + "idna", + "internal/timeseries", + "trace", + ] + pruneopts = "T" + revision = "9b4f9f5ad5197c79fd623a3638e70d8b26cef344" + +[[projects]] + branch = "master" + digest = "1:8e6c1fddbee6ef8cfd1e4c368874d974f085b5424fae5c1a00ec5e23c71e7c40" + name = "golang.org/x/sys" + packages = ["unix"] + pruneopts = "T" + revision = "95b1ffbd15a57cc5abb3f04402b9e8ec0016a52c" + +[[projects]] + digest = "1:6164911cb5e94e8d8d5131d646613ff82c14f5a8ce869de2f6d80d9889df8c5a" + name = "golang.org/x/text" + packages = [ + "collate", + "collate/build", + "internal/colltab", + "internal/gen", + "internal/tag", + "internal/triegen", + "internal/ucd", + "language", + "secure/bidirule", + "transform", + "unicode/bidi", + "unicode/cldr", + "unicode/norm", + "unicode/rangetable", + "width", + ] + pruneopts = "T" + revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" + version = "v0.3.0" + +[[projects]] + branch = "master" + digest = "1:62468f8d9abb738a892313231b2809db45a5b52681fa6084b1cd3dde15fc7cc8" + name = "golang.org/x/tools" + packages = [ + "go/ast/astutil", + "go/buildutil", + "go/internal/cgo", + "go/loader", + "imports", + "internal/fastwalk", + "internal/gopathwalk", + ] + pruneopts = "T" + revision = "f60e5f99f0816fc2d9ecb338008ea420248d2943" + +[[projects]] + digest = "1:3970150423e3f47a6d354b2868f7db632b665463755194aac1a30c4fb341be57" + name = "google.golang.org/genproto" + packages = [ + "googleapis/api/annotations", + "googleapis/rpc/status", + ] + pruneopts = "T" + revision = "383e8b2c3b9e36c4076b235b32537292176bae20" + +[[projects]] + digest = "1:ef437b2116089e1355b910bcbfb66c90d5164c6623f37deb5b94a6973a1ddf16" + name = "google.golang.org/grpc" + packages = [ + ".", + "balancer", + "balancer/base", + "balancer/roundrobin", + "codes", + "connectivity", + "credentials", + "encoding", + "encoding/proto", + "grpclog", + "internal", + "internal/backoff", + "internal/channelz", + "internal/envconfig", + "internal/grpcrand", + "internal/transport", + "keepalive", + "metadata", + "naming", + "peer", + "resolver", + "resolver/dns", + "resolver/passthrough", + "stats", + "status", + "tap", + ] + pruneopts = "T" + revision = "2e463a05d100327ca47ac218281906921038fd95" + version = "v1.16.0" + +[[projects]] + branch = "v2" + digest = "1:342378ac4dcb378a5448dd723f0784ae519383532f5e70ade24132c4c8693202" + name = "gopkg.in/yaml.v2" + packages = ["."] + pruneopts = "T" + revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + input-imports = [ + "github.com/go-openapi/errors", + "github.com/go-openapi/runtime", + "github.com/go-openapi/runtime/client", + "github.com/go-openapi/strfmt", + "github.com/go-openapi/swag", + "github.com/go-openapi/validate", + "github.com/go-swagger/go-swagger/cmd/swagger", + "github.com/golang/protobuf/proto", + "github.com/golang/protobuf/protoc-gen-go", + "github.com/golang/protobuf/ptypes/any", + "github.com/golang/protobuf/ptypes/timestamp", + "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway", + "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger", + "github.com/grpc-ecosystem/grpc-gateway/runtime", + "github.com/grpc-ecosystem/grpc-gateway/utilities", + "golang.org/x/net/context", + "google.golang.org/genproto/googleapis/api/annotations", + "google.golang.org/grpc", + "google.golang.org/grpc/codes", + "google.golang.org/grpc/grpclog", + "google.golang.org/grpc/status", + ] + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/api/Gopkg.toml b/api/Gopkg.toml new file mode 100644 index 0000000000..bc947260ab --- /dev/null +++ b/api/Gopkg.toml @@ -0,0 +1,27 @@ +# tools +required = [ + "github.com/golang/protobuf/protoc-gen-go", + "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway", + "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger", + "github.com/go-swagger/go-swagger/cmd/swagger" +] + +[prune] + go-tests = true + # to keep google/api/annotations.proto and google/protobuf/timestamp.proto + # non-go = true + # unused-packages = true + +# we want all PMM components to use the same versions of key dependecies to avoid nasty suprises +[[constraint]] + name = "github.com/golang/protobuf" + version = "=1.2.0" +[[constraint]] + name = "google.golang.org/grpc" + version = "=1.16.0" +[[constraint]] + name = "github.com/grpc-ecosystem/grpc-gateway" + version = "=1.5.1" +[[constraint]] + name = "github.com/go-swagger/go-swagger" + version = "=0.17.2" diff --git a/api/Makefile b/api/Makefile new file mode 100644 index 0000000000..2453eb522a --- /dev/null +++ b/api/Makefile @@ -0,0 +1,46 @@ +help: ## Display this help message. + @echo "Please use \`make \` where is one of:" + @grep '^[a-zA-Z]' $(MAKEFILE_LIST) | \ + awk -F ':.*?## ' 'NF==2 {printf " %-26s%s\n", $$1, $$2}' + +cert: ## Generate TLS certificate for nginx for local testing with mkcert. + cd nginx && mkcert pmm-api pmm-api.test pmm-api.localhost 127.0.0.1 + +init: ## Install prototool and fill vendor/. + # https://github.com/uber/prototool#installation + curl -L https://github.com/uber/prototool/releases/download/v1.3.0/prototool-$(shell uname -s)-$(shell uname -m) -o ./prototool + chmod +x ./prototool + + dep ensure -v + +gen: clean ## Generate files. + go install -v ./vendor/github.com/golang/protobuf/protoc-gen-go \ + ./vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway \ + ./vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger \ + ./vendor/github.com/go-swagger/go-swagger/cmd/swagger + + ./prototool all + + # no public API for pmm-agent + rm -f agent/*.swagger.json + + swagger mixin inventory/inventory.json inventory/*.swagger.json --output=inventory.swagger.json + swagger validate inventory.swagger.json + rm -f inventory/*.swagger.json + + mkdir json + swagger generate client --spec=inventory.swagger.json --target=json \ + --additional-initialism=pmm \ + --additional-initialism=rds + go install -v ./... + +clean: ## Remove generated files. + find . -name '*.pb.go' -not -path './vendor/*' -delete + find . -name '*.pb.gw.go' -not -path './vendor/*' -delete + find . -name '*.swagger.json' -not -path './vendor/*' -delete + + rm -fr json + +serve: ## Serve API documentation with nginx. + # https://pmm-api.test:8443/ + nginx -p . -c nginx/nginx.conf diff --git a/api/README.md b/api/README.md new file mode 100644 index 0000000000..a21ae3a53b --- /dev/null +++ b/api/README.md @@ -0,0 +1,29 @@ +# pmm-api + +[![Build Status](https://travis-ci.org/percona/pmm.svg?branch=master)](https://travis-ci.org/percona/pmm) + +PMM 2.x APIs. + +## Local setup + +Generate TLS certificate for `nginx` for local testing: +``` +brew install mkcert +mkcert -install +make cert +``` + +Install `prototool` and fill `vendor/`: +``` +make init +``` + +Generate files: +``` +make gen +``` + +Serve API documentation with `nginx`: +``` +make serve +``` diff --git a/api/agent/agent.go b/api/agent/agent.go new file mode 100644 index 0000000000..6d9a249f17 --- /dev/null +++ b/api/agent/agent.go @@ -0,0 +1,8 @@ +package agent + +// Workaround for https://github.com/golang/protobuf/issues/261. +// Useful for helper functions. +type ( + ServerMessagePayload = isServerMessage_Payload + AgentMessagePayload = isAgentMessage_Payload +) diff --git a/api/agent/agent.pb.go b/api/agent/agent.pb.go new file mode 100644 index 0000000000..bf5c0c8a55 --- /dev/null +++ b/api/agent/agent.pb.go @@ -0,0 +1,1174 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: agent/agent.proto + +package agent + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import any "github.com/golang/protobuf/ptypes/any" +import timestamp "github.com/golang/protobuf/ptypes/timestamp" +import inventory "github.com/percona/pmm/api/inventory" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type RegisterRequest struct { + Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RegisterRequest) Reset() { *m = RegisterRequest{} } +func (m *RegisterRequest) String() string { return proto.CompactTextString(m) } +func (*RegisterRequest) ProtoMessage() {} +func (*RegisterRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_agent_a381d3b1fe9961bc, []int{0} +} +func (m *RegisterRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RegisterRequest.Unmarshal(m, b) +} +func (m *RegisterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RegisterRequest.Marshal(b, m, deterministic) +} +func (dst *RegisterRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RegisterRequest.Merge(dst, src) +} +func (m *RegisterRequest) XXX_Size() int { + return xxx_messageInfo_RegisterRequest.Size(m) +} +func (m *RegisterRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RegisterRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_RegisterRequest proto.InternalMessageInfo + +func (m *RegisterRequest) GetHostname() string { + if m != nil { + return m.Hostname + } + return "" +} + +type RegisterResponse struct { + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RegisterResponse) Reset() { *m = RegisterResponse{} } +func (m *RegisterResponse) String() string { return proto.CompactTextString(m) } +func (*RegisterResponse) ProtoMessage() {} +func (*RegisterResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_agent_a381d3b1fe9961bc, []int{1} +} +func (m *RegisterResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RegisterResponse.Unmarshal(m, b) +} +func (m *RegisterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RegisterResponse.Marshal(b, m, deterministic) +} +func (dst *RegisterResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_RegisterResponse.Merge(dst, src) +} +func (m *RegisterResponse) XXX_Size() int { + return xxx_messageInfo_RegisterResponse.Size(m) +} +func (m *RegisterResponse) XXX_DiscardUnknown() { + xxx_messageInfo_RegisterResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_RegisterResponse proto.InternalMessageInfo + +func (m *RegisterResponse) GetUuid() string { + if m != nil { + return m.Uuid + } + return "" +} + +// AuthRequest is an AgentMessage for authenticating pmm-agent on pmm-managed. +type AuthRequest struct { + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthRequest) Reset() { *m = AuthRequest{} } +func (m *AuthRequest) String() string { return proto.CompactTextString(m) } +func (*AuthRequest) ProtoMessage() {} +func (*AuthRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_agent_a381d3b1fe9961bc, []int{2} +} +func (m *AuthRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AuthRequest.Unmarshal(m, b) +} +func (m *AuthRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AuthRequest.Marshal(b, m, deterministic) +} +func (dst *AuthRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthRequest.Merge(dst, src) +} +func (m *AuthRequest) XXX_Size() int { + return xxx_messageInfo_AuthRequest.Size(m) +} +func (m *AuthRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AuthRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AuthRequest proto.InternalMessageInfo + +func (m *AuthRequest) GetUuid() string { + if m != nil { + return m.Uuid + } + return "" +} + +func (m *AuthRequest) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +// AuthResponse is a ServerMessage for successful authentication. +type AuthResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AuthResponse) Reset() { *m = AuthResponse{} } +func (m *AuthResponse) String() string { return proto.CompactTextString(m) } +func (*AuthResponse) ProtoMessage() {} +func (*AuthResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_agent_a381d3b1fe9961bc, []int{3} +} +func (m *AuthResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AuthResponse.Unmarshal(m, b) +} +func (m *AuthResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AuthResponse.Marshal(b, m, deterministic) +} +func (dst *AuthResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthResponse.Merge(dst, src) +} +func (m *AuthResponse) XXX_Size() int { + return xxx_messageInfo_AuthResponse.Size(m) +} +func (m *AuthResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AuthResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AuthResponse proto.InternalMessageInfo + +// QANDataRequest is an AgentMessage for sending QAN data. +type QANDataRequest struct { + Data *any.Any `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *QANDataRequest) Reset() { *m = QANDataRequest{} } +func (m *QANDataRequest) String() string { return proto.CompactTextString(m) } +func (*QANDataRequest) ProtoMessage() {} +func (*QANDataRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_agent_a381d3b1fe9961bc, []int{4} +} +func (m *QANDataRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_QANDataRequest.Unmarshal(m, b) +} +func (m *QANDataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_QANDataRequest.Marshal(b, m, deterministic) +} +func (dst *QANDataRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QANDataRequest.Merge(dst, src) +} +func (m *QANDataRequest) XXX_Size() int { + return xxx_messageInfo_QANDataRequest.Size(m) +} +func (m *QANDataRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QANDataRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QANDataRequest proto.InternalMessageInfo + +func (m *QANDataRequest) GetData() *any.Any { + if m != nil { + return m.Data + } + return nil +} + +// QANDataResponse is a ServerMessage for QAN data acceptance. +type QANDataResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *QANDataResponse) Reset() { *m = QANDataResponse{} } +func (m *QANDataResponse) String() string { return proto.CompactTextString(m) } +func (*QANDataResponse) ProtoMessage() {} +func (*QANDataResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_agent_a381d3b1fe9961bc, []int{5} +} +func (m *QANDataResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_QANDataResponse.Unmarshal(m, b) +} +func (m *QANDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_QANDataResponse.Marshal(b, m, deterministic) +} +func (dst *QANDataResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QANDataResponse.Merge(dst, src) +} +func (m *QANDataResponse) XXX_Size() int { + return xxx_messageInfo_QANDataResponse.Size(m) +} +func (m *QANDataResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QANDataResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QANDataResponse proto.InternalMessageInfo + +// PingRequest is a ServerMessage for checking connectivity, latency and clock drift. +type PingRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PingRequest) Reset() { *m = PingRequest{} } +func (m *PingRequest) String() string { return proto.CompactTextString(m) } +func (*PingRequest) ProtoMessage() {} +func (*PingRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_agent_a381d3b1fe9961bc, []int{6} +} +func (m *PingRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PingRequest.Unmarshal(m, b) +} +func (m *PingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PingRequest.Marshal(b, m, deterministic) +} +func (dst *PingRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PingRequest.Merge(dst, src) +} +func (m *PingRequest) XXX_Size() int { + return xxx_messageInfo_PingRequest.Size(m) +} +func (m *PingRequest) XXX_DiscardUnknown() { + xxx_messageInfo_PingRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_PingRequest proto.InternalMessageInfo + +// PingResponse is an AgentMessage with current time for measuring clock drift. +type PingResponse struct { + CurrentTime *timestamp.Timestamp `protobuf:"bytes,1,opt,name=current_time,json=currentTime,proto3" json:"current_time,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PingResponse) Reset() { *m = PingResponse{} } +func (m *PingResponse) String() string { return proto.CompactTextString(m) } +func (*PingResponse) ProtoMessage() {} +func (*PingResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_agent_a381d3b1fe9961bc, []int{7} +} +func (m *PingResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PingResponse.Unmarshal(m, b) +} +func (m *PingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PingResponse.Marshal(b, m, deterministic) +} +func (dst *PingResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_PingResponse.Merge(dst, src) +} +func (m *PingResponse) XXX_Size() int { + return xxx_messageInfo_PingResponse.Size(m) +} +func (m *PingResponse) XXX_DiscardUnknown() { + xxx_messageInfo_PingResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_PingResponse proto.InternalMessageInfo + +func (m *PingResponse) GetCurrentTime() *timestamp.Timestamp { + if m != nil { + return m.CurrentTime + } + return nil +} + +// SetStateRequest is a ServerMessage asking pmm-agent to run agents according to desired state. +type SetStateRequest struct { + AgentProcesses []*SetStateRequest_AgentProcess `protobuf:"bytes,1,rep,name=agent_processes,json=agentProcesses,proto3" json:"agent_processes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetStateRequest) Reset() { *m = SetStateRequest{} } +func (m *SetStateRequest) String() string { return proto.CompactTextString(m) } +func (*SetStateRequest) ProtoMessage() {} +func (*SetStateRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_agent_a381d3b1fe9961bc, []int{8} +} +func (m *SetStateRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetStateRequest.Unmarshal(m, b) +} +func (m *SetStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetStateRequest.Marshal(b, m, deterministic) +} +func (dst *SetStateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetStateRequest.Merge(dst, src) +} +func (m *SetStateRequest) XXX_Size() int { + return xxx_messageInfo_SetStateRequest.Size(m) +} +func (m *SetStateRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SetStateRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SetStateRequest proto.InternalMessageInfo + +func (m *SetStateRequest) GetAgentProcesses() []*SetStateRequest_AgentProcess { + if m != nil { + return m.AgentProcesses + } + return nil +} + +// AgentProcess describes desired configuration of a single agent. +type SetStateRequest_AgentProcess struct { + AgentId uint32 `protobuf:"varint,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + Type inventory.AgentType `protobuf:"varint,2,opt,name=type,proto3,enum=inventory.AgentType" json:"type,omitempty"` + Args []string `protobuf:"bytes,3,rep,name=args,proto3" json:"args,omitempty"` + Env []string `protobuf:"bytes,4,rep,name=env,proto3" json:"env,omitempty"` + Configs map[string]string `protobuf:"bytes,5,rep,name=configs,proto3" json:"configs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetStateRequest_AgentProcess) Reset() { *m = SetStateRequest_AgentProcess{} } +func (m *SetStateRequest_AgentProcess) String() string { return proto.CompactTextString(m) } +func (*SetStateRequest_AgentProcess) ProtoMessage() {} +func (*SetStateRequest_AgentProcess) Descriptor() ([]byte, []int) { + return fileDescriptor_agent_a381d3b1fe9961bc, []int{8, 0} +} +func (m *SetStateRequest_AgentProcess) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetStateRequest_AgentProcess.Unmarshal(m, b) +} +func (m *SetStateRequest_AgentProcess) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetStateRequest_AgentProcess.Marshal(b, m, deterministic) +} +func (dst *SetStateRequest_AgentProcess) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetStateRequest_AgentProcess.Merge(dst, src) +} +func (m *SetStateRequest_AgentProcess) XXX_Size() int { + return xxx_messageInfo_SetStateRequest_AgentProcess.Size(m) +} +func (m *SetStateRequest_AgentProcess) XXX_DiscardUnknown() { + xxx_messageInfo_SetStateRequest_AgentProcess.DiscardUnknown(m) +} + +var xxx_messageInfo_SetStateRequest_AgentProcess proto.InternalMessageInfo + +func (m *SetStateRequest_AgentProcess) GetAgentId() uint32 { + if m != nil { + return m.AgentId + } + return 0 +} + +func (m *SetStateRequest_AgentProcess) GetType() inventory.AgentType { + if m != nil { + return m.Type + } + return inventory.AgentType_AGENT_TYPE_INVALID +} + +func (m *SetStateRequest_AgentProcess) GetArgs() []string { + if m != nil { + return m.Args + } + return nil +} + +func (m *SetStateRequest_AgentProcess) GetEnv() []string { + if m != nil { + return m.Env + } + return nil +} + +func (m *SetStateRequest_AgentProcess) GetConfigs() map[string]string { + if m != nil { + return m.Configs + } + return nil +} + +// SetStateResponse is an AgentMessage describing agent statuses. +type SetStateResponse struct { + AgentProcesses []*SetStateResponse_AgentProcess `protobuf:"bytes,1,rep,name=agent_processes,json=agentProcesses,proto3" json:"agent_processes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetStateResponse) Reset() { *m = SetStateResponse{} } +func (m *SetStateResponse) String() string { return proto.CompactTextString(m) } +func (*SetStateResponse) ProtoMessage() {} +func (*SetStateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_agent_a381d3b1fe9961bc, []int{9} +} +func (m *SetStateResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetStateResponse.Unmarshal(m, b) +} +func (m *SetStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetStateResponse.Marshal(b, m, deterministic) +} +func (dst *SetStateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetStateResponse.Merge(dst, src) +} +func (m *SetStateResponse) XXX_Size() int { + return xxx_messageInfo_SetStateResponse.Size(m) +} +func (m *SetStateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SetStateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_SetStateResponse proto.InternalMessageInfo + +func (m *SetStateResponse) GetAgentProcesses() []*SetStateResponse_AgentProcess { + if m != nil { + return m.AgentProcesses + } + return nil +} + +// AgentProcess describes status of a single agent. +type SetStateResponse_AgentProcess struct { + AgentId uint32 `protobuf:"varint,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` + Status inventory.AgentProcessStatus `protobuf:"varint,2,opt,name=status,proto3,enum=inventory.AgentProcessStatus" json:"status,omitempty"` + ListenPort uint32 `protobuf:"varint,3,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetStateResponse_AgentProcess) Reset() { *m = SetStateResponse_AgentProcess{} } +func (m *SetStateResponse_AgentProcess) String() string { return proto.CompactTextString(m) } +func (*SetStateResponse_AgentProcess) ProtoMessage() {} +func (*SetStateResponse_AgentProcess) Descriptor() ([]byte, []int) { + return fileDescriptor_agent_a381d3b1fe9961bc, []int{9, 0} +} +func (m *SetStateResponse_AgentProcess) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetStateResponse_AgentProcess.Unmarshal(m, b) +} +func (m *SetStateResponse_AgentProcess) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetStateResponse_AgentProcess.Marshal(b, m, deterministic) +} +func (dst *SetStateResponse_AgentProcess) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetStateResponse_AgentProcess.Merge(dst, src) +} +func (m *SetStateResponse_AgentProcess) XXX_Size() int { + return xxx_messageInfo_SetStateResponse_AgentProcess.Size(m) +} +func (m *SetStateResponse_AgentProcess) XXX_DiscardUnknown() { + xxx_messageInfo_SetStateResponse_AgentProcess.DiscardUnknown(m) +} + +var xxx_messageInfo_SetStateResponse_AgentProcess proto.InternalMessageInfo + +func (m *SetStateResponse_AgentProcess) GetAgentId() uint32 { + if m != nil { + return m.AgentId + } + return 0 +} + +func (m *SetStateResponse_AgentProcess) GetStatus() inventory.AgentProcessStatus { + if m != nil { + return m.Status + } + return inventory.AgentProcessStatus_AGENT_PROCESS_STATUS_INVALID +} + +func (m *SetStateResponse_AgentProcess) GetListenPort() uint32 { + if m != nil { + return m.ListenPort + } + return 0 +} + +type AgentMessage struct { + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // Types that are valid to be assigned to Payload: + // *AgentMessage_Auth + // *AgentMessage_QanData + // *AgentMessage_Ping + // *AgentMessage_State + Payload isAgentMessage_Payload `protobuf_oneof:"payload"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AgentMessage) Reset() { *m = AgentMessage{} } +func (m *AgentMessage) String() string { return proto.CompactTextString(m) } +func (*AgentMessage) ProtoMessage() {} +func (*AgentMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_agent_a381d3b1fe9961bc, []int{10} +} +func (m *AgentMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AgentMessage.Unmarshal(m, b) +} +func (m *AgentMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AgentMessage.Marshal(b, m, deterministic) +} +func (dst *AgentMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_AgentMessage.Merge(dst, src) +} +func (m *AgentMessage) XXX_Size() int { + return xxx_messageInfo_AgentMessage.Size(m) +} +func (m *AgentMessage) XXX_DiscardUnknown() { + xxx_messageInfo_AgentMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_AgentMessage proto.InternalMessageInfo + +func (m *AgentMessage) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +type isAgentMessage_Payload interface { + isAgentMessage_Payload() +} + +type AgentMessage_Auth struct { + Auth *AuthRequest `protobuf:"bytes,2,opt,name=auth,proto3,oneof"` +} + +type AgentMessage_QanData struct { + QanData *QANDataRequest `protobuf:"bytes,3,opt,name=qan_data,json=qanData,proto3,oneof"` +} + +type AgentMessage_Ping struct { + Ping *PingResponse `protobuf:"bytes,8,opt,name=ping,proto3,oneof"` +} + +type AgentMessage_State struct { + State *SetStateResponse `protobuf:"bytes,9,opt,name=state,proto3,oneof"` +} + +func (*AgentMessage_Auth) isAgentMessage_Payload() {} + +func (*AgentMessage_QanData) isAgentMessage_Payload() {} + +func (*AgentMessage_Ping) isAgentMessage_Payload() {} + +func (*AgentMessage_State) isAgentMessage_Payload() {} + +func (m *AgentMessage) GetPayload() isAgentMessage_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *AgentMessage) GetAuth() *AuthRequest { + if x, ok := m.GetPayload().(*AgentMessage_Auth); ok { + return x.Auth + } + return nil +} + +func (m *AgentMessage) GetQanData() *QANDataRequest { + if x, ok := m.GetPayload().(*AgentMessage_QanData); ok { + return x.QanData + } + return nil +} + +func (m *AgentMessage) GetPing() *PingResponse { + if x, ok := m.GetPayload().(*AgentMessage_Ping); ok { + return x.Ping + } + return nil +} + +func (m *AgentMessage) GetState() *SetStateResponse { + if x, ok := m.GetPayload().(*AgentMessage_State); ok { + return x.State + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*AgentMessage) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _AgentMessage_OneofMarshaler, _AgentMessage_OneofUnmarshaler, _AgentMessage_OneofSizer, []interface{}{ + (*AgentMessage_Auth)(nil), + (*AgentMessage_QanData)(nil), + (*AgentMessage_Ping)(nil), + (*AgentMessage_State)(nil), + } +} + +func _AgentMessage_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*AgentMessage) + // payload + switch x := m.Payload.(type) { + case *AgentMessage_Auth: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Auth); err != nil { + return err + } + case *AgentMessage_QanData: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.QanData); err != nil { + return err + } + case *AgentMessage_Ping: + b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Ping); err != nil { + return err + } + case *AgentMessage_State: + b.EncodeVarint(9<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.State); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("AgentMessage.Payload has unexpected type %T", x) + } + return nil +} + +func _AgentMessage_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*AgentMessage) + switch tag { + case 2: // payload.auth + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(AuthRequest) + err := b.DecodeMessage(msg) + m.Payload = &AgentMessage_Auth{msg} + return true, err + case 3: // payload.qan_data + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(QANDataRequest) + err := b.DecodeMessage(msg) + m.Payload = &AgentMessage_QanData{msg} + return true, err + case 8: // payload.ping + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PingResponse) + err := b.DecodeMessage(msg) + m.Payload = &AgentMessage_Ping{msg} + return true, err + case 9: // payload.state + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SetStateResponse) + err := b.DecodeMessage(msg) + m.Payload = &AgentMessage_State{msg} + return true, err + default: + return false, nil + } +} + +func _AgentMessage_OneofSizer(msg proto.Message) (n int) { + m := msg.(*AgentMessage) + // payload + switch x := m.Payload.(type) { + case *AgentMessage_Auth: + s := proto.Size(x.Auth) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *AgentMessage_QanData: + s := proto.Size(x.QanData) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *AgentMessage_Ping: + s := proto.Size(x.Ping) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *AgentMessage_State: + s := proto.Size(x.State) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type ServerMessage struct { + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // Types that are valid to be assigned to Payload: + // *ServerMessage_Auth + // *ServerMessage_QanData + // *ServerMessage_Ping + // *ServerMessage_State + Payload isServerMessage_Payload `protobuf_oneof:"payload"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ServerMessage) Reset() { *m = ServerMessage{} } +func (m *ServerMessage) String() string { return proto.CompactTextString(m) } +func (*ServerMessage) ProtoMessage() {} +func (*ServerMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_agent_a381d3b1fe9961bc, []int{11} +} +func (m *ServerMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ServerMessage.Unmarshal(m, b) +} +func (m *ServerMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ServerMessage.Marshal(b, m, deterministic) +} +func (dst *ServerMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServerMessage.Merge(dst, src) +} +func (m *ServerMessage) XXX_Size() int { + return xxx_messageInfo_ServerMessage.Size(m) +} +func (m *ServerMessage) XXX_DiscardUnknown() { + xxx_messageInfo_ServerMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_ServerMessage proto.InternalMessageInfo + +func (m *ServerMessage) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +type isServerMessage_Payload interface { + isServerMessage_Payload() +} + +type ServerMessage_Auth struct { + Auth *AuthResponse `protobuf:"bytes,2,opt,name=auth,proto3,oneof"` +} + +type ServerMessage_QanData struct { + QanData *QANDataResponse `protobuf:"bytes,3,opt,name=qan_data,json=qanData,proto3,oneof"` +} + +type ServerMessage_Ping struct { + Ping *PingRequest `protobuf:"bytes,8,opt,name=ping,proto3,oneof"` +} + +type ServerMessage_State struct { + State *SetStateRequest `protobuf:"bytes,9,opt,name=state,proto3,oneof"` +} + +func (*ServerMessage_Auth) isServerMessage_Payload() {} + +func (*ServerMessage_QanData) isServerMessage_Payload() {} + +func (*ServerMessage_Ping) isServerMessage_Payload() {} + +func (*ServerMessage_State) isServerMessage_Payload() {} + +func (m *ServerMessage) GetPayload() isServerMessage_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *ServerMessage) GetAuth() *AuthResponse { + if x, ok := m.GetPayload().(*ServerMessage_Auth); ok { + return x.Auth + } + return nil +} + +func (m *ServerMessage) GetQanData() *QANDataResponse { + if x, ok := m.GetPayload().(*ServerMessage_QanData); ok { + return x.QanData + } + return nil +} + +func (m *ServerMessage) GetPing() *PingRequest { + if x, ok := m.GetPayload().(*ServerMessage_Ping); ok { + return x.Ping + } + return nil +} + +func (m *ServerMessage) GetState() *SetStateRequest { + if x, ok := m.GetPayload().(*ServerMessage_State); ok { + return x.State + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ServerMessage) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ServerMessage_OneofMarshaler, _ServerMessage_OneofUnmarshaler, _ServerMessage_OneofSizer, []interface{}{ + (*ServerMessage_Auth)(nil), + (*ServerMessage_QanData)(nil), + (*ServerMessage_Ping)(nil), + (*ServerMessage_State)(nil), + } +} + +func _ServerMessage_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ServerMessage) + // payload + switch x := m.Payload.(type) { + case *ServerMessage_Auth: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Auth); err != nil { + return err + } + case *ServerMessage_QanData: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.QanData); err != nil { + return err + } + case *ServerMessage_Ping: + b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Ping); err != nil { + return err + } + case *ServerMessage_State: + b.EncodeVarint(9<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.State); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("ServerMessage.Payload has unexpected type %T", x) + } + return nil +} + +func _ServerMessage_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ServerMessage) + switch tag { + case 2: // payload.auth + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(AuthResponse) + err := b.DecodeMessage(msg) + m.Payload = &ServerMessage_Auth{msg} + return true, err + case 3: // payload.qan_data + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(QANDataResponse) + err := b.DecodeMessage(msg) + m.Payload = &ServerMessage_QanData{msg} + return true, err + case 8: // payload.ping + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(PingRequest) + err := b.DecodeMessage(msg) + m.Payload = &ServerMessage_Ping{msg} + return true, err + case 9: // payload.state + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SetStateRequest) + err := b.DecodeMessage(msg) + m.Payload = &ServerMessage_State{msg} + return true, err + default: + return false, nil + } +} + +func _ServerMessage_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ServerMessage) + // payload + switch x := m.Payload.(type) { + case *ServerMessage_Auth: + s := proto.Size(x.Auth) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ServerMessage_QanData: + s := proto.Size(x.QanData) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ServerMessage_Ping: + s := proto.Size(x.Ping) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *ServerMessage_State: + s := proto.Size(x.State) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +func init() { + proto.RegisterType((*RegisterRequest)(nil), "agent.RegisterRequest") + proto.RegisterType((*RegisterResponse)(nil), "agent.RegisterResponse") + proto.RegisterType((*AuthRequest)(nil), "agent.AuthRequest") + proto.RegisterType((*AuthResponse)(nil), "agent.AuthResponse") + proto.RegisterType((*QANDataRequest)(nil), "agent.QANDataRequest") + proto.RegisterType((*QANDataResponse)(nil), "agent.QANDataResponse") + proto.RegisterType((*PingRequest)(nil), "agent.PingRequest") + proto.RegisterType((*PingResponse)(nil), "agent.PingResponse") + proto.RegisterType((*SetStateRequest)(nil), "agent.SetStateRequest") + proto.RegisterType((*SetStateRequest_AgentProcess)(nil), "agent.SetStateRequest.AgentProcess") + proto.RegisterMapType((map[string]string)(nil), "agent.SetStateRequest.AgentProcess.ConfigsEntry") + proto.RegisterType((*SetStateResponse)(nil), "agent.SetStateResponse") + proto.RegisterType((*SetStateResponse_AgentProcess)(nil), "agent.SetStateResponse.AgentProcess") + proto.RegisterType((*AgentMessage)(nil), "agent.AgentMessage") + proto.RegisterType((*ServerMessage)(nil), "agent.ServerMessage") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// AgentClient is the client API for Agent service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type AgentClient interface { + // Register adds pmm-agent to pmm-managed database and returns agent's UUID. + Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) + // Connect establishes two-way communication channel between pmm-agent and pmm-managed. + Connect(ctx context.Context, opts ...grpc.CallOption) (Agent_ConnectClient, error) +} + +type agentClient struct { + cc *grpc.ClientConn +} + +func NewAgentClient(cc *grpc.ClientConn) AgentClient { + return &agentClient{cc} +} + +func (c *agentClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) { + out := new(RegisterResponse) + err := c.cc.Invoke(ctx, "/agent.Agent/Register", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *agentClient) Connect(ctx context.Context, opts ...grpc.CallOption) (Agent_ConnectClient, error) { + stream, err := c.cc.NewStream(ctx, &_Agent_serviceDesc.Streams[0], "/agent.Agent/Connect", opts...) + if err != nil { + return nil, err + } + x := &agentConnectClient{stream} + return x, nil +} + +type Agent_ConnectClient interface { + Send(*AgentMessage) error + Recv() (*ServerMessage, error) + grpc.ClientStream +} + +type agentConnectClient struct { + grpc.ClientStream +} + +func (x *agentConnectClient) Send(m *AgentMessage) error { + return x.ClientStream.SendMsg(m) +} + +func (x *agentConnectClient) Recv() (*ServerMessage, error) { + m := new(ServerMessage) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// AgentServer is the server API for Agent service. +type AgentServer interface { + // Register adds pmm-agent to pmm-managed database and returns agent's UUID. + Register(context.Context, *RegisterRequest) (*RegisterResponse, error) + // Connect establishes two-way communication channel between pmm-agent and pmm-managed. + Connect(Agent_ConnectServer) error +} + +func RegisterAgentServer(s *grpc.Server, srv AgentServer) { + s.RegisterService(&_Agent_serviceDesc, srv) +} + +func _Agent_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RegisterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentServer).Register(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/agent.Agent/Register", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentServer).Register(ctx, req.(*RegisterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Agent_Connect_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(AgentServer).Connect(&agentConnectServer{stream}) +} + +type Agent_ConnectServer interface { + Send(*ServerMessage) error + Recv() (*AgentMessage, error) + grpc.ServerStream +} + +type agentConnectServer struct { + grpc.ServerStream +} + +func (x *agentConnectServer) Send(m *ServerMessage) error { + return x.ServerStream.SendMsg(m) +} + +func (x *agentConnectServer) Recv() (*AgentMessage, error) { + m := new(AgentMessage) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _Agent_serviceDesc = grpc.ServiceDesc{ + ServiceName: "agent.Agent", + HandlerType: (*AgentServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Register", + Handler: _Agent_Register_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Connect", + Handler: _Agent_Connect_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "agent/agent.proto", +} + +func init() { proto.RegisterFile("agent/agent.proto", fileDescriptor_agent_a381d3b1fe9961bc) } + +var fileDescriptor_agent_a381d3b1fe9961bc = []byte{ + // 710 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xdd, 0x4e, 0xdb, 0x4c, + 0x10, 0xc5, 0xf9, 0x21, 0x61, 0x12, 0x12, 0x58, 0xf2, 0x81, 0xb1, 0xf4, 0x09, 0xe4, 0x56, 0x55, + 0xb8, 0xa8, 0x83, 0x82, 0x2a, 0x21, 0x50, 0x2f, 0x52, 0x5a, 0x89, 0x56, 0xa5, 0xa2, 0x0e, 0xf7, + 0xd1, 0x92, 0x2c, 0xc6, 0x6a, 0xd8, 0x35, 0xde, 0x75, 0x24, 0xdf, 0x54, 0xea, 0xb3, 0xd2, 0xbe, + 0x47, 0xb5, 0x3f, 0x36, 0x4e, 0x02, 0x2a, 0x37, 0xd1, 0xce, 0xe4, 0xcc, 0x99, 0x3d, 0x67, 0x66, + 0x0d, 0x9b, 0x38, 0x20, 0x54, 0xf4, 0xd4, 0xaf, 0x17, 0xc5, 0x4c, 0x30, 0x54, 0x55, 0x81, 0xb3, + 0x1b, 0x30, 0x16, 0x4c, 0x49, 0x4f, 0x25, 0xaf, 0x93, 0x9b, 0x1e, 0xa6, 0xa9, 0x46, 0x38, 0x7b, + 0x8b, 0x7f, 0x89, 0xf0, 0x8e, 0x70, 0x81, 0xef, 0x22, 0x03, 0xd8, 0x0e, 0xe9, 0x8c, 0x50, 0xc1, + 0xe2, 0x54, 0x33, 0x73, 0x9d, 0x77, 0xdf, 0x42, 0xdb, 0x27, 0x41, 0xc8, 0x05, 0x89, 0x7d, 0x72, + 0x9f, 0x10, 0x2e, 0x90, 0x03, 0xf5, 0x5b, 0xc6, 0x05, 0xc5, 0x77, 0xc4, 0xb6, 0xf6, 0xad, 0xee, + 0x9a, 0x9f, 0xc7, 0xee, 0x1b, 0xd8, 0x78, 0x84, 0xf3, 0x88, 0x51, 0x4e, 0x10, 0x82, 0x4a, 0x92, + 0x84, 0x13, 0x83, 0x55, 0x67, 0xf7, 0x14, 0x1a, 0x83, 0x44, 0xdc, 0x66, 0x94, 0x4f, 0x40, 0x90, + 0x0d, 0xb5, 0x19, 0x89, 0x79, 0xc8, 0xa8, 0x5d, 0x52, 0xe9, 0x2c, 0x74, 0x5b, 0xd0, 0xd4, 0xc5, + 0xba, 0x81, 0x7b, 0x02, 0xad, 0xef, 0x83, 0x6f, 0x1f, 0xb1, 0xc0, 0x19, 0x5f, 0x17, 0x2a, 0x13, + 0x2c, 0xb0, 0xe2, 0x6b, 0xf4, 0x3b, 0x9e, 0x56, 0xef, 0x65, 0xea, 0xbd, 0x01, 0x4d, 0x7d, 0x85, + 0x70, 0x37, 0xa1, 0x9d, 0xd7, 0x1a, 0xba, 0x75, 0x68, 0x5c, 0x86, 0x34, 0x30, 0x5c, 0xee, 0x05, + 0x34, 0x75, 0x68, 0xe4, 0xbc, 0x87, 0xe6, 0x38, 0x89, 0x63, 0x42, 0xc5, 0x48, 0x9a, 0x68, 0x7a, + 0x38, 0x4b, 0x3d, 0xae, 0x32, 0x87, 0xfd, 0x86, 0xc1, 0xcb, 0x8c, 0xfb, 0x50, 0x82, 0xf6, 0x90, + 0x88, 0xa1, 0xc0, 0x82, 0x64, 0xd7, 0xfd, 0x0a, 0x6d, 0x65, 0xfa, 0x28, 0x8a, 0xd9, 0x98, 0x70, + 0x4e, 0xb8, 0x6d, 0xed, 0x97, 0xbb, 0x8d, 0xfe, 0x2b, 0x4f, 0x8f, 0x79, 0xa1, 0xc0, 0x1b, 0xc8, + 0xec, 0xa5, 0x06, 0xfb, 0x2d, 0x5c, 0x88, 0x08, 0x77, 0x7e, 0x95, 0xa0, 0x59, 0x04, 0xa0, 0x5d, + 0xa8, 0x6b, 0x7a, 0xe3, 0xf0, 0xba, 0x5f, 0x53, 0xf1, 0xe7, 0x89, 0x34, 0x4a, 0xa4, 0x11, 0x51, + 0x0e, 0xb7, 0xfa, 0x1d, 0x2f, 0xdf, 0x02, 0xdd, 0xe2, 0x2a, 0x8d, 0x88, 0xaf, 0x10, 0x72, 0x44, + 0x38, 0x0e, 0xb8, 0x5d, 0xde, 0x2f, 0xcb, 0x11, 0xc9, 0x33, 0xda, 0x80, 0x32, 0xa1, 0x33, 0xbb, + 0xa2, 0x52, 0xf2, 0x88, 0xbe, 0x40, 0x6d, 0xcc, 0xe8, 0x4d, 0x18, 0x70, 0xbb, 0xaa, 0x14, 0x1c, + 0xbe, 0x40, 0x81, 0x77, 0xa6, 0x4b, 0x3e, 0x51, 0x11, 0xa7, 0x7e, 0x46, 0xe0, 0x9c, 0x40, 0xb3, + 0xf8, 0x87, 0xec, 0xf6, 0x83, 0xa4, 0x66, 0x47, 0xe4, 0x11, 0x75, 0xa0, 0x3a, 0xc3, 0xd3, 0x84, + 0x98, 0x05, 0xd1, 0xc1, 0x49, 0xe9, 0xd8, 0x72, 0xff, 0x58, 0xb0, 0xf1, 0xd8, 0xd2, 0x4c, 0xee, + 0xe2, 0x39, 0x9b, 0x5f, 0x2f, 0x5d, 0x52, 0x57, 0xfc, 0xc3, 0x67, 0xeb, 0xe5, 0x3e, 0xbf, 0x83, + 0x55, 0x2e, 0xb0, 0x48, 0xb8, 0x71, 0xfa, 0xff, 0x45, 0xa7, 0x0d, 0xc7, 0x50, 0x81, 0x7c, 0x03, + 0x46, 0x7b, 0xd0, 0x98, 0xca, 0xc7, 0x44, 0x47, 0x11, 0x8b, 0x85, 0x5d, 0x56, 0xa4, 0xa0, 0x53, + 0x97, 0x2c, 0x16, 0xee, 0x43, 0x76, 0x87, 0x0b, 0xc2, 0x39, 0x0e, 0x08, 0x6a, 0x41, 0x29, 0xef, + 0x5e, 0x0a, 0xd5, 0x80, 0x71, 0x22, 0x6e, 0x55, 0xdb, 0x46, 0x1f, 0x19, 0xa1, 0x85, 0xb7, 0x77, + 0xbe, 0xe2, 0x2b, 0x04, 0xea, 0x43, 0xfd, 0x1e, 0xd3, 0x91, 0x7a, 0x37, 0x65, 0x85, 0xfe, 0xcf, + 0xa0, 0xe7, 0x1f, 0xd7, 0xf9, 0x8a, 0x5f, 0xbb, 0xc7, 0x54, 0x66, 0xd0, 0x01, 0x54, 0xa2, 0x90, + 0x06, 0x76, 0x5d, 0xe1, 0xb7, 0x0c, 0xbe, 0xf8, 0x5c, 0x24, 0xbd, 0x84, 0xa0, 0x1e, 0x54, 0xa5, + 0x28, 0x62, 0xaf, 0x29, 0xec, 0xce, 0x33, 0x96, 0x9f, 0xaf, 0xf8, 0x1a, 0xf7, 0x61, 0x0d, 0x6a, + 0x11, 0x4e, 0xa7, 0x0c, 0x4f, 0xdc, 0xdf, 0x16, 0xac, 0x0f, 0x49, 0x3c, 0x23, 0xf1, 0x73, 0x32, + 0x0f, 0xe6, 0x64, 0x6e, 0xcd, 0xc9, 0x7c, 0xbc, 0x88, 0xd2, 0x79, 0xb4, 0xa4, 0x73, 0x7b, 0x51, + 0x67, 0x5e, 0x91, 0x0b, 0xed, 0xce, 0x09, 0x45, 0x73, 0x42, 0x73, 0x1b, 0x95, 0x4e, 0x6f, 0x5e, + 0xe7, 0xf6, 0xd3, 0xfb, 0xff, 0x94, 0xcc, 0xfe, 0x4f, 0xa8, 0xaa, 0x59, 0xa2, 0x53, 0xa8, 0x67, + 0x5f, 0x51, 0x94, 0x11, 0x2c, 0x7c, 0x85, 0x9d, 0x9d, 0xa5, 0xbc, 0xd9, 0xf2, 0x63, 0xa8, 0x9d, + 0x31, 0x4a, 0xc9, 0x58, 0xa0, 0xdc, 0x87, 0xc2, 0x86, 0x38, 0x9d, 0xfc, 0x46, 0x05, 0x43, 0xbb, + 0xd6, 0xa1, 0x75, 0xbd, 0xaa, 0xbe, 0x5d, 0x47, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x95, 0x7f, + 0x3e, 0xae, 0x62, 0x06, 0x00, 0x00, +} diff --git a/api/agent/agent.proto b/api/agent/agent.proto new file mode 100644 index 0000000000..f772aec416 --- /dev/null +++ b/api/agent/agent.proto @@ -0,0 +1,99 @@ +syntax = "proto3"; + +package agent; + +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +import "inventory/agents.proto"; + +message RegisterRequest { + // FIXME We need node information there to create a new node or map new agent to the existing node. + // This is hard problem. + + string hostname = 1; +} + +message RegisterResponse { + string uuid = 1; +} + +// AuthRequest is an AgentMessage for authenticating pmm-agent on pmm-managed. +message AuthRequest { + string uuid = 1; + string version = 2; +} + +// AuthResponse is a ServerMessage for successful authentication. +message AuthResponse {} + +// QANDataRequest is an AgentMessage for sending QAN data. +message QANDataRequest { + google.protobuf.Any data = 1; // agent.QANData +} + +// QANDataResponse is a ServerMessage for QAN data acceptance. +message QANDataResponse {} + +// PingRequest is a ServerMessage for checking connectivity, latency and clock drift. +message PingRequest {} + +// PingResponse is an AgentMessage with current time for measuring clock drift. +message PingResponse { + google.protobuf.Timestamp current_time = 1; +} + +// SetStateRequest is a ServerMessage asking pmm-agent to run agents according to desired state. +message SetStateRequest { + // AgentProcess describes desired configuration of a single agent. + message AgentProcess { + uint32 agent_id = 1; + inventory.AgentType type = 2; + repeated string args = 3; + repeated string env = 4; + map configs = 5; + } + repeated AgentProcess agent_processes = 1; +} + +// SetStateResponse is an AgentMessage describing agent statuses. +message SetStateResponse { + // AgentProcess describes status of a single agent. + message AgentProcess { + uint32 agent_id = 1; + inventory.AgentProcessStatus status = 2; + uint32 listen_port = 3; + } + repeated AgentProcess agent_processes = 1; +} + +message AgentMessage { + uint32 id = 1; + oneof payload { + // requests from agent + AuthRequest auth = 2; + QANDataRequest qan_data = 3; + // responses from agent + PingResponse ping = 8; + SetStateResponse state = 9; + } +} + +message ServerMessage { + uint32 id = 1; + oneof payload { + // responses from server + AuthResponse auth = 2; + QANDataResponse qan_data = 3; + // requests from server + PingRequest ping = 8; + SetStateRequest state = 9; + } +} + +// Agent service provides private methods for pmm-agent <-> pmm-managed interactions. +service Agent { + // Register adds pmm-agent to pmm-managed database and returns agent's UUID. + rpc Register(RegisterRequest) returns (RegisterResponse); + // Connect establishes two-way communication channel between pmm-agent and pmm-managed. + rpc Connect(stream AgentMessage) returns (stream ServerMessage); +} diff --git a/api/agent/qan.pb.go b/api/agent/qan.pb.go new file mode 100644 index 0000000000..2b56f3ccbc --- /dev/null +++ b/api/agent/qan.pb.go @@ -0,0 +1,126 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: agent/qan.proto + +package agent + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// QANData represents sent QAN data. +type QANData struct { + Rows []*QANData_Row `protobuf:"bytes,1,rep,name=rows,proto3" json:"rows,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *QANData) Reset() { *m = QANData{} } +func (m *QANData) String() string { return proto.CompactTextString(m) } +func (*QANData) ProtoMessage() {} +func (*QANData) Descriptor() ([]byte, []int) { + return fileDescriptor_qan_8f829fd0a7760133, []int{0} +} +func (m *QANData) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_QANData.Unmarshal(m, b) +} +func (m *QANData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_QANData.Marshal(b, m, deterministic) +} +func (dst *QANData) XXX_Merge(src proto.Message) { + xxx_messageInfo_QANData.Merge(dst, src) +} +func (m *QANData) XXX_Size() int { + return xxx_messageInfo_QANData.Size(m) +} +func (m *QANData) XXX_DiscardUnknown() { + xxx_messageInfo_QANData.DiscardUnknown(m) +} + +var xxx_messageInfo_QANData proto.InternalMessageInfo + +func (m *QANData) GetRows() []*QANData_Row { + if m != nil { + return m.Rows + } + return nil +} + +// Row describes a single row of QAN data. +type QANData_Row struct { + // TODO + Digest string `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` + DigestText string `protobuf:"bytes,2,opt,name=digest_text,json=digestText,proto3" json:"digest_text,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *QANData_Row) Reset() { *m = QANData_Row{} } +func (m *QANData_Row) String() string { return proto.CompactTextString(m) } +func (*QANData_Row) ProtoMessage() {} +func (*QANData_Row) Descriptor() ([]byte, []int) { + return fileDescriptor_qan_8f829fd0a7760133, []int{0, 0} +} +func (m *QANData_Row) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_QANData_Row.Unmarshal(m, b) +} +func (m *QANData_Row) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_QANData_Row.Marshal(b, m, deterministic) +} +func (dst *QANData_Row) XXX_Merge(src proto.Message) { + xxx_messageInfo_QANData_Row.Merge(dst, src) +} +func (m *QANData_Row) XXX_Size() int { + return xxx_messageInfo_QANData_Row.Size(m) +} +func (m *QANData_Row) XXX_DiscardUnknown() { + xxx_messageInfo_QANData_Row.DiscardUnknown(m) +} + +var xxx_messageInfo_QANData_Row proto.InternalMessageInfo + +func (m *QANData_Row) GetDigest() string { + if m != nil { + return m.Digest + } + return "" +} + +func (m *QANData_Row) GetDigestText() string { + if m != nil { + return m.DigestText + } + return "" +} + +func init() { + proto.RegisterType((*QANData)(nil), "agent.QANData") + proto.RegisterType((*QANData_Row)(nil), "agent.QANData.Row") +} + +func init() { proto.RegisterFile("agent/qan.proto", fileDescriptor_qan_8f829fd0a7760133) } + +var fileDescriptor_qan_8f829fd0a7760133 = []byte{ + // 137 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4f, 0x4c, 0x4f, 0xcd, + 0x2b, 0xd1, 0x2f, 0x4c, 0xcc, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x0b, 0x28, + 0x15, 0x72, 0xb1, 0x07, 0x3a, 0xfa, 0xb9, 0x24, 0x96, 0x24, 0x0a, 0xa9, 0x71, 0xb1, 0x14, 0xe5, + 0x97, 0x17, 0x4b, 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x1b, 0x09, 0xe9, 0x81, 0x15, 0xe8, 0x41, 0x65, + 0xf5, 0x82, 0xf2, 0xcb, 0x83, 0xc0, 0xf2, 0x52, 0x76, 0x5c, 0xcc, 0x41, 0xf9, 0xe5, 0x42, 0x62, + 0x5c, 0x6c, 0x29, 0x99, 0xe9, 0xa9, 0xc5, 0x25, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x50, + 0x9e, 0x90, 0x3c, 0x17, 0x37, 0x84, 0x15, 0x5f, 0x92, 0x5a, 0x51, 0x22, 0xc1, 0x04, 0x96, 0xe4, + 0x82, 0x08, 0x85, 0xa4, 0x56, 0x94, 0x24, 0xb1, 0x81, 0x1d, 0x60, 0x0c, 0x08, 0x00, 0x00, 0xff, + 0xff, 0x0f, 0xce, 0x16, 0x0e, 0x93, 0x00, 0x00, 0x00, +} diff --git a/api/agent/qan.proto b/api/agent/qan.proto new file mode 100644 index 0000000000..7a3b03ff0b --- /dev/null +++ b/api/agent/qan.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package agent; + +// QANData represents sent QAN data. +message QANData { + // Row describes a single row of QAN data. + message Row { + // TODO + string digest = 1; + string digest_text = 2; + } + repeated Row rows = 1; +} diff --git a/api/inventory.swagger.json b/api/inventory.swagger.json new file mode 100644 index 0000000000..10a2c7593c --- /dev/null +++ b/api/inventory.swagger.json @@ -0,0 +1,822 @@ +{ + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "schemes": [ + "http", + "https" + ], + "swagger": "2.0", + "info": { + "title": "PMM Server Inventory API", + "version": "version 0" + }, + "paths": { + "/v0/inventory/Agents/AddMySQLdExporterAgent": { + "post": { + "tags": [ + "Agents" + ], + "summary": "AddMySQLdExporterAgent adds mysqld_exporter Agent.", + "operationId": "AddMySQLdExporterAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/inventoryAddMySQLdExporterAgentRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/inventoryAddMySQLdExporterAgentResponse" + } + } + } + } + }, + "/v0/inventory/Agents/GetAgent": { + "post": { + "tags": [ + "Agents" + ], + "summary": "GetAgent returns a single Agent by ID.", + "operationId": "GetAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/inventoryGetAgentRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/inventoryGetAgentResponse" + } + } + } + } + }, + "/v0/inventory/Agents/ListAgents": { + "post": { + "tags": [ + "Agents" + ], + "summary": "ListAgents returns a list of all Agents.", + "operationId": "ListAgents", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/inventoryListAgentsRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/inventoryListAgentsResponse" + } + } + } + } + }, + "/v0/inventory/Agents/RemoveAgent": { + "post": { + "tags": [ + "Agents" + ], + "summary": "RemoveAgent removes Agent.", + "operationId": "RemoveAgent", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/inventoryRemoveAgentRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/inventoryRemoveAgentResponse" + } + } + } + } + }, + "/v0/inventory/Nodes/AddNode": { + "post": { + "tags": [ + "Nodes" + ], + "summary": "AddNode adds bare metal, virtual machine, or container node Node.", + "operationId": "AddNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/inventoryAddNodeRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/inventoryAddNodeResponse" + } + } + } + } + }, + "/v0/inventory/Nodes/AddRDSNode": { + "post": { + "tags": [ + "Nodes" + ], + "summary": "AddRDSNode adds AWS RDS Node.", + "operationId": "AddRDSNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/inventoryAddRDSNodeRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/inventoryAddRDSNodeResponse" + } + } + } + } + }, + "/v0/inventory/Nodes/AddRemoveNode": { + "post": { + "tags": [ + "Nodes" + ], + "summary": "AddRemoveNode adds remote Node.", + "operationId": "AddRemoveNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/inventoryAddRemoveNodeRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/inventoryAddRemoveNodeResponse" + } + } + } + } + }, + "/v0/inventory/Nodes/GetNode": { + "post": { + "tags": [ + "Nodes" + ], + "summary": "GetNode returns a single Node by ID.", + "operationId": "GetNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/inventoryGetNodeRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/inventoryGetNodeResponse" + } + } + } + } + }, + "/v0/inventory/Nodes/ListNodes": { + "post": { + "tags": [ + "Nodes" + ], + "summary": "ListNodes returns a list of all Nodes.", + "operationId": "ListNodes", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/inventoryListNodesRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/inventoryListNodesResponse" + } + } + } + } + }, + "/v0/inventory/Nodes/RemoveNode": { + "post": { + "tags": [ + "Nodes" + ], + "summary": "RemoveNode removes Node without any Agents and Services.", + "operationId": "RemoveNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/inventoryRemoveNodeRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/inventoryRemoveNodeResponse" + } + } + } + } + }, + "/v0/inventory/Services/AddMySQLService": { + "post": { + "tags": [ + "Services" + ], + "summary": "AddMySQLService adds MySQL Service.", + "operationId": "AddMySQLService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/inventoryAddMySQLServiceRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/inventoryAddMySQLServiceResponse" + } + } + } + } + }, + "/v0/inventory/Services/GetService": { + "post": { + "tags": [ + "Services" + ], + "summary": "GetService returns a single Service by ID.", + "operationId": "GetService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/inventoryGetServiceRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/inventoryGetServiceResponse" + } + } + } + } + }, + "/v0/inventory/Services/ListServices": { + "post": { + "tags": [ + "Services" + ], + "summary": "ListServices returns a list of all Services.", + "operationId": "ListServices", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/inventoryListServicesRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/inventoryListServicesResponse" + } + } + } + } + }, + "/v0/inventory/Services/RemoveService": { + "post": { + "tags": [ + "Services" + ], + "summary": "RemoveService removes Service without any Agents.", + "operationId": "RemoveService", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/inventoryRemoveServiceRequest" + } + } + ], + "responses": { + "200": { + "description": "(empty)", + "schema": { + "$ref": "#/definitions/inventoryRemoveServiceResponse" + } + } + } + } + } + }, + "definitions": { + "inventoryAddMySQLServiceRequest": { + "type": "object" + }, + "inventoryAddMySQLServiceResponse": { + "type": "object", + "properties": { + "mysql": { + "$ref": "#/definitions/inventoryMySQLService" + } + } + }, + "inventoryAddMySQLdExporterAgentRequest": { + "type": "object", + "properties": { + "password": { + "description": "MySQL password for extracting metrics.", + "type": "string" + }, + "runs_on_node_id": { + "description": "Node identifier where agent should run.", + "type": "integer", + "format": "int64" + }, + "service_id": { + "description": "Service identifier for extracting metrics.", + "type": "integer", + "format": "int64" + }, + "username": { + "description": "MySQL username for extracting metrics.", + "type": "string" + } + } + }, + "inventoryAddMySQLdExporterAgentResponse": { + "type": "object", + "properties": { + "mysqld_exporter": { + "$ref": "#/definitions/inventoryMySQLdExporter" + } + } + }, + "inventoryAddNodeRequest": { + "type": "object", + "properties": { + "hostname": { + "description": "Hostname. Is not unique.", + "type": "string" + }, + "name": { + "description": "Unique Node name.", + "type": "string" + }, + "type": { + "description": "Node type.", + "$ref": "#/definitions/inventoryNodeType" + } + } + }, + "inventoryAddNodeResponse": { + "type": "object", + "properties": { + "bare_metal": { + "$ref": "#/definitions/inventoryBareMetalNode" + }, + "container": { + "$ref": "#/definitions/inventoryContainerNode" + }, + "virtual_machine": { + "$ref": "#/definitions/inventoryVirtualMachineNode" + } + } + }, + "inventoryAddRDSNodeRequest": { + "type": "object", + "properties": { + "name": { + "description": "Unique Node name.", + "type": "string" + } + } + }, + "inventoryAddRDSNodeResponse": { + "type": "object", + "properties": { + "rds": { + "$ref": "#/definitions/inventoryRDSNode" + } + } + }, + "inventoryAddRemoveNodeRequest": { + "type": "object", + "properties": { + "name": { + "description": "Unique Node name.", + "type": "string" + } + } + }, + "inventoryAddRemoveNodeResponse": { + "type": "object", + "properties": { + "remote": { + "$ref": "#/definitions/inventoryRemoteNode" + } + } + }, + "inventoryBareMetalNode": { + "description": "BareMetalNode represents bare metal Node.", + "type": "object", + "properties": { + "hostname": { + "description": "Hostname. Is not unique.", + "type": "string" + }, + "id": { + "description": "Unique Node identifier.", + "type": "integer", + "format": "int64" + }, + "name": { + "description": "Unique Node name.", + "type": "string" + } + } + }, + "inventoryContainerNode": { + "description": "ContainerNode represents a container (Docker) Node.", + "type": "object", + "properties": { + "id": { + "description": "Unique Node identifier.", + "type": "integer", + "format": "int64" + }, + "name": { + "description": "Unique Node name.", + "type": "string" + } + } + }, + "inventoryGetAgentRequest": { + "type": "object", + "properties": { + "id": { + "description": "Unique Agent identifier.", + "type": "integer", + "format": "int64" + } + } + }, + "inventoryGetAgentResponse": { + "type": "object", + "properties": { + "mysqld_exporter": { + "$ref": "#/definitions/inventoryMySQLdExporter" + } + } + }, + "inventoryGetNodeRequest": { + "type": "object", + "properties": { + "id": { + "description": "Unique Node identifier.", + "type": "integer", + "format": "int64" + } + } + }, + "inventoryGetNodeResponse": { + "type": "object", + "properties": { + "bare_metal": { + "$ref": "#/definitions/inventoryBareMetalNode" + }, + "container": { + "$ref": "#/definitions/inventoryContainerNode" + }, + "rds": { + "$ref": "#/definitions/inventoryRDSNode" + }, + "remote": { + "$ref": "#/definitions/inventoryRemoteNode" + }, + "virtual_machine": { + "$ref": "#/definitions/inventoryVirtualMachineNode" + } + } + }, + "inventoryGetServiceRequest": { + "type": "object", + "properties": { + "id": { + "description": "Unique Service identifier.", + "type": "integer", + "format": "int64" + } + } + }, + "inventoryGetServiceResponse": { + "type": "object", + "properties": { + "mysql": { + "$ref": "#/definitions/inventoryMySQLService" + } + } + }, + "inventoryListAgentsRequest": { + "type": "object" + }, + "inventoryListAgentsResponse": { + "type": "object", + "properties": { + "mysqld_exporter": { + "type": "array", + "items": { + "$ref": "#/definitions/inventoryMySQLdExporter" + } + } + } + }, + "inventoryListNodesRequest": { + "type": "object" + }, + "inventoryListNodesResponse": { + "type": "object", + "properties": { + "bare_metal": { + "type": "array", + "items": { + "$ref": "#/definitions/inventoryBareMetalNode" + } + }, + "container": { + "type": "array", + "items": { + "$ref": "#/definitions/inventoryContainerNode" + } + }, + "rds": { + "type": "array", + "items": { + "$ref": "#/definitions/inventoryRDSNode" + } + }, + "remote": { + "type": "array", + "items": { + "$ref": "#/definitions/inventoryRemoteNode" + } + }, + "virtual_machine": { + "type": "array", + "items": { + "$ref": "#/definitions/inventoryVirtualMachineNode" + } + } + } + }, + "inventoryListServicesRequest": { + "type": "object" + }, + "inventoryListServicesResponse": { + "type": "object", + "properties": { + "mysql": { + "type": "array", + "items": { + "$ref": "#/definitions/inventoryMySQLService" + } + } + } + }, + "inventoryMySQLService": { + "description": "MySQLService represents MySQL service configuration.", + "type": "object", + "properties": { + "id": { + "description": "Unique service identifier.", + "type": "integer", + "format": "int64" + }, + "name": { + "description": "Unique service name.", + "type": "string" + } + } + }, + "inventoryMySQLdExporter": { + "description": "MySQLdExporter represents mysqld_exporter Agent configuration.", + "type": "object", + "properties": { + "id": { + "description": "Unique agent identifier.", + "type": "integer", + "format": "int64" + }, + "listen_port": { + "description": "HTTP listen port for exposing metrics.", + "type": "integer", + "format": "int64" + }, + "password": { + "description": "MySQL password for extracting metrics.", + "type": "string" + }, + "runs_on_node_id": { + "description": "Node identifier where agent runs.", + "type": "integer", + "format": "int64" + }, + "service_id": { + "description": "Service identifier for extracting metrics.", + "type": "integer", + "format": "int64" + }, + "username": { + "description": "MySQL username for extracting metrics.", + "type": "string" + } + } + }, + "inventoryNodeType": { + "description": "NodeType represents Node type.", + "type": "string", + "default": "NODE_TYPE_INVALID", + "enum": [ + "NODE_TYPE_INVALID", + "BARE_METAL", + "VIRTUAL_MACHINE", + "CONTAINER", + "REMOTE", + "RDS" + ] + }, + "inventoryRDSNode": { + "description": "RDSNode represents AWS RDS Node.", + "type": "object", + "properties": { + "id": { + "description": "Unique Node identifier.", + "type": "integer", + "format": "int64" + }, + "name": { + "description": "Unique Node name.", + "type": "string" + }, + "region": { + "type": "string" + } + } + }, + "inventoryRemoteNode": { + "description": "RemoteNode represents a generic remote Node.", + "type": "object", + "properties": { + "id": { + "description": "Unique Node identifier.", + "type": "integer", + "format": "int64" + }, + "name": { + "description": "Unique Node name.", + "type": "string" + } + } + }, + "inventoryRemoveAgentRequest": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "inventoryRemoveAgentResponse": { + "type": "object" + }, + "inventoryRemoveNodeRequest": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "inventoryRemoveNodeResponse": { + "type": "object" + }, + "inventoryRemoveServiceRequest": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + } + } + }, + "inventoryRemoveServiceResponse": { + "type": "object" + }, + "inventoryVirtualMachineNode": { + "description": "VirtualMachineNode represents virtual machine Node.", + "type": "object", + "properties": { + "hostname": { + "description": "Hostname. Is not unique.", + "type": "string" + }, + "id": { + "description": "Unique Node identifier.", + "type": "integer", + "format": "int64" + }, + "name": { + "description": "Unique Node name.", + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/api/inventory/agents.pb.go b/api/inventory/agents.pb.go new file mode 100644 index 0000000000..7308d1fb94 --- /dev/null +++ b/api/inventory/agents.pb.go @@ -0,0 +1,791 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: inventory/agents.proto + +package inventory + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// AgentType represents Agent type. +type AgentType int32 + +const ( + AgentType_AGENT_TYPE_INVALID AgentType = 0 + AgentType_MYSQLD_EXPORTER AgentType = 1 +) + +var AgentType_name = map[int32]string{ + 0: "AGENT_TYPE_INVALID", + 1: "MYSQLD_EXPORTER", +} +var AgentType_value = map[string]int32{ + "AGENT_TYPE_INVALID": 0, + "MYSQLD_EXPORTER": 1, +} + +func (x AgentType) String() string { + return proto.EnumName(AgentType_name, int32(x)) +} +func (AgentType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_agents_ec07511c82fd2e94, []int{0} +} + +// AgentProcessStatus represents agent process state. +type AgentProcessStatus int32 + +const ( + AgentProcessStatus_AGENT_PROCESS_STATUS_INVALID AgentProcessStatus = 0 + AgentProcessStatus_DISABLED AgentProcessStatus = 1 + AgentProcessStatus_RUNNING AgentProcessStatus = 2 +) + +var AgentProcessStatus_name = map[int32]string{ + 0: "AGENT_PROCESS_STATUS_INVALID", + 1: "DISABLED", + 2: "RUNNING", +} +var AgentProcessStatus_value = map[string]int32{ + "AGENT_PROCESS_STATUS_INVALID": 0, + "DISABLED": 1, + "RUNNING": 2, +} + +func (x AgentProcessStatus) String() string { + return proto.EnumName(AgentProcessStatus_name, int32(x)) +} +func (AgentProcessStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_agents_ec07511c82fd2e94, []int{1} +} + +// MySQLdExporter represents mysqld_exporter Agent configuration. +type MySQLdExporter struct { + // Unique agent identifier. + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // Node identifier where agent runs. + RunsOnNodeId uint32 `protobuf:"varint,3,opt,name=runs_on_node_id,json=runsOnNodeId,proto3" json:"runs_on_node_id,omitempty"` + // Service identifier for extracting metrics. + ServiceId uint32 `protobuf:"varint,4,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` + // MySQL username for extracting metrics. + Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` + // MySQL password for extracting metrics. + Password string `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"` + // HTTP listen port for exposing metrics. + ListenPort uint32 `protobuf:"varint,7,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MySQLdExporter) Reset() { *m = MySQLdExporter{} } +func (m *MySQLdExporter) String() string { return proto.CompactTextString(m) } +func (*MySQLdExporter) ProtoMessage() {} +func (*MySQLdExporter) Descriptor() ([]byte, []int) { + return fileDescriptor_agents_ec07511c82fd2e94, []int{0} +} +func (m *MySQLdExporter) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MySQLdExporter.Unmarshal(m, b) +} +func (m *MySQLdExporter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MySQLdExporter.Marshal(b, m, deterministic) +} +func (dst *MySQLdExporter) XXX_Merge(src proto.Message) { + xxx_messageInfo_MySQLdExporter.Merge(dst, src) +} +func (m *MySQLdExporter) XXX_Size() int { + return xxx_messageInfo_MySQLdExporter.Size(m) +} +func (m *MySQLdExporter) XXX_DiscardUnknown() { + xxx_messageInfo_MySQLdExporter.DiscardUnknown(m) +} + +var xxx_messageInfo_MySQLdExporter proto.InternalMessageInfo + +func (m *MySQLdExporter) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *MySQLdExporter) GetRunsOnNodeId() uint32 { + if m != nil { + return m.RunsOnNodeId + } + return 0 +} + +func (m *MySQLdExporter) GetServiceId() uint32 { + if m != nil { + return m.ServiceId + } + return 0 +} + +func (m *MySQLdExporter) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *MySQLdExporter) GetPassword() string { + if m != nil { + return m.Password + } + return "" +} + +func (m *MySQLdExporter) GetListenPort() uint32 { + if m != nil { + return m.ListenPort + } + return 0 +} + +type ListAgentsRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListAgentsRequest) Reset() { *m = ListAgentsRequest{} } +func (m *ListAgentsRequest) String() string { return proto.CompactTextString(m) } +func (*ListAgentsRequest) ProtoMessage() {} +func (*ListAgentsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_agents_ec07511c82fd2e94, []int{1} +} +func (m *ListAgentsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListAgentsRequest.Unmarshal(m, b) +} +func (m *ListAgentsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListAgentsRequest.Marshal(b, m, deterministic) +} +func (dst *ListAgentsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListAgentsRequest.Merge(dst, src) +} +func (m *ListAgentsRequest) XXX_Size() int { + return xxx_messageInfo_ListAgentsRequest.Size(m) +} +func (m *ListAgentsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListAgentsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListAgentsRequest proto.InternalMessageInfo + +type ListAgentsResponse struct { + MysqldExporter []*MySQLdExporter `protobuf:"bytes,1,rep,name=mysqld_exporter,json=mysqldExporter,proto3" json:"mysqld_exporter,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListAgentsResponse) Reset() { *m = ListAgentsResponse{} } +func (m *ListAgentsResponse) String() string { return proto.CompactTextString(m) } +func (*ListAgentsResponse) ProtoMessage() {} +func (*ListAgentsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_agents_ec07511c82fd2e94, []int{2} +} +func (m *ListAgentsResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListAgentsResponse.Unmarshal(m, b) +} +func (m *ListAgentsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListAgentsResponse.Marshal(b, m, deterministic) +} +func (dst *ListAgentsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListAgentsResponse.Merge(dst, src) +} +func (m *ListAgentsResponse) XXX_Size() int { + return xxx_messageInfo_ListAgentsResponse.Size(m) +} +func (m *ListAgentsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListAgentsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListAgentsResponse proto.InternalMessageInfo + +func (m *ListAgentsResponse) GetMysqldExporter() []*MySQLdExporter { + if m != nil { + return m.MysqldExporter + } + return nil +} + +type GetAgentRequest struct { + // Unique Agent identifier. + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetAgentRequest) Reset() { *m = GetAgentRequest{} } +func (m *GetAgentRequest) String() string { return proto.CompactTextString(m) } +func (*GetAgentRequest) ProtoMessage() {} +func (*GetAgentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_agents_ec07511c82fd2e94, []int{3} +} +func (m *GetAgentRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetAgentRequest.Unmarshal(m, b) +} +func (m *GetAgentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetAgentRequest.Marshal(b, m, deterministic) +} +func (dst *GetAgentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAgentRequest.Merge(dst, src) +} +func (m *GetAgentRequest) XXX_Size() int { + return xxx_messageInfo_GetAgentRequest.Size(m) +} +func (m *GetAgentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetAgentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAgentRequest proto.InternalMessageInfo + +func (m *GetAgentRequest) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +type GetAgentResponse struct { + // Types that are valid to be assigned to Agent: + // *GetAgentResponse_MysqldExporter + Agent isGetAgentResponse_Agent `protobuf_oneof:"agent"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetAgentResponse) Reset() { *m = GetAgentResponse{} } +func (m *GetAgentResponse) String() string { return proto.CompactTextString(m) } +func (*GetAgentResponse) ProtoMessage() {} +func (*GetAgentResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_agents_ec07511c82fd2e94, []int{4} +} +func (m *GetAgentResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetAgentResponse.Unmarshal(m, b) +} +func (m *GetAgentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetAgentResponse.Marshal(b, m, deterministic) +} +func (dst *GetAgentResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAgentResponse.Merge(dst, src) +} +func (m *GetAgentResponse) XXX_Size() int { + return xxx_messageInfo_GetAgentResponse.Size(m) +} +func (m *GetAgentResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetAgentResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAgentResponse proto.InternalMessageInfo + +type isGetAgentResponse_Agent interface { + isGetAgentResponse_Agent() +} + +type GetAgentResponse_MysqldExporter struct { + MysqldExporter *MySQLdExporter `protobuf:"bytes,1,opt,name=mysqld_exporter,json=mysqldExporter,proto3,oneof"` +} + +func (*GetAgentResponse_MysqldExporter) isGetAgentResponse_Agent() {} + +func (m *GetAgentResponse) GetAgent() isGetAgentResponse_Agent { + if m != nil { + return m.Agent + } + return nil +} + +func (m *GetAgentResponse) GetMysqldExporter() *MySQLdExporter { + if x, ok := m.GetAgent().(*GetAgentResponse_MysqldExporter); ok { + return x.MysqldExporter + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*GetAgentResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _GetAgentResponse_OneofMarshaler, _GetAgentResponse_OneofUnmarshaler, _GetAgentResponse_OneofSizer, []interface{}{ + (*GetAgentResponse_MysqldExporter)(nil), + } +} + +func _GetAgentResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*GetAgentResponse) + // agent + switch x := m.Agent.(type) { + case *GetAgentResponse_MysqldExporter: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.MysqldExporter); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("GetAgentResponse.Agent has unexpected type %T", x) + } + return nil +} + +func _GetAgentResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*GetAgentResponse) + switch tag { + case 1: // agent.mysqld_exporter + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(MySQLdExporter) + err := b.DecodeMessage(msg) + m.Agent = &GetAgentResponse_MysqldExporter{msg} + return true, err + default: + return false, nil + } +} + +func _GetAgentResponse_OneofSizer(msg proto.Message) (n int) { + m := msg.(*GetAgentResponse) + // agent + switch x := m.Agent.(type) { + case *GetAgentResponse_MysqldExporter: + s := proto.Size(x.MysqldExporter) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type AddMySQLdExporterAgentRequest struct { + // Node identifier where agent should run. + RunsOnNodeId uint32 `protobuf:"varint,3,opt,name=runs_on_node_id,json=runsOnNodeId,proto3" json:"runs_on_node_id,omitempty"` + // Service identifier for extracting metrics. + ServiceId uint32 `protobuf:"varint,4,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` + // MySQL username for extracting metrics. + Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` + // MySQL password for extracting metrics. + Password string `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddMySQLdExporterAgentRequest) Reset() { *m = AddMySQLdExporterAgentRequest{} } +func (m *AddMySQLdExporterAgentRequest) String() string { return proto.CompactTextString(m) } +func (*AddMySQLdExporterAgentRequest) ProtoMessage() {} +func (*AddMySQLdExporterAgentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_agents_ec07511c82fd2e94, []int{5} +} +func (m *AddMySQLdExporterAgentRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddMySQLdExporterAgentRequest.Unmarshal(m, b) +} +func (m *AddMySQLdExporterAgentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddMySQLdExporterAgentRequest.Marshal(b, m, deterministic) +} +func (dst *AddMySQLdExporterAgentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddMySQLdExporterAgentRequest.Merge(dst, src) +} +func (m *AddMySQLdExporterAgentRequest) XXX_Size() int { + return xxx_messageInfo_AddMySQLdExporterAgentRequest.Size(m) +} +func (m *AddMySQLdExporterAgentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AddMySQLdExporterAgentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AddMySQLdExporterAgentRequest proto.InternalMessageInfo + +func (m *AddMySQLdExporterAgentRequest) GetRunsOnNodeId() uint32 { + if m != nil { + return m.RunsOnNodeId + } + return 0 +} + +func (m *AddMySQLdExporterAgentRequest) GetServiceId() uint32 { + if m != nil { + return m.ServiceId + } + return 0 +} + +func (m *AddMySQLdExporterAgentRequest) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *AddMySQLdExporterAgentRequest) GetPassword() string { + if m != nil { + return m.Password + } + return "" +} + +type AddMySQLdExporterAgentResponse struct { + MysqldExporter *MySQLdExporter `protobuf:"bytes,1,opt,name=mysqld_exporter,json=mysqldExporter,proto3" json:"mysqld_exporter,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddMySQLdExporterAgentResponse) Reset() { *m = AddMySQLdExporterAgentResponse{} } +func (m *AddMySQLdExporterAgentResponse) String() string { return proto.CompactTextString(m) } +func (*AddMySQLdExporterAgentResponse) ProtoMessage() {} +func (*AddMySQLdExporterAgentResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_agents_ec07511c82fd2e94, []int{6} +} +func (m *AddMySQLdExporterAgentResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddMySQLdExporterAgentResponse.Unmarshal(m, b) +} +func (m *AddMySQLdExporterAgentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddMySQLdExporterAgentResponse.Marshal(b, m, deterministic) +} +func (dst *AddMySQLdExporterAgentResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddMySQLdExporterAgentResponse.Merge(dst, src) +} +func (m *AddMySQLdExporterAgentResponse) XXX_Size() int { + return xxx_messageInfo_AddMySQLdExporterAgentResponse.Size(m) +} +func (m *AddMySQLdExporterAgentResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AddMySQLdExporterAgentResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AddMySQLdExporterAgentResponse proto.InternalMessageInfo + +func (m *AddMySQLdExporterAgentResponse) GetMysqldExporter() *MySQLdExporter { + if m != nil { + return m.MysqldExporter + } + return nil +} + +type RemoveAgentRequest struct { + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RemoveAgentRequest) Reset() { *m = RemoveAgentRequest{} } +func (m *RemoveAgentRequest) String() string { return proto.CompactTextString(m) } +func (*RemoveAgentRequest) ProtoMessage() {} +func (*RemoveAgentRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_agents_ec07511c82fd2e94, []int{7} +} +func (m *RemoveAgentRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RemoveAgentRequest.Unmarshal(m, b) +} +func (m *RemoveAgentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RemoveAgentRequest.Marshal(b, m, deterministic) +} +func (dst *RemoveAgentRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveAgentRequest.Merge(dst, src) +} +func (m *RemoveAgentRequest) XXX_Size() int { + return xxx_messageInfo_RemoveAgentRequest.Size(m) +} +func (m *RemoveAgentRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveAgentRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveAgentRequest proto.InternalMessageInfo + +func (m *RemoveAgentRequest) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +type RemoveAgentResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RemoveAgentResponse) Reset() { *m = RemoveAgentResponse{} } +func (m *RemoveAgentResponse) String() string { return proto.CompactTextString(m) } +func (*RemoveAgentResponse) ProtoMessage() {} +func (*RemoveAgentResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_agents_ec07511c82fd2e94, []int{8} +} +func (m *RemoveAgentResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RemoveAgentResponse.Unmarshal(m, b) +} +func (m *RemoveAgentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RemoveAgentResponse.Marshal(b, m, deterministic) +} +func (dst *RemoveAgentResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveAgentResponse.Merge(dst, src) +} +func (m *RemoveAgentResponse) XXX_Size() int { + return xxx_messageInfo_RemoveAgentResponse.Size(m) +} +func (m *RemoveAgentResponse) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveAgentResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveAgentResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MySQLdExporter)(nil), "inventory.MySQLdExporter") + proto.RegisterType((*ListAgentsRequest)(nil), "inventory.ListAgentsRequest") + proto.RegisterType((*ListAgentsResponse)(nil), "inventory.ListAgentsResponse") + proto.RegisterType((*GetAgentRequest)(nil), "inventory.GetAgentRequest") + proto.RegisterType((*GetAgentResponse)(nil), "inventory.GetAgentResponse") + proto.RegisterType((*AddMySQLdExporterAgentRequest)(nil), "inventory.AddMySQLdExporterAgentRequest") + proto.RegisterType((*AddMySQLdExporterAgentResponse)(nil), "inventory.AddMySQLdExporterAgentResponse") + proto.RegisterType((*RemoveAgentRequest)(nil), "inventory.RemoveAgentRequest") + proto.RegisterType((*RemoveAgentResponse)(nil), "inventory.RemoveAgentResponse") + proto.RegisterEnum("inventory.AgentType", AgentType_name, AgentType_value) + proto.RegisterEnum("inventory.AgentProcessStatus", AgentProcessStatus_name, AgentProcessStatus_value) +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// AgentsClient is the client API for Agents service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type AgentsClient interface { + // ListAgents returns a list of all Agents. + ListAgents(ctx context.Context, in *ListAgentsRequest, opts ...grpc.CallOption) (*ListAgentsResponse, error) + // GetAgent returns a single Agent by ID. + GetAgent(ctx context.Context, in *GetAgentRequest, opts ...grpc.CallOption) (*GetAgentResponse, error) + // AddMySQLdExporterAgent adds mysqld_exporter Agent. + AddMySQLdExporterAgent(ctx context.Context, in *AddMySQLdExporterAgentRequest, opts ...grpc.CallOption) (*AddMySQLdExporterAgentResponse, error) + // RemoveAgent removes Agent. + RemoveAgent(ctx context.Context, in *RemoveAgentRequest, opts ...grpc.CallOption) (*RemoveAgentResponse, error) +} + +type agentsClient struct { + cc *grpc.ClientConn +} + +func NewAgentsClient(cc *grpc.ClientConn) AgentsClient { + return &agentsClient{cc} +} + +func (c *agentsClient) ListAgents(ctx context.Context, in *ListAgentsRequest, opts ...grpc.CallOption) (*ListAgentsResponse, error) { + out := new(ListAgentsResponse) + err := c.cc.Invoke(ctx, "/inventory.Agents/ListAgents", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *agentsClient) GetAgent(ctx context.Context, in *GetAgentRequest, opts ...grpc.CallOption) (*GetAgentResponse, error) { + out := new(GetAgentResponse) + err := c.cc.Invoke(ctx, "/inventory.Agents/GetAgent", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *agentsClient) AddMySQLdExporterAgent(ctx context.Context, in *AddMySQLdExporterAgentRequest, opts ...grpc.CallOption) (*AddMySQLdExporterAgentResponse, error) { + out := new(AddMySQLdExporterAgentResponse) + err := c.cc.Invoke(ctx, "/inventory.Agents/AddMySQLdExporterAgent", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *agentsClient) RemoveAgent(ctx context.Context, in *RemoveAgentRequest, opts ...grpc.CallOption) (*RemoveAgentResponse, error) { + out := new(RemoveAgentResponse) + err := c.cc.Invoke(ctx, "/inventory.Agents/RemoveAgent", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AgentsServer is the server API for Agents service. +type AgentsServer interface { + // ListAgents returns a list of all Agents. + ListAgents(context.Context, *ListAgentsRequest) (*ListAgentsResponse, error) + // GetAgent returns a single Agent by ID. + GetAgent(context.Context, *GetAgentRequest) (*GetAgentResponse, error) + // AddMySQLdExporterAgent adds mysqld_exporter Agent. + AddMySQLdExporterAgent(context.Context, *AddMySQLdExporterAgentRequest) (*AddMySQLdExporterAgentResponse, error) + // RemoveAgent removes Agent. + RemoveAgent(context.Context, *RemoveAgentRequest) (*RemoveAgentResponse, error) +} + +func RegisterAgentsServer(s *grpc.Server, srv AgentsServer) { + s.RegisterService(&_Agents_serviceDesc, srv) +} + +func _Agents_ListAgents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAgentsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentsServer).ListAgents(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/inventory.Agents/ListAgents", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentsServer).ListAgents(ctx, req.(*ListAgentsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Agents_GetAgent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAgentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentsServer).GetAgent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/inventory.Agents/GetAgent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentsServer).GetAgent(ctx, req.(*GetAgentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Agents_AddMySQLdExporterAgent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddMySQLdExporterAgentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentsServer).AddMySQLdExporterAgent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/inventory.Agents/AddMySQLdExporterAgent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentsServer).AddMySQLdExporterAgent(ctx, req.(*AddMySQLdExporterAgentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Agents_RemoveAgent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveAgentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentsServer).RemoveAgent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/inventory.Agents/RemoveAgent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentsServer).RemoveAgent(ctx, req.(*RemoveAgentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Agents_serviceDesc = grpc.ServiceDesc{ + ServiceName: "inventory.Agents", + HandlerType: (*AgentsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListAgents", + Handler: _Agents_ListAgents_Handler, + }, + { + MethodName: "GetAgent", + Handler: _Agents_GetAgent_Handler, + }, + { + MethodName: "AddMySQLdExporterAgent", + Handler: _Agents_AddMySQLdExporterAgent_Handler, + }, + { + MethodName: "RemoveAgent", + Handler: _Agents_RemoveAgent_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "inventory/agents.proto", +} + +func init() { proto.RegisterFile("inventory/agents.proto", fileDescriptor_agents_ec07511c82fd2e94) } + +var fileDescriptor_agents_ec07511c82fd2e94 = []byte{ + // 636 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x54, 0xd1, 0x4e, 0x1a, 0x41, + 0x14, 0x75, 0x10, 0x65, 0xb9, 0x58, 0xd9, 0x8e, 0xa9, 0xa1, 0x5b, 0x51, 0x3a, 0xd1, 0x84, 0x62, + 0x22, 0xc6, 0x26, 0x4d, 0xe3, 0x1b, 0x96, 0x8d, 0xc5, 0x20, 0xe2, 0x2e, 0x36, 0xfa, 0xb4, 0xd9, + 0x3a, 0x13, 0xb3, 0x89, 0xcc, 0xe0, 0xce, 0x42, 0xcb, 0x6b, 0xff, 0xa0, 0xe9, 0x37, 0xf4, 0xb9, + 0x5f, 0xd1, 0x2f, 0xe8, 0x2f, 0xf4, 0x43, 0x1a, 0x66, 0x17, 0x59, 0x74, 0x21, 0xed, 0x53, 0x1f, + 0xef, 0xbd, 0xe7, 0xde, 0x73, 0xe6, 0xde, 0x93, 0x81, 0x75, 0x8f, 0x0f, 0x18, 0x0f, 0x84, 0x3f, + 0xac, 0xba, 0x37, 0x8c, 0x07, 0x72, 0xaf, 0xe7, 0x8b, 0x40, 0xe0, 0xec, 0x7d, 0xde, 0xd8, 0xb8, + 0x11, 0xe2, 0xe6, 0x96, 0x55, 0xdd, 0x9e, 0x57, 0x75, 0x39, 0x17, 0x81, 0x1b, 0x78, 0x82, 0x47, + 0x40, 0xf2, 0x13, 0xc1, 0xea, 0xe9, 0xd0, 0x3e, 0x6f, 0x52, 0xf3, 0x73, 0x4f, 0xf8, 0x01, 0xf3, + 0xf1, 0x2a, 0xa4, 0x3c, 0x5a, 0x40, 0x25, 0x54, 0x7e, 0x62, 0xa5, 0x3c, 0x8a, 0x77, 0x20, 0xef, + 0xf7, 0xb9, 0x74, 0x04, 0x77, 0xb8, 0xa0, 0xcc, 0xf1, 0x68, 0x61, 0x51, 0x15, 0x57, 0x46, 0xe9, + 0x33, 0xde, 0x12, 0x94, 0x35, 0x28, 0x2e, 0x02, 0x48, 0xe6, 0x0f, 0xbc, 0x6b, 0x85, 0x48, 0x2b, + 0x44, 0x36, 0xca, 0x34, 0x28, 0x36, 0x40, 0xeb, 0x4b, 0xe6, 0x73, 0xb7, 0xcb, 0x0a, 0x4b, 0x25, + 0x54, 0xce, 0x5a, 0xf7, 0xf1, 0xa8, 0xd6, 0x73, 0xa5, 0xfc, 0x24, 0x7c, 0x5a, 0x58, 0x0e, 0x6b, + 0xe3, 0x18, 0x6f, 0x41, 0xee, 0xd6, 0x93, 0x01, 0xe3, 0xce, 0x48, 0x5e, 0x21, 0xa3, 0xe6, 0x42, + 0x98, 0x6a, 0x0b, 0x3f, 0x38, 0x49, 0x6b, 0x29, 0x7d, 0x91, 0xac, 0xc1, 0xd3, 0xa6, 0x27, 0x83, + 0x9a, 0x5a, 0x82, 0xc5, 0xee, 0xfa, 0x4c, 0x06, 0xe4, 0x12, 0x70, 0x3c, 0x29, 0x7b, 0x82, 0x4b, + 0x86, 0x8f, 0x20, 0xdf, 0x1d, 0xca, 0xbb, 0x5b, 0xea, 0xb0, 0xe8, 0xc9, 0x05, 0x54, 0x5a, 0x2c, + 0xe7, 0x0e, 0x9e, 0xef, 0xdd, 0x6f, 0x6d, 0x6f, 0x7a, 0x27, 0xd6, 0x6a, 0xd8, 0x31, 0x8e, 0xc9, + 0x4b, 0xc8, 0x1f, 0xb3, 0x70, 0x70, 0x44, 0xf6, 0x70, 0x6d, 0xc4, 0x05, 0x7d, 0x02, 0x89, 0xa8, + 0xeb, 0x49, 0xd4, 0x68, 0x2e, 0xf5, 0xfb, 0x85, 0x87, 0xe4, 0x47, 0x19, 0x58, 0x52, 0xc7, 0x26, + 0x3f, 0x10, 0x14, 0x6b, 0x94, 0x4e, 0x37, 0x4c, 0x89, 0xfa, 0xaf, 0xb7, 0x3b, 0x49, 0x6b, 0x48, + 0x4f, 0x85, 0x07, 0x3a, 0x49, 0x6b, 0x19, 0x5d, 0x23, 0x14, 0x36, 0x67, 0x09, 0x9e, 0x77, 0x1d, + 0xf4, 0x6f, 0xd7, 0xd9, 0x06, 0x6c, 0xb1, 0xae, 0x18, 0xb0, 0xb9, 0x07, 0x7a, 0x06, 0x6b, 0x53, + 0xa8, 0x50, 0x40, 0xe5, 0x2d, 0x64, 0x55, 0xa2, 0x33, 0xec, 0x31, 0xbc, 0x0e, 0xb8, 0x76, 0x6c, + 0xb6, 0x3a, 0x4e, 0xe7, 0xaa, 0x6d, 0x3a, 0x8d, 0xd6, 0x87, 0x5a, 0xb3, 0x51, 0xd7, 0x17, 0xf0, + 0x1a, 0xe4, 0x4f, 0xaf, 0xec, 0xf3, 0x66, 0xdd, 0x31, 0x2f, 0xdb, 0x67, 0x56, 0xc7, 0xb4, 0x74, + 0x54, 0x39, 0x07, 0xac, 0x3a, 0xdb, 0xbe, 0xb8, 0x66, 0x52, 0xda, 0x81, 0x1b, 0xf4, 0x25, 0x2e, + 0xc1, 0x46, 0x38, 0xa2, 0x6d, 0x9d, 0xbd, 0x33, 0x6d, 0xdb, 0xb1, 0x3b, 0xb5, 0xce, 0x85, 0x1d, + 0x1b, 0xb6, 0x02, 0x5a, 0xbd, 0x61, 0xd7, 0x8e, 0x9a, 0x66, 0x5d, 0x47, 0x38, 0x07, 0x19, 0xeb, + 0xa2, 0xd5, 0x6a, 0xb4, 0x8e, 0xf5, 0xd4, 0xc1, 0xd7, 0x34, 0x2c, 0x87, 0xf6, 0xc5, 0x7d, 0x80, + 0x89, 0x99, 0xf1, 0x46, 0x6c, 0x1b, 0x8f, 0x8c, 0x6f, 0x14, 0x67, 0x54, 0xc3, 0x27, 0x92, 0xca, + 0x97, 0x5f, 0xbf, 0xbf, 0xa5, 0xb6, 0xc9, 0x56, 0x75, 0xb0, 0x5f, 0x9d, 0xfc, 0x20, 0x21, 0xaa, + 0x3a, 0x69, 0x38, 0x44, 0x15, 0xdc, 0x05, 0x6d, 0x6c, 0x63, 0x6c, 0xc4, 0xc6, 0x3e, 0xb0, 0xbf, + 0xf1, 0x22, 0xb1, 0x16, 0x11, 0x96, 0x15, 0x21, 0x21, 0xc5, 0x44, 0xc2, 0x31, 0x7c, 0x44, 0xf7, + 0x1d, 0xc1, 0x7a, 0xb2, 0x43, 0x70, 0x39, 0xc6, 0x30, 0xd7, 0xf5, 0xc6, 0xab, 0xbf, 0x40, 0x46, + 0xca, 0xde, 0x28, 0x65, 0xfb, 0x64, 0x37, 0x51, 0x59, 0x72, 0xf3, 0x48, 0xe7, 0x10, 0x72, 0x31, + 0xf3, 0xe0, 0xf8, 0xc2, 0x1f, 0x5b, 0xcf, 0xd8, 0x9c, 0x55, 0x8e, 0x54, 0xec, 0x2a, 0x15, 0x3b, + 0xa4, 0x94, 0xa8, 0x22, 0xd6, 0x71, 0x88, 0x2a, 0x1f, 0x97, 0xd5, 0xcf, 0xfd, 0xfa, 0x4f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xd3, 0xd1, 0xcf, 0xd2, 0xfc, 0x05, 0x00, 0x00, +} diff --git a/api/inventory/agents.pb.gw.go b/api/inventory/agents.pb.gw.go new file mode 100644 index 0000000000..e401ca07fc --- /dev/null +++ b/api/inventory/agents.pb.gw.go @@ -0,0 +1,258 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: inventory/agents.proto + +/* +Package inventory is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package inventory + +import ( + "io" + "net/http" + + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray + +func request_Agents_ListAgents_0(ctx context.Context, marshaler runtime.Marshaler, client AgentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListAgentsRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListAgents(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_Agents_GetAgent_0(ctx context.Context, marshaler runtime.Marshaler, client AgentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAgentRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetAgent(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_Agents_AddMySQLdExporterAgent_0(ctx context.Context, marshaler runtime.Marshaler, client AgentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddMySQLdExporterAgentRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AddMySQLdExporterAgent(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_Agents_RemoveAgent_0(ctx context.Context, marshaler runtime.Marshaler, client AgentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RemoveAgentRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RemoveAgent(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +// RegisterAgentsHandlerFromEndpoint is same as RegisterAgentsHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterAgentsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterAgentsHandler(ctx, mux, conn) +} + +// RegisterAgentsHandler registers the http handlers for service Agents to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterAgentsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterAgentsHandlerClient(ctx, mux, NewAgentsClient(conn)) +} + +// RegisterAgentsHandlerClient registers the http handlers for service Agents +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AgentsClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AgentsClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "AgentsClient" to call the correct interceptors. +func RegisterAgentsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AgentsClient) error { + + mux.Handle("POST", pattern_Agents_ListAgents_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Agents_ListAgents_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Agents_ListAgents_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Agents_GetAgent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Agents_GetAgent_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Agents_GetAgent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Agents_AddMySQLdExporterAgent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Agents_AddMySQLdExporterAgent_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Agents_AddMySQLdExporterAgent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Agents_RemoveAgent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Agents_RemoveAgent_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Agents_RemoveAgent_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Agents_ListAgents_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v0", "inventory", "Agents", "ListAgents"}, "")) + + pattern_Agents_GetAgent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v0", "inventory", "Agents", "GetAgent"}, "")) + + pattern_Agents_AddMySQLdExporterAgent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v0", "inventory", "Agents", "AddMySQLdExporterAgent"}, "")) + + pattern_Agents_RemoveAgent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v0", "inventory", "Agents", "RemoveAgent"}, "")) +) + +var ( + forward_Agents_ListAgents_0 = runtime.ForwardResponseMessage + + forward_Agents_GetAgent_0 = runtime.ForwardResponseMessage + + forward_Agents_AddMySQLdExporterAgent_0 = runtime.ForwardResponseMessage + + forward_Agents_RemoveAgent_0 = runtime.ForwardResponseMessage +) diff --git a/api/inventory/agents.proto b/api/inventory/agents.proto new file mode 100644 index 0000000000..df377cabd3 --- /dev/null +++ b/api/inventory/agents.proto @@ -0,0 +1,110 @@ +syntax = "proto3"; + +package inventory; + +import "google/api/annotations.proto"; + +// AgentType represents Agent type. +enum AgentType { + AGENT_TYPE_INVALID = 0; + MYSQLD_EXPORTER = 1; +} + +// AgentProcessStatus represents agent process state. +enum AgentProcessStatus { + AGENT_PROCESS_STATUS_INVALID = 0; + DISABLED = 1; + RUNNING = 2; + // TODO adopt http://supervisord.org/subprocess.html#process-states ? + +} + +// MySQLdExporter represents mysqld_exporter Agent configuration. +message MySQLdExporter { + // Unique agent identifier. + uint32 id = 1; + reserved 2; // type + // Node identifier where agent runs. + uint32 runs_on_node_id = 3; + // Service identifier for extracting metrics. + uint32 service_id = 4; + // MySQL username for extracting metrics. + string username = 5; + // MySQL password for extracting metrics. + string password = 6; + // HTTP listen port for exposing metrics. + uint32 listen_port = 7; +} + +message ListAgentsRequest {} + +message ListAgentsResponse { + repeated MySQLdExporter mysqld_exporter = 1; +} + +message GetAgentRequest { + // Unique Agent identifier. + uint32 id = 1; +} + +message GetAgentResponse { + oneof agent { + MySQLdExporter mysqld_exporter = 1; + } +} + +message AddMySQLdExporterAgentRequest { + reserved 1; // id + reserved 2; // type + // Node identifier where agent should run. + uint32 runs_on_node_id = 3; + // Service identifier for extracting metrics. + uint32 service_id = 4; + // MySQL username for extracting metrics. + string username = 5; + // MySQL password for extracting metrics. + string password = 6; + reserved 7; // listen_port +} + +message AddMySQLdExporterAgentResponse { + MySQLdExporter mysqld_exporter = 1; +} + +message RemoveAgentRequest { + uint32 id = 1; +} + +message RemoveAgentResponse {} + +// Agents service provides public methods for managing Agents. +service Agents { + // ListAgents returns a list of all Agents. + rpc ListAgents(ListAgentsRequest) returns (ListAgentsResponse) { + option (google.api.http) = { + post: "/v0/inventory/Agents/ListAgents" + body: "*" + }; + } + // GetAgent returns a single Agent by ID. + rpc GetAgent(GetAgentRequest) returns (GetAgentResponse) { + option (google.api.http) = { + post: "/v0/inventory/Agents/GetAgent" + body: "*" + }; + } + // AddMySQLdExporterAgent adds mysqld_exporter Agent. + rpc AddMySQLdExporterAgent(AddMySQLdExporterAgentRequest) returns (AddMySQLdExporterAgentResponse) { + option (google.api.http) = { + post: "/v0/inventory/Agents/AddMySQLdExporterAgent" + body: "*" + }; + } + // RemoveAgent removes Agent. + rpc RemoveAgent(RemoveAgentRequest) returns (RemoveAgentResponse) { + option (google.api.http) = { + post: "/v0/inventory/Agents/RemoveAgent" + body: "*" + }; + } +} diff --git a/api/inventory/inventory.json b/api/inventory/inventory.json new file mode 100644 index 0000000000..4b4f181001 --- /dev/null +++ b/api/inventory/inventory.json @@ -0,0 +1,7 @@ +{ + "swagger": "2.0", + "info": { + "title": "PMM Server Inventory API", + "version": "version 0" + } +} diff --git a/api/inventory/nodes.pb.go b/api/inventory/nodes.pb.go new file mode 100644 index 0000000000..dbc8253a6d --- /dev/null +++ b/api/inventory/nodes.pb.go @@ -0,0 +1,1500 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: inventory/nodes.proto + +package inventory + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// NodeType represents Node type. +type NodeType int32 + +const ( + NodeType_NODE_TYPE_INVALID NodeType = 0 + NodeType_BARE_METAL NodeType = 1 + NodeType_VIRTUAL_MACHINE NodeType = 2 + NodeType_CONTAINER NodeType = 3 + NodeType_REMOTE NodeType = 4 + NodeType_RDS NodeType = 5 +) + +var NodeType_name = map[int32]string{ + 0: "NODE_TYPE_INVALID", + 1: "BARE_METAL", + 2: "VIRTUAL_MACHINE", + 3: "CONTAINER", + 4: "REMOTE", + 5: "RDS", +} +var NodeType_value = map[string]int32{ + "NODE_TYPE_INVALID": 0, + "BARE_METAL": 1, + "VIRTUAL_MACHINE": 2, + "CONTAINER": 3, + "REMOTE": 4, + "RDS": 5, +} + +func (x NodeType) String() string { + return proto.EnumName(NodeType_name, int32(x)) +} +func (NodeType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_nodes_c79059c91c0f32b3, []int{0} +} + +// BareMetalNode represents bare metal Node. +type BareMetalNode struct { + // Unique Node identifier. + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // Unique Node name. + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + // Hostname. Is not unique. + Hostname string `protobuf:"bytes,4,opt,name=hostname,proto3" json:"hostname,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BareMetalNode) Reset() { *m = BareMetalNode{} } +func (m *BareMetalNode) String() string { return proto.CompactTextString(m) } +func (*BareMetalNode) ProtoMessage() {} +func (*BareMetalNode) Descriptor() ([]byte, []int) { + return fileDescriptor_nodes_c79059c91c0f32b3, []int{0} +} +func (m *BareMetalNode) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BareMetalNode.Unmarshal(m, b) +} +func (m *BareMetalNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BareMetalNode.Marshal(b, m, deterministic) +} +func (dst *BareMetalNode) XXX_Merge(src proto.Message) { + xxx_messageInfo_BareMetalNode.Merge(dst, src) +} +func (m *BareMetalNode) XXX_Size() int { + return xxx_messageInfo_BareMetalNode.Size(m) +} +func (m *BareMetalNode) XXX_DiscardUnknown() { + xxx_messageInfo_BareMetalNode.DiscardUnknown(m) +} + +var xxx_messageInfo_BareMetalNode proto.InternalMessageInfo + +func (m *BareMetalNode) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *BareMetalNode) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *BareMetalNode) GetHostname() string { + if m != nil { + return m.Hostname + } + return "" +} + +// VirtualMachineNode represents virtual machine Node. +type VirtualMachineNode struct { + // Unique Node identifier. + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // Unique Node name. + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + // Hostname. Is not unique. + Hostname string `protobuf:"bytes,4,opt,name=hostname,proto3" json:"hostname,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *VirtualMachineNode) Reset() { *m = VirtualMachineNode{} } +func (m *VirtualMachineNode) String() string { return proto.CompactTextString(m) } +func (*VirtualMachineNode) ProtoMessage() {} +func (*VirtualMachineNode) Descriptor() ([]byte, []int) { + return fileDescriptor_nodes_c79059c91c0f32b3, []int{1} +} +func (m *VirtualMachineNode) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_VirtualMachineNode.Unmarshal(m, b) +} +func (m *VirtualMachineNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_VirtualMachineNode.Marshal(b, m, deterministic) +} +func (dst *VirtualMachineNode) XXX_Merge(src proto.Message) { + xxx_messageInfo_VirtualMachineNode.Merge(dst, src) +} +func (m *VirtualMachineNode) XXX_Size() int { + return xxx_messageInfo_VirtualMachineNode.Size(m) +} +func (m *VirtualMachineNode) XXX_DiscardUnknown() { + xxx_messageInfo_VirtualMachineNode.DiscardUnknown(m) +} + +var xxx_messageInfo_VirtualMachineNode proto.InternalMessageInfo + +func (m *VirtualMachineNode) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *VirtualMachineNode) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *VirtualMachineNode) GetHostname() string { + if m != nil { + return m.Hostname + } + return "" +} + +// ContainerNode represents a container (Docker) Node. +type ContainerNode struct { + // Unique Node identifier. + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // Unique Node name. + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ContainerNode) Reset() { *m = ContainerNode{} } +func (m *ContainerNode) String() string { return proto.CompactTextString(m) } +func (*ContainerNode) ProtoMessage() {} +func (*ContainerNode) Descriptor() ([]byte, []int) { + return fileDescriptor_nodes_c79059c91c0f32b3, []int{2} +} +func (m *ContainerNode) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ContainerNode.Unmarshal(m, b) +} +func (m *ContainerNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ContainerNode.Marshal(b, m, deterministic) +} +func (dst *ContainerNode) XXX_Merge(src proto.Message) { + xxx_messageInfo_ContainerNode.Merge(dst, src) +} +func (m *ContainerNode) XXX_Size() int { + return xxx_messageInfo_ContainerNode.Size(m) +} +func (m *ContainerNode) XXX_DiscardUnknown() { + xxx_messageInfo_ContainerNode.DiscardUnknown(m) +} + +var xxx_messageInfo_ContainerNode proto.InternalMessageInfo + +func (m *ContainerNode) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *ContainerNode) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// RemoteNode represents a generic remote Node. +type RemoteNode struct { + // Unique Node identifier. + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // Unique Node name. + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RemoteNode) Reset() { *m = RemoteNode{} } +func (m *RemoteNode) String() string { return proto.CompactTextString(m) } +func (*RemoteNode) ProtoMessage() {} +func (*RemoteNode) Descriptor() ([]byte, []int) { + return fileDescriptor_nodes_c79059c91c0f32b3, []int{3} +} +func (m *RemoteNode) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RemoteNode.Unmarshal(m, b) +} +func (m *RemoteNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RemoteNode.Marshal(b, m, deterministic) +} +func (dst *RemoteNode) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoteNode.Merge(dst, src) +} +func (m *RemoteNode) XXX_Size() int { + return xxx_messageInfo_RemoteNode.Size(m) +} +func (m *RemoteNode) XXX_DiscardUnknown() { + xxx_messageInfo_RemoteNode.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoteNode proto.InternalMessageInfo + +func (m *RemoteNode) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *RemoteNode) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// RDSNode represents AWS RDS Node. +type RDSNode struct { + // Unique Node identifier. + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // Unique Node name. + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Region string `protobuf:"bytes,5,opt,name=region,proto3" json:"region,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RDSNode) Reset() { *m = RDSNode{} } +func (m *RDSNode) String() string { return proto.CompactTextString(m) } +func (*RDSNode) ProtoMessage() {} +func (*RDSNode) Descriptor() ([]byte, []int) { + return fileDescriptor_nodes_c79059c91c0f32b3, []int{4} +} +func (m *RDSNode) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RDSNode.Unmarshal(m, b) +} +func (m *RDSNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RDSNode.Marshal(b, m, deterministic) +} +func (dst *RDSNode) XXX_Merge(src proto.Message) { + xxx_messageInfo_RDSNode.Merge(dst, src) +} +func (m *RDSNode) XXX_Size() int { + return xxx_messageInfo_RDSNode.Size(m) +} +func (m *RDSNode) XXX_DiscardUnknown() { + xxx_messageInfo_RDSNode.DiscardUnknown(m) +} + +var xxx_messageInfo_RDSNode proto.InternalMessageInfo + +func (m *RDSNode) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *RDSNode) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *RDSNode) GetRegion() string { + if m != nil { + return m.Region + } + return "" +} + +type ListNodesRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListNodesRequest) Reset() { *m = ListNodesRequest{} } +func (m *ListNodesRequest) String() string { return proto.CompactTextString(m) } +func (*ListNodesRequest) ProtoMessage() {} +func (*ListNodesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_nodes_c79059c91c0f32b3, []int{5} +} +func (m *ListNodesRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListNodesRequest.Unmarshal(m, b) +} +func (m *ListNodesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListNodesRequest.Marshal(b, m, deterministic) +} +func (dst *ListNodesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListNodesRequest.Merge(dst, src) +} +func (m *ListNodesRequest) XXX_Size() int { + return xxx_messageInfo_ListNodesRequest.Size(m) +} +func (m *ListNodesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListNodesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListNodesRequest proto.InternalMessageInfo + +type ListNodesResponse struct { + BareMetal []*BareMetalNode `protobuf:"bytes,1,rep,name=bare_metal,json=bareMetal,proto3" json:"bare_metal,omitempty"` + VirtualMachine []*VirtualMachineNode `protobuf:"bytes,2,rep,name=virtual_machine,json=virtualMachine,proto3" json:"virtual_machine,omitempty"` + Container []*ContainerNode `protobuf:"bytes,3,rep,name=container,proto3" json:"container,omitempty"` + Remote []*RemoteNode `protobuf:"bytes,4,rep,name=remote,proto3" json:"remote,omitempty"` + Rds []*RDSNode `protobuf:"bytes,5,rep,name=rds,proto3" json:"rds,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListNodesResponse) Reset() { *m = ListNodesResponse{} } +func (m *ListNodesResponse) String() string { return proto.CompactTextString(m) } +func (*ListNodesResponse) ProtoMessage() {} +func (*ListNodesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_nodes_c79059c91c0f32b3, []int{6} +} +func (m *ListNodesResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListNodesResponse.Unmarshal(m, b) +} +func (m *ListNodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListNodesResponse.Marshal(b, m, deterministic) +} +func (dst *ListNodesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListNodesResponse.Merge(dst, src) +} +func (m *ListNodesResponse) XXX_Size() int { + return xxx_messageInfo_ListNodesResponse.Size(m) +} +func (m *ListNodesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListNodesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListNodesResponse proto.InternalMessageInfo + +func (m *ListNodesResponse) GetBareMetal() []*BareMetalNode { + if m != nil { + return m.BareMetal + } + return nil +} + +func (m *ListNodesResponse) GetVirtualMachine() []*VirtualMachineNode { + if m != nil { + return m.VirtualMachine + } + return nil +} + +func (m *ListNodesResponse) GetContainer() []*ContainerNode { + if m != nil { + return m.Container + } + return nil +} + +func (m *ListNodesResponse) GetRemote() []*RemoteNode { + if m != nil { + return m.Remote + } + return nil +} + +func (m *ListNodesResponse) GetRds() []*RDSNode { + if m != nil { + return m.Rds + } + return nil +} + +type GetNodeRequest struct { + // Unique Node identifier. + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetNodeRequest) Reset() { *m = GetNodeRequest{} } +func (m *GetNodeRequest) String() string { return proto.CompactTextString(m) } +func (*GetNodeRequest) ProtoMessage() {} +func (*GetNodeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_nodes_c79059c91c0f32b3, []int{7} +} +func (m *GetNodeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetNodeRequest.Unmarshal(m, b) +} +func (m *GetNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetNodeRequest.Marshal(b, m, deterministic) +} +func (dst *GetNodeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNodeRequest.Merge(dst, src) +} +func (m *GetNodeRequest) XXX_Size() int { + return xxx_messageInfo_GetNodeRequest.Size(m) +} +func (m *GetNodeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetNodeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetNodeRequest proto.InternalMessageInfo + +func (m *GetNodeRequest) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +type GetNodeResponse struct { + // Types that are valid to be assigned to Node: + // *GetNodeResponse_BareMetal + // *GetNodeResponse_VirtualMachine + // *GetNodeResponse_Container + // *GetNodeResponse_Remote + // *GetNodeResponse_Rds + Node isGetNodeResponse_Node `protobuf_oneof:"node"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetNodeResponse) Reset() { *m = GetNodeResponse{} } +func (m *GetNodeResponse) String() string { return proto.CompactTextString(m) } +func (*GetNodeResponse) ProtoMessage() {} +func (*GetNodeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_nodes_c79059c91c0f32b3, []int{8} +} +func (m *GetNodeResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetNodeResponse.Unmarshal(m, b) +} +func (m *GetNodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetNodeResponse.Marshal(b, m, deterministic) +} +func (dst *GetNodeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNodeResponse.Merge(dst, src) +} +func (m *GetNodeResponse) XXX_Size() int { + return xxx_messageInfo_GetNodeResponse.Size(m) +} +func (m *GetNodeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetNodeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetNodeResponse proto.InternalMessageInfo + +type isGetNodeResponse_Node interface { + isGetNodeResponse_Node() +} + +type GetNodeResponse_BareMetal struct { + BareMetal *BareMetalNode `protobuf:"bytes,1,opt,name=bare_metal,json=bareMetal,proto3,oneof"` +} + +type GetNodeResponse_VirtualMachine struct { + VirtualMachine *VirtualMachineNode `protobuf:"bytes,2,opt,name=virtual_machine,json=virtualMachine,proto3,oneof"` +} + +type GetNodeResponse_Container struct { + Container *ContainerNode `protobuf:"bytes,3,opt,name=container,proto3,oneof"` +} + +type GetNodeResponse_Remote struct { + Remote *RemoteNode `protobuf:"bytes,4,opt,name=remote,proto3,oneof"` +} + +type GetNodeResponse_Rds struct { + Rds *RDSNode `protobuf:"bytes,5,opt,name=rds,proto3,oneof"` +} + +func (*GetNodeResponse_BareMetal) isGetNodeResponse_Node() {} + +func (*GetNodeResponse_VirtualMachine) isGetNodeResponse_Node() {} + +func (*GetNodeResponse_Container) isGetNodeResponse_Node() {} + +func (*GetNodeResponse_Remote) isGetNodeResponse_Node() {} + +func (*GetNodeResponse_Rds) isGetNodeResponse_Node() {} + +func (m *GetNodeResponse) GetNode() isGetNodeResponse_Node { + if m != nil { + return m.Node + } + return nil +} + +func (m *GetNodeResponse) GetBareMetal() *BareMetalNode { + if x, ok := m.GetNode().(*GetNodeResponse_BareMetal); ok { + return x.BareMetal + } + return nil +} + +func (m *GetNodeResponse) GetVirtualMachine() *VirtualMachineNode { + if x, ok := m.GetNode().(*GetNodeResponse_VirtualMachine); ok { + return x.VirtualMachine + } + return nil +} + +func (m *GetNodeResponse) GetContainer() *ContainerNode { + if x, ok := m.GetNode().(*GetNodeResponse_Container); ok { + return x.Container + } + return nil +} + +func (m *GetNodeResponse) GetRemote() *RemoteNode { + if x, ok := m.GetNode().(*GetNodeResponse_Remote); ok { + return x.Remote + } + return nil +} + +func (m *GetNodeResponse) GetRds() *RDSNode { + if x, ok := m.GetNode().(*GetNodeResponse_Rds); ok { + return x.Rds + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*GetNodeResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _GetNodeResponse_OneofMarshaler, _GetNodeResponse_OneofUnmarshaler, _GetNodeResponse_OneofSizer, []interface{}{ + (*GetNodeResponse_BareMetal)(nil), + (*GetNodeResponse_VirtualMachine)(nil), + (*GetNodeResponse_Container)(nil), + (*GetNodeResponse_Remote)(nil), + (*GetNodeResponse_Rds)(nil), + } +} + +func _GetNodeResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*GetNodeResponse) + // node + switch x := m.Node.(type) { + case *GetNodeResponse_BareMetal: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BareMetal); err != nil { + return err + } + case *GetNodeResponse_VirtualMachine: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.VirtualMachine); err != nil { + return err + } + case *GetNodeResponse_Container: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Container); err != nil { + return err + } + case *GetNodeResponse_Remote: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Remote); err != nil { + return err + } + case *GetNodeResponse_Rds: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Rds); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("GetNodeResponse.Node has unexpected type %T", x) + } + return nil +} + +func _GetNodeResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*GetNodeResponse) + switch tag { + case 1: // node.bare_metal + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BareMetalNode) + err := b.DecodeMessage(msg) + m.Node = &GetNodeResponse_BareMetal{msg} + return true, err + case 2: // node.virtual_machine + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(VirtualMachineNode) + err := b.DecodeMessage(msg) + m.Node = &GetNodeResponse_VirtualMachine{msg} + return true, err + case 3: // node.container + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ContainerNode) + err := b.DecodeMessage(msg) + m.Node = &GetNodeResponse_Container{msg} + return true, err + case 4: // node.remote + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RemoteNode) + err := b.DecodeMessage(msg) + m.Node = &GetNodeResponse_Remote{msg} + return true, err + case 5: // node.rds + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RDSNode) + err := b.DecodeMessage(msg) + m.Node = &GetNodeResponse_Rds{msg} + return true, err + default: + return false, nil + } +} + +func _GetNodeResponse_OneofSizer(msg proto.Message) (n int) { + m := msg.(*GetNodeResponse) + // node + switch x := m.Node.(type) { + case *GetNodeResponse_BareMetal: + s := proto.Size(x.BareMetal) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *GetNodeResponse_VirtualMachine: + s := proto.Size(x.VirtualMachine) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *GetNodeResponse_Container: + s := proto.Size(x.Container) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *GetNodeResponse_Remote: + s := proto.Size(x.Remote) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *GetNodeResponse_Rds: + s := proto.Size(x.Rds) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type AddNodeRequest struct { + // Node type. + Type NodeType `protobuf:"varint,2,opt,name=type,proto3,enum=inventory.NodeType" json:"type,omitempty"` + // Unique Node name. + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + // Hostname. Is not unique. + Hostname string `protobuf:"bytes,4,opt,name=hostname,proto3" json:"hostname,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddNodeRequest) Reset() { *m = AddNodeRequest{} } +func (m *AddNodeRequest) String() string { return proto.CompactTextString(m) } +func (*AddNodeRequest) ProtoMessage() {} +func (*AddNodeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_nodes_c79059c91c0f32b3, []int{9} +} +func (m *AddNodeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddNodeRequest.Unmarshal(m, b) +} +func (m *AddNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddNodeRequest.Marshal(b, m, deterministic) +} +func (dst *AddNodeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddNodeRequest.Merge(dst, src) +} +func (m *AddNodeRequest) XXX_Size() int { + return xxx_messageInfo_AddNodeRequest.Size(m) +} +func (m *AddNodeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AddNodeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AddNodeRequest proto.InternalMessageInfo + +func (m *AddNodeRequest) GetType() NodeType { + if m != nil { + return m.Type + } + return NodeType_NODE_TYPE_INVALID +} + +func (m *AddNodeRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *AddNodeRequest) GetHostname() string { + if m != nil { + return m.Hostname + } + return "" +} + +type AddNodeResponse struct { + // Types that are valid to be assigned to Node: + // *AddNodeResponse_BareMetal + // *AddNodeResponse_VirtualMachine + // *AddNodeResponse_Container + Node isAddNodeResponse_Node `protobuf_oneof:"node"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddNodeResponse) Reset() { *m = AddNodeResponse{} } +func (m *AddNodeResponse) String() string { return proto.CompactTextString(m) } +func (*AddNodeResponse) ProtoMessage() {} +func (*AddNodeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_nodes_c79059c91c0f32b3, []int{10} +} +func (m *AddNodeResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddNodeResponse.Unmarshal(m, b) +} +func (m *AddNodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddNodeResponse.Marshal(b, m, deterministic) +} +func (dst *AddNodeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddNodeResponse.Merge(dst, src) +} +func (m *AddNodeResponse) XXX_Size() int { + return xxx_messageInfo_AddNodeResponse.Size(m) +} +func (m *AddNodeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AddNodeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AddNodeResponse proto.InternalMessageInfo + +type isAddNodeResponse_Node interface { + isAddNodeResponse_Node() +} + +type AddNodeResponse_BareMetal struct { + BareMetal *BareMetalNode `protobuf:"bytes,1,opt,name=bare_metal,json=bareMetal,proto3,oneof"` +} + +type AddNodeResponse_VirtualMachine struct { + VirtualMachine *VirtualMachineNode `protobuf:"bytes,2,opt,name=virtual_machine,json=virtualMachine,proto3,oneof"` +} + +type AddNodeResponse_Container struct { + Container *ContainerNode `protobuf:"bytes,3,opt,name=container,proto3,oneof"` +} + +func (*AddNodeResponse_BareMetal) isAddNodeResponse_Node() {} + +func (*AddNodeResponse_VirtualMachine) isAddNodeResponse_Node() {} + +func (*AddNodeResponse_Container) isAddNodeResponse_Node() {} + +func (m *AddNodeResponse) GetNode() isAddNodeResponse_Node { + if m != nil { + return m.Node + } + return nil +} + +func (m *AddNodeResponse) GetBareMetal() *BareMetalNode { + if x, ok := m.GetNode().(*AddNodeResponse_BareMetal); ok { + return x.BareMetal + } + return nil +} + +func (m *AddNodeResponse) GetVirtualMachine() *VirtualMachineNode { + if x, ok := m.GetNode().(*AddNodeResponse_VirtualMachine); ok { + return x.VirtualMachine + } + return nil +} + +func (m *AddNodeResponse) GetContainer() *ContainerNode { + if x, ok := m.GetNode().(*AddNodeResponse_Container); ok { + return x.Container + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*AddNodeResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _AddNodeResponse_OneofMarshaler, _AddNodeResponse_OneofUnmarshaler, _AddNodeResponse_OneofSizer, []interface{}{ + (*AddNodeResponse_BareMetal)(nil), + (*AddNodeResponse_VirtualMachine)(nil), + (*AddNodeResponse_Container)(nil), + } +} + +func _AddNodeResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*AddNodeResponse) + // node + switch x := m.Node.(type) { + case *AddNodeResponse_BareMetal: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.BareMetal); err != nil { + return err + } + case *AddNodeResponse_VirtualMachine: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.VirtualMachine); err != nil { + return err + } + case *AddNodeResponse_Container: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Container); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("AddNodeResponse.Node has unexpected type %T", x) + } + return nil +} + +func _AddNodeResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*AddNodeResponse) + switch tag { + case 1: // node.bare_metal + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BareMetalNode) + err := b.DecodeMessage(msg) + m.Node = &AddNodeResponse_BareMetal{msg} + return true, err + case 2: // node.virtual_machine + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(VirtualMachineNode) + err := b.DecodeMessage(msg) + m.Node = &AddNodeResponse_VirtualMachine{msg} + return true, err + case 3: // node.container + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ContainerNode) + err := b.DecodeMessage(msg) + m.Node = &AddNodeResponse_Container{msg} + return true, err + default: + return false, nil + } +} + +func _AddNodeResponse_OneofSizer(msg proto.Message) (n int) { + m := msg.(*AddNodeResponse) + // node + switch x := m.Node.(type) { + case *AddNodeResponse_BareMetal: + s := proto.Size(x.BareMetal) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *AddNodeResponse_VirtualMachine: + s := proto.Size(x.VirtualMachine) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *AddNodeResponse_Container: + s := proto.Size(x.Container) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type AddRemoveNodeRequest struct { + // Unique Node name. + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddRemoveNodeRequest) Reset() { *m = AddRemoveNodeRequest{} } +func (m *AddRemoveNodeRequest) String() string { return proto.CompactTextString(m) } +func (*AddRemoveNodeRequest) ProtoMessage() {} +func (*AddRemoveNodeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_nodes_c79059c91c0f32b3, []int{11} +} +func (m *AddRemoveNodeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddRemoveNodeRequest.Unmarshal(m, b) +} +func (m *AddRemoveNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddRemoveNodeRequest.Marshal(b, m, deterministic) +} +func (dst *AddRemoveNodeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddRemoveNodeRequest.Merge(dst, src) +} +func (m *AddRemoveNodeRequest) XXX_Size() int { + return xxx_messageInfo_AddRemoveNodeRequest.Size(m) +} +func (m *AddRemoveNodeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AddRemoveNodeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AddRemoveNodeRequest proto.InternalMessageInfo + +func (m *AddRemoveNodeRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type AddRemoveNodeResponse struct { + Remote *RemoteNode `protobuf:"bytes,1,opt,name=remote,proto3" json:"remote,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddRemoveNodeResponse) Reset() { *m = AddRemoveNodeResponse{} } +func (m *AddRemoveNodeResponse) String() string { return proto.CompactTextString(m) } +func (*AddRemoveNodeResponse) ProtoMessage() {} +func (*AddRemoveNodeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_nodes_c79059c91c0f32b3, []int{12} +} +func (m *AddRemoveNodeResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddRemoveNodeResponse.Unmarshal(m, b) +} +func (m *AddRemoveNodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddRemoveNodeResponse.Marshal(b, m, deterministic) +} +func (dst *AddRemoveNodeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddRemoveNodeResponse.Merge(dst, src) +} +func (m *AddRemoveNodeResponse) XXX_Size() int { + return xxx_messageInfo_AddRemoveNodeResponse.Size(m) +} +func (m *AddRemoveNodeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AddRemoveNodeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AddRemoveNodeResponse proto.InternalMessageInfo + +func (m *AddRemoveNodeResponse) GetRemote() *RemoteNode { + if m != nil { + return m.Remote + } + return nil +} + +type AddRDSNodeRequest struct { + // Unique Node name. + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddRDSNodeRequest) Reset() { *m = AddRDSNodeRequest{} } +func (m *AddRDSNodeRequest) String() string { return proto.CompactTextString(m) } +func (*AddRDSNodeRequest) ProtoMessage() {} +func (*AddRDSNodeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_nodes_c79059c91c0f32b3, []int{13} +} +func (m *AddRDSNodeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddRDSNodeRequest.Unmarshal(m, b) +} +func (m *AddRDSNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddRDSNodeRequest.Marshal(b, m, deterministic) +} +func (dst *AddRDSNodeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddRDSNodeRequest.Merge(dst, src) +} +func (m *AddRDSNodeRequest) XXX_Size() int { + return xxx_messageInfo_AddRDSNodeRequest.Size(m) +} +func (m *AddRDSNodeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AddRDSNodeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AddRDSNodeRequest proto.InternalMessageInfo + +func (m *AddRDSNodeRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type AddRDSNodeResponse struct { + Rds *RDSNode `protobuf:"bytes,1,opt,name=rds,proto3" json:"rds,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddRDSNodeResponse) Reset() { *m = AddRDSNodeResponse{} } +func (m *AddRDSNodeResponse) String() string { return proto.CompactTextString(m) } +func (*AddRDSNodeResponse) ProtoMessage() {} +func (*AddRDSNodeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_nodes_c79059c91c0f32b3, []int{14} +} +func (m *AddRDSNodeResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddRDSNodeResponse.Unmarshal(m, b) +} +func (m *AddRDSNodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddRDSNodeResponse.Marshal(b, m, deterministic) +} +func (dst *AddRDSNodeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddRDSNodeResponse.Merge(dst, src) +} +func (m *AddRDSNodeResponse) XXX_Size() int { + return xxx_messageInfo_AddRDSNodeResponse.Size(m) +} +func (m *AddRDSNodeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AddRDSNodeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AddRDSNodeResponse proto.InternalMessageInfo + +func (m *AddRDSNodeResponse) GetRds() *RDSNode { + if m != nil { + return m.Rds + } + return nil +} + +type RemoveNodeRequest struct { + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RemoveNodeRequest) Reset() { *m = RemoveNodeRequest{} } +func (m *RemoveNodeRequest) String() string { return proto.CompactTextString(m) } +func (*RemoveNodeRequest) ProtoMessage() {} +func (*RemoveNodeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_nodes_c79059c91c0f32b3, []int{15} +} +func (m *RemoveNodeRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RemoveNodeRequest.Unmarshal(m, b) +} +func (m *RemoveNodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RemoveNodeRequest.Marshal(b, m, deterministic) +} +func (dst *RemoveNodeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveNodeRequest.Merge(dst, src) +} +func (m *RemoveNodeRequest) XXX_Size() int { + return xxx_messageInfo_RemoveNodeRequest.Size(m) +} +func (m *RemoveNodeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveNodeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveNodeRequest proto.InternalMessageInfo + +func (m *RemoveNodeRequest) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +type RemoveNodeResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RemoveNodeResponse) Reset() { *m = RemoveNodeResponse{} } +func (m *RemoveNodeResponse) String() string { return proto.CompactTextString(m) } +func (*RemoveNodeResponse) ProtoMessage() {} +func (*RemoveNodeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_nodes_c79059c91c0f32b3, []int{16} +} +func (m *RemoveNodeResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RemoveNodeResponse.Unmarshal(m, b) +} +func (m *RemoveNodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RemoveNodeResponse.Marshal(b, m, deterministic) +} +func (dst *RemoveNodeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveNodeResponse.Merge(dst, src) +} +func (m *RemoveNodeResponse) XXX_Size() int { + return xxx_messageInfo_RemoveNodeResponse.Size(m) +} +func (m *RemoveNodeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveNodeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveNodeResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*BareMetalNode)(nil), "inventory.BareMetalNode") + proto.RegisterType((*VirtualMachineNode)(nil), "inventory.VirtualMachineNode") + proto.RegisterType((*ContainerNode)(nil), "inventory.ContainerNode") + proto.RegisterType((*RemoteNode)(nil), "inventory.RemoteNode") + proto.RegisterType((*RDSNode)(nil), "inventory.RDSNode") + proto.RegisterType((*ListNodesRequest)(nil), "inventory.ListNodesRequest") + proto.RegisterType((*ListNodesResponse)(nil), "inventory.ListNodesResponse") + proto.RegisterType((*GetNodeRequest)(nil), "inventory.GetNodeRequest") + proto.RegisterType((*GetNodeResponse)(nil), "inventory.GetNodeResponse") + proto.RegisterType((*AddNodeRequest)(nil), "inventory.AddNodeRequest") + proto.RegisterType((*AddNodeResponse)(nil), "inventory.AddNodeResponse") + proto.RegisterType((*AddRemoveNodeRequest)(nil), "inventory.AddRemoveNodeRequest") + proto.RegisterType((*AddRemoveNodeResponse)(nil), "inventory.AddRemoveNodeResponse") + proto.RegisterType((*AddRDSNodeRequest)(nil), "inventory.AddRDSNodeRequest") + proto.RegisterType((*AddRDSNodeResponse)(nil), "inventory.AddRDSNodeResponse") + proto.RegisterType((*RemoveNodeRequest)(nil), "inventory.RemoveNodeRequest") + proto.RegisterType((*RemoveNodeResponse)(nil), "inventory.RemoveNodeResponse") + proto.RegisterEnum("inventory.NodeType", NodeType_name, NodeType_value) +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// NodesClient is the client API for Nodes service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type NodesClient interface { + // ListNodes returns a list of all Nodes. + ListNodes(ctx context.Context, in *ListNodesRequest, opts ...grpc.CallOption) (*ListNodesResponse, error) + // GetNode returns a single Node by ID. + GetNode(ctx context.Context, in *GetNodeRequest, opts ...grpc.CallOption) (*GetNodeResponse, error) + // AddNode adds bare metal, virtual machine, or container node Node. + AddNode(ctx context.Context, in *AddNodeRequest, opts ...grpc.CallOption) (*AddNodeResponse, error) + // AddRemoveNode adds remote Node. + AddRemoveNode(ctx context.Context, in *AddRemoveNodeRequest, opts ...grpc.CallOption) (*AddRemoveNodeResponse, error) + // AddRDSNode adds AWS RDS Node. + AddRDSNode(ctx context.Context, in *AddRDSNodeRequest, opts ...grpc.CallOption) (*AddRDSNodeResponse, error) + // RemoveNode removes Node without any Agents and Services. + RemoveNode(ctx context.Context, in *RemoveNodeRequest, opts ...grpc.CallOption) (*RemoveNodeResponse, error) +} + +type nodesClient struct { + cc *grpc.ClientConn +} + +func NewNodesClient(cc *grpc.ClientConn) NodesClient { + return &nodesClient{cc} +} + +func (c *nodesClient) ListNodes(ctx context.Context, in *ListNodesRequest, opts ...grpc.CallOption) (*ListNodesResponse, error) { + out := new(ListNodesResponse) + err := c.cc.Invoke(ctx, "/inventory.Nodes/ListNodes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodesClient) GetNode(ctx context.Context, in *GetNodeRequest, opts ...grpc.CallOption) (*GetNodeResponse, error) { + out := new(GetNodeResponse) + err := c.cc.Invoke(ctx, "/inventory.Nodes/GetNode", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodesClient) AddNode(ctx context.Context, in *AddNodeRequest, opts ...grpc.CallOption) (*AddNodeResponse, error) { + out := new(AddNodeResponse) + err := c.cc.Invoke(ctx, "/inventory.Nodes/AddNode", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodesClient) AddRemoveNode(ctx context.Context, in *AddRemoveNodeRequest, opts ...grpc.CallOption) (*AddRemoveNodeResponse, error) { + out := new(AddRemoveNodeResponse) + err := c.cc.Invoke(ctx, "/inventory.Nodes/AddRemoveNode", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodesClient) AddRDSNode(ctx context.Context, in *AddRDSNodeRequest, opts ...grpc.CallOption) (*AddRDSNodeResponse, error) { + out := new(AddRDSNodeResponse) + err := c.cc.Invoke(ctx, "/inventory.Nodes/AddRDSNode", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodesClient) RemoveNode(ctx context.Context, in *RemoveNodeRequest, opts ...grpc.CallOption) (*RemoveNodeResponse, error) { + out := new(RemoveNodeResponse) + err := c.cc.Invoke(ctx, "/inventory.Nodes/RemoveNode", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NodesServer is the server API for Nodes service. +type NodesServer interface { + // ListNodes returns a list of all Nodes. + ListNodes(context.Context, *ListNodesRequest) (*ListNodesResponse, error) + // GetNode returns a single Node by ID. + GetNode(context.Context, *GetNodeRequest) (*GetNodeResponse, error) + // AddNode adds bare metal, virtual machine, or container node Node. + AddNode(context.Context, *AddNodeRequest) (*AddNodeResponse, error) + // AddRemoveNode adds remote Node. + AddRemoveNode(context.Context, *AddRemoveNodeRequest) (*AddRemoveNodeResponse, error) + // AddRDSNode adds AWS RDS Node. + AddRDSNode(context.Context, *AddRDSNodeRequest) (*AddRDSNodeResponse, error) + // RemoveNode removes Node without any Agents and Services. + RemoveNode(context.Context, *RemoveNodeRequest) (*RemoveNodeResponse, error) +} + +func RegisterNodesServer(s *grpc.Server, srv NodesServer) { + s.RegisterService(&_Nodes_serviceDesc, srv) +} + +func _Nodes_ListNodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListNodesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodesServer).ListNodes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/inventory.Nodes/ListNodes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodesServer).ListNodes(ctx, req.(*ListNodesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Nodes_GetNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodesServer).GetNode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/inventory.Nodes/GetNode", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodesServer).GetNode(ctx, req.(*GetNodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Nodes_AddNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddNodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodesServer).AddNode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/inventory.Nodes/AddNode", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodesServer).AddNode(ctx, req.(*AddNodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Nodes_AddRemoveNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddRemoveNodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodesServer).AddRemoveNode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/inventory.Nodes/AddRemoveNode", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodesServer).AddRemoveNode(ctx, req.(*AddRemoveNodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Nodes_AddRDSNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddRDSNodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodesServer).AddRDSNode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/inventory.Nodes/AddRDSNode", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodesServer).AddRDSNode(ctx, req.(*AddRDSNodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Nodes_RemoveNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveNodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodesServer).RemoveNode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/inventory.Nodes/RemoveNode", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodesServer).RemoveNode(ctx, req.(*RemoveNodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Nodes_serviceDesc = grpc.ServiceDesc{ + ServiceName: "inventory.Nodes", + HandlerType: (*NodesServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListNodes", + Handler: _Nodes_ListNodes_Handler, + }, + { + MethodName: "GetNode", + Handler: _Nodes_GetNode_Handler, + }, + { + MethodName: "AddNode", + Handler: _Nodes_AddNode_Handler, + }, + { + MethodName: "AddRemoveNode", + Handler: _Nodes_AddRemoveNode_Handler, + }, + { + MethodName: "AddRDSNode", + Handler: _Nodes_AddRDSNode_Handler, + }, + { + MethodName: "RemoveNode", + Handler: _Nodes_RemoveNode_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "inventory/nodes.proto", +} + +func init() { proto.RegisterFile("inventory/nodes.proto", fileDescriptor_nodes_c79059c91c0f32b3) } + +var fileDescriptor_nodes_c79059c91c0f32b3 = []byte{ + // 827 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x96, 0x5d, 0x6e, 0xeb, 0x44, + 0x14, 0xc7, 0x33, 0x8e, 0x93, 0x26, 0x07, 0x25, 0x71, 0xa6, 0x0d, 0x32, 0x69, 0x02, 0xc1, 0x45, + 0x25, 0x54, 0xd0, 0xa0, 0x22, 0x01, 0xad, 0x2a, 0x21, 0xb7, 0x71, 0x49, 0xaa, 0x24, 0x85, 0x69, + 0x5a, 0x09, 0x5e, 0x22, 0xb7, 0x1e, 0xb5, 0x46, 0x8d, 0x1d, 0x6c, 0x37, 0x52, 0xdf, 0x10, 0x5b, + 0x60, 0x05, 0x2c, 0x81, 0x77, 0x76, 0xc1, 0x0b, 0x0b, 0xb8, 0x0b, 0xb9, 0xf2, 0x78, 0xe2, 0xd8, + 0xce, 0xc7, 0xed, 0xad, 0xee, 0xd3, 0x7d, 0xab, 0x67, 0xce, 0x39, 0xff, 0x39, 0xbf, 0xf3, 0xd1, + 0x40, 0xc5, 0xb4, 0xa6, 0xd4, 0xf2, 0x6c, 0xe7, 0xa9, 0x65, 0xd9, 0x06, 0x75, 0xf7, 0x27, 0x8e, + 0xed, 0xd9, 0x38, 0x1f, 0x1e, 0x57, 0x6b, 0x77, 0xb6, 0x7d, 0xf7, 0x40, 0x5b, 0xfa, 0xc4, 0x6c, + 0xe9, 0x96, 0x65, 0x7b, 0xba, 0x67, 0xda, 0x16, 0x37, 0x54, 0xae, 0xa0, 0x70, 0xa2, 0x3b, 0xb4, + 0x4f, 0x3d, 0xfd, 0x61, 0x60, 0x1b, 0x14, 0x17, 0x41, 0x30, 0x0d, 0x19, 0x35, 0x50, 0xb3, 0x40, + 0x04, 0xd3, 0xc0, 0x18, 0x44, 0x4b, 0x1f, 0x53, 0x39, 0xdd, 0x40, 0xcd, 0x3c, 0x61, 0x7f, 0xe3, + 0x2a, 0xe4, 0xee, 0x6d, 0xd7, 0x63, 0xe7, 0x22, 0x3b, 0x0f, 0xbf, 0xcf, 0xc5, 0x9c, 0x20, 0xa5, + 0x95, 0x5f, 0x01, 0x5f, 0x9b, 0x8e, 0xf7, 0xa8, 0x3f, 0xf4, 0xf5, 0xdb, 0x7b, 0xd3, 0xa2, 0xef, + 0x30, 0xf6, 0x0f, 0x50, 0x38, 0xb5, 0x2d, 0x4f, 0x37, 0x2d, 0xea, 0x3c, 0x37, 0x6c, 0xe0, 0x7a, + 0x2e, 0xe6, 0x44, 0x29, 0xa3, 0x1c, 0x03, 0x10, 0x3a, 0xb6, 0x3d, 0xfa, 0x22, 0xef, 0x9f, 0x61, + 0x83, 0xb4, 0x2f, 0x9f, 0x9d, 0xcf, 0x87, 0x90, 0x75, 0xe8, 0x9d, 0x69, 0x5b, 0x72, 0x86, 0x9d, + 0xf2, 0xaf, 0x58, 0x48, 0x0c, 0x52, 0xcf, 0x74, 0x3d, 0x3f, 0xa6, 0x4b, 0xe8, 0xef, 0x8f, 0xd4, + 0xf5, 0x94, 0xbf, 0x05, 0x28, 0x47, 0x0e, 0xdd, 0x89, 0x6d, 0xb9, 0x14, 0x7f, 0x07, 0x70, 0xa3, + 0x3b, 0x74, 0x34, 0xf6, 0xeb, 0x25, 0xa3, 0x46, 0xba, 0xf9, 0xc1, 0x81, 0xbc, 0x1f, 0x16, 0x7b, + 0x3f, 0x56, 0x4b, 0x92, 0xbf, 0x99, 0x7d, 0xe2, 0x33, 0x28, 0x4d, 0x83, 0x82, 0x8c, 0xc6, 0x41, + 0x45, 0x64, 0x81, 0x79, 0xd7, 0x23, 0xde, 0x8b, 0x25, 0x23, 0xc5, 0x69, 0xec, 0x0c, 0x7f, 0x0b, + 0xf9, 0xdb, 0x19, 0x7c, 0x39, 0xbd, 0xa0, 0x1f, 0x2b, 0x0c, 0x99, 0x9b, 0xe2, 0xaf, 0x7c, 0x0c, + 0x3e, 0x73, 0x59, 0x64, 0x4e, 0x95, 0x88, 0xd3, 0xbc, 0x18, 0x84, 0x1b, 0xe1, 0xcf, 0x20, 0xed, + 0x18, 0xae, 0x9c, 0x61, 0xb6, 0x38, 0x6a, 0x1b, 0xa0, 0x27, 0xfe, 0xb5, 0xd2, 0x80, 0xe2, 0x8f, + 0x94, 0x11, 0xe2, 0xd4, 0x92, 0x15, 0x51, 0xfe, 0x11, 0xa0, 0x14, 0x9a, 0x70, 0x86, 0x87, 0x09, + 0x86, 0x68, 0x1d, 0xc3, 0x4e, 0x2a, 0x4a, 0xb1, 0xb3, 0x8c, 0x22, 0x7a, 0x23, 0xc5, 0x4e, 0x6a, + 0x81, 0xe3, 0xf7, 0x71, 0x8e, 0x68, 0x1d, 0x47, 0xff, 0x0d, 0x73, 0x92, 0xad, 0x08, 0x49, 0xb4, + 0x92, 0x64, 0x27, 0x15, 0xb2, 0xdc, 0x9d, 0xb1, 0x44, 0xcb, 0x59, 0x76, 0x52, 0x8c, 0xe6, 0x49, + 0x16, 0x44, 0x7f, 0x85, 0x28, 0x36, 0x14, 0x55, 0xc3, 0x88, 0x52, 0xfd, 0x1c, 0x44, 0xef, 0x69, + 0x12, 0xe4, 0x5a, 0x3c, 0xd8, 0x8c, 0x84, 0xf0, 0xad, 0x86, 0x4f, 0x13, 0x4a, 0x98, 0xc1, 0x0b, + 0x06, 0x1a, 0x49, 0x82, 0xf2, 0x3f, 0x82, 0x52, 0xa8, 0xf8, 0x5e, 0x14, 0x29, 0x64, 0x79, 0x0c, + 0x5b, 0xaa, 0x61, 0xf8, 0x65, 0x99, 0xd2, 0x28, 0xd1, 0xe5, 0x4b, 0x06, 0x49, 0x42, 0x6c, 0x2f, + 0x9c, 0x41, 0x25, 0xe1, 0xcd, 0xe9, 0xcc, 0xa7, 0x09, 0xad, 0xe9, 0x81, 0x59, 0x07, 0x28, 0x87, + 0x50, 0xf6, 0xe3, 0xf0, 0xd1, 0x79, 0xab, 0x27, 0x1c, 0x01, 0x8e, 0xba, 0x72, 0x7d, 0x3e, 0x9e, + 0x68, 0x55, 0x4b, 0x05, 0xe3, 0xb9, 0x03, 0xe5, 0xc5, 0xcc, 0x93, 0x13, 0xba, 0x05, 0x78, 0x31, + 0xc1, 0xbd, 0xdf, 0x20, 0x37, 0x6b, 0x2d, 0x5c, 0x81, 0xf2, 0xe0, 0xa2, 0xad, 0x8d, 0x86, 0xbf, + 0xfc, 0xa4, 0x8d, 0xba, 0x83, 0x6b, 0xb5, 0xd7, 0x6d, 0x4b, 0x29, 0x5c, 0x04, 0x38, 0x51, 0x89, + 0x36, 0xea, 0x6b, 0x43, 0xb5, 0x27, 0x21, 0xbc, 0x09, 0xa5, 0xeb, 0x2e, 0x19, 0x5e, 0xa9, 0xbd, + 0x51, 0x5f, 0x3d, 0xed, 0x74, 0x07, 0x9a, 0x24, 0xe0, 0x02, 0xe4, 0x4f, 0x2f, 0x06, 0x43, 0xb5, + 0x3b, 0xd0, 0x88, 0x94, 0xc6, 0x00, 0x59, 0xa2, 0xf5, 0x2f, 0x86, 0x9a, 0x24, 0xe2, 0x0d, 0x48, + 0x93, 0xf6, 0xa5, 0x94, 0x39, 0xf8, 0x37, 0x03, 0x19, 0xb6, 0x65, 0xf1, 0x04, 0xf2, 0xe1, 0xca, + 0xc5, 0xdb, 0x91, 0xb4, 0x92, 0xdb, 0xb9, 0x5a, 0x5b, 0x7e, 0x19, 0xbc, 0x5e, 0x69, 0xfe, 0xf9, + 0xdf, 0xab, 0xbf, 0x04, 0x45, 0xa9, 0xb7, 0xa6, 0x5f, 0xb7, 0xe6, 0xff, 0xa0, 0x99, 0x51, 0x2b, + 0x34, 0x3f, 0x42, 0x7b, 0xf8, 0x1e, 0x36, 0xf8, 0x7a, 0xc2, 0x1f, 0x45, 0x42, 0xc6, 0xb7, 0x5a, + 0xb5, 0xba, 0xec, 0x8a, 0x6b, 0xed, 0x32, 0xad, 0x86, 0xb2, 0xbd, 0x4c, 0x8b, 0x1b, 0x73, 0x25, + 0x3e, 0x63, 0x31, 0xa5, 0xf8, 0xa4, 0xc7, 0x94, 0x12, 0x23, 0xb9, 0x5e, 0x89, 0x1b, 0xfb, 0x4a, + 0x7f, 0x20, 0x28, 0xc4, 0xda, 0x16, 0x7f, 0x12, 0x8f, 0xba, 0xd0, 0x14, 0xd5, 0xc6, 0x6a, 0x03, + 0x2e, 0xfe, 0x25, 0x13, 0xdf, 0x55, 0x3e, 0x5d, 0x21, 0x3e, 0x77, 0xf1, 0x9f, 0xe0, 0x01, 0xcc, + 0xbb, 0x16, 0xd7, 0x12, 0xd1, 0x63, 0x73, 0x50, 0xad, 0xaf, 0xb8, 0xe5, 0xc2, 0x5f, 0x30, 0xe1, + 0x1d, 0xe5, 0xe3, 0x55, 0xc2, 0x81, 0x3d, 0x57, 0x8d, 0x24, 0x5d, 0x4b, 0xcc, 0x64, 0x3c, 0xe3, + 0xfa, 0x8a, 0xdb, 0xe7, 0xa8, 0xc6, 0x72, 0xbd, 0xc9, 0xb2, 0x1f, 0x72, 0xdf, 0xbc, 0x0e, 0x00, + 0x00, 0xff, 0xff, 0x2e, 0x6a, 0xf8, 0x89, 0x0a, 0x0a, 0x00, 0x00, +} diff --git a/api/inventory/nodes.pb.gw.go b/api/inventory/nodes.pb.gw.go new file mode 100644 index 0000000000..a4bee61b78 --- /dev/null +++ b/api/inventory/nodes.pb.gw.go @@ -0,0 +1,350 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: inventory/nodes.proto + +/* +Package inventory is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package inventory + +import ( + "io" + "net/http" + + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray + +func request_Nodes_ListNodes_0(ctx context.Context, marshaler runtime.Marshaler, client NodesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListNodesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListNodes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_Nodes_GetNode_0(ctx context.Context, marshaler runtime.Marshaler, client NodesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetNodeRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetNode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_Nodes_AddNode_0(ctx context.Context, marshaler runtime.Marshaler, client NodesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddNodeRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AddNode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_Nodes_AddRemoveNode_0(ctx context.Context, marshaler runtime.Marshaler, client NodesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddRemoveNodeRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AddRemoveNode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_Nodes_AddRDSNode_0(ctx context.Context, marshaler runtime.Marshaler, client NodesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddRDSNodeRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AddRDSNode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_Nodes_RemoveNode_0(ctx context.Context, marshaler runtime.Marshaler, client NodesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RemoveNodeRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RemoveNode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +// RegisterNodesHandlerFromEndpoint is same as RegisterNodesHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterNodesHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterNodesHandler(ctx, mux, conn) +} + +// RegisterNodesHandler registers the http handlers for service Nodes to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterNodesHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterNodesHandlerClient(ctx, mux, NewNodesClient(conn)) +} + +// RegisterNodesHandlerClient registers the http handlers for service Nodes +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NodesClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NodesClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "NodesClient" to call the correct interceptors. +func RegisterNodesHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NodesClient) error { + + mux.Handle("POST", pattern_Nodes_ListNodes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Nodes_ListNodes_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Nodes_ListNodes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Nodes_GetNode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Nodes_GetNode_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Nodes_GetNode_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Nodes_AddNode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Nodes_AddNode_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Nodes_AddNode_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Nodes_AddRemoveNode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Nodes_AddRemoveNode_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Nodes_AddRemoveNode_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Nodes_AddRDSNode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Nodes_AddRDSNode_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Nodes_AddRDSNode_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Nodes_RemoveNode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Nodes_RemoveNode_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Nodes_RemoveNode_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Nodes_ListNodes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v0", "inventory", "Nodes", "ListNodes"}, "")) + + pattern_Nodes_GetNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v0", "inventory", "Nodes", "GetNode"}, "")) + + pattern_Nodes_AddNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v0", "inventory", "Nodes", "AddNode"}, "")) + + pattern_Nodes_AddRemoveNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v0", "inventory", "Nodes", "AddRemoveNode"}, "")) + + pattern_Nodes_AddRDSNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v0", "inventory", "Nodes", "AddRDSNode"}, "")) + + pattern_Nodes_RemoveNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v0", "inventory", "Nodes", "RemoveNode"}, "")) +) + +var ( + forward_Nodes_ListNodes_0 = runtime.ForwardResponseMessage + + forward_Nodes_GetNode_0 = runtime.ForwardResponseMessage + + forward_Nodes_AddNode_0 = runtime.ForwardResponseMessage + + forward_Nodes_AddRemoveNode_0 = runtime.ForwardResponseMessage + + forward_Nodes_AddRDSNode_0 = runtime.ForwardResponseMessage + + forward_Nodes_RemoveNode_0 = runtime.ForwardResponseMessage +) diff --git a/api/inventory/nodes.proto b/api/inventory/nodes.proto new file mode 100644 index 0000000000..70ff11a28f --- /dev/null +++ b/api/inventory/nodes.proto @@ -0,0 +1,187 @@ +syntax = "proto3"; + +package inventory; + +import "google/api/annotations.proto"; + +// NodeType represents Node type. +enum NodeType { + NODE_TYPE_INVALID = 0; + BARE_METAL = 1; + VIRTUAL_MACHINE = 2; + CONTAINER = 3; + REMOTE = 4; // a.k.a. external + RDS = 5; +} + +// BareMetalNode represents bare metal Node. +message BareMetalNode { + // Unique Node identifier. + uint32 id = 1; + reserved 2; // type + // Unique Node name. + string name = 3; + // Hostname. Is not unique. + string hostname = 4; +} + +// VirtualMachineNode represents virtual machine Node. +message VirtualMachineNode { + // Unique Node identifier. + uint32 id = 1; + reserved 2; // type + // Unique Node name. + string name = 3; + // Hostname. Is not unique. + string hostname = 4; +} + +// ContainerNode represents a container (Docker) Node. +message ContainerNode { + // Unique Node identifier. + uint32 id = 1; + reserved 2; // type + // Unique Node name. + string name = 3; + reserved 4; // hostname +} + +// RemoteNode represents a generic remote Node. +message RemoteNode { + // Unique Node identifier. + uint32 id = 1; + reserved 2; // type + // Unique Node name. + string name = 3; + reserved 4; // hostname +} + +// RDSNode represents AWS RDS Node. +message RDSNode { + // Unique Node identifier. + uint32 id = 1; + reserved 2; // type + // Unique Node name. + string name = 3; + reserved 4; // hostname + string region = 5; +} + +message ListNodesRequest {} + +message ListNodesResponse { + repeated BareMetalNode bare_metal = 1; + repeated VirtualMachineNode virtual_machine = 2; + repeated ContainerNode container = 3; + repeated RemoteNode remote = 4; + repeated RDSNode rds = 5; +} + +message GetNodeRequest { + // Unique Node identifier. + uint32 id = 1; +} + +message GetNodeResponse { + oneof node { + BareMetalNode bare_metal = 1; + VirtualMachineNode virtual_machine = 2; + ContainerNode container = 3; + RemoteNode remote = 4; + RDSNode rds = 5; + } +} + +message AddNodeRequest { + reserved 1; // id + // Node type. + NodeType type = 2; + // Unique Node name. + string name = 3; + // Hostname. Is not unique. + string hostname = 4; +} + +message AddNodeResponse { + oneof node { + BareMetalNode bare_metal = 1; + VirtualMachineNode virtual_machine = 2; + ContainerNode container = 3; + } +} + +message AddRemoveNodeRequest { + reserved 1; // id + reserved 2; // type + // Unique Node name. + string name = 3; + reserved 4; // hostname +} + +message AddRemoveNodeResponse { + RemoteNode remote = 1; +} + +message AddRDSNodeRequest { + reserved 1; // id + reserved 2; // type + // Unique Node name. + string name = 3; + reserved 4; // hostname +} + +message AddRDSNodeResponse { + RDSNode rds = 1; +} + +message RemoveNodeRequest { + uint32 id = 1; +} + +message RemoveNodeResponse {} + +// Nodes service provides public methods for managing Nodes. +service Nodes { + // ListNodes returns a list of all Nodes. + rpc ListNodes(ListNodesRequest) returns (ListNodesResponse) { + option (google.api.http) = { + post: "/v0/inventory/Nodes/ListNodes" + body: "*" + }; + } + // GetNode returns a single Node by ID. + rpc GetNode(GetNodeRequest) returns (GetNodeResponse) { + option (google.api.http) = { + post: "/v0/inventory/Nodes/GetNode" + body: "*" + }; + } + // AddNode adds bare metal, virtual machine, or container node Node. + rpc AddNode(AddNodeRequest) returns (AddNodeResponse) { + option (google.api.http) = { + post: "/v0/inventory/Nodes/AddNode" + body: "*" + }; + } + // AddRemoveNode adds remote Node. + rpc AddRemoveNode(AddRemoveNodeRequest) returns (AddRemoveNodeResponse) { + option (google.api.http) = { + post: "/v0/inventory/Nodes/AddRemoveNode" + body: "*" + }; + } + // AddRDSNode adds AWS RDS Node. + rpc AddRDSNode(AddRDSNodeRequest) returns (AddRDSNodeResponse) { + option (google.api.http) = { + post: "/v0/inventory/Nodes/AddRDSNode" + body: "*" + }; + } + // RemoveNode removes Node without any Agents and Services. + rpc RemoveNode(RemoveNodeRequest) returns (RemoveNodeResponse) { + option (google.api.http) = { + post: "/v0/inventory/Nodes/RemoveNode" + body: "*" + }; + } +} diff --git a/api/inventory/services.pb.go b/api/inventory/services.pb.go new file mode 100644 index 0000000000..a2ee882f6a --- /dev/null +++ b/api/inventory/services.pb.go @@ -0,0 +1,680 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: inventory/services.proto + +package inventory + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// ServiceType represents Service type. +type ServiceType int32 + +const ( + ServiceType_SERVICE_TYPE_INVALID ServiceType = 0 + ServiceType_MYSQL ServiceType = 1 +) + +var ServiceType_name = map[int32]string{ + 0: "SERVICE_TYPE_INVALID", + 1: "MYSQL", +} +var ServiceType_value = map[string]int32{ + "SERVICE_TYPE_INVALID": 0, + "MYSQL": 1, +} + +func (x ServiceType) String() string { + return proto.EnumName(ServiceType_name, int32(x)) +} +func (ServiceType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_services_d17cc4e2b8be6975, []int{0} +} + +// MySQLService represents MySQL service configuration. +type MySQLService struct { + // Unique service identifier. + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // Unique service name. + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MySQLService) Reset() { *m = MySQLService{} } +func (m *MySQLService) String() string { return proto.CompactTextString(m) } +func (*MySQLService) ProtoMessage() {} +func (*MySQLService) Descriptor() ([]byte, []int) { + return fileDescriptor_services_d17cc4e2b8be6975, []int{0} +} +func (m *MySQLService) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MySQLService.Unmarshal(m, b) +} +func (m *MySQLService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MySQLService.Marshal(b, m, deterministic) +} +func (dst *MySQLService) XXX_Merge(src proto.Message) { + xxx_messageInfo_MySQLService.Merge(dst, src) +} +func (m *MySQLService) XXX_Size() int { + return xxx_messageInfo_MySQLService.Size(m) +} +func (m *MySQLService) XXX_DiscardUnknown() { + xxx_messageInfo_MySQLService.DiscardUnknown(m) +} + +var xxx_messageInfo_MySQLService proto.InternalMessageInfo + +func (m *MySQLService) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *MySQLService) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type ListServicesRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListServicesRequest) Reset() { *m = ListServicesRequest{} } +func (m *ListServicesRequest) String() string { return proto.CompactTextString(m) } +func (*ListServicesRequest) ProtoMessage() {} +func (*ListServicesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_services_d17cc4e2b8be6975, []int{1} +} +func (m *ListServicesRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListServicesRequest.Unmarshal(m, b) +} +func (m *ListServicesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListServicesRequest.Marshal(b, m, deterministic) +} +func (dst *ListServicesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListServicesRequest.Merge(dst, src) +} +func (m *ListServicesRequest) XXX_Size() int { + return xxx_messageInfo_ListServicesRequest.Size(m) +} +func (m *ListServicesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListServicesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListServicesRequest proto.InternalMessageInfo + +type ListServicesResponse struct { + Mysql []*MySQLService `protobuf:"bytes,1,rep,name=mysql,proto3" json:"mysql,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListServicesResponse) Reset() { *m = ListServicesResponse{} } +func (m *ListServicesResponse) String() string { return proto.CompactTextString(m) } +func (*ListServicesResponse) ProtoMessage() {} +func (*ListServicesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_services_d17cc4e2b8be6975, []int{2} +} +func (m *ListServicesResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListServicesResponse.Unmarshal(m, b) +} +func (m *ListServicesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListServicesResponse.Marshal(b, m, deterministic) +} +func (dst *ListServicesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListServicesResponse.Merge(dst, src) +} +func (m *ListServicesResponse) XXX_Size() int { + return xxx_messageInfo_ListServicesResponse.Size(m) +} +func (m *ListServicesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListServicesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListServicesResponse proto.InternalMessageInfo + +func (m *ListServicesResponse) GetMysql() []*MySQLService { + if m != nil { + return m.Mysql + } + return nil +} + +type GetServiceRequest struct { + // Unique Service identifier. + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetServiceRequest) Reset() { *m = GetServiceRequest{} } +func (m *GetServiceRequest) String() string { return proto.CompactTextString(m) } +func (*GetServiceRequest) ProtoMessage() {} +func (*GetServiceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_services_d17cc4e2b8be6975, []int{3} +} +func (m *GetServiceRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetServiceRequest.Unmarshal(m, b) +} +func (m *GetServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetServiceRequest.Marshal(b, m, deterministic) +} +func (dst *GetServiceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetServiceRequest.Merge(dst, src) +} +func (m *GetServiceRequest) XXX_Size() int { + return xxx_messageInfo_GetServiceRequest.Size(m) +} +func (m *GetServiceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetServiceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetServiceRequest proto.InternalMessageInfo + +func (m *GetServiceRequest) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +type GetServiceResponse struct { + // Types that are valid to be assigned to Service: + // *GetServiceResponse_Mysql + Service isGetServiceResponse_Service `protobuf_oneof:"service"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetServiceResponse) Reset() { *m = GetServiceResponse{} } +func (m *GetServiceResponse) String() string { return proto.CompactTextString(m) } +func (*GetServiceResponse) ProtoMessage() {} +func (*GetServiceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_services_d17cc4e2b8be6975, []int{4} +} +func (m *GetServiceResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetServiceResponse.Unmarshal(m, b) +} +func (m *GetServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetServiceResponse.Marshal(b, m, deterministic) +} +func (dst *GetServiceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetServiceResponse.Merge(dst, src) +} +func (m *GetServiceResponse) XXX_Size() int { + return xxx_messageInfo_GetServiceResponse.Size(m) +} +func (m *GetServiceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetServiceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetServiceResponse proto.InternalMessageInfo + +type isGetServiceResponse_Service interface { + isGetServiceResponse_Service() +} + +type GetServiceResponse_Mysql struct { + Mysql *MySQLService `protobuf:"bytes,1,opt,name=mysql,proto3,oneof"` +} + +func (*GetServiceResponse_Mysql) isGetServiceResponse_Service() {} + +func (m *GetServiceResponse) GetService() isGetServiceResponse_Service { + if m != nil { + return m.Service + } + return nil +} + +func (m *GetServiceResponse) GetMysql() *MySQLService { + if x, ok := m.GetService().(*GetServiceResponse_Mysql); ok { + return x.Mysql + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*GetServiceResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _GetServiceResponse_OneofMarshaler, _GetServiceResponse_OneofUnmarshaler, _GetServiceResponse_OneofSizer, []interface{}{ + (*GetServiceResponse_Mysql)(nil), + } +} + +func _GetServiceResponse_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*GetServiceResponse) + // service + switch x := m.Service.(type) { + case *GetServiceResponse_Mysql: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Mysql); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("GetServiceResponse.Service has unexpected type %T", x) + } + return nil +} + +func _GetServiceResponse_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*GetServiceResponse) + switch tag { + case 1: // service.mysql + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(MySQLService) + err := b.DecodeMessage(msg) + m.Service = &GetServiceResponse_Mysql{msg} + return true, err + default: + return false, nil + } +} + +func _GetServiceResponse_OneofSizer(msg proto.Message) (n int) { + m := msg.(*GetServiceResponse) + // service + switch x := m.Service.(type) { + case *GetServiceResponse_Mysql: + s := proto.Size(x.Mysql) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type AddMySQLServiceRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddMySQLServiceRequest) Reset() { *m = AddMySQLServiceRequest{} } +func (m *AddMySQLServiceRequest) String() string { return proto.CompactTextString(m) } +func (*AddMySQLServiceRequest) ProtoMessage() {} +func (*AddMySQLServiceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_services_d17cc4e2b8be6975, []int{5} +} +func (m *AddMySQLServiceRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddMySQLServiceRequest.Unmarshal(m, b) +} +func (m *AddMySQLServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddMySQLServiceRequest.Marshal(b, m, deterministic) +} +func (dst *AddMySQLServiceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddMySQLServiceRequest.Merge(dst, src) +} +func (m *AddMySQLServiceRequest) XXX_Size() int { + return xxx_messageInfo_AddMySQLServiceRequest.Size(m) +} +func (m *AddMySQLServiceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AddMySQLServiceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AddMySQLServiceRequest proto.InternalMessageInfo + +type AddMySQLServiceResponse struct { + Mysql *MySQLService `protobuf:"bytes,1,opt,name=mysql,proto3" json:"mysql,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddMySQLServiceResponse) Reset() { *m = AddMySQLServiceResponse{} } +func (m *AddMySQLServiceResponse) String() string { return proto.CompactTextString(m) } +func (*AddMySQLServiceResponse) ProtoMessage() {} +func (*AddMySQLServiceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_services_d17cc4e2b8be6975, []int{6} +} +func (m *AddMySQLServiceResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddMySQLServiceResponse.Unmarshal(m, b) +} +func (m *AddMySQLServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddMySQLServiceResponse.Marshal(b, m, deterministic) +} +func (dst *AddMySQLServiceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddMySQLServiceResponse.Merge(dst, src) +} +func (m *AddMySQLServiceResponse) XXX_Size() int { + return xxx_messageInfo_AddMySQLServiceResponse.Size(m) +} +func (m *AddMySQLServiceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AddMySQLServiceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AddMySQLServiceResponse proto.InternalMessageInfo + +func (m *AddMySQLServiceResponse) GetMysql() *MySQLService { + if m != nil { + return m.Mysql + } + return nil +} + +type RemoveServiceRequest struct { + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RemoveServiceRequest) Reset() { *m = RemoveServiceRequest{} } +func (m *RemoveServiceRequest) String() string { return proto.CompactTextString(m) } +func (*RemoveServiceRequest) ProtoMessage() {} +func (*RemoveServiceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_services_d17cc4e2b8be6975, []int{7} +} +func (m *RemoveServiceRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RemoveServiceRequest.Unmarshal(m, b) +} +func (m *RemoveServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RemoveServiceRequest.Marshal(b, m, deterministic) +} +func (dst *RemoveServiceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveServiceRequest.Merge(dst, src) +} +func (m *RemoveServiceRequest) XXX_Size() int { + return xxx_messageInfo_RemoveServiceRequest.Size(m) +} +func (m *RemoveServiceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveServiceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveServiceRequest proto.InternalMessageInfo + +func (m *RemoveServiceRequest) GetId() uint32 { + if m != nil { + return m.Id + } + return 0 +} + +type RemoveServiceResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RemoveServiceResponse) Reset() { *m = RemoveServiceResponse{} } +func (m *RemoveServiceResponse) String() string { return proto.CompactTextString(m) } +func (*RemoveServiceResponse) ProtoMessage() {} +func (*RemoveServiceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_services_d17cc4e2b8be6975, []int{8} +} +func (m *RemoveServiceResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RemoveServiceResponse.Unmarshal(m, b) +} +func (m *RemoveServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RemoveServiceResponse.Marshal(b, m, deterministic) +} +func (dst *RemoveServiceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveServiceResponse.Merge(dst, src) +} +func (m *RemoveServiceResponse) XXX_Size() int { + return xxx_messageInfo_RemoveServiceResponse.Size(m) +} +func (m *RemoveServiceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveServiceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveServiceResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MySQLService)(nil), "inventory.MySQLService") + proto.RegisterType((*ListServicesRequest)(nil), "inventory.ListServicesRequest") + proto.RegisterType((*ListServicesResponse)(nil), "inventory.ListServicesResponse") + proto.RegisterType((*GetServiceRequest)(nil), "inventory.GetServiceRequest") + proto.RegisterType((*GetServiceResponse)(nil), "inventory.GetServiceResponse") + proto.RegisterType((*AddMySQLServiceRequest)(nil), "inventory.AddMySQLServiceRequest") + proto.RegisterType((*AddMySQLServiceResponse)(nil), "inventory.AddMySQLServiceResponse") + proto.RegisterType((*RemoveServiceRequest)(nil), "inventory.RemoveServiceRequest") + proto.RegisterType((*RemoveServiceResponse)(nil), "inventory.RemoveServiceResponse") + proto.RegisterEnum("inventory.ServiceType", ServiceType_name, ServiceType_value) +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// ServicesClient is the client API for Services service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ServicesClient interface { + // ListServices returns a list of all Services. + ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) + // GetService returns a single Service by ID. + GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*GetServiceResponse, error) + // AddMySQLService adds MySQL Service. + AddMySQLService(ctx context.Context, in *AddMySQLServiceRequest, opts ...grpc.CallOption) (*AddMySQLServiceResponse, error) + // RemoveService removes Service without any Agents. + RemoveService(ctx context.Context, in *RemoveServiceRequest, opts ...grpc.CallOption) (*RemoveServiceResponse, error) +} + +type servicesClient struct { + cc *grpc.ClientConn +} + +func NewServicesClient(cc *grpc.ClientConn) ServicesClient { + return &servicesClient{cc} +} + +func (c *servicesClient) ListServices(ctx context.Context, in *ListServicesRequest, opts ...grpc.CallOption) (*ListServicesResponse, error) { + out := new(ListServicesResponse) + err := c.cc.Invoke(ctx, "/inventory.Services/ListServices", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *servicesClient) GetService(ctx context.Context, in *GetServiceRequest, opts ...grpc.CallOption) (*GetServiceResponse, error) { + out := new(GetServiceResponse) + err := c.cc.Invoke(ctx, "/inventory.Services/GetService", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *servicesClient) AddMySQLService(ctx context.Context, in *AddMySQLServiceRequest, opts ...grpc.CallOption) (*AddMySQLServiceResponse, error) { + out := new(AddMySQLServiceResponse) + err := c.cc.Invoke(ctx, "/inventory.Services/AddMySQLService", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *servicesClient) RemoveService(ctx context.Context, in *RemoveServiceRequest, opts ...grpc.CallOption) (*RemoveServiceResponse, error) { + out := new(RemoveServiceResponse) + err := c.cc.Invoke(ctx, "/inventory.Services/RemoveService", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ServicesServer is the server API for Services service. +type ServicesServer interface { + // ListServices returns a list of all Services. + ListServices(context.Context, *ListServicesRequest) (*ListServicesResponse, error) + // GetService returns a single Service by ID. + GetService(context.Context, *GetServiceRequest) (*GetServiceResponse, error) + // AddMySQLService adds MySQL Service. + AddMySQLService(context.Context, *AddMySQLServiceRequest) (*AddMySQLServiceResponse, error) + // RemoveService removes Service without any Agents. + RemoveService(context.Context, *RemoveServiceRequest) (*RemoveServiceResponse, error) +} + +func RegisterServicesServer(s *grpc.Server, srv ServicesServer) { + s.RegisterService(&_Services_serviceDesc, srv) +} + +func _Services_ListServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListServicesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServicesServer).ListServices(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/inventory.Services/ListServices", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServicesServer).ListServices(ctx, req.(*ListServicesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Services_GetService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServicesServer).GetService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/inventory.Services/GetService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServicesServer).GetService(ctx, req.(*GetServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Services_AddMySQLService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddMySQLServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServicesServer).AddMySQLService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/inventory.Services/AddMySQLService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServicesServer).AddMySQLService(ctx, req.(*AddMySQLServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Services_RemoveService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServicesServer).RemoveService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/inventory.Services/RemoveService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServicesServer).RemoveService(ctx, req.(*RemoveServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Services_serviceDesc = grpc.ServiceDesc{ + ServiceName: "inventory.Services", + HandlerType: (*ServicesServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListServices", + Handler: _Services_ListServices_Handler, + }, + { + MethodName: "GetService", + Handler: _Services_GetService_Handler, + }, + { + MethodName: "AddMySQLService", + Handler: _Services_AddMySQLService_Handler, + }, + { + MethodName: "RemoveService", + Handler: _Services_RemoveService_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "inventory/services.proto", +} + +func init() { proto.RegisterFile("inventory/services.proto", fileDescriptor_services_d17cc4e2b8be6975) } + +var fileDescriptor_services_d17cc4e2b8be6975 = []byte{ + // 463 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x41, 0x6f, 0xd3, 0x30, + 0x14, 0xc7, 0xe7, 0xb6, 0x83, 0xf5, 0x6d, 0x83, 0x62, 0x3a, 0x1a, 0x45, 0x03, 0x3a, 0x0f, 0x55, + 0xa1, 0x40, 0x0c, 0xe5, 0x82, 0x76, 0x1b, 0x10, 0xb1, 0xa2, 0x0c, 0x6d, 0xc9, 0x34, 0x69, 0xa7, + 0x29, 0x10, 0x6b, 0x8a, 0xb4, 0xc6, 0x59, 0x1d, 0x82, 0x72, 0x42, 0x82, 0x23, 0x47, 0x2e, 0x7c, + 0x2f, 0xbe, 0x02, 0x1f, 0x04, 0x2d, 0x71, 0x17, 0x27, 0x6d, 0x06, 0xb7, 0xc8, 0xef, 0xff, 0xde, + 0xff, 0xf7, 0xfc, 0xb7, 0x02, 0x5a, 0x10, 0x26, 0x2c, 0x8c, 0xf9, 0x34, 0xa5, 0x82, 0x4d, 0x93, + 0xe0, 0x13, 0x13, 0x66, 0x34, 0xe5, 0x31, 0xc7, 0xed, 0xab, 0x8a, 0xbe, 0x79, 0xc6, 0xf9, 0xd9, + 0x39, 0xa3, 0x5e, 0x14, 0x50, 0x2f, 0x0c, 0x79, 0xec, 0xc5, 0x01, 0x0f, 0xa5, 0x90, 0xbc, 0x82, + 0xb5, 0xfd, 0xd4, 0x3d, 0xb4, 0xdd, 0xbc, 0x1f, 0xdf, 0x82, 0x46, 0xe0, 0x6b, 0xa8, 0x8f, 0x8c, + 0x75, 0xa7, 0x11, 0xf8, 0x18, 0x43, 0x2b, 0xf4, 0x26, 0x4c, 0x6b, 0xf6, 0x91, 0xd1, 0x76, 0xb2, + 0xef, 0xf7, 0xad, 0x95, 0x46, 0xa7, 0x49, 0x36, 0xe0, 0xae, 0x1d, 0x88, 0x58, 0x36, 0x0a, 0x87, + 0x5d, 0x7c, 0x66, 0x22, 0x26, 0x16, 0x74, 0xcb, 0xc7, 0x22, 0xe2, 0xa1, 0x60, 0xf8, 0x19, 0x2c, + 0x4f, 0x52, 0x71, 0x71, 0xae, 0xa1, 0x7e, 0xd3, 0x58, 0x1d, 0xf5, 0xcc, 0x2b, 0x42, 0x53, 0x05, + 0x70, 0x72, 0x15, 0xd9, 0x86, 0x3b, 0xef, 0xd8, 0x6c, 0x8a, 0x9c, 0x5d, 0x85, 0x23, 0x07, 0x80, + 0x55, 0x91, 0x74, 0xa2, 0x85, 0x13, 0xba, 0xc6, 0x69, 0x6f, 0x49, 0x7a, 0xbd, 0x6e, 0xc3, 0x4d, + 0x79, 0x7d, 0x44, 0x83, 0x7b, 0xbb, 0xbe, 0x5f, 0x02, 0x92, 0x7b, 0xed, 0x41, 0x6f, 0xae, 0x32, + 0xbf, 0x1a, 0xfa, 0x8f, 0xd5, 0x06, 0xd0, 0x75, 0xd8, 0x84, 0x27, 0xec, 0x1f, 0xdb, 0xf5, 0x60, + 0xa3, 0xa2, 0xcb, 0xfd, 0x86, 0x23, 0x58, 0x95, 0x47, 0x47, 0x69, 0xc4, 0xb0, 0x06, 0x5d, 0xd7, + 0x72, 0x8e, 0xc7, 0x6f, 0xac, 0xd3, 0xa3, 0x93, 0x03, 0xeb, 0x74, 0xfc, 0xe1, 0x78, 0xd7, 0x1e, + 0xbf, 0xed, 0x2c, 0xe1, 0x36, 0x2c, 0xef, 0x9f, 0xb8, 0x87, 0x76, 0x07, 0x8d, 0x7e, 0xb5, 0x60, + 0x65, 0x96, 0x09, 0xfe, 0x0a, 0x6b, 0x6a, 0x46, 0xf8, 0x81, 0x42, 0xbc, 0x20, 0x53, 0xfd, 0x61, + 0x6d, 0x3d, 0x27, 0x22, 0xe6, 0xb7, 0xdf, 0x7f, 0x7e, 0x36, 0x0c, 0xb2, 0x4d, 0x93, 0xe7, 0xb4, + 0x78, 0x94, 0x33, 0x1d, 0x55, 0x9b, 0x76, 0xd0, 0x10, 0x7f, 0x01, 0x28, 0x82, 0xc3, 0x9b, 0xca, + 0xf8, 0xb9, 0xd0, 0xf5, 0xfb, 0x35, 0x55, 0x69, 0xfd, 0x34, 0xb3, 0x1e, 0x90, 0xad, 0x1a, 0xeb, + 0xa2, 0xe5, 0xd2, 0xf8, 0x07, 0x82, 0xdb, 0x95, 0x18, 0xf1, 0x96, 0x62, 0xb0, 0x38, 0x7c, 0x9d, + 0x5c, 0x27, 0x91, 0x20, 0x2f, 0x32, 0x90, 0x27, 0x64, 0x50, 0x03, 0x52, 0xe9, 0xbb, 0xa4, 0xf9, + 0x8e, 0x60, 0xbd, 0x14, 0x31, 0x56, 0x6f, 0x7a, 0xd1, 0x23, 0xd1, 0xfb, 0xf5, 0x02, 0xc9, 0x41, + 0x33, 0x8e, 0xc7, 0xe4, 0x51, 0x0d, 0x47, 0xa9, 0x6b, 0x07, 0x0d, 0x3f, 0xde, 0xc8, 0xfe, 0x04, + 0x2f, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xee, 0x8c, 0x2f, 0xfa, 0x4e, 0x04, 0x00, 0x00, +} diff --git a/api/inventory/services.pb.gw.go b/api/inventory/services.pb.gw.go new file mode 100644 index 0000000000..2bc8cc13d5 --- /dev/null +++ b/api/inventory/services.pb.gw.go @@ -0,0 +1,258 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: inventory/services.proto + +/* +Package inventory is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package inventory + +import ( + "io" + "net/http" + + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray + +func request_Services_ListServices_0(ctx context.Context, marshaler runtime.Marshaler, client ServicesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListServicesRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListServices(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_Services_GetService_0(ctx context.Context, marshaler runtime.Marshaler, client ServicesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetServiceRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetService(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_Services_AddMySQLService_0(ctx context.Context, marshaler runtime.Marshaler, client ServicesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddMySQLServiceRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AddMySQLService(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func request_Services_RemoveService_0(ctx context.Context, marshaler runtime.Marshaler, client ServicesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RemoveServiceRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RemoveService(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +// RegisterServicesHandlerFromEndpoint is same as RegisterServicesHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterServicesHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterServicesHandler(ctx, mux, conn) +} + +// RegisterServicesHandler registers the http handlers for service Services to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterServicesHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterServicesHandlerClient(ctx, mux, NewServicesClient(conn)) +} + +// RegisterServicesHandlerClient registers the http handlers for service Services +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServicesClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServicesClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ServicesClient" to call the correct interceptors. +func RegisterServicesHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServicesClient) error { + + mux.Handle("POST", pattern_Services_ListServices_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Services_ListServices_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Services_ListServices_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Services_GetService_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Services_GetService_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Services_GetService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Services_AddMySQLService_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Services_AddMySQLService_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Services_AddMySQLService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Services_RemoveService_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Services_RemoveService_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Services_RemoveService_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Services_ListServices_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v0", "inventory", "Services", "ListServices"}, "")) + + pattern_Services_GetService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v0", "inventory", "Services", "GetService"}, "")) + + pattern_Services_AddMySQLService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v0", "inventory", "Services", "AddMySQLService"}, "")) + + pattern_Services_RemoveService_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v0", "inventory", "Services", "RemoveService"}, "")) +) + +var ( + forward_Services_ListServices_0 = runtime.ForwardResponseMessage + + forward_Services_GetService_0 = runtime.ForwardResponseMessage + + forward_Services_AddMySQLService_0 = runtime.ForwardResponseMessage + + forward_Services_RemoveService_0 = runtime.ForwardResponseMessage +) diff --git a/api/inventory/services.proto b/api/inventory/services.proto new file mode 100644 index 0000000000..caf3dae4e2 --- /dev/null +++ b/api/inventory/services.proto @@ -0,0 +1,81 @@ +syntax = "proto3"; + +package inventory; + +import "google/api/annotations.proto"; + +// ServiceType represents Service type. +enum ServiceType { + SERVICE_TYPE_INVALID = 0; + MYSQL = 1; +} + +// MySQLService represents MySQL service configuration. +message MySQLService { + // Unique service identifier. + uint32 id = 1; + reserved 2; // type + // Unique service name. + string name = 3; +} + +message ListServicesRequest {} + +message ListServicesResponse { + repeated MySQLService mysql = 1; +} + +message GetServiceRequest { + // Unique Service identifier. + uint32 id = 1; +} + +message GetServiceResponse { + oneof service { + MySQLService mysql = 1; + } +} + +message AddMySQLServiceRequest {} + +message AddMySQLServiceResponse { + MySQLService mysql = 1; +} + +message RemoveServiceRequest { + uint32 id = 1; +} + +message RemoveServiceResponse {} + +// Services service provides public methods for managing Services. +service Services { + // ListServices returns a list of all Services. + rpc ListServices(ListServicesRequest) returns (ListServicesResponse) { + option (google.api.http) = { + post: "/v0/inventory/Services/ListServices" + body: "*" + }; + } + // GetService returns a single Service by ID. + rpc GetService(GetServiceRequest) returns (GetServiceResponse) { + option (google.api.http) = { + post: "/v0/inventory/Services/GetService" + body: "*" + }; + } + // AddMySQLService adds MySQL Service. + rpc AddMySQLService(AddMySQLServiceRequest) returns (AddMySQLServiceResponse) { + option (google.api.http) = { + post: "/v0/inventory/Services/AddMySQLService" + body: "*" + }; + } + // RemoveService removes Service without any Agents. + rpc RemoveService(RemoveServiceRequest) returns (RemoveServiceResponse) { + option (google.api.http) = { + post: "/v0/inventory/Services/RemoveService" + body: "*" + }; + } +} diff --git a/api/json/client/agents/add_my_sqld_exporter_agent_parameters.go b/api/json/client/agents/add_my_sqld_exporter_agent_parameters.go new file mode 100644 index 0000000000..69bc342d83 --- /dev/null +++ b/api/json/client/agents/add_my_sqld_exporter_agent_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// NewAddMySqldExporterAgentParams creates a new AddMySqldExporterAgentParams object +// with the default values initialized. +func NewAddMySqldExporterAgentParams() *AddMySqldExporterAgentParams { + var () + return &AddMySqldExporterAgentParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewAddMySqldExporterAgentParamsWithTimeout creates a new AddMySqldExporterAgentParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewAddMySqldExporterAgentParamsWithTimeout(timeout time.Duration) *AddMySqldExporterAgentParams { + var () + return &AddMySqldExporterAgentParams{ + + timeout: timeout, + } +} + +// NewAddMySqldExporterAgentParamsWithContext creates a new AddMySqldExporterAgentParams object +// with the default values initialized, and the ability to set a context for a request +func NewAddMySqldExporterAgentParamsWithContext(ctx context.Context) *AddMySqldExporterAgentParams { + var () + return &AddMySqldExporterAgentParams{ + + Context: ctx, + } +} + +// NewAddMySqldExporterAgentParamsWithHTTPClient creates a new AddMySqldExporterAgentParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewAddMySqldExporterAgentParamsWithHTTPClient(client *http.Client) *AddMySqldExporterAgentParams { + var () + return &AddMySqldExporterAgentParams{ + HTTPClient: client, + } +} + +/*AddMySqldExporterAgentParams contains all the parameters to send to the API endpoint +for the add my sqld exporter agent operation typically these are written to a http.Request +*/ +type AddMySqldExporterAgentParams struct { + + /*Body*/ + Body *models.InventoryAddMySqldExporterAgentRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the add my sqld exporter agent params +func (o *AddMySqldExporterAgentParams) WithTimeout(timeout time.Duration) *AddMySqldExporterAgentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the add my sqld exporter agent params +func (o *AddMySqldExporterAgentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the add my sqld exporter agent params +func (o *AddMySqldExporterAgentParams) WithContext(ctx context.Context) *AddMySqldExporterAgentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the add my sqld exporter agent params +func (o *AddMySqldExporterAgentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the add my sqld exporter agent params +func (o *AddMySqldExporterAgentParams) WithHTTPClient(client *http.Client) *AddMySqldExporterAgentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the add my sqld exporter agent params +func (o *AddMySqldExporterAgentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the add my sqld exporter agent params +func (o *AddMySqldExporterAgentParams) WithBody(body *models.InventoryAddMySqldExporterAgentRequest) *AddMySqldExporterAgentParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the add my sqld exporter agent params +func (o *AddMySqldExporterAgentParams) SetBody(body *models.InventoryAddMySqldExporterAgentRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *AddMySqldExporterAgentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/json/client/agents/add_my_sqld_exporter_agent_responses.go b/api/json/client/agents/add_my_sqld_exporter_agent_responses.go new file mode 100644 index 0000000000..de426fab63 --- /dev/null +++ b/api/json/client/agents/add_my_sqld_exporter_agent_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// AddMySqldExporterAgentReader is a Reader for the AddMySqldExporterAgent structure. +type AddMySqldExporterAgentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AddMySqldExporterAgentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewAddMySqldExporterAgentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewAddMySqldExporterAgentOK creates a AddMySqldExporterAgentOK with default headers values +func NewAddMySqldExporterAgentOK() *AddMySqldExporterAgentOK { + return &AddMySqldExporterAgentOK{} +} + +/*AddMySqldExporterAgentOK handles this case with default header values. + +(empty) +*/ +type AddMySqldExporterAgentOK struct { + Payload *models.InventoryAddMySqldExporterAgentResponse +} + +func (o *AddMySqldExporterAgentOK) Error() string { + return fmt.Sprintf("[POST /v0/inventory/Agents/AddMySQLdExporterAgent][%d] addMySqldExporterAgentOK %+v", 200, o.Payload) +} + +func (o *AddMySqldExporterAgentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InventoryAddMySqldExporterAgentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/json/client/agents/agents_client.go b/api/json/client/agents/agents_client.go new file mode 100644 index 0000000000..ac323258a3 --- /dev/null +++ b/api/json/client/agents/agents_client.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new agents API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for agents API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +AddMySqldExporterAgent adds my sqld exporter agent adds mysqld exporter agent +*/ +func (a *Client) AddMySqldExporterAgent(params *AddMySqldExporterAgentParams) (*AddMySqldExporterAgentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAddMySqldExporterAgentParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "AddMySQLdExporterAgent", + Method: "POST", + PathPattern: "/v0/inventory/Agents/AddMySQLdExporterAgent", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &AddMySqldExporterAgentReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*AddMySqldExporterAgentOK), nil + +} + +/* +GetAgent gets agent returns a single agent by ID +*/ +func (a *Client) GetAgent(params *GetAgentParams) (*GetAgentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetAgentParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetAgent", + Method: "POST", + PathPattern: "/v0/inventory/Agents/GetAgent", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetAgentReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*GetAgentOK), nil + +} + +/* +ListAgents lists agents returns a list of all agents +*/ +func (a *Client) ListAgents(params *ListAgentsParams) (*ListAgentsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListAgentsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ListAgents", + Method: "POST", + PathPattern: "/v0/inventory/Agents/ListAgents", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ListAgentsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ListAgentsOK), nil + +} + +/* +RemoveAgent removes agent removes agent +*/ +func (a *Client) RemoveAgent(params *RemoveAgentParams) (*RemoveAgentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRemoveAgentParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "RemoveAgent", + Method: "POST", + PathPattern: "/v0/inventory/Agents/RemoveAgent", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &RemoveAgentReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*RemoveAgentOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/api/json/client/agents/get_agent_parameters.go b/api/json/client/agents/get_agent_parameters.go new file mode 100644 index 0000000000..761fe415a5 --- /dev/null +++ b/api/json/client/agents/get_agent_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// NewGetAgentParams creates a new GetAgentParams object +// with the default values initialized. +func NewGetAgentParams() *GetAgentParams { + var () + return &GetAgentParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetAgentParamsWithTimeout creates a new GetAgentParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetAgentParamsWithTimeout(timeout time.Duration) *GetAgentParams { + var () + return &GetAgentParams{ + + timeout: timeout, + } +} + +// NewGetAgentParamsWithContext creates a new GetAgentParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetAgentParamsWithContext(ctx context.Context) *GetAgentParams { + var () + return &GetAgentParams{ + + Context: ctx, + } +} + +// NewGetAgentParamsWithHTTPClient creates a new GetAgentParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetAgentParamsWithHTTPClient(client *http.Client) *GetAgentParams { + var () + return &GetAgentParams{ + HTTPClient: client, + } +} + +/*GetAgentParams contains all the parameters to send to the API endpoint +for the get agent operation typically these are written to a http.Request +*/ +type GetAgentParams struct { + + /*Body*/ + Body *models.InventoryGetAgentRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get agent params +func (o *GetAgentParams) WithTimeout(timeout time.Duration) *GetAgentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get agent params +func (o *GetAgentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get agent params +func (o *GetAgentParams) WithContext(ctx context.Context) *GetAgentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get agent params +func (o *GetAgentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get agent params +func (o *GetAgentParams) WithHTTPClient(client *http.Client) *GetAgentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get agent params +func (o *GetAgentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the get agent params +func (o *GetAgentParams) WithBody(body *models.InventoryGetAgentRequest) *GetAgentParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the get agent params +func (o *GetAgentParams) SetBody(body *models.InventoryGetAgentRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *GetAgentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/json/client/agents/get_agent_responses.go b/api/json/client/agents/get_agent_responses.go new file mode 100644 index 0000000000..2046624653 --- /dev/null +++ b/api/json/client/agents/get_agent_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// GetAgentReader is a Reader for the GetAgent structure. +type GetAgentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetAgentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewGetAgentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetAgentOK creates a GetAgentOK with default headers values +func NewGetAgentOK() *GetAgentOK { + return &GetAgentOK{} +} + +/*GetAgentOK handles this case with default header values. + +(empty) +*/ +type GetAgentOK struct { + Payload *models.InventoryGetAgentResponse +} + +func (o *GetAgentOK) Error() string { + return fmt.Sprintf("[POST /v0/inventory/Agents/GetAgent][%d] getAgentOK %+v", 200, o.Payload) +} + +func (o *GetAgentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InventoryGetAgentResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/json/client/agents/list_agents_parameters.go b/api/json/client/agents/list_agents_parameters.go new file mode 100644 index 0000000000..3370c5e0d0 --- /dev/null +++ b/api/json/client/agents/list_agents_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// NewListAgentsParams creates a new ListAgentsParams object +// with the default values initialized. +func NewListAgentsParams() *ListAgentsParams { + var () + return &ListAgentsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewListAgentsParamsWithTimeout creates a new ListAgentsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListAgentsParamsWithTimeout(timeout time.Duration) *ListAgentsParams { + var () + return &ListAgentsParams{ + + timeout: timeout, + } +} + +// NewListAgentsParamsWithContext creates a new ListAgentsParams object +// with the default values initialized, and the ability to set a context for a request +func NewListAgentsParamsWithContext(ctx context.Context) *ListAgentsParams { + var () + return &ListAgentsParams{ + + Context: ctx, + } +} + +// NewListAgentsParamsWithHTTPClient creates a new ListAgentsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListAgentsParamsWithHTTPClient(client *http.Client) *ListAgentsParams { + var () + return &ListAgentsParams{ + HTTPClient: client, + } +} + +/*ListAgentsParams contains all the parameters to send to the API endpoint +for the list agents operation typically these are written to a http.Request +*/ +type ListAgentsParams struct { + + /*Body*/ + Body models.InventoryListAgentsRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list agents params +func (o *ListAgentsParams) WithTimeout(timeout time.Duration) *ListAgentsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list agents params +func (o *ListAgentsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list agents params +func (o *ListAgentsParams) WithContext(ctx context.Context) *ListAgentsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list agents params +func (o *ListAgentsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list agents params +func (o *ListAgentsParams) WithHTTPClient(client *http.Client) *ListAgentsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list agents params +func (o *ListAgentsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the list agents params +func (o *ListAgentsParams) WithBody(body models.InventoryListAgentsRequest) *ListAgentsParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the list agents params +func (o *ListAgentsParams) SetBody(body models.InventoryListAgentsRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *ListAgentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/json/client/agents/list_agents_responses.go b/api/json/client/agents/list_agents_responses.go new file mode 100644 index 0000000000..8feee28093 --- /dev/null +++ b/api/json/client/agents/list_agents_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// ListAgentsReader is a Reader for the ListAgents structure. +type ListAgentsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListAgentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewListAgentsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewListAgentsOK creates a ListAgentsOK with default headers values +func NewListAgentsOK() *ListAgentsOK { + return &ListAgentsOK{} +} + +/*ListAgentsOK handles this case with default header values. + +(empty) +*/ +type ListAgentsOK struct { + Payload *models.InventoryListAgentsResponse +} + +func (o *ListAgentsOK) Error() string { + return fmt.Sprintf("[POST /v0/inventory/Agents/ListAgents][%d] listAgentsOK %+v", 200, o.Payload) +} + +func (o *ListAgentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InventoryListAgentsResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/json/client/agents/remove_agent_parameters.go b/api/json/client/agents/remove_agent_parameters.go new file mode 100644 index 0000000000..b8075a9d22 --- /dev/null +++ b/api/json/client/agents/remove_agent_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// NewRemoveAgentParams creates a new RemoveAgentParams object +// with the default values initialized. +func NewRemoveAgentParams() *RemoveAgentParams { + var () + return &RemoveAgentParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewRemoveAgentParamsWithTimeout creates a new RemoveAgentParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewRemoveAgentParamsWithTimeout(timeout time.Duration) *RemoveAgentParams { + var () + return &RemoveAgentParams{ + + timeout: timeout, + } +} + +// NewRemoveAgentParamsWithContext creates a new RemoveAgentParams object +// with the default values initialized, and the ability to set a context for a request +func NewRemoveAgentParamsWithContext(ctx context.Context) *RemoveAgentParams { + var () + return &RemoveAgentParams{ + + Context: ctx, + } +} + +// NewRemoveAgentParamsWithHTTPClient creates a new RemoveAgentParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewRemoveAgentParamsWithHTTPClient(client *http.Client) *RemoveAgentParams { + var () + return &RemoveAgentParams{ + HTTPClient: client, + } +} + +/*RemoveAgentParams contains all the parameters to send to the API endpoint +for the remove agent operation typically these are written to a http.Request +*/ +type RemoveAgentParams struct { + + /*Body*/ + Body *models.InventoryRemoveAgentRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the remove agent params +func (o *RemoveAgentParams) WithTimeout(timeout time.Duration) *RemoveAgentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the remove agent params +func (o *RemoveAgentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the remove agent params +func (o *RemoveAgentParams) WithContext(ctx context.Context) *RemoveAgentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the remove agent params +func (o *RemoveAgentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the remove agent params +func (o *RemoveAgentParams) WithHTTPClient(client *http.Client) *RemoveAgentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the remove agent params +func (o *RemoveAgentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the remove agent params +func (o *RemoveAgentParams) WithBody(body *models.InventoryRemoveAgentRequest) *RemoveAgentParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the remove agent params +func (o *RemoveAgentParams) SetBody(body *models.InventoryRemoveAgentRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *RemoveAgentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/json/client/agents/remove_agent_responses.go b/api/json/client/agents/remove_agent_responses.go new file mode 100644 index 0000000000..6536964d4b --- /dev/null +++ b/api/json/client/agents/remove_agent_responses.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// RemoveAgentReader is a Reader for the RemoveAgent structure. +type RemoveAgentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RemoveAgentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewRemoveAgentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewRemoveAgentOK creates a RemoveAgentOK with default headers values +func NewRemoveAgentOK() *RemoveAgentOK { + return &RemoveAgentOK{} +} + +/*RemoveAgentOK handles this case with default header values. + +(empty) +*/ +type RemoveAgentOK struct { + Payload models.InventoryRemoveAgentResponse +} + +func (o *RemoveAgentOK) Error() string { + return fmt.Sprintf("[POST /v0/inventory/Agents/RemoveAgent][%d] removeAgentOK %+v", 200, o.Payload) +} + +func (o *RemoveAgentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/json/client/nodes/add_node_parameters.go b/api/json/client/nodes/add_node_parameters.go new file mode 100644 index 0000000000..05954f085f --- /dev/null +++ b/api/json/client/nodes/add_node_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package nodes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// NewAddNodeParams creates a new AddNodeParams object +// with the default values initialized. +func NewAddNodeParams() *AddNodeParams { + var () + return &AddNodeParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewAddNodeParamsWithTimeout creates a new AddNodeParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewAddNodeParamsWithTimeout(timeout time.Duration) *AddNodeParams { + var () + return &AddNodeParams{ + + timeout: timeout, + } +} + +// NewAddNodeParamsWithContext creates a new AddNodeParams object +// with the default values initialized, and the ability to set a context for a request +func NewAddNodeParamsWithContext(ctx context.Context) *AddNodeParams { + var () + return &AddNodeParams{ + + Context: ctx, + } +} + +// NewAddNodeParamsWithHTTPClient creates a new AddNodeParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewAddNodeParamsWithHTTPClient(client *http.Client) *AddNodeParams { + var () + return &AddNodeParams{ + HTTPClient: client, + } +} + +/*AddNodeParams contains all the parameters to send to the API endpoint +for the add node operation typically these are written to a http.Request +*/ +type AddNodeParams struct { + + /*Body*/ + Body *models.InventoryAddNodeRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the add node params +func (o *AddNodeParams) WithTimeout(timeout time.Duration) *AddNodeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the add node params +func (o *AddNodeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the add node params +func (o *AddNodeParams) WithContext(ctx context.Context) *AddNodeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the add node params +func (o *AddNodeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the add node params +func (o *AddNodeParams) WithHTTPClient(client *http.Client) *AddNodeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the add node params +func (o *AddNodeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the add node params +func (o *AddNodeParams) WithBody(body *models.InventoryAddNodeRequest) *AddNodeParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the add node params +func (o *AddNodeParams) SetBody(body *models.InventoryAddNodeRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *AddNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/json/client/nodes/add_node_responses.go b/api/json/client/nodes/add_node_responses.go new file mode 100644 index 0000000000..28794a1752 --- /dev/null +++ b/api/json/client/nodes/add_node_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package nodes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// AddNodeReader is a Reader for the AddNode structure. +type AddNodeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AddNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewAddNodeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewAddNodeOK creates a AddNodeOK with default headers values +func NewAddNodeOK() *AddNodeOK { + return &AddNodeOK{} +} + +/*AddNodeOK handles this case with default header values. + +(empty) +*/ +type AddNodeOK struct { + Payload *models.InventoryAddNodeResponse +} + +func (o *AddNodeOK) Error() string { + return fmt.Sprintf("[POST /v0/inventory/Nodes/AddNode][%d] addNodeOK %+v", 200, o.Payload) +} + +func (o *AddNodeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InventoryAddNodeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/json/client/nodes/add_rds_node_parameters.go b/api/json/client/nodes/add_rds_node_parameters.go new file mode 100644 index 0000000000..e847c38ec7 --- /dev/null +++ b/api/json/client/nodes/add_rds_node_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package nodes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// NewAddRDSNodeParams creates a new AddRDSNodeParams object +// with the default values initialized. +func NewAddRDSNodeParams() *AddRDSNodeParams { + var () + return &AddRDSNodeParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewAddRDSNodeParamsWithTimeout creates a new AddRDSNodeParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewAddRDSNodeParamsWithTimeout(timeout time.Duration) *AddRDSNodeParams { + var () + return &AddRDSNodeParams{ + + timeout: timeout, + } +} + +// NewAddRDSNodeParamsWithContext creates a new AddRDSNodeParams object +// with the default values initialized, and the ability to set a context for a request +func NewAddRDSNodeParamsWithContext(ctx context.Context) *AddRDSNodeParams { + var () + return &AddRDSNodeParams{ + + Context: ctx, + } +} + +// NewAddRDSNodeParamsWithHTTPClient creates a new AddRDSNodeParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewAddRDSNodeParamsWithHTTPClient(client *http.Client) *AddRDSNodeParams { + var () + return &AddRDSNodeParams{ + HTTPClient: client, + } +} + +/*AddRDSNodeParams contains all the parameters to send to the API endpoint +for the add RDS node operation typically these are written to a http.Request +*/ +type AddRDSNodeParams struct { + + /*Body*/ + Body *models.InventoryAddRDSNodeRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the add RDS node params +func (o *AddRDSNodeParams) WithTimeout(timeout time.Duration) *AddRDSNodeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the add RDS node params +func (o *AddRDSNodeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the add RDS node params +func (o *AddRDSNodeParams) WithContext(ctx context.Context) *AddRDSNodeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the add RDS node params +func (o *AddRDSNodeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the add RDS node params +func (o *AddRDSNodeParams) WithHTTPClient(client *http.Client) *AddRDSNodeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the add RDS node params +func (o *AddRDSNodeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the add RDS node params +func (o *AddRDSNodeParams) WithBody(body *models.InventoryAddRDSNodeRequest) *AddRDSNodeParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the add RDS node params +func (o *AddRDSNodeParams) SetBody(body *models.InventoryAddRDSNodeRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *AddRDSNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/json/client/nodes/add_rds_node_responses.go b/api/json/client/nodes/add_rds_node_responses.go new file mode 100644 index 0000000000..59cdb0cb42 --- /dev/null +++ b/api/json/client/nodes/add_rds_node_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package nodes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// AddRDSNodeReader is a Reader for the AddRDSNode structure. +type AddRDSNodeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AddRDSNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewAddRDSNodeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewAddRDSNodeOK creates a AddRDSNodeOK with default headers values +func NewAddRDSNodeOK() *AddRDSNodeOK { + return &AddRDSNodeOK{} +} + +/*AddRDSNodeOK handles this case with default header values. + +(empty) +*/ +type AddRDSNodeOK struct { + Payload *models.InventoryAddRDSNodeResponse +} + +func (o *AddRDSNodeOK) Error() string { + return fmt.Sprintf("[POST /v0/inventory/Nodes/AddRDSNode][%d] addRdsNodeOK %+v", 200, o.Payload) +} + +func (o *AddRDSNodeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InventoryAddRDSNodeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/json/client/nodes/add_remove_node_parameters.go b/api/json/client/nodes/add_remove_node_parameters.go new file mode 100644 index 0000000000..e72c897a90 --- /dev/null +++ b/api/json/client/nodes/add_remove_node_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package nodes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// NewAddRemoveNodeParams creates a new AddRemoveNodeParams object +// with the default values initialized. +func NewAddRemoveNodeParams() *AddRemoveNodeParams { + var () + return &AddRemoveNodeParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewAddRemoveNodeParamsWithTimeout creates a new AddRemoveNodeParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewAddRemoveNodeParamsWithTimeout(timeout time.Duration) *AddRemoveNodeParams { + var () + return &AddRemoveNodeParams{ + + timeout: timeout, + } +} + +// NewAddRemoveNodeParamsWithContext creates a new AddRemoveNodeParams object +// with the default values initialized, and the ability to set a context for a request +func NewAddRemoveNodeParamsWithContext(ctx context.Context) *AddRemoveNodeParams { + var () + return &AddRemoveNodeParams{ + + Context: ctx, + } +} + +// NewAddRemoveNodeParamsWithHTTPClient creates a new AddRemoveNodeParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewAddRemoveNodeParamsWithHTTPClient(client *http.Client) *AddRemoveNodeParams { + var () + return &AddRemoveNodeParams{ + HTTPClient: client, + } +} + +/*AddRemoveNodeParams contains all the parameters to send to the API endpoint +for the add remove node operation typically these are written to a http.Request +*/ +type AddRemoveNodeParams struct { + + /*Body*/ + Body *models.InventoryAddRemoveNodeRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the add remove node params +func (o *AddRemoveNodeParams) WithTimeout(timeout time.Duration) *AddRemoveNodeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the add remove node params +func (o *AddRemoveNodeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the add remove node params +func (o *AddRemoveNodeParams) WithContext(ctx context.Context) *AddRemoveNodeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the add remove node params +func (o *AddRemoveNodeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the add remove node params +func (o *AddRemoveNodeParams) WithHTTPClient(client *http.Client) *AddRemoveNodeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the add remove node params +func (o *AddRemoveNodeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the add remove node params +func (o *AddRemoveNodeParams) WithBody(body *models.InventoryAddRemoveNodeRequest) *AddRemoveNodeParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the add remove node params +func (o *AddRemoveNodeParams) SetBody(body *models.InventoryAddRemoveNodeRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *AddRemoveNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/json/client/nodes/add_remove_node_responses.go b/api/json/client/nodes/add_remove_node_responses.go new file mode 100644 index 0000000000..ba6ec77b88 --- /dev/null +++ b/api/json/client/nodes/add_remove_node_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package nodes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// AddRemoveNodeReader is a Reader for the AddRemoveNode structure. +type AddRemoveNodeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AddRemoveNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewAddRemoveNodeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewAddRemoveNodeOK creates a AddRemoveNodeOK with default headers values +func NewAddRemoveNodeOK() *AddRemoveNodeOK { + return &AddRemoveNodeOK{} +} + +/*AddRemoveNodeOK handles this case with default header values. + +(empty) +*/ +type AddRemoveNodeOK struct { + Payload *models.InventoryAddRemoveNodeResponse +} + +func (o *AddRemoveNodeOK) Error() string { + return fmt.Sprintf("[POST /v0/inventory/Nodes/AddRemoveNode][%d] addRemoveNodeOK %+v", 200, o.Payload) +} + +func (o *AddRemoveNodeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InventoryAddRemoveNodeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/json/client/nodes/get_node_parameters.go b/api/json/client/nodes/get_node_parameters.go new file mode 100644 index 0000000000..784eed312e --- /dev/null +++ b/api/json/client/nodes/get_node_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package nodes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// NewGetNodeParams creates a new GetNodeParams object +// with the default values initialized. +func NewGetNodeParams() *GetNodeParams { + var () + return &GetNodeParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetNodeParamsWithTimeout creates a new GetNodeParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetNodeParamsWithTimeout(timeout time.Duration) *GetNodeParams { + var () + return &GetNodeParams{ + + timeout: timeout, + } +} + +// NewGetNodeParamsWithContext creates a new GetNodeParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetNodeParamsWithContext(ctx context.Context) *GetNodeParams { + var () + return &GetNodeParams{ + + Context: ctx, + } +} + +// NewGetNodeParamsWithHTTPClient creates a new GetNodeParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetNodeParamsWithHTTPClient(client *http.Client) *GetNodeParams { + var () + return &GetNodeParams{ + HTTPClient: client, + } +} + +/*GetNodeParams contains all the parameters to send to the API endpoint +for the get node operation typically these are written to a http.Request +*/ +type GetNodeParams struct { + + /*Body*/ + Body *models.InventoryGetNodeRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get node params +func (o *GetNodeParams) WithTimeout(timeout time.Duration) *GetNodeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get node params +func (o *GetNodeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get node params +func (o *GetNodeParams) WithContext(ctx context.Context) *GetNodeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get node params +func (o *GetNodeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get node params +func (o *GetNodeParams) WithHTTPClient(client *http.Client) *GetNodeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get node params +func (o *GetNodeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the get node params +func (o *GetNodeParams) WithBody(body *models.InventoryGetNodeRequest) *GetNodeParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the get node params +func (o *GetNodeParams) SetBody(body *models.InventoryGetNodeRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *GetNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/json/client/nodes/get_node_responses.go b/api/json/client/nodes/get_node_responses.go new file mode 100644 index 0000000000..d3a8126d2a --- /dev/null +++ b/api/json/client/nodes/get_node_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package nodes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// GetNodeReader is a Reader for the GetNode structure. +type GetNodeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewGetNodeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetNodeOK creates a GetNodeOK with default headers values +func NewGetNodeOK() *GetNodeOK { + return &GetNodeOK{} +} + +/*GetNodeOK handles this case with default header values. + +(empty) +*/ +type GetNodeOK struct { + Payload *models.InventoryGetNodeResponse +} + +func (o *GetNodeOK) Error() string { + return fmt.Sprintf("[POST /v0/inventory/Nodes/GetNode][%d] getNodeOK %+v", 200, o.Payload) +} + +func (o *GetNodeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InventoryGetNodeResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/json/client/nodes/list_nodes_parameters.go b/api/json/client/nodes/list_nodes_parameters.go new file mode 100644 index 0000000000..885175292f --- /dev/null +++ b/api/json/client/nodes/list_nodes_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package nodes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// NewListNodesParams creates a new ListNodesParams object +// with the default values initialized. +func NewListNodesParams() *ListNodesParams { + var () + return &ListNodesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewListNodesParamsWithTimeout creates a new ListNodesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListNodesParamsWithTimeout(timeout time.Duration) *ListNodesParams { + var () + return &ListNodesParams{ + + timeout: timeout, + } +} + +// NewListNodesParamsWithContext creates a new ListNodesParams object +// with the default values initialized, and the ability to set a context for a request +func NewListNodesParamsWithContext(ctx context.Context) *ListNodesParams { + var () + return &ListNodesParams{ + + Context: ctx, + } +} + +// NewListNodesParamsWithHTTPClient creates a new ListNodesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListNodesParamsWithHTTPClient(client *http.Client) *ListNodesParams { + var () + return &ListNodesParams{ + HTTPClient: client, + } +} + +/*ListNodesParams contains all the parameters to send to the API endpoint +for the list nodes operation typically these are written to a http.Request +*/ +type ListNodesParams struct { + + /*Body*/ + Body models.InventoryListNodesRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list nodes params +func (o *ListNodesParams) WithTimeout(timeout time.Duration) *ListNodesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list nodes params +func (o *ListNodesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list nodes params +func (o *ListNodesParams) WithContext(ctx context.Context) *ListNodesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list nodes params +func (o *ListNodesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list nodes params +func (o *ListNodesParams) WithHTTPClient(client *http.Client) *ListNodesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list nodes params +func (o *ListNodesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the list nodes params +func (o *ListNodesParams) WithBody(body models.InventoryListNodesRequest) *ListNodesParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the list nodes params +func (o *ListNodesParams) SetBody(body models.InventoryListNodesRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *ListNodesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/json/client/nodes/list_nodes_responses.go b/api/json/client/nodes/list_nodes_responses.go new file mode 100644 index 0000000000..dfbb555743 --- /dev/null +++ b/api/json/client/nodes/list_nodes_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package nodes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// ListNodesReader is a Reader for the ListNodes structure. +type ListNodesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListNodesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewListNodesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewListNodesOK creates a ListNodesOK with default headers values +func NewListNodesOK() *ListNodesOK { + return &ListNodesOK{} +} + +/*ListNodesOK handles this case with default header values. + +(empty) +*/ +type ListNodesOK struct { + Payload *models.InventoryListNodesResponse +} + +func (o *ListNodesOK) Error() string { + return fmt.Sprintf("[POST /v0/inventory/Nodes/ListNodes][%d] listNodesOK %+v", 200, o.Payload) +} + +func (o *ListNodesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InventoryListNodesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/json/client/nodes/nodes_client.go b/api/json/client/nodes/nodes_client.go new file mode 100644 index 0000000000..c1c8392fca --- /dev/null +++ b/api/json/client/nodes/nodes_client.go @@ -0,0 +1,198 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package nodes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new nodes API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for nodes API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +AddNode adds node adds bare metal virtual machine or container node node +*/ +func (a *Client) AddNode(params *AddNodeParams) (*AddNodeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAddNodeParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "AddNode", + Method: "POST", + PathPattern: "/v0/inventory/Nodes/AddNode", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &AddNodeReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*AddNodeOK), nil + +} + +/* +AddRDSNode adds RDS node adds a w s RDS node +*/ +func (a *Client) AddRDSNode(params *AddRDSNodeParams) (*AddRDSNodeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAddRDSNodeParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "AddRDSNode", + Method: "POST", + PathPattern: "/v0/inventory/Nodes/AddRDSNode", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &AddRDSNodeReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*AddRDSNodeOK), nil + +} + +/* +AddRemoveNode adds remove node adds remote node +*/ +func (a *Client) AddRemoveNode(params *AddRemoveNodeParams) (*AddRemoveNodeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAddRemoveNodeParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "AddRemoveNode", + Method: "POST", + PathPattern: "/v0/inventory/Nodes/AddRemoveNode", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &AddRemoveNodeReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*AddRemoveNodeOK), nil + +} + +/* +GetNode gets node returns a single node by ID +*/ +func (a *Client) GetNode(params *GetNodeParams) (*GetNodeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetNodeParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetNode", + Method: "POST", + PathPattern: "/v0/inventory/Nodes/GetNode", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetNodeReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*GetNodeOK), nil + +} + +/* +ListNodes lists nodes returns a list of all nodes +*/ +func (a *Client) ListNodes(params *ListNodesParams) (*ListNodesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListNodesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ListNodes", + Method: "POST", + PathPattern: "/v0/inventory/Nodes/ListNodes", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ListNodesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ListNodesOK), nil + +} + +/* +RemoveNode removes node removes node without any agents and services +*/ +func (a *Client) RemoveNode(params *RemoveNodeParams) (*RemoveNodeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRemoveNodeParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "RemoveNode", + Method: "POST", + PathPattern: "/v0/inventory/Nodes/RemoveNode", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &RemoveNodeReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*RemoveNodeOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/api/json/client/nodes/remove_node_parameters.go b/api/json/client/nodes/remove_node_parameters.go new file mode 100644 index 0000000000..be31d6e3e2 --- /dev/null +++ b/api/json/client/nodes/remove_node_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package nodes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// NewRemoveNodeParams creates a new RemoveNodeParams object +// with the default values initialized. +func NewRemoveNodeParams() *RemoveNodeParams { + var () + return &RemoveNodeParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewRemoveNodeParamsWithTimeout creates a new RemoveNodeParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewRemoveNodeParamsWithTimeout(timeout time.Duration) *RemoveNodeParams { + var () + return &RemoveNodeParams{ + + timeout: timeout, + } +} + +// NewRemoveNodeParamsWithContext creates a new RemoveNodeParams object +// with the default values initialized, and the ability to set a context for a request +func NewRemoveNodeParamsWithContext(ctx context.Context) *RemoveNodeParams { + var () + return &RemoveNodeParams{ + + Context: ctx, + } +} + +// NewRemoveNodeParamsWithHTTPClient creates a new RemoveNodeParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewRemoveNodeParamsWithHTTPClient(client *http.Client) *RemoveNodeParams { + var () + return &RemoveNodeParams{ + HTTPClient: client, + } +} + +/*RemoveNodeParams contains all the parameters to send to the API endpoint +for the remove node operation typically these are written to a http.Request +*/ +type RemoveNodeParams struct { + + /*Body*/ + Body *models.InventoryRemoveNodeRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the remove node params +func (o *RemoveNodeParams) WithTimeout(timeout time.Duration) *RemoveNodeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the remove node params +func (o *RemoveNodeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the remove node params +func (o *RemoveNodeParams) WithContext(ctx context.Context) *RemoveNodeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the remove node params +func (o *RemoveNodeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the remove node params +func (o *RemoveNodeParams) WithHTTPClient(client *http.Client) *RemoveNodeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the remove node params +func (o *RemoveNodeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the remove node params +func (o *RemoveNodeParams) WithBody(body *models.InventoryRemoveNodeRequest) *RemoveNodeParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the remove node params +func (o *RemoveNodeParams) SetBody(body *models.InventoryRemoveNodeRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *RemoveNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/json/client/nodes/remove_node_responses.go b/api/json/client/nodes/remove_node_responses.go new file mode 100644 index 0000000000..d65d853c70 --- /dev/null +++ b/api/json/client/nodes/remove_node_responses.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package nodes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// RemoveNodeReader is a Reader for the RemoveNode structure. +type RemoveNodeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RemoveNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewRemoveNodeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewRemoveNodeOK creates a RemoveNodeOK with default headers values +func NewRemoveNodeOK() *RemoveNodeOK { + return &RemoveNodeOK{} +} + +/*RemoveNodeOK handles this case with default header values. + +(empty) +*/ +type RemoveNodeOK struct { + Payload models.InventoryRemoveNodeResponse +} + +func (o *RemoveNodeOK) Error() string { + return fmt.Sprintf("[POST /v0/inventory/Nodes/RemoveNode][%d] removeNodeOK %+v", 200, o.Payload) +} + +func (o *RemoveNodeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/json/client/pmm_server_inventory_client.go b/api/json/client/pmm_server_inventory_client.go new file mode 100644 index 0000000000..7b11822266 --- /dev/null +++ b/api/json/client/pmm_server_inventory_client.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/percona/pmm/api/json/client/agents" + "github.com/percona/pmm/api/json/client/nodes" + "github.com/percona/pmm/api/json/client/services" +) + +// Default PMM server inventory HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "localhost" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"http", "https"} + +// NewHTTPClient creates a new PMM server inventory HTTP client. +func NewHTTPClient(formats strfmt.Registry) *PMMServerInventory { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new PMM server inventory HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *PMMServerInventory { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new PMM server inventory client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *PMMServerInventory { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(PMMServerInventory) + cli.Transport = transport + + cli.Agents = agents.New(transport, formats) + + cli.Nodes = nodes.New(transport, formats) + + cli.Services = services.New(transport, formats) + + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// PMMServerInventory is a client for PMM server inventory +type PMMServerInventory struct { + Agents *agents.Client + + Nodes *nodes.Client + + Services *services.Client + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *PMMServerInventory) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + + c.Agents.SetTransport(transport) + + c.Nodes.SetTransport(transport) + + c.Services.SetTransport(transport) + +} diff --git a/api/json/client/services/add_my_sql_service_parameters.go b/api/json/client/services/add_my_sql_service_parameters.go new file mode 100644 index 0000000000..889ce2d43e --- /dev/null +++ b/api/json/client/services/add_my_sql_service_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package services + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// NewAddMySQLServiceParams creates a new AddMySQLServiceParams object +// with the default values initialized. +func NewAddMySQLServiceParams() *AddMySQLServiceParams { + var () + return &AddMySQLServiceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewAddMySQLServiceParamsWithTimeout creates a new AddMySQLServiceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewAddMySQLServiceParamsWithTimeout(timeout time.Duration) *AddMySQLServiceParams { + var () + return &AddMySQLServiceParams{ + + timeout: timeout, + } +} + +// NewAddMySQLServiceParamsWithContext creates a new AddMySQLServiceParams object +// with the default values initialized, and the ability to set a context for a request +func NewAddMySQLServiceParamsWithContext(ctx context.Context) *AddMySQLServiceParams { + var () + return &AddMySQLServiceParams{ + + Context: ctx, + } +} + +// NewAddMySQLServiceParamsWithHTTPClient creates a new AddMySQLServiceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewAddMySQLServiceParamsWithHTTPClient(client *http.Client) *AddMySQLServiceParams { + var () + return &AddMySQLServiceParams{ + HTTPClient: client, + } +} + +/*AddMySQLServiceParams contains all the parameters to send to the API endpoint +for the add my SQL service operation typically these are written to a http.Request +*/ +type AddMySQLServiceParams struct { + + /*Body*/ + Body models.InventoryAddMySQLServiceRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the add my SQL service params +func (o *AddMySQLServiceParams) WithTimeout(timeout time.Duration) *AddMySQLServiceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the add my SQL service params +func (o *AddMySQLServiceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the add my SQL service params +func (o *AddMySQLServiceParams) WithContext(ctx context.Context) *AddMySQLServiceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the add my SQL service params +func (o *AddMySQLServiceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the add my SQL service params +func (o *AddMySQLServiceParams) WithHTTPClient(client *http.Client) *AddMySQLServiceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the add my SQL service params +func (o *AddMySQLServiceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the add my SQL service params +func (o *AddMySQLServiceParams) WithBody(body models.InventoryAddMySQLServiceRequest) *AddMySQLServiceParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the add my SQL service params +func (o *AddMySQLServiceParams) SetBody(body models.InventoryAddMySQLServiceRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *AddMySQLServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/json/client/services/add_my_sql_service_responses.go b/api/json/client/services/add_my_sql_service_responses.go new file mode 100644 index 0000000000..03336a7ec6 --- /dev/null +++ b/api/json/client/services/add_my_sql_service_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package services + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// AddMySQLServiceReader is a Reader for the AddMySQLService structure. +type AddMySQLServiceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AddMySQLServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewAddMySQLServiceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewAddMySQLServiceOK creates a AddMySQLServiceOK with default headers values +func NewAddMySQLServiceOK() *AddMySQLServiceOK { + return &AddMySQLServiceOK{} +} + +/*AddMySQLServiceOK handles this case with default header values. + +(empty) +*/ +type AddMySQLServiceOK struct { + Payload *models.InventoryAddMySQLServiceResponse +} + +func (o *AddMySQLServiceOK) Error() string { + return fmt.Sprintf("[POST /v0/inventory/Services/AddMySQLService][%d] addMySqlServiceOK %+v", 200, o.Payload) +} + +func (o *AddMySQLServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InventoryAddMySQLServiceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/json/client/services/get_service_parameters.go b/api/json/client/services/get_service_parameters.go new file mode 100644 index 0000000000..57a3c0f1db --- /dev/null +++ b/api/json/client/services/get_service_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package services + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// NewGetServiceParams creates a new GetServiceParams object +// with the default values initialized. +func NewGetServiceParams() *GetServiceParams { + var () + return &GetServiceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewGetServiceParamsWithTimeout creates a new GetServiceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewGetServiceParamsWithTimeout(timeout time.Duration) *GetServiceParams { + var () + return &GetServiceParams{ + + timeout: timeout, + } +} + +// NewGetServiceParamsWithContext creates a new GetServiceParams object +// with the default values initialized, and the ability to set a context for a request +func NewGetServiceParamsWithContext(ctx context.Context) *GetServiceParams { + var () + return &GetServiceParams{ + + Context: ctx, + } +} + +// NewGetServiceParamsWithHTTPClient creates a new GetServiceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewGetServiceParamsWithHTTPClient(client *http.Client) *GetServiceParams { + var () + return &GetServiceParams{ + HTTPClient: client, + } +} + +/*GetServiceParams contains all the parameters to send to the API endpoint +for the get service operation typically these are written to a http.Request +*/ +type GetServiceParams struct { + + /*Body*/ + Body *models.InventoryGetServiceRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the get service params +func (o *GetServiceParams) WithTimeout(timeout time.Duration) *GetServiceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get service params +func (o *GetServiceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get service params +func (o *GetServiceParams) WithContext(ctx context.Context) *GetServiceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get service params +func (o *GetServiceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get service params +func (o *GetServiceParams) WithHTTPClient(client *http.Client) *GetServiceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get service params +func (o *GetServiceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the get service params +func (o *GetServiceParams) WithBody(body *models.InventoryGetServiceRequest) *GetServiceParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the get service params +func (o *GetServiceParams) SetBody(body *models.InventoryGetServiceRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *GetServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/json/client/services/get_service_responses.go b/api/json/client/services/get_service_responses.go new file mode 100644 index 0000000000..647cc9385c --- /dev/null +++ b/api/json/client/services/get_service_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package services + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// GetServiceReader is a Reader for the GetService structure. +type GetServiceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewGetServiceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewGetServiceOK creates a GetServiceOK with default headers values +func NewGetServiceOK() *GetServiceOK { + return &GetServiceOK{} +} + +/*GetServiceOK handles this case with default header values. + +(empty) +*/ +type GetServiceOK struct { + Payload *models.InventoryGetServiceResponse +} + +func (o *GetServiceOK) Error() string { + return fmt.Sprintf("[POST /v0/inventory/Services/GetService][%d] getServiceOK %+v", 200, o.Payload) +} + +func (o *GetServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InventoryGetServiceResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/json/client/services/list_services_parameters.go b/api/json/client/services/list_services_parameters.go new file mode 100644 index 0000000000..e87891fc99 --- /dev/null +++ b/api/json/client/services/list_services_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package services + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// NewListServicesParams creates a new ListServicesParams object +// with the default values initialized. +func NewListServicesParams() *ListServicesParams { + var () + return &ListServicesParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewListServicesParamsWithTimeout creates a new ListServicesParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewListServicesParamsWithTimeout(timeout time.Duration) *ListServicesParams { + var () + return &ListServicesParams{ + + timeout: timeout, + } +} + +// NewListServicesParamsWithContext creates a new ListServicesParams object +// with the default values initialized, and the ability to set a context for a request +func NewListServicesParamsWithContext(ctx context.Context) *ListServicesParams { + var () + return &ListServicesParams{ + + Context: ctx, + } +} + +// NewListServicesParamsWithHTTPClient creates a new ListServicesParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewListServicesParamsWithHTTPClient(client *http.Client) *ListServicesParams { + var () + return &ListServicesParams{ + HTTPClient: client, + } +} + +/*ListServicesParams contains all the parameters to send to the API endpoint +for the list services operation typically these are written to a http.Request +*/ +type ListServicesParams struct { + + /*Body*/ + Body models.InventoryListServicesRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the list services params +func (o *ListServicesParams) WithTimeout(timeout time.Duration) *ListServicesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list services params +func (o *ListServicesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list services params +func (o *ListServicesParams) WithContext(ctx context.Context) *ListServicesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list services params +func (o *ListServicesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list services params +func (o *ListServicesParams) WithHTTPClient(client *http.Client) *ListServicesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list services params +func (o *ListServicesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the list services params +func (o *ListServicesParams) WithBody(body models.InventoryListServicesRequest) *ListServicesParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the list services params +func (o *ListServicesParams) SetBody(body models.InventoryListServicesRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *ListServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/json/client/services/list_services_responses.go b/api/json/client/services/list_services_responses.go new file mode 100644 index 0000000000..2589a683d7 --- /dev/null +++ b/api/json/client/services/list_services_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package services + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// ListServicesReader is a Reader for the ListServices structure. +type ListServicesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewListServicesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewListServicesOK creates a ListServicesOK with default headers values +func NewListServicesOK() *ListServicesOK { + return &ListServicesOK{} +} + +/*ListServicesOK handles this case with default header values. + +(empty) +*/ +type ListServicesOK struct { + Payload *models.InventoryListServicesResponse +} + +func (o *ListServicesOK) Error() string { + return fmt.Sprintf("[POST /v0/inventory/Services/ListServices][%d] listServicesOK %+v", 200, o.Payload) +} + +func (o *ListServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InventoryListServicesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/json/client/services/remove_service_parameters.go b/api/json/client/services/remove_service_parameters.go new file mode 100644 index 0000000000..aabbf23601 --- /dev/null +++ b/api/json/client/services/remove_service_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package services + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// NewRemoveServiceParams creates a new RemoveServiceParams object +// with the default values initialized. +func NewRemoveServiceParams() *RemoveServiceParams { + var () + return &RemoveServiceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewRemoveServiceParamsWithTimeout creates a new RemoveServiceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewRemoveServiceParamsWithTimeout(timeout time.Duration) *RemoveServiceParams { + var () + return &RemoveServiceParams{ + + timeout: timeout, + } +} + +// NewRemoveServiceParamsWithContext creates a new RemoveServiceParams object +// with the default values initialized, and the ability to set a context for a request +func NewRemoveServiceParamsWithContext(ctx context.Context) *RemoveServiceParams { + var () + return &RemoveServiceParams{ + + Context: ctx, + } +} + +// NewRemoveServiceParamsWithHTTPClient creates a new RemoveServiceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewRemoveServiceParamsWithHTTPClient(client *http.Client) *RemoveServiceParams { + var () + return &RemoveServiceParams{ + HTTPClient: client, + } +} + +/*RemoveServiceParams contains all the parameters to send to the API endpoint +for the remove service operation typically these are written to a http.Request +*/ +type RemoveServiceParams struct { + + /*Body*/ + Body *models.InventoryRemoveServiceRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the remove service params +func (o *RemoveServiceParams) WithTimeout(timeout time.Duration) *RemoveServiceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the remove service params +func (o *RemoveServiceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the remove service params +func (o *RemoveServiceParams) WithContext(ctx context.Context) *RemoveServiceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the remove service params +func (o *RemoveServiceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the remove service params +func (o *RemoveServiceParams) WithHTTPClient(client *http.Client) *RemoveServiceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the remove service params +func (o *RemoveServiceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the remove service params +func (o *RemoveServiceParams) WithBody(body *models.InventoryRemoveServiceRequest) *RemoveServiceParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the remove service params +func (o *RemoveServiceParams) SetBody(body *models.InventoryRemoveServiceRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *RemoveServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/json/client/services/remove_service_responses.go b/api/json/client/services/remove_service_responses.go new file mode 100644 index 0000000000..44b63a564e --- /dev/null +++ b/api/json/client/services/remove_service_responses.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package services + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/percona/pmm/api/json/models" +) + +// RemoveServiceReader is a Reader for the RemoveService structure. +type RemoveServiceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RemoveServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewRemoveServiceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewRemoveServiceOK creates a RemoveServiceOK with default headers values +func NewRemoveServiceOK() *RemoveServiceOK { + return &RemoveServiceOK{} +} + +/*RemoveServiceOK handles this case with default header values. + +(empty) +*/ +type RemoveServiceOK struct { + Payload models.InventoryRemoveServiceResponse +} + +func (o *RemoveServiceOK) Error() string { + return fmt.Sprintf("[POST /v0/inventory/Services/RemoveService][%d] removeServiceOK %+v", 200, o.Payload) +} + +func (o *RemoveServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/api/json/client/services/services_client.go b/api/json/client/services/services_client.go new file mode 100644 index 0000000000..06f8dc7b05 --- /dev/null +++ b/api/json/client/services/services_client.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package services + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new services API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for services API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +AddMySQLService adds my SQL service adds my SQL service +*/ +func (a *Client) AddMySQLService(params *AddMySQLServiceParams) (*AddMySQLServiceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAddMySQLServiceParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "AddMySQLService", + Method: "POST", + PathPattern: "/v0/inventory/Services/AddMySQLService", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &AddMySQLServiceReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*AddMySQLServiceOK), nil + +} + +/* +GetService gets service returns a single service by ID +*/ +func (a *Client) GetService(params *GetServiceParams) (*GetServiceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetServiceParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "GetService", + Method: "POST", + PathPattern: "/v0/inventory/Services/GetService", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetServiceReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*GetServiceOK), nil + +} + +/* +ListServices lists services returns a list of all services +*/ +func (a *Client) ListServices(params *ListServicesParams) (*ListServicesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListServicesParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ListServices", + Method: "POST", + PathPattern: "/v0/inventory/Services/ListServices", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &ListServicesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ListServicesOK), nil + +} + +/* +RemoveService removes service removes service without any agents +*/ +func (a *Client) RemoveService(params *RemoveServiceParams) (*RemoveServiceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRemoveServiceParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "RemoveService", + Method: "POST", + PathPattern: "/v0/inventory/Services/RemoveService", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &RemoveServiceReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*RemoveServiceOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/api/json/models/inventory_add_my_sql_service_request.go b/api/json/models/inventory_add_my_sql_service_request.go new file mode 100644 index 0000000000..56541b4d51 --- /dev/null +++ b/api/json/models/inventory_add_my_sql_service_request.go @@ -0,0 +1,10 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// InventoryAddMySQLServiceRequest inventory add my SQL service request +// swagger:model inventoryAddMySQLServiceRequest +type InventoryAddMySQLServiceRequest interface{} diff --git a/api/json/models/inventory_add_my_sql_service_response.go b/api/json/models/inventory_add_my_sql_service_response.go new file mode 100644 index 0000000000..58e34b4337 --- /dev/null +++ b/api/json/models/inventory_add_my_sql_service_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// InventoryAddMySQLServiceResponse inventory add my SQL service response +// swagger:model inventoryAddMySQLServiceResponse +type InventoryAddMySQLServiceResponse struct { + + // mysql + Mysql *InventoryMySQLService `json:"mysql,omitempty"` +} + +// Validate validates this inventory add my SQL service response +func (m *InventoryAddMySQLServiceResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMysql(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InventoryAddMySQLServiceResponse) validateMysql(formats strfmt.Registry) error { + + if swag.IsZero(m.Mysql) { // not required + return nil + } + + if m.Mysql != nil { + if err := m.Mysql.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mysql") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryAddMySQLServiceResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryAddMySQLServiceResponse) UnmarshalBinary(b []byte) error { + var res InventoryAddMySQLServiceResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_add_my_sqld_exporter_agent_request.go b/api/json/models/inventory_add_my_sqld_exporter_agent_request.go new file mode 100644 index 0000000000..ac20f165cf --- /dev/null +++ b/api/json/models/inventory_add_my_sqld_exporter_agent_request.go @@ -0,0 +1,52 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// InventoryAddMySqldExporterAgentRequest inventory add my sqld exporter agent request +// swagger:model inventoryAddMySQLdExporterAgentRequest +type InventoryAddMySqldExporterAgentRequest struct { + + // MySQL password for extracting metrics. + Password string `json:"password,omitempty"` + + // Node identifier where agent should run. + RunsOnNodeID int64 `json:"runs_on_node_id,omitempty"` + + // Service identifier for extracting metrics. + ServiceID int64 `json:"service_id,omitempty"` + + // MySQL username for extracting metrics. + Username string `json:"username,omitempty"` +} + +// Validate validates this inventory add my sqld exporter agent request +func (m *InventoryAddMySqldExporterAgentRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryAddMySqldExporterAgentRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryAddMySqldExporterAgentRequest) UnmarshalBinary(b []byte) error { + var res InventoryAddMySqldExporterAgentRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_add_my_sqld_exporter_agent_response.go b/api/json/models/inventory_add_my_sqld_exporter_agent_response.go new file mode 100644 index 0000000000..2733e937fc --- /dev/null +++ b/api/json/models/inventory_add_my_sqld_exporter_agent_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// InventoryAddMySqldExporterAgentResponse inventory add my sqld exporter agent response +// swagger:model inventoryAddMySQLdExporterAgentResponse +type InventoryAddMySqldExporterAgentResponse struct { + + // mysqld exporter + MysqldExporter *InventoryMySqldExporter `json:"mysqld_exporter,omitempty"` +} + +// Validate validates this inventory add my sqld exporter agent response +func (m *InventoryAddMySqldExporterAgentResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMysqldExporter(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InventoryAddMySqldExporterAgentResponse) validateMysqldExporter(formats strfmt.Registry) error { + + if swag.IsZero(m.MysqldExporter) { // not required + return nil + } + + if m.MysqldExporter != nil { + if err := m.MysqldExporter.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mysqld_exporter") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryAddMySqldExporterAgentResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryAddMySqldExporterAgentResponse) UnmarshalBinary(b []byte) error { + var res InventoryAddMySqldExporterAgentResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_add_node_request.go b/api/json/models/inventory_add_node_request.go new file mode 100644 index 0000000000..e936a38d1b --- /dev/null +++ b/api/json/models/inventory_add_node_request.go @@ -0,0 +1,75 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// InventoryAddNodeRequest inventory add node request +// swagger:model inventoryAddNodeRequest +type InventoryAddNodeRequest struct { + + // Hostname. Is not unique. + Hostname string `json:"hostname,omitempty"` + + // Unique Node name. + Name string `json:"name,omitempty"` + + // Node type. + Type InventoryNodeType `json:"type,omitempty"` +} + +// Validate validates this inventory add node request +func (m *InventoryAddNodeRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InventoryAddNodeRequest) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryAddNodeRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryAddNodeRequest) UnmarshalBinary(b []byte) error { + var res InventoryAddNodeRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_add_node_response.go b/api/json/models/inventory_add_node_response.go new file mode 100644 index 0000000000..a4f3ada45b --- /dev/null +++ b/api/json/models/inventory_add_node_response.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// InventoryAddNodeResponse inventory add node response +// swagger:model inventoryAddNodeResponse +type InventoryAddNodeResponse struct { + + // bare metal + BareMetal *InventoryBareMetalNode `json:"bare_metal,omitempty"` + + // container + Container *InventoryContainerNode `json:"container,omitempty"` + + // virtual machine + VirtualMachine *InventoryVirtualMachineNode `json:"virtual_machine,omitempty"` +} + +// Validate validates this inventory add node response +func (m *InventoryAddNodeResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBareMetal(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainer(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVirtualMachine(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InventoryAddNodeResponse) validateBareMetal(formats strfmt.Registry) error { + + if swag.IsZero(m.BareMetal) { // not required + return nil + } + + if m.BareMetal != nil { + if err := m.BareMetal.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bare_metal") + } + return err + } + } + + return nil +} + +func (m *InventoryAddNodeResponse) validateContainer(formats strfmt.Registry) error { + + if swag.IsZero(m.Container) { // not required + return nil + } + + if m.Container != nil { + if err := m.Container.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("container") + } + return err + } + } + + return nil +} + +func (m *InventoryAddNodeResponse) validateVirtualMachine(formats strfmt.Registry) error { + + if swag.IsZero(m.VirtualMachine) { // not required + return nil + } + + if m.VirtualMachine != nil { + if err := m.VirtualMachine.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtual_machine") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryAddNodeResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryAddNodeResponse) UnmarshalBinary(b []byte) error { + var res InventoryAddNodeResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_add_rds_node_request.go b/api/json/models/inventory_add_rds_node_request.go new file mode 100644 index 0000000000..ce21340f4f --- /dev/null +++ b/api/json/models/inventory_add_rds_node_request.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// InventoryAddRDSNodeRequest inventory add RDS node request +// swagger:model inventoryAddRDSNodeRequest +type InventoryAddRDSNodeRequest struct { + + // Unique Node name. + Name string `json:"name,omitempty"` +} + +// Validate validates this inventory add RDS node request +func (m *InventoryAddRDSNodeRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryAddRDSNodeRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryAddRDSNodeRequest) UnmarshalBinary(b []byte) error { + var res InventoryAddRDSNodeRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_add_rds_node_response.go b/api/json/models/inventory_add_rds_node_response.go new file mode 100644 index 0000000000..27d2c56a42 --- /dev/null +++ b/api/json/models/inventory_add_rds_node_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// InventoryAddRDSNodeResponse inventory add RDS node response +// swagger:model inventoryAddRDSNodeResponse +type InventoryAddRDSNodeResponse struct { + + // rds + RDS *InventoryRDSNode `json:"rds,omitempty"` +} + +// Validate validates this inventory add RDS node response +func (m *InventoryAddRDSNodeResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRDS(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InventoryAddRDSNodeResponse) validateRDS(formats strfmt.Registry) error { + + if swag.IsZero(m.RDS) { // not required + return nil + } + + if m.RDS != nil { + if err := m.RDS.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rds") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryAddRDSNodeResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryAddRDSNodeResponse) UnmarshalBinary(b []byte) error { + var res InventoryAddRDSNodeResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_add_remove_node_request.go b/api/json/models/inventory_add_remove_node_request.go new file mode 100644 index 0000000000..22d148962f --- /dev/null +++ b/api/json/models/inventory_add_remove_node_request.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// InventoryAddRemoveNodeRequest inventory add remove node request +// swagger:model inventoryAddRemoveNodeRequest +type InventoryAddRemoveNodeRequest struct { + + // Unique Node name. + Name string `json:"name,omitempty"` +} + +// Validate validates this inventory add remove node request +func (m *InventoryAddRemoveNodeRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryAddRemoveNodeRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryAddRemoveNodeRequest) UnmarshalBinary(b []byte) error { + var res InventoryAddRemoveNodeRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_add_remove_node_response.go b/api/json/models/inventory_add_remove_node_response.go new file mode 100644 index 0000000000..f0cbb17f7e --- /dev/null +++ b/api/json/models/inventory_add_remove_node_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// InventoryAddRemoveNodeResponse inventory add remove node response +// swagger:model inventoryAddRemoveNodeResponse +type InventoryAddRemoveNodeResponse struct { + + // remote + Remote *InventoryRemoteNode `json:"remote,omitempty"` +} + +// Validate validates this inventory add remove node response +func (m *InventoryAddRemoveNodeResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRemote(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InventoryAddRemoveNodeResponse) validateRemote(formats strfmt.Registry) error { + + if swag.IsZero(m.Remote) { // not required + return nil + } + + if m.Remote != nil { + if err := m.Remote.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("remote") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryAddRemoveNodeResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryAddRemoveNodeResponse) UnmarshalBinary(b []byte) error { + var res InventoryAddRemoveNodeResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_bare_metal_node.go b/api/json/models/inventory_bare_metal_node.go new file mode 100644 index 0000000000..c03bb93a91 --- /dev/null +++ b/api/json/models/inventory_bare_metal_node.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// InventoryBareMetalNode BareMetalNode represents bare metal Node. +// swagger:model inventoryBareMetalNode +type InventoryBareMetalNode struct { + + // Hostname. Is not unique. + Hostname string `json:"hostname,omitempty"` + + // Unique Node identifier. + ID int64 `json:"id,omitempty"` + + // Unique Node name. + Name string `json:"name,omitempty"` +} + +// Validate validates this inventory bare metal node +func (m *InventoryBareMetalNode) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryBareMetalNode) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryBareMetalNode) UnmarshalBinary(b []byte) error { + var res InventoryBareMetalNode + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_container_node.go b/api/json/models/inventory_container_node.go new file mode 100644 index 0000000000..f85990c07c --- /dev/null +++ b/api/json/models/inventory_container_node.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// InventoryContainerNode ContainerNode represents a container (Docker) Node. +// swagger:model inventoryContainerNode +type InventoryContainerNode struct { + + // Unique Node identifier. + ID int64 `json:"id,omitempty"` + + // Unique Node name. + Name string `json:"name,omitempty"` +} + +// Validate validates this inventory container node +func (m *InventoryContainerNode) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryContainerNode) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryContainerNode) UnmarshalBinary(b []byte) error { + var res InventoryContainerNode + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_get_agent_request.go b/api/json/models/inventory_get_agent_request.go new file mode 100644 index 0000000000..44b2b99f03 --- /dev/null +++ b/api/json/models/inventory_get_agent_request.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// InventoryGetAgentRequest inventory get agent request +// swagger:model inventoryGetAgentRequest +type InventoryGetAgentRequest struct { + + // Unique Agent identifier. + ID int64 `json:"id,omitempty"` +} + +// Validate validates this inventory get agent request +func (m *InventoryGetAgentRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryGetAgentRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryGetAgentRequest) UnmarshalBinary(b []byte) error { + var res InventoryGetAgentRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_get_agent_response.go b/api/json/models/inventory_get_agent_response.go new file mode 100644 index 0000000000..6d7cc54509 --- /dev/null +++ b/api/json/models/inventory_get_agent_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// InventoryGetAgentResponse inventory get agent response +// swagger:model inventoryGetAgentResponse +type InventoryGetAgentResponse struct { + + // mysqld exporter + MysqldExporter *InventoryMySqldExporter `json:"mysqld_exporter,omitempty"` +} + +// Validate validates this inventory get agent response +func (m *InventoryGetAgentResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMysqldExporter(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InventoryGetAgentResponse) validateMysqldExporter(formats strfmt.Registry) error { + + if swag.IsZero(m.MysqldExporter) { // not required + return nil + } + + if m.MysqldExporter != nil { + if err := m.MysqldExporter.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mysqld_exporter") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryGetAgentResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryGetAgentResponse) UnmarshalBinary(b []byte) error { + var res InventoryGetAgentResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_get_node_request.go b/api/json/models/inventory_get_node_request.go new file mode 100644 index 0000000000..e03aea5109 --- /dev/null +++ b/api/json/models/inventory_get_node_request.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// InventoryGetNodeRequest inventory get node request +// swagger:model inventoryGetNodeRequest +type InventoryGetNodeRequest struct { + + // Unique Node identifier. + ID int64 `json:"id,omitempty"` +} + +// Validate validates this inventory get node request +func (m *InventoryGetNodeRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryGetNodeRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryGetNodeRequest) UnmarshalBinary(b []byte) error { + var res InventoryGetNodeRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_get_node_response.go b/api/json/models/inventory_get_node_response.go new file mode 100644 index 0000000000..20bf828863 --- /dev/null +++ b/api/json/models/inventory_get_node_response.go @@ -0,0 +1,171 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// InventoryGetNodeResponse inventory get node response +// swagger:model inventoryGetNodeResponse +type InventoryGetNodeResponse struct { + + // bare metal + BareMetal *InventoryBareMetalNode `json:"bare_metal,omitempty"` + + // container + Container *InventoryContainerNode `json:"container,omitempty"` + + // rds + RDS *InventoryRDSNode `json:"rds,omitempty"` + + // remote + Remote *InventoryRemoteNode `json:"remote,omitempty"` + + // virtual machine + VirtualMachine *InventoryVirtualMachineNode `json:"virtual_machine,omitempty"` +} + +// Validate validates this inventory get node response +func (m *InventoryGetNodeResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBareMetal(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainer(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRDS(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRemote(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVirtualMachine(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InventoryGetNodeResponse) validateBareMetal(formats strfmt.Registry) error { + + if swag.IsZero(m.BareMetal) { // not required + return nil + } + + if m.BareMetal != nil { + if err := m.BareMetal.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bare_metal") + } + return err + } + } + + return nil +} + +func (m *InventoryGetNodeResponse) validateContainer(formats strfmt.Registry) error { + + if swag.IsZero(m.Container) { // not required + return nil + } + + if m.Container != nil { + if err := m.Container.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("container") + } + return err + } + } + + return nil +} + +func (m *InventoryGetNodeResponse) validateRDS(formats strfmt.Registry) error { + + if swag.IsZero(m.RDS) { // not required + return nil + } + + if m.RDS != nil { + if err := m.RDS.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rds") + } + return err + } + } + + return nil +} + +func (m *InventoryGetNodeResponse) validateRemote(formats strfmt.Registry) error { + + if swag.IsZero(m.Remote) { // not required + return nil + } + + if m.Remote != nil { + if err := m.Remote.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("remote") + } + return err + } + } + + return nil +} + +func (m *InventoryGetNodeResponse) validateVirtualMachine(formats strfmt.Registry) error { + + if swag.IsZero(m.VirtualMachine) { // not required + return nil + } + + if m.VirtualMachine != nil { + if err := m.VirtualMachine.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtual_machine") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryGetNodeResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryGetNodeResponse) UnmarshalBinary(b []byte) error { + var res InventoryGetNodeResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_get_service_request.go b/api/json/models/inventory_get_service_request.go new file mode 100644 index 0000000000..9070d97eea --- /dev/null +++ b/api/json/models/inventory_get_service_request.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// InventoryGetServiceRequest inventory get service request +// swagger:model inventoryGetServiceRequest +type InventoryGetServiceRequest struct { + + // Unique Service identifier. + ID int64 `json:"id,omitempty"` +} + +// Validate validates this inventory get service request +func (m *InventoryGetServiceRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryGetServiceRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryGetServiceRequest) UnmarshalBinary(b []byte) error { + var res InventoryGetServiceRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_get_service_response.go b/api/json/models/inventory_get_service_response.go new file mode 100644 index 0000000000..e66fbf304c --- /dev/null +++ b/api/json/models/inventory_get_service_response.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// InventoryGetServiceResponse inventory get service response +// swagger:model inventoryGetServiceResponse +type InventoryGetServiceResponse struct { + + // mysql + Mysql *InventoryMySQLService `json:"mysql,omitempty"` +} + +// Validate validates this inventory get service response +func (m *InventoryGetServiceResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMysql(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InventoryGetServiceResponse) validateMysql(formats strfmt.Registry) error { + + if swag.IsZero(m.Mysql) { // not required + return nil + } + + if m.Mysql != nil { + if err := m.Mysql.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mysql") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryGetServiceResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryGetServiceResponse) UnmarshalBinary(b []byte) error { + var res InventoryGetServiceResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_list_agents_request.go b/api/json/models/inventory_list_agents_request.go new file mode 100644 index 0000000000..94c42094be --- /dev/null +++ b/api/json/models/inventory_list_agents_request.go @@ -0,0 +1,10 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// InventoryListAgentsRequest inventory list agents request +// swagger:model inventoryListAgentsRequest +type InventoryListAgentsRequest interface{} diff --git a/api/json/models/inventory_list_agents_response.go b/api/json/models/inventory_list_agents_response.go new file mode 100644 index 0000000000..3ebd3fa400 --- /dev/null +++ b/api/json/models/inventory_list_agents_response.go @@ -0,0 +1,80 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// InventoryListAgentsResponse inventory list agents response +// swagger:model inventoryListAgentsResponse +type InventoryListAgentsResponse struct { + + // mysqld exporter + MysqldExporter []*InventoryMySqldExporter `json:"mysqld_exporter"` +} + +// Validate validates this inventory list agents response +func (m *InventoryListAgentsResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMysqldExporter(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InventoryListAgentsResponse) validateMysqldExporter(formats strfmt.Registry) error { + + if swag.IsZero(m.MysqldExporter) { // not required + return nil + } + + for i := 0; i < len(m.MysqldExporter); i++ { + if swag.IsZero(m.MysqldExporter[i]) { // not required + continue + } + + if m.MysqldExporter[i] != nil { + if err := m.MysqldExporter[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mysqld_exporter" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryListAgentsResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryListAgentsResponse) UnmarshalBinary(b []byte) error { + var res InventoryListAgentsResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_list_nodes_request.go b/api/json/models/inventory_list_nodes_request.go new file mode 100644 index 0000000000..978f91e500 --- /dev/null +++ b/api/json/models/inventory_list_nodes_request.go @@ -0,0 +1,10 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// InventoryListNodesRequest inventory list nodes request +// swagger:model inventoryListNodesRequest +type InventoryListNodesRequest interface{} diff --git a/api/json/models/inventory_list_nodes_response.go b/api/json/models/inventory_list_nodes_response.go new file mode 100644 index 0000000000..3cd1b53554 --- /dev/null +++ b/api/json/models/inventory_list_nodes_response.go @@ -0,0 +1,208 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// InventoryListNodesResponse inventory list nodes response +// swagger:model inventoryListNodesResponse +type InventoryListNodesResponse struct { + + // bare metal + BareMetal []*InventoryBareMetalNode `json:"bare_metal"` + + // container + Container []*InventoryContainerNode `json:"container"` + + // rds + RDS []*InventoryRDSNode `json:"rds"` + + // remote + Remote []*InventoryRemoteNode `json:"remote"` + + // virtual machine + VirtualMachine []*InventoryVirtualMachineNode `json:"virtual_machine"` +} + +// Validate validates this inventory list nodes response +func (m *InventoryListNodesResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBareMetal(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContainer(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRDS(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRemote(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVirtualMachine(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InventoryListNodesResponse) validateBareMetal(formats strfmt.Registry) error { + + if swag.IsZero(m.BareMetal) { // not required + return nil + } + + for i := 0; i < len(m.BareMetal); i++ { + if swag.IsZero(m.BareMetal[i]) { // not required + continue + } + + if m.BareMetal[i] != nil { + if err := m.BareMetal[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bare_metal" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *InventoryListNodesResponse) validateContainer(formats strfmt.Registry) error { + + if swag.IsZero(m.Container) { // not required + return nil + } + + for i := 0; i < len(m.Container); i++ { + if swag.IsZero(m.Container[i]) { // not required + continue + } + + if m.Container[i] != nil { + if err := m.Container[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("container" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *InventoryListNodesResponse) validateRDS(formats strfmt.Registry) error { + + if swag.IsZero(m.RDS) { // not required + return nil + } + + for i := 0; i < len(m.RDS); i++ { + if swag.IsZero(m.RDS[i]) { // not required + continue + } + + if m.RDS[i] != nil { + if err := m.RDS[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rds" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *InventoryListNodesResponse) validateRemote(formats strfmt.Registry) error { + + if swag.IsZero(m.Remote) { // not required + return nil + } + + for i := 0; i < len(m.Remote); i++ { + if swag.IsZero(m.Remote[i]) { // not required + continue + } + + if m.Remote[i] != nil { + if err := m.Remote[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("remote" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *InventoryListNodesResponse) validateVirtualMachine(formats strfmt.Registry) error { + + if swag.IsZero(m.VirtualMachine) { // not required + return nil + } + + for i := 0; i < len(m.VirtualMachine); i++ { + if swag.IsZero(m.VirtualMachine[i]) { // not required + continue + } + + if m.VirtualMachine[i] != nil { + if err := m.VirtualMachine[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtual_machine" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryListNodesResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryListNodesResponse) UnmarshalBinary(b []byte) error { + var res InventoryListNodesResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_list_services_request.go b/api/json/models/inventory_list_services_request.go new file mode 100644 index 0000000000..7f69755aa9 --- /dev/null +++ b/api/json/models/inventory_list_services_request.go @@ -0,0 +1,10 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// InventoryListServicesRequest inventory list services request +// swagger:model inventoryListServicesRequest +type InventoryListServicesRequest interface{} diff --git a/api/json/models/inventory_list_services_response.go b/api/json/models/inventory_list_services_response.go new file mode 100644 index 0000000000..3adf772bc2 --- /dev/null +++ b/api/json/models/inventory_list_services_response.go @@ -0,0 +1,80 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// InventoryListServicesResponse inventory list services response +// swagger:model inventoryListServicesResponse +type InventoryListServicesResponse struct { + + // mysql + Mysql []*InventoryMySQLService `json:"mysql"` +} + +// Validate validates this inventory list services response +func (m *InventoryListServicesResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMysql(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InventoryListServicesResponse) validateMysql(formats strfmt.Registry) error { + + if swag.IsZero(m.Mysql) { // not required + return nil + } + + for i := 0; i < len(m.Mysql); i++ { + if swag.IsZero(m.Mysql[i]) { // not required + continue + } + + if m.Mysql[i] != nil { + if err := m.Mysql[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mysql" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryListServicesResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryListServicesResponse) UnmarshalBinary(b []byte) error { + var res InventoryListServicesResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_my_sql_service.go b/api/json/models/inventory_my_sql_service.go new file mode 100644 index 0000000000..c938918539 --- /dev/null +++ b/api/json/models/inventory_my_sql_service.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// InventoryMySQLService MySQLService represents MySQL service configuration. +// swagger:model inventoryMySQLService +type InventoryMySQLService struct { + + // Unique service identifier. + ID int64 `json:"id,omitempty"` + + // Unique service name. + Name string `json:"name,omitempty"` +} + +// Validate validates this inventory my SQL service +func (m *InventoryMySQLService) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryMySQLService) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryMySQLService) UnmarshalBinary(b []byte) error { + var res InventoryMySQLService + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_my_sqld_exporter.go b/api/json/models/inventory_my_sqld_exporter.go new file mode 100644 index 0000000000..7855fa81b9 --- /dev/null +++ b/api/json/models/inventory_my_sqld_exporter.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// InventoryMySqldExporter MySQLdExporter represents mysqld_exporter Agent configuration. +// swagger:model inventoryMySQLdExporter +type InventoryMySqldExporter struct { + + // Unique agent identifier. + ID int64 `json:"id,omitempty"` + + // HTTP listen port for exposing metrics. + ListenPort int64 `json:"listen_port,omitempty"` + + // MySQL password for extracting metrics. + Password string `json:"password,omitempty"` + + // Node identifier where agent runs. + RunsOnNodeID int64 `json:"runs_on_node_id,omitempty"` + + // Service identifier for extracting metrics. + ServiceID int64 `json:"service_id,omitempty"` + + // MySQL username for extracting metrics. + Username string `json:"username,omitempty"` +} + +// Validate validates this inventory my sqld exporter +func (m *InventoryMySqldExporter) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryMySqldExporter) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryMySqldExporter) UnmarshalBinary(b []byte) error { + var res InventoryMySqldExporter + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_node_type.go b/api/json/models/inventory_node_type.go new file mode 100644 index 0000000000..7bfb422212 --- /dev/null +++ b/api/json/models/inventory_node_type.go @@ -0,0 +1,75 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/validate" +) + +// InventoryNodeType NodeType represents Node type. +// swagger:model inventoryNodeType +type InventoryNodeType string + +const ( + + // InventoryNodeTypeNODETYPEINVALID captures enum value "NODE_TYPE_INVALID" + InventoryNodeTypeNODETYPEINVALID InventoryNodeType = "NODE_TYPE_INVALID" + + // InventoryNodeTypeBAREMETAL captures enum value "BARE_METAL" + InventoryNodeTypeBAREMETAL InventoryNodeType = "BARE_METAL" + + // InventoryNodeTypeVIRTUALMACHINE captures enum value "VIRTUAL_MACHINE" + InventoryNodeTypeVIRTUALMACHINE InventoryNodeType = "VIRTUAL_MACHINE" + + // InventoryNodeTypeCONTAINER captures enum value "CONTAINER" + InventoryNodeTypeCONTAINER InventoryNodeType = "CONTAINER" + + // InventoryNodeTypeREMOTE captures enum value "REMOTE" + InventoryNodeTypeREMOTE InventoryNodeType = "REMOTE" + + // InventoryNodeTypeRDS captures enum value "RDS" + InventoryNodeTypeRDS InventoryNodeType = "RDS" +) + +// for schema +var inventoryNodeTypeEnum []interface{} + +func init() { + var res []InventoryNodeType + if err := json.Unmarshal([]byte(`["NODE_TYPE_INVALID","BARE_METAL","VIRTUAL_MACHINE","CONTAINER","REMOTE","RDS"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + inventoryNodeTypeEnum = append(inventoryNodeTypeEnum, v) + } +} + +func (m InventoryNodeType) validateInventoryNodeTypeEnum(path, location string, value InventoryNodeType) error { + if err := validate.Enum(path, location, value, inventoryNodeTypeEnum); err != nil { + return err + } + return nil +} + +// Validate validates this inventory node type +func (m InventoryNodeType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateInventoryNodeTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/json/models/inventory_rds_node.go b/api/json/models/inventory_rds_node.go new file mode 100644 index 0000000000..05b1ce4201 --- /dev/null +++ b/api/json/models/inventory_rds_node.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// InventoryRDSNode RDSNode represents AWS RDS Node. +// swagger:model inventoryRDSNode +type InventoryRDSNode struct { + + // Unique Node identifier. + ID int64 `json:"id,omitempty"` + + // Unique Node name. + Name string `json:"name,omitempty"` + + // region + Region string `json:"region,omitempty"` +} + +// Validate validates this inventory RDS node +func (m *InventoryRDSNode) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryRDSNode) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryRDSNode) UnmarshalBinary(b []byte) error { + var res InventoryRDSNode + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_remote_node.go b/api/json/models/inventory_remote_node.go new file mode 100644 index 0000000000..cea91ea1e5 --- /dev/null +++ b/api/json/models/inventory_remote_node.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// InventoryRemoteNode RemoteNode represents a generic remote Node. +// swagger:model inventoryRemoteNode +type InventoryRemoteNode struct { + + // Unique Node identifier. + ID int64 `json:"id,omitempty"` + + // Unique Node name. + Name string `json:"name,omitempty"` +} + +// Validate validates this inventory remote node +func (m *InventoryRemoteNode) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryRemoteNode) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryRemoteNode) UnmarshalBinary(b []byte) error { + var res InventoryRemoteNode + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_remove_agent_request.go b/api/json/models/inventory_remove_agent_request.go new file mode 100644 index 0000000000..1c6ebe8d4b --- /dev/null +++ b/api/json/models/inventory_remove_agent_request.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// InventoryRemoveAgentRequest inventory remove agent request +// swagger:model inventoryRemoveAgentRequest +type InventoryRemoveAgentRequest struct { + + // id + ID int64 `json:"id,omitempty"` +} + +// Validate validates this inventory remove agent request +func (m *InventoryRemoveAgentRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryRemoveAgentRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryRemoveAgentRequest) UnmarshalBinary(b []byte) error { + var res InventoryRemoveAgentRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_remove_agent_response.go b/api/json/models/inventory_remove_agent_response.go new file mode 100644 index 0000000000..f19f073607 --- /dev/null +++ b/api/json/models/inventory_remove_agent_response.go @@ -0,0 +1,10 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// InventoryRemoveAgentResponse inventory remove agent response +// swagger:model inventoryRemoveAgentResponse +type InventoryRemoveAgentResponse interface{} diff --git a/api/json/models/inventory_remove_node_request.go b/api/json/models/inventory_remove_node_request.go new file mode 100644 index 0000000000..9ee2465828 --- /dev/null +++ b/api/json/models/inventory_remove_node_request.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// InventoryRemoveNodeRequest inventory remove node request +// swagger:model inventoryRemoveNodeRequest +type InventoryRemoveNodeRequest struct { + + // id + ID int64 `json:"id,omitempty"` +} + +// Validate validates this inventory remove node request +func (m *InventoryRemoveNodeRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryRemoveNodeRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryRemoveNodeRequest) UnmarshalBinary(b []byte) error { + var res InventoryRemoveNodeRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_remove_node_response.go b/api/json/models/inventory_remove_node_response.go new file mode 100644 index 0000000000..03e1efaa97 --- /dev/null +++ b/api/json/models/inventory_remove_node_response.go @@ -0,0 +1,10 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// InventoryRemoveNodeResponse inventory remove node response +// swagger:model inventoryRemoveNodeResponse +type InventoryRemoveNodeResponse interface{} diff --git a/api/json/models/inventory_remove_service_request.go b/api/json/models/inventory_remove_service_request.go new file mode 100644 index 0000000000..813e39624d --- /dev/null +++ b/api/json/models/inventory_remove_service_request.go @@ -0,0 +1,43 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// InventoryRemoveServiceRequest inventory remove service request +// swagger:model inventoryRemoveServiceRequest +type InventoryRemoveServiceRequest struct { + + // id + ID int64 `json:"id,omitempty"` +} + +// Validate validates this inventory remove service request +func (m *InventoryRemoveServiceRequest) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryRemoveServiceRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryRemoveServiceRequest) UnmarshalBinary(b []byte) error { + var res InventoryRemoveServiceRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/json/models/inventory_remove_service_response.go b/api/json/models/inventory_remove_service_response.go new file mode 100644 index 0000000000..ce472b14ee --- /dev/null +++ b/api/json/models/inventory_remove_service_response.go @@ -0,0 +1,10 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +// InventoryRemoveServiceResponse inventory remove service response +// swagger:model inventoryRemoveServiceResponse +type InventoryRemoveServiceResponse interface{} diff --git a/api/json/models/inventory_virtual_machine_node.go b/api/json/models/inventory_virtual_machine_node.go new file mode 100644 index 0000000000..89146e62fb --- /dev/null +++ b/api/json/models/inventory_virtual_machine_node.go @@ -0,0 +1,49 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/swag" +) + +// InventoryVirtualMachineNode VirtualMachineNode represents virtual machine Node. +// swagger:model inventoryVirtualMachineNode +type InventoryVirtualMachineNode struct { + + // Hostname. Is not unique. + Hostname string `json:"hostname,omitempty"` + + // Unique Node identifier. + ID int64 `json:"id,omitempty"` + + // Unique Node name. + Name string `json:"name,omitempty"` +} + +// Validate validates this inventory virtual machine node +func (m *InventoryVirtualMachineNode) Validate(formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryVirtualMachineNode) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryVirtualMachineNode) UnmarshalBinary(b []byte) error { + var res InventoryVirtualMachineNode + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/api/nginx/nginx.conf b/api/nginx/nginx.conf new file mode 100644 index 0000000000..7773398908 --- /dev/null +++ b/api/nginx/nginx.conf @@ -0,0 +1,52 @@ +daemon off; + +error_log stderr info; +# error_log stderr debug; + +events { +} + +http { + upstream managed-grpc { + server 127.0.0.1:7771; + keepalive 32; + keepalive_requests 100; + keepalive_timeout 60s; + } + + upstream managed-json { + server 127.0.0.1:7772; + keepalive 32; + keepalive_requests 100; + keepalive_timeout 60s; + } + + server { + listen 127.0.0.1:8443 default_server ssl http2; + ssl_certificate pmm-api+3.pem; + ssl_certificate_key pmm-api+3-key.pem; + + # serve Swagger UI + root ./swagger; + autoindex on; + types { + text/html html; + text/css css; + application/javascript js; + application/json json; + } + + # pmm-managed gRPC APIs + location /agent. { + grpc_pass grpc://managed-grpc; + } + location /inventory. { + grpc_pass grpc://managed-grpc; + } + + # pmm-managed JSON APIs + location /managed/ { + proxy_pass http://managed-json/; + } + } +} diff --git a/api/prototool.yaml b/api/prototool.yaml new file mode 100644 index 0000000000..e84c728cc0 --- /dev/null +++ b/api/prototool.yaml @@ -0,0 +1,69 @@ +excludes: + - ./vendor + +protoc: + version: 3.6.1 + includes: + - ./vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis + +lint: + rules: + no_default: true + add: + - COMMENTS_NO_C_STYLE # Verifies that there are no /* c-style */ comments. + + - ENUMS_HAVE_COMMENTS # Verifies that all enums have a comment of the form "// EnumName ...". + - ENUMS_NO_ALLOW_ALIAS # Verifies that no enums use the option "allow_alias". + - ENUM_FIELD_NAMES_UPPER_SNAKE_CASE # Verifies that all enum field names are UPPER_SNAKE_CASE. + # - ENUM_FIELD_PREFIXES # Verifies that all enum fields are prefixed with [NESTED_MESSAGE_NAME_]ENUM_NAME_. + # - ENUM_NAMES_CAMEL_CASE # Verifies that all enum names are CamelCase. + # - ENUM_NAMES_CAPITALIZED # Verifies that all enum names are Capitalized. + - ENUM_ZERO_VALUES_INVALID # Verifies that all enum zero value names are [NESTED_MESSAGE_NAME_]ENUM_NAME_INVALID. + + # TODO + # - FILE_OPTIONS_EQUAL_GO_PACKAGE_PB_SUFFIX # Verifies that the file option "go_package" is equal to $(basename PACKAGE)pb. + # - FILE_OPTIONS_GO_PACKAGE_NOT_LONG_FORM # Verifies that the file option "go_package" is not of the form "go/import/path;package". + # - FILE_OPTIONS_GO_PACKAGE_SAME_IN_DIR # Verifies that the file option "go_package" of all files in a directory are the same. + # - FILE_OPTIONS_REQUIRE_GO_PACKAGE # Verifies that the file option "go_package" is set. + + # TODO - MESSAGES_HAVE_COMMENTS # Verifies that all non-extended messages have a comment of the form "// MessageName ...". + - MESSAGES_HAVE_COMMENTS_EXCEPT_REQUEST_RESPONSE_TYPES # Verifies that all non-extended messages except for request and response types have a comment of the form "// MessageName ...". + - MESSAGE_FIELD_NAMES_LOWER_SNAKE_CASE # Verifies that all message field names are lower_snake_case. + - MESSAGE_NAMES_CAMEL_CASE # Verifies that all non-extended message names are CamelCase. + + - ONEOF_NAMES_LOWER_SNAKE_CASE + + - PACKAGES_SAME_IN_DIR + - PACKAGE_IS_DECLARED + - PACKAGE_LOWER_SNAKE_CASE + + # TODO - REQUEST_RESPONSE_NAMES_MATCH_RPC # Verifies that all request names are RpcNameRequest and all response names are RpcNameResponse. + - REQUEST_RESPONSE_TYPES_IN_SAME_FILE + - REQUEST_RESPONSE_TYPES_UNIQUE + + - RPC_NAMES_CAMEL_CASE + - RPCS_HAVE_COMMENTS + - SERVICE_NAMES_CAMEL_CASE + - SERVICES_HAVE_COMMENTS + - SYNTAX_PROTO3 + - WKT_DIRECTLY_IMPORTED + +generate: + go_options: + import_path: github.com/percona/pmm/api + + plugins: + - name: go + type: go + flags: plugins=grpc + output: . + + - name: grpc-gateway + type: go + flags: logtostderr=true + output: . + + - name: swagger + type: go + flags: logtostderr=true + output: . diff --git a/api/swagger/favicon-16x16.png b/api/swagger/favicon-16x16.png new file mode 100644 index 0000000000..0f7e13b0d9 Binary files /dev/null and b/api/swagger/favicon-16x16.png differ diff --git a/api/swagger/favicon-32x32.png b/api/swagger/favicon-32x32.png new file mode 100644 index 0000000000..b0a3352ffd Binary files /dev/null and b/api/swagger/favicon-32x32.png differ diff --git a/api/swagger/redoc.html b/api/swagger/redoc.html new file mode 100644 index 0000000000..92fba9939e --- /dev/null +++ b/api/swagger/redoc.html @@ -0,0 +1,24 @@ + + + + ReDoc + + + + + + + + + + + + + diff --git a/api/swagger/redoc.min.js b/api/swagger/redoc.min.js new file mode 100644 index 0000000000..ae0b403f9a --- /dev/null +++ b/api/swagger/redoc.min.js @@ -0,0 +1,8 @@ +/*! + * ReDoc - OpenAPI/Swagger-generated API Reference Documentation + * ------------------------------------------------------------- + * Version: "1.22.2" + * Repo: https://github.com/Rebilly/ReDoc + */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(function(){try{return require("esprima")}catch(e){}}(),function(){try{return require("jquery")}catch(e){}}()):"function"==typeof define&&define.amd?define("Redoc",["esprima","jquery"],t):"object"==typeof exports?exports.Redoc=t(function(){try{return require("esprima")}catch(e){}}(),function(){try{return require("jquery")}catch(e){}}()):e.Redoc=t(e.esprima,e.jquery)}("undefined"!=typeof self?self:this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=250)}([function(e,t,n){var r=n(5),o=n(8),i=n(25),a=n(20),s=n(58),l=function(e,t,n){var u,c,p,d,f=e&l.F,h=e&l.G,g=e&l.S,m=e&l.P,y=e&l.B,v=h?r:g?r[t]||(r[t]={}):(r[t]||{}).prototype,b=h?o:o[t]||(o[t]={}),_=b.prototype||(b.prototype={});h&&(n=t);for(u in n)c=!f&&v&&void 0!==v[u],p=(c?v:n)[u],d=y&&c?s(p,r):m&&"function"==typeof p?s(Function.call,p):p,v&&a(v,u,p,e&l.U),b[u]!=p&&i(b,u,d),m&&_[u]!=p&&(_[u]=p)};r.core=o,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){function r(){if(!Do){var e=jo.Symbol;if(e&&e.iterator)Do=e.iterator;else for(var t=Object.getOwnPropertyNames(Map.prototype),n=0;n-1)return t.push(e[n]),t;t.push(e[n])}return t}function k(e){if(e.length>1){return" ("+x(e.slice().reverse()).map(function(e){return a(e.token)}).join(" -> ")+")"}return""}function C(e,t,n,r){var o=[t],i=n(o),a=r?w(i,r):Error(i);return a.addKey=S,a.keys=o,a.injectors=[e],a.constructResolvingMessage=n,a[_i]=r,a}function S(e,t){this.injectors.push(e),this.keys.push(t),this.message=this.constructResolvingMessage(this.keys)}function O(e,t){return C(e,t,function(e){return"No provider for "+a(e[0].token)+"!"+k(e)})}function P(e,t){return C(e,t,function(e){return"Cannot instantiate cyclic dependency!"+k(e)})}function M(e,t,n,r){return C(e,r,function(e){var n=a(e[0].token);return t.message+": Error during instantiation of "+n+"!"+k(e)+"."},t)}function E(e){return Error("Invalid provider - only instances of Provider and Type are allowed, got: "+e)}function T(e,t){for(var n=[],r=0,o=t.length;r-1&&e.splice(n,1)}function ve(e,t){var n=Fa.get(e);if(n)throw new Error("Duplicate module registered for "+e+" - "+n.moduleType.name+" vs "+t.moduleType.name);Fa.set(e,t)}function be(e){var t=Fa.get(e);if(!t)throw new Error("No module with ID "+e+" loaded");return t}function _e(e){return e.reduce(function(e,t){var n=Array.isArray(t)?_e(t):t;return e.concat(n)},[])}function we(e,t,n){if(!e)throw new Error("Cannot find '"+n+"' in '"+t+"'");return e}function xe(e){return e.map(function(e){return e.nativeElement})}function ke(e,t,n){e.childNodes.forEach(function(e){e instanceof Ga&&(t(e)&&n.push(e),ke(e,t,n))})}function Ce(e,t,n){e instanceof Ga&&e.childNodes.forEach(function(e){t(e)&&n.push(e),e instanceof Ga&&Ce(e,t,n)})}function Se(e){return Ja.get(e)||null}function Oe(e){Ja.set(e.nativeNode,e)}function Pe(e){Ja.delete(e.nativeNode)}function Me(e,t){var n=Ee(e),r=Ee(t);if(n&&r)return Te(e,t,Me);var o=e&&("object"==typeof e||"function"==typeof e),a=t&&("object"==typeof t||"function"==typeof t);return!(n||!o||r||!a)||i(e,t)}function Ee(e){return!!Ae(e)&&(Array.isArray(e)||!(e instanceof Map)&&r()in e)}function Te(e,t,n){for(var o=e[r()](),i=t[r()]();;){var a=o.next(),s=i.next();if(a.done&&s.done)return!0;if(a.done||s.done)return!1;if(!n(a.value,s.value))return!1}}function Ie(e,t){if(Array.isArray(e))for(var n=0;n0&&jt(e,t,0,n)&&(f=!0),d>1&&jt(e,t,1,r)&&(f=!0),d>2&&jt(e,t,2,o)&&(f=!0),d>3&&jt(e,t,3,i)&&(f=!0),d>4&&jt(e,t,4,a)&&(f=!0),d>5&&jt(e,t,5,s)&&(f=!0),d>6&&jt(e,t,6,l)&&(f=!0),d>7&&jt(e,t,7,u)&&(f=!0),d>8&&jt(e,t,8,c)&&(f=!0),d>9&&jt(e,t,9,p)&&(f=!0),f}function Nt(e,t,n){for(var r=!1,o=0;o0?o[n-1]:null,r)}function Xt(e,t){var n=at(t);if(n&&n!==e&&!(16&t.state)){t.state|=16;var r=n.template._projectedViews;r||(r=n.template._projectedViews=[]),r.push(t),Gt(t.parent.def,t.parentNodeDef)}}function Gt(e,t){if(!(4&t.flags)){e.nodeFlags|=4,t.flags|=4;for(var n=t.parent;n;)n.childFlags|=4,n=n.parent}}function Jt(e,t){var n=e.viewContainer._embeddedViews;if((null==t||t>=n.length)&&(t=n.length-1),t<0)return null;var r=n[t];return r.viewContainerParent=null,rn(n,t),Os.dirtyParentQueries(r),tn(r),r}function Kt(e){if(16&e.state){var t=at(e);if(t){var n=t.template._projectedViews;n&&(rn(n,n.indexOf(e)),Os.dirtyParentQueries(e))}}}function Qt(e,t,n){var r=e.viewContainer._embeddedViews,o=r[t];return rn(r,t),null==n&&(n=r.length),nn(r,n,o),Os.dirtyParentQueries(o),tn(o),en(e,n>0?r[n-1]:null,o),o}function en(e,t,n){var r=t?lt(t,t.def.lastRenderRootNode):e.renderElement;vt(n,2,n.renderer.parentNode(r),n.renderer.nextSibling(r),void 0)}function tn(e){vt(e,3,null,null,void 0)}function nn(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function rn(e,t){t>=e.length-1?e.pop():e.splice(t,1)}function on(e,t,n,r,o,i){return new Vs(e,t,n,r,o,i)}function an(e){return e.viewDefFactory}function sn(e,t,n){return new Hs(e,t,n)}function ln(e){return new qs(e)}function un(e,t){return new Us(e,t)}function cn(e,t){return new $s(e,t)}function pn(e,t){var n=e.def.nodes[t];if(1&n.flags){var r=Ve(e,n.nodeIndex);return n.element.template?r.template:r.renderElement}if(2&n.flags)return ze(e,n.nodeIndex).renderText;if(20240&n.flags)return Be(e,n.nodeIndex).instance;throw new Error("Illegal state: read nodeValue for node index "+t)}function dn(e){return new Ys(e.renderer)}function fn(e,t,n,r){return new Ws(e,t,n,r)}function hn(e,t,n,r,o,i,a,s){var l=[];if(a)for(var u in a){var c=a[u],p=c[0],d=c[1];l[p]={flags:8,name:u,nonMinifiedName:d,ns:null,securityContext:null,suffix:null}}var f=[];if(s)for(var h in s)f.push({type:1,propName:h,target:null,eventName:s[h]});return t|=16384,yn(e,t,n,r,o,o,i,l,f)}function gn(e,t,n){return e|=16,yn(-1,e,null,0,t,t,n)}function mn(e,t,n,r,o){return yn(-1,e,t,0,n,r,o)}function yn(e,t,n,r,o,i,a,s,l){var u=ft(n),c=u.matchedQueries,p=u.references,d=u.matchedQueryIds;l||(l=[]),s||(s=[]);var f=ht(a);return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:e,flags:t,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:c,matchedQueryIds:d,references:p,ngContentIndex:-1,childCount:r,bindings:s,bindingFlags:Ct(s),outputs:l,element:null,provider:{token:o,value:i,deps:f},text:null,query:null,ngContent:null}}function vn(e,t){return Cn(e,t)}function bn(e,t){for(var n=e;n.parent&&!ct(n);)n=n.parent;return Sn(n.parent,st(n),!0,t.provider.value,t.provider.deps)}function _n(e,t){var n=(32768&t.flags)>0,r=Sn(e,t.parent,n,t.provider.value,t.provider.deps);if(t.outputs.length)for(var o=0;o0&&et(e,t,0,n)&&(h=!0,g=En(e,d,t,0,n,g)),m>1&&et(e,t,1,r)&&(h=!0,g=En(e,d,t,1,r,g)),m>2&&et(e,t,2,o)&&(h=!0,g=En(e,d,t,2,o,g)),m>3&&et(e,t,3,i)&&(h=!0,g=En(e,d,t,3,i,g)),m>4&&et(e,t,4,a)&&(h=!0,g=En(e,d,t,4,a,g)),m>5&&et(e,t,5,s)&&(h=!0,g=En(e,d,t,5,s,g)),m>6&&et(e,t,6,l)&&(h=!0,g=En(e,d,t,6,l,g)),m>7&&et(e,t,7,u)&&(h=!0,g=En(e,d,t,7,u,g)),m>8&&et(e,t,8,c)&&(h=!0,g=En(e,d,t,8,c,g)),m>9&&et(e,t,9,p)&&(h=!0,g=En(e,d,t,9,p,g)),g&&f.ngOnChanges(g),2&e.state&&65536&t.flags&&f.ngOnInit(),262144&t.flags&&f.ngDoCheck(),h}function kn(e,t,n){for(var r=Be(e,t.nodeIndex),o=r.instance,i=!1,a=void 0,s=0;s0,r=t.provider;switch(201347067&t.flags){case 512:return Sn(e,t.parent,n,r.value,r.deps);case 1024:return On(e,t.parent,n,r.value,r.deps);case 2048:return Pn(e,t.parent,n,r.deps[0]);case 256:return r.value}}function Sn(e,t,n,r,o){var i=o.length;switch(i){case 0:return new r;case 1:return new r(Pn(e,t,n,o[0]));case 2:return new r(Pn(e,t,n,o[0]),Pn(e,t,n,o[1]));case 3:return new r(Pn(e,t,n,o[0]),Pn(e,t,n,o[1]),Pn(e,t,n,o[2]));default:for(var a=new Array(i),s=0;s0&&tt(e,t,0,n)&&(f=!0),h>1&&tt(e,t,1,r)&&(f=!0),h>2&&tt(e,t,2,o)&&(f=!0),h>3&&tt(e,t,3,i)&&(f=!0),h>4&&tt(e,t,4,a)&&(f=!0),h>5&&tt(e,t,5,s)&&(f=!0),h>6&&tt(e,t,6,l)&&(f=!0),h>7&&tt(e,t,7,u)&&(f=!0),h>8&&tt(e,t,8,c)&&(f=!0),h>9&&tt(e,t,9,p)&&(f=!0),f){var g=He(e,t.nodeIndex),m=void 0;switch(201347067&t.flags){case 32:m=new Array(d.length),h>0&&(m[0]=n),h>1&&(m[1]=r),h>2&&(m[2]=o),h>3&&(m[3]=i),h>4&&(m[4]=a),h>5&&(m[5]=s),h>6&&(m[6]=l),h>7&&(m[7]=u),h>8&&(m[8]=c),h>9&&(m[9]=p);break;case 64:m={},h>0&&(m[d[0].name]=n),h>1&&(m[d[1].name]=r),h>2&&(m[d[2].name]=o),h>3&&(m[d[3].name]=i),h>4&&(m[d[4].name]=a),h>5&&(m[d[5].name]=s),h>6&&(m[d[6].name]=l),h>7&&(m[d[7].name]=u),h>8&&(m[d[8].name]=c),h>9&&(m[d[9].name]=p);break;case 128:var y=n;switch(h){case 1:m=y.transform(n);break;case 2:m=y.transform(r);break;case 3:m=y.transform(r,o);break;case 4:m=y.transform(r,o,i);break;case 5:m=y.transform(r,o,i,a);break;case 6:m=y.transform(r,o,i,a,s);break;case 7:m=y.transform(r,o,i,a,s,l);break;case 8:m=y.transform(r,o,i,a,s,l,u);break;case 9:m=y.transform(r,o,i,a,s,l,u,c);break;case 10:m=y.transform(r,o,i,a,s,l,u,c,p)}}g.value=m}return f}function Wn(e,t,n){for(var r=t.bindings,o=!1,i=0;i0&&tt(e,t,0,n)&&(d=!0),h>1&&tt(e,t,1,r)&&(d=!0),h>2&&tt(e,t,2,o)&&(d=!0),h>3&&tt(e,t,3,i)&&(d=!0),h>4&&tt(e,t,4,a)&&(d=!0),h>5&&tt(e,t,5,s)&&(d=!0),h>6&&tt(e,t,6,l)&&(d=!0),h>7&&tt(e,t,7,u)&&(d=!0),h>8&&tt(e,t,8,c)&&(d=!0),h>9&&tt(e,t,9,p)&&(d=!0),d){var g=t.text.prefix;h>0&&(g+=Kn(n,f[0])),h>1&&(g+=Kn(r,f[1])),h>2&&(g+=Kn(o,f[2])),h>3&&(g+=Kn(i,f[3])),h>4&&(g+=Kn(a,f[4])),h>5&&(g+=Kn(s,f[5])),h>6&&(g+=Kn(l,f[6])),h>7&&(g+=Kn(u,f[7])),h>8&&(g+=Kn(c,f[8])),h>9&&(g+=Kn(p,f[9]));var m=ze(e,t.nodeIndex).renderText;e.renderer.setValue(m,g)}return d}function Jn(e,t,n){for(var r=t.bindings,o=!1,i=0;i0)u=g,er(g)||(c=g);else for(;u&&h===u.nodeIndex+u.childCount;){var b=u.parent;b&&(b.childFlags|=u.childFlags,b.childMatchedQueries|=u.childMatchedQueries),u=b,c=u&&er(u)?u.renderParent:u}}var _=function(e,n,r,o){return t[n].element.handleEvent(e,r,o)};return{factory:null,nodeFlags:a,rootNodeFlags:s,nodeMatchedQueries:l,flags:e,nodes:t,updateDirectives:n||Ps,updateRenderer:r||Ps,handleEvent:_,bindingCount:o,outputCount:i,lastRenderRootNode:f}}function er(e){return 0!=(1&e.flags)&&null===e.element.name}function tr(e,t,n){var r=t.element&&t.element.template;if(r){if(!r.lastRenderRootNode)throw new Error("Illegal State: Embedded templates without nodes are not allowed!");if(r.lastRenderRootNode&&16777216&r.lastRenderRootNode.flags)throw new Error("Illegal State: Last root node of a template can't have embedded views, at index "+t.nodeIndex+"!")}if(20224&t.flags){if(0==(1&(e?e.flags:0)))throw new Error("Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index "+t.nodeIndex+"!")}if(t.query){if(67108864&t.flags&&(!e||0==(16384&e.flags)))throw new Error("Illegal State: Content Query nodes need to be children of directives, at index "+t.nodeIndex+"!");if(134217728&t.flags&&e)throw new Error("Illegal State: View Query nodes have to be top level nodes, at index "+t.nodeIndex+"!")}if(t.childCount){var o=e?e.nodeIndex+e.childCount:n-1;if(t.nodeIndex<=o&&t.nodeIndex+t.childCount>o)throw new Error("Illegal State: childCount of node leads outside of parent, at index "+t.nodeIndex+"!")}}function nr(e,t,n,r){var o=ir(e.root,e.renderer,e,t,n);return ar(o,e.component,r),sr(o),o}function rr(e,t,n){var r=ir(e,e.renderer,null,null,t);return ar(r,n,n),sr(r),r}function or(e,t,n,r){var o,i=t.element.componentRendererType;return o=i?e.root.rendererFactory.createRenderer(r,i):e.root.renderer,ir(e.root,o,e,t.element.componentProvider,n)}function ir(e,t,n,r,o){var i=new Array(o.nodes.length),a=o.outputCount?new Array(o.outputCount):null;return{def:o,parent:n,viewContainerParent:null,parentNodeDef:r,context:null,component:null,nodes:i,state:13,root:e,renderer:t,oldValues:new Array(o.bindingCount),disposables:a}}function ar(e,t,n){e.component=t,e.context=n}function sr(e){var t;if(ct(e)){var n=e.parentNodeDef;t=Ve(e.parent,n.parent.nodeIndex).renderElement}for(var r=e.def,o=e.nodes,i=0;i0&&nt(e,t,0,n),d>1&&nt(e,t,1,r),d>2&&nt(e,t,2,o),d>3&&nt(e,t,3,i),d>4&&nt(e,t,4,a),d>5&&nt(e,t,5,s),d>6&&nt(e,t,6,l),d>7&&nt(e,t,7,u),d>8&&nt(e,t,8,c),d>9&&nt(e,t,9,p)}function mr(e,t,n){for(var r=0;r=this._providers.length)throw I(e);return this._providers[e]},e.prototype._new=function(e){if(this._constructionCounter++>this._getMaxNumberOfObjects())throw P(this,e.key);return this._instantiateProvider(e)},e.prototype._getMaxNumberOfObjects=function(){return this.objs.length},e.prototype._instantiateProvider=function(e){if(e.multiProvider){for(var t=new Array(e.resolvedFactories.length),n=0;n0)e._bootstrapComponents.forEach(function(e){return t.bootstrap(e)});else{if(!e.instance.ngDoBootstrap)throw new Error("The module "+a(e.instance.constructor)+' was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.');e.instance.ngDoBootstrap(t)}this._modules.push(e)},t}(Sa);Oa.decorators=[{type:ci}],Oa.ctorParameters=function(){return[{type:yi}]};var Pa=function(){function e(){}return e.prototype.bootstrap=function(e,t){},e.prototype.tick=function(){},e.prototype.componentTypes=function(){},e.prototype.components=function(){},e.prototype.attachView=function(e){},e.prototype.detachView=function(e){},e.prototype.viewCount=function(){},e.prototype.isStable=function(){},e}(),Ma=function(e){function t(t,n,r,i,a,s){var l=e.call(this)||this;l._zone=t,l._console=n,l._injector=r,l._exceptionHandler=i,l._componentFactoryResolver=a,l._initStatus=s,l._bootstrapListeners=[],l._rootComponents=[],l._rootComponentTypes=[],l._views=[],l._runningTick=!1,l._enforceNoNewChanges=!1,l._stable=!0,l._enforceNoNewChanges=ce(),l._zone.onMicrotaskEmpty.subscribe({next:function(){l._zone.run(function(){l.tick()})}});var u=new Oo.Observable(function(e){l._stable=l._zone.isStable&&!l._zone.hasPendingMacrotasks&&!l._zone.hasPendingMicrotasks,l._zone.runOutsideAngular(function(){e.next(l._stable),e.complete()})}),c=new Oo.Observable(function(e){var t;l._zone.runOutsideAngular(function(){t=l._zone.onStable.subscribe(function(){ga.assertNotInAngularZone(),o(function(){l._stable||l._zone.hasPendingMacrotasks||l._zone.hasPendingMicrotasks||(l._stable=!0,e.next(!0))})})});var n=l._zone.onUnstable.subscribe(function(){ga.assertInAngularZone(),l._stable&&(l._stable=!1,l._zone.runOutsideAngular(function(){e.next(!1)}))});return function(){t.unsubscribe(),n.unsubscribe()}});return l._isStable=Object(Po.merge)(u,Mo.share.call(c)),l}return So.a(t,e),t.prototype.attachView=function(e){var t=e;this._views.push(t),t.attachToAppRef(this)},t.prototype.detachView=function(e){var t=e;ye(this._views,t),t.detachFromAppRef()},t.prototype.bootstrap=function(e,t){var n=this;if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");var r;r=e instanceof Qi?e:this._componentFactoryResolver.resolveComponentFactory(e),this._rootComponentTypes.push(r.componentType);var o=r instanceof aa?null:this._injector.get(sa),i=t||r.selector,a=r.create(yi.NULL,[],i,o);a.onDestroy(function(){n._unloadComponent(a)});var s=a.injector.get(ma,null);return s&&a.injector.get(ya).registerApplication(a.location.nativeElement,s),this._loadComponent(a),ce()&&this._console.log("Angular is running in the development mode. Call enableProdMode() to enable the production mode."),a},t.prototype._loadComponent=function(e){this.attachView(e.hostView),this.tick(),this._rootComponents.push(e),this._injector.get($i,[]).concat(this._bootstrapListeners).forEach(function(t){return t(e)})},t.prototype._unloadComponent=function(e){this.detachView(e.hostView),ye(this._rootComponents,e)},t.prototype.tick=function(){var e=this;if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");var n=t._tickScope();try{this._runningTick=!0,this._views.forEach(function(e){return e.detectChanges()}),this._enforceNoNewChanges&&this._views.forEach(function(e){return e.checkNoChanges()})}catch(t){this._zone.runOutsideAngular(function(){return e._exceptionHandler.handleError(t)})}finally{this._runningTick=!1,pa(n)}},t.prototype.ngOnDestroy=function(){this._views.slice().forEach(function(e){return e.destroy()})},Object.defineProperty(t.prototype,"viewCount",{get:function(){return this._views.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentTypes",{get:function(){return this._rootComponentTypes},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"components",{get:function(){return this._rootComponents},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isStable",{get:function(){return this._isStable},enumerable:!0,configurable:!0}),t}(Pa);Ma._tickScope=ca("ApplicationRef#tick()"),Ma.decorators=[{type:ci}],Ma.ctorParameters=function(){return[{type:ga},{type:Wi},{type:yi},{type:xi},{type:na},{type:Vi}]};var Ea=function(){function e(e,t,n,r,o,i){this.id=e,this.templateUrl=t,this.slotCount=n,this.encapsulation=r,this.styles=o,this.animations=i}return e}(),Ta=function(){function e(){}return e.prototype.injector=function(){},e.prototype.component=function(){},e.prototype.providerTokens=function(){},e.prototype.references=function(){},e.prototype.context=function(){},e.prototype.source=function(){},e}(),Ia=function(){function e(){}return e.prototype.selectRootElement=function(e,t){},e.prototype.createElement=function(e,t,n){},e.prototype.createViewRoot=function(e){},e.prototype.createTemplateAnchor=function(e,t){},e.prototype.createText=function(e,t,n){},e.prototype.projectNodes=function(e,t){},e.prototype.attachViewAfter=function(e,t){},e.prototype.detachView=function(e){},e.prototype.destroyView=function(e,t){},e.prototype.listen=function(e,t,n){},e.prototype.listenGlobal=function(e,t,n){},e.prototype.setElementProperty=function(e,t,n){},e.prototype.setElementAttribute=function(e,t,n){},e.prototype.setBindingDebugInfo=function(e,t,n){},e.prototype.setElementClass=function(e,t,n){},e.prototype.setElementStyle=function(e,t,n){},e.prototype.invokeElementMethod=function(e,t,n){},e.prototype.setText=function(e,t){},e.prototype.animate=function(e,t,n,r,o,i,a){},e}(),Aa=(new Io("Renderer2Interceptor"),function(){function e(){}return e.prototype.renderComponent=function(e){},e}()),Ra=function(){function e(){}return e.prototype.createRenderer=function(e,t){},e.prototype.begin=function(){},e.prototype.end=function(){},e.prototype.whenRenderingDone=function(){},e}(),Na={};Na.Important=1,Na.DashCase=2,Na[Na.Important]="Important",Na[Na.DashCase]="DashCase";var ja=function(){function e(){}return e.prototype.data=function(){},e.prototype.destroy=function(){},e.prototype.createElement=function(e,t){},e.prototype.createComment=function(e){},e.prototype.createText=function(e){},e.prototype.appendChild=function(e,t){},e.prototype.insertBefore=function(e,t,n){},e.prototype.removeChild=function(e,t){},e.prototype.selectRootElement=function(e){},e.prototype.parentNode=function(e){},e.prototype.nextSibling=function(e){},e.prototype.setAttribute=function(e,t,n,r){},e.prototype.removeAttribute=function(e,t,n){},e.prototype.addClass=function(e,t){},e.prototype.removeClass=function(e,t){},e.prototype.setStyle=function(e,t,n,r){},e.prototype.removeStyle=function(e,t,n){},e.prototype.setProperty=function(e,t,n){},e.prototype.setValue=function(e,t){},e.prototype.listen=function(e,t,n){},e}(),Da=function(){function e(e){this.nativeElement=e}return e}(),La=function(){function e(){}return e.prototype.load=function(e){},e}(),Fa=new Map,za=function(){function e(){this._dirty=!0,this._results=[],this._emitter=new ha}return Object.defineProperty(e.prototype,"changes",{get:function(){return this._emitter},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._results.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"first",{get:function(){return this._results[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"last",{get:function(){return this._results[this.length-1]},enumerable:!0,configurable:!0}),e.prototype.map=function(e){return this._results.map(e)},e.prototype.filter=function(e){return this._results.filter(e)},e.prototype.find=function(e){return this._results.find(e)},e.prototype.reduce=function(e,t){return this._results.reduce(e,t)},e.prototype.forEach=function(e){this._results.forEach(e)},e.prototype.some=function(e){return this._results.some(e)},e.prototype.toArray=function(){return this._results.slice()},e.prototype[r()]=function(){return this._results[r()]()},e.prototype.toString=function(){return this._results.toString()},e.prototype.reset=function(e){this._results=_e(e),this._dirty=!1},e.prototype.notifyOnChanges=function(){this._emitter.emit(this)},e.prototype.setDirty=function(){this._dirty=!0},Object.defineProperty(e.prototype,"dirty",{get:function(){return this._dirty},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this._emitter.complete(),this._emitter.unsubscribe()},e}(),Va=function(){function e(){}return e}(),Ba={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"},Ha=function(){function e(e,t){this._compiler=e,this._config=t||Ba}return e.prototype.load=function(e){return this._compiler instanceof Xi?this.loadFactory(e):this.loadAndCompile(e)},e.prototype.loadAndCompile=function(e){var t=this,r=e.split("#"),o=r[0],i=r[1];return void 0===i&&(i="default"),n(216)(o).then(function(e){return e[i]}).then(function(e){return we(e,o,i)}).then(function(e){return t._compiler.compileModuleAsync(e)})},e.prototype.loadFactory=function(e){var t=e.split("#"),r=t[0],o=t[1],i="NgFactory";return void 0===o&&(o="default",i=""),n(216)(this._config.factoryPathPrefix+r+this._config.factoryPathSuffix).then(function(e){return e[o+i]}).then(function(e){return we(e,r,o)})},e}();Ha.decorators=[{type:ci}],Ha.ctorParameters=function(){return[{type:Xi},{type:Va,decorators:[{type:ui}]}]};var qa=function(){function e(){}return e.prototype.elementRef=function(){},e.prototype.createEmbeddedView=function(e){},e}(),Ua=function(){function e(){}return e.prototype.element=function(){},e.prototype.injector=function(){},e.prototype.parentInjector=function(){},e.prototype.clear=function(){},e.prototype.get=function(e){},e.prototype.length=function(){},e.prototype.createEmbeddedView=function(e,t,n){},e.prototype.createComponent=function(e,t,n,r,o){},e.prototype.insert=function(e,t){},e.prototype.move=function(e,t){},e.prototype.indexOf=function(e){},e.prototype.remove=function(e){},e.prototype.detach=function(e){},e}(),$a=function(){function e(){}return e.prototype.markForCheck=function(){},e.prototype.detach=function(){},e.prototype.detectChanges=function(){},e.prototype.checkNoChanges=function(){},e.prototype.reattach=function(){},e}(),Ya=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return So.a(t,e),t.prototype.destroy=function(){},t.prototype.destroyed=function(){},t.prototype.onDestroy=function(e){},t}($a),Wa=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return So.a(t,e),t.prototype.context=function(){},t.prototype.rootNodes=function(){},t}(Ya),Za=function(){function e(e,t){this.name=e,this.callback=t}return e}(),Xa=function(){function e(e,t,n){this._debugContext=n,this.nativeNode=e,t&&t instanceof Ga?t.addChild(this):this.parent=null,this.listeners=[]}return Object.defineProperty(e.prototype,"injector",{get:function(){return this._debugContext.injector},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"componentInstance",{get:function(){return this._debugContext.component},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){return this._debugContext.context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"references",{get:function(){return this._debugContext.references},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"providerTokens",{get:function(){return this._debugContext.providerTokens},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"source",{get:function(){return"Deprecated since v4"},enumerable:!0,configurable:!0}),e}(),Ga=function(e){function t(t,n,r){var o=e.call(this,t,n,r)||this;return o.properties={},o.attributes={},o.classes={},o.styles={},o.childNodes=[],o.nativeElement=t,o}return So.a(t,e),t.prototype.addChild=function(e){e&&(this.childNodes.push(e),e.parent=this)},t.prototype.removeChild=function(e){var t=this.childNodes.indexOf(e);-1!==t&&(e.parent=null,this.childNodes.splice(t,1))},t.prototype.insertChildrenAfter=function(e,t){var n=this,r=this.childNodes.indexOf(e);-1!==r&&((o=this.childNodes).splice.apply(o,[r+1,0].concat(t)),t.forEach(function(e){e.parent&&e.parent.removeChild(e),e.parent=n}));var o},t.prototype.insertBefore=function(e,t){var n=this.childNodes.indexOf(e);-1===n?this.addChild(t):(t.parent&&t.parent.removeChild(t),t.parent=this,this.childNodes.splice(n,0,t))},t.prototype.query=function(e){return this.queryAll(e)[0]||null},t.prototype.queryAll=function(e){var t=[];return ke(this,e,t),t},t.prototype.queryAllNodes=function(e){var t=[];return Ce(this,e,t),t},Object.defineProperty(t.prototype,"children",{get:function(){return this.childNodes.filter(function(e){return e instanceof t})},enumerable:!0,configurable:!0}),t.prototype.triggerEventHandler=function(e,t){this.listeners.forEach(function(n){n.name==e&&n.callback(t)})},t}(Xa),Ja=new Map,Ka=function(){function e(e){this.wrapped=e}return e.wrap=function(t){return new e(t)},e}(),Qa=function(){function e(){this.hasWrappedValue=!1}return e.prototype.unwrap=function(e){return e instanceof Ka?(this.hasWrappedValue=!0,e.wrapped):e},e.prototype.reset=function(){this.hasWrappedValue=!1},e}(),es=function(){function e(e,t,n){this.previousValue=e,this.currentValue=t,this.firstChange=n}return e.prototype.isFirstChange=function(){return this.firstChange},e}(),ts=function(){function e(){}return e.prototype.supports=function(e){return Ee(e)},e.prototype.create=function(e,t){return new rs(t||e)},e}(),ns=function(e,t){return t},rs=function(){function e(e){this._length=0,this._collection=null,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||ns}return Object.defineProperty(e.prototype,"collection",{get:function(){return this._collection},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),e.prototype.forEachItem=function(e){var t;for(t=this._itHead;null!==t;t=t._next)e(t)},e.prototype.forEachOperation=function(e){for(var t=this._itHead,n=this._removalsHead,r=0,o=null;t||n;){var i=!n||t&&t.currentIndex"+a(this.currentIndex)+"]"},e}(),is=function(){function e(){this._head=null,this._tail=null}return e.prototype.add=function(e){null===this._head?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)},e.prototype.get=function(e,t){var n;for(n=this._head;null!==n;n=n._nextDup)if((null===t||t<=n.currentIndex)&&i(n.trackById,e))return n;return null},e.prototype.remove=function(e){var t=e._prevDup,n=e._nextDup;return null===t?this._head=n:t._nextDup=n,null===n?this._tail=t:n._prevDup=t,null===this._head},e}(),as=function(){function e(){this.map=new Map}return e.prototype.put=function(e){var t=e.trackById,n=this.map.get(t);n||(n=new is,this.map.set(t,n)),n.add(e)},e.prototype.get=function(e,t){var n=e,r=this.map.get(n);return r?r.get(e,t):null},e.prototype.remove=function(e){var t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e},Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0===this.map.size},enumerable:!0,configurable:!0}),e.prototype.clear=function(){this.map.clear()},e.prototype.toString=function(){return"_DuplicateMap("+a(this.map)+")"},e}(),ss=function(){function e(){}return e.prototype.supports=function(e){return e instanceof Map||Ae(e)},e.prototype.create=function(e){return new ls},e}(),ls=function(){function e(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}return Object.defineProperty(e.prototype,"isDirty",{get:function(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead},enumerable:!0,configurable:!0}),e.prototype.forEachItem=function(e){var t;for(t=this._mapHead;null!==t;t=t._next)e(t)},e.prototype.forEachPreviousItem=function(e){var t;for(t=this._previousMapHead;null!==t;t=t._nextPrevious)e(t)},e.prototype.forEachChangedItem=function(e){var t;for(t=this._changesHead;null!==t;t=t._nextChanged)e(t)},e.prototype.forEachAddedItem=function(e){var t;for(t=this._additionsHead;null!==t;t=t._nextAdded)e(t)},e.prototype.forEachRemovedItem=function(e){var t;for(t=this._removalsHead;null!==t;t=t._nextRemoved)e(t)},e.prototype.diff=function(e){if(e){if(!(e instanceof Map||Ae(e)))throw new Error("Error trying to diff '"+a(e)+"'. Only maps and objects are allowed")}else e=new Map;return this.check(e)?this:null},e.prototype.onDestroy=function(){},e.prototype.check=function(e){var t=this;this._reset();var n=this._mapHead;if(this._appendAfter=null,this._forEach(e,function(e,r){if(n&&n.key===r)t._maybeAddToChanges(n,e),t._appendAfter=n,n=n._next;else{var o=t._getOrCreateRecordForKey(r,e);n=t._insertBeforeOrAppend(n,o)}}),n){n._prev&&(n._prev._next=null),this._removalsHead=n;for(var r=n;null!==r;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty},e.prototype._insertBeforeOrAppend=function(e,t){if(e){var n=e._prev;return t._next=e,t._prev=n,e._prev=t,n&&(n._next=t),e===this._mapHead&&(this._mapHead=t),this._appendAfter=e,e}return this._appendAfter?(this._appendAfter._next=t,t._prev=this._appendAfter):this._mapHead=t,this._appendAfter=t,null},e.prototype._getOrCreateRecordForKey=function(e,t){if(this._records.has(e)){var n=this._records.get(e);this._maybeAddToChanges(n,t);var r=n._prev,o=n._next;return r&&(r._next=o),o&&(o._prev=r),n._next=null,n._prev=null,n}var i=new us(e);return this._records.set(e,i),i.currentValue=t,this._addToAdditions(i),i},e.prototype._reset=function(){if(this.isDirty){var e=void 0;for(this._previousMapHead=this._mapHead,e=this._previousMapHead;null!==e;e=e._next)e._nextPrevious=e._next;for(e=this._changesHead;null!==e;e=e._nextChanged)e.previousValue=e.currentValue;for(e=this._additionsHead;null!=e;e=e._nextAdded)e.previousValue=e.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}},e.prototype._maybeAddToChanges=function(e,t){i(t,e.currentValue)||(e.previousValue=e.currentValue,e.currentValue=t,this._addToChanges(e))},e.prototype._addToAdditions=function(e){null===this._additionsHead?this._additionsHead=this._additionsTail=e:(this._additionsTail._nextAdded=e,this._additionsTail=e)},e.prototype._addToChanges=function(e){null===this._changesHead?this._changesHead=this._changesTail=e:(this._changesTail._nextChanged=e,this._changesTail=e)},e.prototype._forEach=function(e,t){e instanceof Map?e.forEach(t):Object.keys(e).forEach(function(n){return t(e[n],n)})},e}(),us=function(){function e(e){this.key=e,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}return e}(),cs=function(){function e(e){this.factories=e}return e.create=function(t,n){if(null!=n){var r=n.factories.slice();return t=t.concat(r),new e(t)}return new e(t)},e.extend=function(t){return{provide:e,useFactory:function(n){if(!n)throw new Error("Cannot extend IterableDiffers without a parent injector");return e.create(t,n)},deps:[[e,new di,new ui]]}},e.prototype.find=function(e){var t=this.factories.find(function(t){return t.supports(e)});if(null!=t)return t;throw new Error("Cannot find a differ supporting object '"+e+"' of type '"+Ne(e)+"'")},e}(),ps=function(){function e(e){this.factories=e}return e.create=function(t,n){if(n){var r=n.factories.slice();t=t.concat(r)}return new e(t)},e.extend=function(t){return{provide:e,useFactory:function(n){if(!n)throw new Error("Cannot extend KeyValueDiffers without a parent injector");return e.create(t,n)},deps:[[e,new di,new ui]]}},e.prototype.find=function(e){var t=this.factories.find(function(t){return t.supports(e)});if(t)return t;throw new Error("Cannot find a differ supporting object '"+e+"'")},e}(),ds=[new ss],fs=[new ts],hs=new cs(fs),gs=new ps(ds),ms=[{provide:Ui,useValue:"unknown"},Oa,{provide:Sa,useExisting:Oa},{provide:Ei,useFactory:je,deps:[]},ya,Wi],ys=de(null,"core",ms),vs=new Io("LocaleId"),bs=new Io("Translations"),_s=new Io("TranslationsFormat"),ws={};ws.Error=0,ws.Warning=1,ws.Ignore=2,ws[ws.Error]="Error",ws[ws.Warning]="Warning",ws[ws.Ignore]="Ignore";var xs=function(){function e(e){}return e}();xs.decorators=[{type:ri,args:[{providers:[Ma,{provide:Pa,useExisting:Ma},Vi,Xi,Hi,{provide:cs,useFactory:De},{provide:ps,useFactory:Le},{provide:vs,useFactory:Fe,deps:[[new li(vs),new ui,new di]]}]}]}],xs.ctorParameters=function(){return[{type:Pa}]};var ks={};ks.NONE=0,ks.HTML=1,ks.STYLE=2,ks.SCRIPT=3,ks.URL=4,ks.RESOURCE_URL=5,ks[ks.NONE]="NONE",ks[ks.HTML]="HTML",ks[ks.STYLE]="STYLE",ks[ks.SCRIPT]="SCRIPT",ks[ks.URL]="URL",ks[ks.RESOURCE_URL]="RESOURCE_URL";var Cs=function(){function e(){}return e.prototype.sanitize=function(e,t){},e}(),Ss=function(){function e(){}return e.prototype.view=function(){},e.prototype.nodeIndex=function(){},e.prototype.injector=function(){},e.prototype.component=function(){},e.prototype.providerTokens=function(){},e.prototype.references=function(){},e.prototype.context=function(){},e.prototype.componentRenderElement=function(){},e.prototype.renderNode=function(){},e.prototype.logError=function(e){for(var t=[],n=1;n=0;t--){var n=Jt(this._data,t);Os.destroyView(n)}},e.prototype.get=function(e){var t=this._embeddedViews[e];if(t){var n=new qs(t);return n.attachToViewContainerRef(this),n}return null},Object.defineProperty(e.prototype,"length",{get:function(){return this._embeddedViews.length},enumerable:!0,configurable:!0}),e.prototype.createEmbeddedView=function(e,t,n){var r=e.createEmbeddedView(t||{});return this.insert(r,n),r},e.prototype.createComponent=function(e,t,n,r,o){var i=n||this.parentInjector;o||e instanceof aa||(o=i.get(sa));var a=e.create(i,r,void 0,o);return this.insert(a.hostView,t),a},e.prototype.insert=function(e,t){if(e.destroyed)throw new Error("Cannot insert a destroyed View in a ViewContainer!");var n=e,r=n._view;return Zt(this._view,this._data,t,r),n.attachToViewContainerRef(this),e},e.prototype.move=function(e,t){if(e.destroyed)throw new Error("Cannot move a destroyed View in a ViewContainer!");var n=this._embeddedViews.indexOf(e._view);return Qt(this._data,n,t),e},e.prototype.indexOf=function(e){return this._embeddedViews.indexOf(e._view)},e.prototype.remove=function(e){var t=Jt(this._data,e);t&&Os.destroyView(t)},e.prototype.detach=function(e){var t=Jt(this._data,e);return t?new qs(t):null},e}(),qs=function(){function e(e){this._view=e,this._viewContainerRef=null,this._appRef=null}return Object.defineProperty(e.prototype,"rootNodes",{get:function(){return yt(this._view)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){return this._view.context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"destroyed",{get:function(){return 0!=(128&this._view.state)},enumerable:!0,configurable:!0}),e.prototype.markForCheck=function(){rt(this._view)},e.prototype.detach=function(){this._view.state&=-5},e.prototype.detectChanges=function(){var e=this._view.root.rendererFactory;e.begin&&e.begin(),Os.checkAndUpdateView(this._view),e.end&&e.end()},e.prototype.checkNoChanges=function(){Os.checkNoChangesView(this._view)},e.prototype.reattach=function(){this._view.state|=4},e.prototype.onDestroy=function(e){this._view.disposables||(this._view.disposables=[]),this._view.disposables.push(e)},e.prototype.destroy=function(){this._appRef?this._appRef.detachView(this):this._viewContainerRef&&this._viewContainerRef.detach(this._viewContainerRef.indexOf(this)),Os.destroyView(this._view)},e.prototype.detachFromAppRef=function(){this._appRef=null,tn(this._view),Os.dirtyParentQueries(this._view)},e.prototype.attachToAppRef=function(e){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e},e.prototype.attachToViewContainerRef=function(e){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=e},e}(),Us=function(e){function t(t,n){var r=e.call(this)||this;return r._parentView=t,r._def=n,r}return So.a(t,e),t.prototype.createEmbeddedView=function(e){return new qs(Os.createEmbeddedView(this._parentView,this._def,this._def.element.template,e))},Object.defineProperty(t.prototype,"elementRef",{get:function(){return new Da(Ve(this._parentView,this._def.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),t}(qa),$s=function(){function e(e,t){this.view=e,this.elDef=t}return e.prototype.get=function(e,t){void 0===t&&(t=yi.THROW_IF_NOT_FOUND);var n=!!this.elDef&&0!=(33554432&this.elDef.flags);return Os.resolveDep(this.view,this.elDef,n,{flags:0,token:e,tokenKey:Ge(e)},t)},e}(),Ys=function(){function e(e){this.delegate=e}return e.prototype.selectRootElement=function(e){return this.delegate.selectRootElement(e)},e.prototype.createElement=function(e,t){var n=kt(t),r=n[0],o=n[1],i=this.delegate.createElement(o,r);return e&&this.delegate.appendChild(e,i),i},e.prototype.createViewRoot=function(e){return e},e.prototype.createTemplateAnchor=function(e){var t=this.delegate.createComment("");return e&&this.delegate.appendChild(e,t),t},e.prototype.createText=function(e,t){var n=this.delegate.createText(t);return e&&this.delegate.appendChild(e,n),n},e.prototype.projectNodes=function(e,t){for(var n=0;n-1)return r;if(r=n.getPluralCategory(e),t.indexOf(r)>-1)return r;if(t.indexOf("other")>-1)return"other";throw new Error('No plural message found for value "'+e+'"')}function a(e,t){"string"==typeof t&&(t=parseInt(t,10));var n=t,r=n.toString().replace(/^[^.]*\.?/,""),o=Math.floor(Math.abs(n)),i=r.length,a=parseInt(r,10),s=parseInt(n.toString().replace(/^[^.]*\.?|0+$/g,""),10)||0;switch(e.split("-")[0].toLowerCase()){case"af":case"asa":case"az":case"bem":case"bez":case"bg":case"brx":case"ce":case"cgg":case"chr":case"ckb":case"ee":case"el":case"eo":case"es":case"eu":case"fo":case"fur":case"gsw":case"ha":case"haw":case"hu":case"jgo":case"jmc":case"ka":case"kk":case"kkj":case"kl":case"ks":case"ksb":case"ky":case"lb":case"lg":case"mas":case"mgo":case"ml":case"mn":case"nb":case"nd":case"ne":case"nn":case"nnh":case"nyn":case"om":case"or":case"os":case"ps":case"rm":case"rof":case"rwk":case"saq":case"seh":case"sn":case"so":case"sq":case"ta":case"te":case"teo":case"tk":case"tr":case"ug":case"uz":case"vo":case"vun":case"wae":case"xog":return 1===n?U.One:U.Other;case"ak":case"ln":case"mg":case"pa":case"ti":return n===Math.floor(n)&&n>=0&&n<=1?U.One:U.Other;case"am":case"as":case"bn":case"fa":case"gu":case"hi":case"kn":case"mr":case"zu":return 0===o||1===n?U.One:U.Other;case"ar":return 0===n?U.Zero:1===n?U.One:2===n?U.Two:n%100===Math.floor(n%100)&&n%100>=3&&n%100<=10?U.Few:n%100===Math.floor(n%100)&&n%100>=11&&n%100<=99?U.Many:U.Other;case"ast":case"ca":case"de":case"en":case"et":case"fi":case"fy":case"gl":case"it":case"nl":case"sv":case"sw":case"ur":case"yi":return 1===o&&0===i?U.One:U.Other;case"be":return n%10==1&&n%100!=11?U.One:n%10===Math.floor(n%10)&&n%10>=2&&n%10<=4&&!(n%100>=12&&n%100<=14)?U.Few:n%10==0||n%10===Math.floor(n%10)&&n%10>=5&&n%10<=9||n%100===Math.floor(n%100)&&n%100>=11&&n%100<=14?U.Many:U.Other;case"br":return n%10==1&&n%100!=11&&n%100!=71&&n%100!=91?U.One:n%10==2&&n%100!=12&&n%100!=72&&n%100!=92?U.Two:n%10===Math.floor(n%10)&&(n%10>=3&&n%10<=4||n%10==9)&&!(n%100>=10&&n%100<=19||n%100>=70&&n%100<=79||n%100>=90&&n%100<=99)?U.Few:0!==n&&n%1e6==0?U.Many:U.Other;case"bs":case"hr":case"sr":return 0===i&&o%10==1&&o%100!=11||a%10==1&&a%100!=11?U.One:0===i&&o%10===Math.floor(o%10)&&o%10>=2&&o%10<=4&&!(o%100>=12&&o%100<=14)||a%10===Math.floor(a%10)&&a%10>=2&&a%10<=4&&!(a%100>=12&&a%100<=14)?U.Few:U.Other;case"cs":case"sk":return 1===o&&0===i?U.One:o===Math.floor(o)&&o>=2&&o<=4&&0===i?U.Few:0!==i?U.Many:U.Other;case"cy":return 0===n?U.Zero:1===n?U.One:2===n?U.Two:3===n?U.Few:6===n?U.Many:U.Other;case"da":return 1===n||0!==s&&(0===o||1===o)?U.One:U.Other;case"dsb":case"hsb":return 0===i&&o%100==1||a%100==1?U.One:0===i&&o%100==2||a%100==2?U.Two:0===i&&o%100===Math.floor(o%100)&&o%100>=3&&o%100<=4||a%100===Math.floor(a%100)&&a%100>=3&&a%100<=4?U.Few:U.Other;case"ff":case"fr":case"hy":case"kab":return 0===o||1===o?U.One:U.Other;case"fil":return 0===i&&(1===o||2===o||3===o)||0===i&&o%10!=4&&o%10!=6&&o%10!=9||0!==i&&a%10!=4&&a%10!=6&&a%10!=9?U.One:U.Other;case"ga":return 1===n?U.One:2===n?U.Two:n===Math.floor(n)&&n>=3&&n<=6?U.Few:n===Math.floor(n)&&n>=7&&n<=10?U.Many:U.Other;case"gd":return 1===n||11===n?U.One:2===n||12===n?U.Two:n===Math.floor(n)&&(n>=3&&n<=10||n>=13&&n<=19)?U.Few:U.Other;case"gv":return 0===i&&o%10==1?U.One:0===i&&o%10==2?U.Two:0!==i||o%100!=0&&o%100!=20&&o%100!=40&&o%100!=60&&o%100!=80?0!==i?U.Many:U.Other:U.Few;case"he":return 1===o&&0===i?U.One:2===o&&0===i?U.Two:0!==i||n>=0&&n<=10||n%10!=0?U.Other:U.Many;case"is":return 0===s&&o%10==1&&o%100!=11||0!==s?U.One:U.Other;case"ksh":return 0===n?U.Zero:1===n?U.One:U.Other;case"kw":case"naq":case"se":case"smn":return 1===n?U.One:2===n?U.Two:U.Other;case"lag":return 0===n?U.Zero:0!==o&&1!==o||0===n?U.Other:U.One;case"lt":return n%10!=1||n%100>=11&&n%100<=19?n%10===Math.floor(n%10)&&n%10>=2&&n%10<=9&&!(n%100>=11&&n%100<=19)?U.Few:0!==a?U.Many:U.Other:U.One;case"lv":case"prg":return n%10==0||n%100===Math.floor(n%100)&&n%100>=11&&n%100<=19||2===i&&a%100===Math.floor(a%100)&&a%100>=11&&a%100<=19?U.Zero:n%10==1&&n%100!=11||2===i&&a%10==1&&a%100!=11||2!==i&&a%10==1?U.One:U.Other;case"mk":return 0===i&&o%10==1||a%10==1?U.One:U.Other;case"mt":return 1===n?U.One:0===n||n%100===Math.floor(n%100)&&n%100>=2&&n%100<=10?U.Few:n%100===Math.floor(n%100)&&n%100>=11&&n%100<=19?U.Many:U.Other;case"pl":return 1===o&&0===i?U.One:0===i&&o%10===Math.floor(o%10)&&o%10>=2&&o%10<=4&&!(o%100>=12&&o%100<=14)?U.Few:0===i&&1!==o&&o%10===Math.floor(o%10)&&o%10>=0&&o%10<=1||0===i&&o%10===Math.floor(o%10)&&o%10>=5&&o%10<=9||0===i&&o%100===Math.floor(o%100)&&o%100>=12&&o%100<=14?U.Many:U.Other;case"pt":return n===Math.floor(n)&&n>=0&&n<=2&&2!==n?U.One:U.Other;case"ro":return 1===o&&0===i?U.One:0!==i||0===n||1!==n&&n%100===Math.floor(n%100)&&n%100>=1&&n%100<=19?U.Few:U.Other;case"ru":case"uk":return 0===i&&o%10==1&&o%100!=11?U.One:0===i&&o%10===Math.floor(o%10)&&o%10>=2&&o%10<=4&&!(o%100>=12&&o%100<=14)?U.Few:0===i&&o%10==0||0===i&&o%10===Math.floor(o%10)&&o%10>=5&&o%10<=9||0===i&&o%100===Math.floor(o%100)&&o%100>=11&&o%100<=14?U.Many:U.Other;case"shi":return 0===o||1===n?U.One:n===Math.floor(n)&&n>=2&&n<=10?U.Few:U.Other;case"si":return 0===n||1===n||0===o&&1===a?U.One:U.Other;case"sl":return 0===i&&o%100==1?U.One:0===i&&o%100==2?U.Two:0===i&&o%100===Math.floor(o%100)&&o%100>=3&&o%100<=4||0!==i?U.Few:U.Other;case"tzm":return n===Math.floor(n)&&n>=0&&n<=1||n===Math.floor(n)&&n>=11&&n<=99?U.One:U.Other;default:return U.Other}}function s(e,t){t=encodeURIComponent(t);for(var n=0,r=e.split(";");n1?"short":"narrow":"long",n}function v(e){return e.reduce(function(e,t){return Object.assign({},e,t)},{})}function b(e){return function(t,n){return f(t,n,e)}}function _(e,t,n){var r=be[e];if(r)return r(t,n);var o=e,i=we.get(o);if(!i){i=[];var a=void 0;ve.exec(e);for(var s=e;s;)a=ve.exec(s),a?(i=i.concat(a.slice(1)),s=i.pop()):(i.push(s),s=null);we.set(o,i)}return i.reduce(function(e,r){var o=_e[r];return e+(o?o(t,n):w(r))},"")}function w(e){return"''"===e?"'":e.replace(/(^'|'$)/g,"").replace(/''/g,"'")}function x(e,t,n,r,o,i,a){if(void 0===i&&(i=null),void 0===a&&(a=!1),null==n)return null;if("number"!=typeof(n="string"==typeof n&&C(n)?+n:n))throw u(e,n);var s=void 0,l=void 0,c=void 0;if(r!==me.Currency&&(s=1,l=0,c=3),o){var p=o.match(ke);if(null===p)throw new Error(o+" is not a valid digit info for number pipes");null!=p[1]&&(s=k(p[1])),null!=p[3]&&(l=k(p[3])),null!=p[5]&&(c=k(p[5]))}return ye.format(n,t,r,{minimumIntegerDigits:s,minimumFractionDigits:l,maximumFractionDigits:c,currency:i,currencyAsSymbol:a})}function k(e){var t=parseInt(e);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+e);return t}function C(e){return!isNaN(e-parseFloat(e))}function S(e){return null==e||""===e}function O(e){return e instanceof Date&&!isNaN(e.valueOf())}function P(e){var t=new Date(0),n=0,r=0,o=e[8]?t.setUTCFullYear:t.setFullYear,i=e[8]?t.setUTCHours:t.setHours;e[9]&&(n=M(e[9]+e[10]),r=M(e[9]+e[11])),o.call(t,M(e[1]),M(e[2])-1,M(e[3]));var a=M(e[4]||"0")-n,s=M(e[5]||"0")-r,l=M(e[6]||"0"),u=Math.round(1e3*parseFloat("0."+(e[7]||0)));return i.call(t,a,s,l,u),t}function M(e){return parseInt(e,10)}function E(e){return e===Fe}function T(e){return e===ze}function I(e){return e===Ve}function A(e){return e===Be}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"NgLocaleLocalization",function(){return q}),n.d(t,"NgLocalization",function(){return H}),n.d(t,"ɵparseCookieValue",function(){return s}),n.d(t,"CommonModule",function(){return je}),n.d(t,"DeprecatedI18NPipesModule",function(){return De}),n.d(t,"NgClass",function(){return $}),n.d(t,"NgFor",function(){return G}),n.d(t,"NgForOf",function(){return Z}),n.d(t,"NgForOfContext",function(){return W}),n.d(t,"NgIf",function(){return J}),n.d(t,"NgIfContext",function(){return K}),n.d(t,"NgPlural",function(){return re}),n.d(t,"NgPluralCase",function(){return oe}),n.d(t,"NgStyle",function(){return ie}),n.d(t,"NgSwitch",function(){return ee}),n.d(t,"NgSwitchCase",function(){return te}),n.d(t,"NgSwitchDefault",function(){return ne}),n.d(t,"NgTemplateOutlet",function(){return ae}),n.d(t,"NgComponentOutlet",function(){return Y}),n.d(t,"DOCUMENT",function(){return Le}),n.d(t,"AsyncPipe",function(){return de}),n.d(t,"DatePipe",function(){return Me}),n.d(t,"I18nPluralPipe",function(){return Te}),n.d(t,"I18nSelectPipe",function(){return Ie}),n.d(t,"JsonPipe",function(){return Ae}),n.d(t,"LowerCasePipe",function(){return fe}),n.d(t,"CurrencyPipe",function(){return Oe}),n.d(t,"DecimalPipe",function(){return Ce}),n.d(t,"PercentPipe",function(){return Se}),n.d(t,"SlicePipe",function(){return Re}),n.d(t,"UpperCasePipe",function(){return ge}),n.d(t,"TitleCasePipe",function(){return he}),n.d(t,"ɵPLATFORM_BROWSER_ID",function(){return Fe}),n.d(t,"ɵPLATFORM_SERVER_ID",function(){return ze}),n.d(t,"ɵPLATFORM_WORKER_APP_ID",function(){return Ve}),n.d(t,"ɵPLATFORM_WORKER_UI_ID",function(){return Be}),n.d(t,"isPlatformBrowser",function(){return E}),n.d(t,"isPlatformServer",function(){return T}),n.d(t,"isPlatformWorkerApp",function(){return I}),n.d(t,"isPlatformWorkerUi",function(){return A}),n.d(t,"VERSION",function(){return He}),n.d(t,"PlatformLocation",function(){return j}),n.d(t,"LOCATION_INITIALIZED",function(){return D}),n.d(t,"LocationStrategy",function(){return L}),n.d(t,"APP_BASE_HREF",function(){return F}),n.d(t,"HashLocationStrategy",function(){return V}),n.d(t,"PathLocationStrategy",function(){return B}),n.d(t,"Location",function(){return z}),n.d(t,"ɵa",function(){return se}),n.d(t,"ɵb",function(){return Ne});var R=n(142),N=n(1),j=function(){function e(){}return e.prototype.getBaseHrefFromDOM=function(){},e.prototype.onPopState=function(e){},e.prototype.onHashChange=function(e){},e.prototype.pathname=function(){},e.prototype.search=function(){},e.prototype.hash=function(){},e.prototype.replaceState=function(e,t,n){},e.prototype.pushState=function(e,t,n){},e.prototype.forward=function(){},e.prototype.back=function(){},e}(),D=new N.InjectionToken("Location Initialized"),L=function(){function e(){}return e.prototype.path=function(e){},e.prototype.prepareExternalUrl=function(e){},e.prototype.pushState=function(e,t,n,r){},e.prototype.replaceState=function(e,t,n,r){},e.prototype.forward=function(){},e.prototype.back=function(){},e.prototype.onPopState=function(e){},e.prototype.getBaseHref=function(){},e}(),F=new N.InjectionToken("appBaseHref"),z=function(){function e(t){var n=this;this._subject=new N.EventEmitter,this._platformStrategy=t;var r=this._platformStrategy.getBaseHref();this._baseHref=e.stripTrailingSlash(o(r)),this._platformStrategy.onPopState(function(e){n._subject.emit({url:n.path(!0),pop:!0,type:e.type})})}return e.prototype.path=function(e){return void 0===e&&(e=!1),this.normalize(this._platformStrategy.path(e))},e.prototype.isCurrentPathEqualTo=function(t,n){return void 0===n&&(n=""),this.path()==this.normalize(t+e.normalizeQueryParams(n))},e.prototype.normalize=function(t){return e.stripTrailingSlash(r(this._baseHref,o(t)))},e.prototype.prepareExternalUrl=function(e){return e&&"/"!==e[0]&&(e="/"+e),this._platformStrategy.prepareExternalUrl(e)},e.prototype.go=function(e,t){void 0===t&&(t=""),this._platformStrategy.pushState(null,"",e,t)},e.prototype.replaceState=function(e,t){void 0===t&&(t=""),this._platformStrategy.replaceState(null,"",e,t)},e.prototype.forward=function(){this._platformStrategy.forward()},e.prototype.back=function(){this._platformStrategy.back()},e.prototype.subscribe=function(e,t,n){return this._subject.subscribe({next:e,error:t,complete:n})},e.normalizeQueryParams=function(e){return e&&"?"!==e[0]?"?"+e:e},e.joinWithSlash=function(e,t){if(0==e.length)return t;if(0==t.length)return e;var n=0;return e.endsWith("/")&&n++,t.startsWith("/")&&n++,2==n?e+t.substring(1):1==n?e+t:e+"/"+t},e.stripTrailingSlash=function(e){var t=e.match(/#|\?|$/),n=t&&t.index||e.length,r=n-("/"===e[n-1]?1:0);return e.slice(0,r)+e.slice(n)},e}();z.decorators=[{type:N.Injectable}],z.ctorParameters=function(){return[{type:L}]};var V=function(e){function t(t,n){var r=e.call(this)||this;return r._platformLocation=t,r._baseHref="",null!=n&&(r._baseHref=n),r}return R.a(t,e),t.prototype.onPopState=function(e){this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e)},t.prototype.getBaseHref=function(){return this._baseHref},t.prototype.path=function(e){void 0===e&&(e=!1);var t=this._platformLocation.hash;return null==t&&(t="#"),t.length>0?t.substring(1):t},t.prototype.prepareExternalUrl=function(e){var t=z.joinWithSlash(this._baseHref,e);return t.length>0?"#"+t:t},t.prototype.pushState=function(e,t,n,r){var o=this.prepareExternalUrl(n+z.normalizeQueryParams(r));0==o.length&&(o=this._platformLocation.pathname),this._platformLocation.pushState(e,t,o)},t.prototype.replaceState=function(e,t,n,r){var o=this.prepareExternalUrl(n+z.normalizeQueryParams(r));0==o.length&&(o=this._platformLocation.pathname),this._platformLocation.replaceState(e,t,o)},t.prototype.forward=function(){this._platformLocation.forward()},t.prototype.back=function(){this._platformLocation.back()},t}(L);V.decorators=[{type:N.Injectable}],V.ctorParameters=function(){return[{type:j},{type:void 0,decorators:[{type:N.Optional},{type:N.Inject,args:[F]}]}]};var B=function(e){function t(t,n){var r=e.call(this)||this;if(r._platformLocation=t,null==n&&(n=r._platformLocation.getBaseHrefFromDOM()),null==n)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");return r._baseHref=n,r}return R.a(t,e),t.prototype.onPopState=function(e){this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e)},t.prototype.getBaseHref=function(){return this._baseHref},t.prototype.prepareExternalUrl=function(e){return z.joinWithSlash(this._baseHref,e)},t.prototype.path=function(e){void 0===e&&(e=!1);var t=this._platformLocation.pathname+z.normalizeQueryParams(this._platformLocation.search),n=this._platformLocation.hash;return n&&e?""+t+n:t},t.prototype.pushState=function(e,t,n,r){var o=this.prepareExternalUrl(n+z.normalizeQueryParams(r));this._platformLocation.pushState(e,t,o)},t.prototype.replaceState=function(e,t,n,r){var o=this.prepareExternalUrl(n+z.normalizeQueryParams(r));this._platformLocation.replaceState(e,t,o)},t.prototype.forward=function(){this._platformLocation.forward()},t.prototype.back=function(){this._platformLocation.back()},t}(L);B.decorators=[{type:N.Injectable}],B.ctorParameters=function(){return[{type:j},{type:void 0,decorators:[{type:N.Optional},{type:N.Inject,args:[F]}]}]};var H=function(){function e(){}return e.prototype.getPluralCategory=function(e){},e}(),q=function(e){function t(t){var n=e.call(this)||this;return n.locale=t,n}return R.a(t,e),t.prototype.getPluralCategory=function(e){switch(a(this.locale,e)){case U.Zero:return"zero";case U.One:return"one";case U.Two:return"two";case U.Few:return"few";case U.Many:return"many";default:return"other"}},t}(H);q.decorators=[{type:N.Injectable}],q.ctorParameters=function(){return[{type:void 0,decorators:[{type:N.Inject,args:[N.LOCALE_ID]}]}]};var U={};U.Zero=0,U.One=1,U.Two=2,U.Few=3,U.Many=4,U.Other=5,U[U.Zero]="Zero",U[U.One]="One",U[U.Two]="Two",U[U.Few]="Few",U[U.Many]="Many",U[U.Other]="Other";var $=function(){function e(e,t,n,r){this._iterableDiffers=e,this._keyValueDiffers=t,this._ngEl=n,this._renderer=r,this._initialClasses=[]}return Object.defineProperty(e.prototype,"klass",{set:function(e){this._applyInitialClasses(!0),this._initialClasses="string"==typeof e?e.split(/\s+/):[],this._applyInitialClasses(!1),this._applyClasses(this._rawClass,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngClass",{set:function(e){this._cleanupClasses(this._rawClass),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof e?e.split(/\s+/):e,this._rawClass&&(Object(N["ɵisListLikeIterable"])(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())},enumerable:!0,configurable:!0}),e.prototype.ngDoCheck=function(){if(this._iterableDiffer){var e=this._iterableDiffer.diff(this._rawClass);e&&this._applyIterableChanges(e)}else if(this._keyValueDiffer){var t=this._keyValueDiffer.diff(this._rawClass);t&&this._applyKeyValueChanges(t)}},e.prototype._cleanupClasses=function(e){this._applyClasses(e,!0),this._applyInitialClasses(!1)},e.prototype._applyKeyValueChanges=function(e){var t=this;e.forEachAddedItem(function(e){return t._toggleClass(e.key,e.currentValue)}),e.forEachChangedItem(function(e){return t._toggleClass(e.key,e.currentValue)}),e.forEachRemovedItem(function(e){e.previousValue&&t._toggleClass(e.key,!1)})},e.prototype._applyIterableChanges=function(e){var t=this;e.forEachAddedItem(function(e){if("string"!=typeof e.item)throw new Error("NgClass can only toggle CSS classes expressed as strings, got "+Object(N["ɵstringify"])(e.item));t._toggleClass(e.item,!0)}),e.forEachRemovedItem(function(e){return t._toggleClass(e.item,!1)})},e.prototype._applyInitialClasses=function(e){var t=this;this._initialClasses.forEach(function(n){return t._toggleClass(n,!e)})},e.prototype._applyClasses=function(e,t){var n=this;e&&(Array.isArray(e)||e instanceof Set?e.forEach(function(e){return n._toggleClass(e,!t)}):Object.keys(e).forEach(function(r){null!=e[r]&&n._toggleClass(r,!t)}))},e.prototype._toggleClass=function(e,t){var n=this;(e=e.trim())&&e.split(/\s+/g).forEach(function(e){n._renderer.setElementClass(n._ngEl.nativeElement,e,!!t)})},e}();$.decorators=[{type:N.Directive,args:[{selector:"[ngClass]"}]}],$.ctorParameters=function(){return[{type:N.IterableDiffers},{type:N.KeyValueDiffers},{type:N.ElementRef},{type:N.Renderer}]},$.propDecorators={klass:[{type:N.Input,args:["class"]}],ngClass:[{type:N.Input}]};var Y=function(){function e(e){this._viewContainerRef=e,this._componentRef=null,this._moduleRef=null}return e.prototype.ngOnChanges=function(e){if(this._viewContainerRef.clear(),this._componentRef=null,this.ngComponentOutlet){var t=this.ngComponentOutletInjector||this._viewContainerRef.parentInjector;if(e.ngComponentOutletNgModuleFactory)if(this._moduleRef&&this._moduleRef.destroy(),this.ngComponentOutletNgModuleFactory){var n=t.get(N.NgModuleRef);this._moduleRef=this.ngComponentOutletNgModuleFactory.create(n.injector)}else this._moduleRef=null;var r=this._moduleRef?this._moduleRef.componentFactoryResolver:t.get(N.ComponentFactoryResolver),o=r.resolveComponentFactory(this.ngComponentOutlet);this._componentRef=this._viewContainerRef.createComponent(o,this._viewContainerRef.length,t,this.ngComponentOutletContent)}},e.prototype.ngOnDestroy=function(){this._moduleRef&&this._moduleRef.destroy()},e}();Y.decorators=[{type:N.Directive,args:[{selector:"[ngComponentOutlet]"}]}],Y.ctorParameters=function(){return[{type:N.ViewContainerRef}]},Y.propDecorators={ngComponentOutlet:[{type:N.Input}],ngComponentOutletInjector:[{type:N.Input}],ngComponentOutletContent:[{type:N.Input}],ngComponentOutletNgModuleFactory:[{type:N.Input}]};var W=function(){function e(e,t,n,r){this.$implicit=e,this.ngForOf=t,this.index=n,this.count=r}return Object.defineProperty(e.prototype,"first",{get:function(){return 0===this.index},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"last",{get:function(){return this.index===this.count-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"even",{get:function(){return this.index%2==0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"odd",{get:function(){return!this.even},enumerable:!0,configurable:!0}),e}(),Z=function(){function e(e,t,n){this._viewContainer=e,this._template=t,this._differs=n,this._differ=null}return Object.defineProperty(e.prototype,"ngForTrackBy",{get:function(){return this._trackByFn},set:function(e){Object(N.isDevMode)()&&null!=e&&"function"!=typeof e&&console&&console.warn&&console.warn("trackBy must be a function, but received "+JSON.stringify(e)+". See https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html#!#change-propagation for more information."),this._trackByFn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngForTemplate",{set:function(e){e&&(this._template=e)},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(e){if("ngForOf"in e){var t=e.ngForOf.currentValue;if(!this._differ&&t)try{this._differ=this._differs.find(t).create(this.ngForTrackBy)}catch(e){throw new Error("Cannot find a differ supporting object '"+t+"' of type '"+l(t)+"'. NgFor only supports binding to Iterables such as Arrays.")}}},e.prototype.ngDoCheck=function(){if(this._differ){var e=this._differ.diff(this.ngForOf);e&&this._applyChanges(e)}},e.prototype._applyChanges=function(e){var t=this,n=[];e.forEachOperation(function(e,r,o){if(null==e.previousIndex){var i=t._viewContainer.createEmbeddedView(t._template,new W(null,t.ngForOf,-1,-1),o),a=new X(e,i);n.push(a)}else if(null==o)t._viewContainer.remove(r);else{var i=t._viewContainer.get(r);t._viewContainer.move(i,o);var a=new X(e,i);n.push(a)}});for(var r=0;r/g,">")}function S(e){Ie.attributeMap(e).forEach(function(t,n){"xmlns:ns1"!==n&&0!==n.indexOf("ns1:")||Ie.removeAttribute(e,n)});for(var t=0,n=Ie.childNodesAsList(e);t0},t.prototype.tagName=function(e){return e.tagName},t.prototype.attributeMap=function(e){for(var t=new Map,n=e.attributes,r=0;r-1},t}(le);Ce.decorators=[{type:L.Injectable}],Ce.ctorParameters=function(){return[{type:void 0,decorators:[{type:L.Inject,args:[W]}]},{type:ke,decorators:[{type:L.Inject,args:[xe]}]}]};var Se=["alt","control","meta","shift"],Oe={alt:function(e){return e.altKey},control:function(e){return e.ctrlKey},meta:function(e){return e.metaKey},shift:function(e){return e.shiftKey}},Pe=function(e){function t(t){return e.call(this,t)||this}return j.a(t,e),t.prototype.supports=function(e){return null!=t.parseEventName(e)},t.prototype.addEventListener=function(e,n,o){var i=t.parseEventName(n),a=t.eventCallback(i.fullKey,o,this.manager.getZone());return this.manager.getZone().runOutsideAngular(function(){return r().onAndCancel(e,i.domEventName,a)})},t.parseEventName=function(e){var n=e.toLowerCase().split("."),r=n.shift();if(0===n.length||"keydown"!==r&&"keyup"!==r)return null;var o=t._normalizeKey(n.pop()),i="";if(Se.forEach(function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),i+=e+".")}),i+=o,0!=n.length||0===o.length)return null;var a={};return a.domEventName=r,a.fullKey=i,a},t.getEventFullKey=function(e){var t="",n=r().getEventKey(e);return n=n.toLowerCase()," "===n?n="space":"."===n&&(n="dot"),Se.forEach(function(r){if(r!=n){(0,Oe[r])(e)&&(t+=r+".")}}),t+=n},t.eventCallback=function(e,n,r){return function(o){t.getEventFullKey(o)===e&&r.runGuarded(function(){return n(o)})}},t._normalizeKey=function(e){switch(e){case"esc":return"escape";default:return e}},t}(le);Pe.decorators=[{type:L.Injectable}],Pe.ctorParameters=function(){return[{type:void 0,decorators:[{type:L.Inject,args:[W]}]}]};var Me=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:\/?#]*(?:[\/?#]|$))/gi,Ee=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i,Te=null,Ie=null,Ae=w("area,br,col,hr,img,wbr"),Re=w("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Ne=w("rp,rt"),je=x(Ne,Re),De=x(Re,w("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Le=x(Ne,w("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Fe=x(Ae,De,Le,je),ze=w("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),Ve=w("srcset"),Be=w("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),He=x(ze,Ve,Be),qe=function(){function e(){this.sanitizedSomething=!1,this.buf=[]}return e.prototype.sanitizeChildren=function(e){for(var t=e.firstChild;t;)if(Ie.isElementNode(t)?this.startElement(t):Ie.isTextNode(t)?this.chars(Ie.nodeValue(t)):this.sanitizedSomething=!0,Ie.firstChild(t))t=Ie.firstChild(t);else for(;t;){Ie.isElementNode(t)&&this.endElement(t);var n=k(t,Ie.nextSibling(t));if(n){t=n;break}t=k(t,Ie.parentElement(t))}return this.buf.join("")},e.prototype.startElement=function(e){var t=this,n=Ie.nodeName(e).toLowerCase();if(!Fe.hasOwnProperty(n))return void(this.sanitizedSomething=!0);this.buf.push("<"),this.buf.push(n),Ie.attributeMap(e).forEach(function(e,n){var r=n.toLowerCase();if(!He.hasOwnProperty(r))return void(t.sanitizedSomething=!0);ze[r]&&(e=v(e)),Ve[r]&&(e=b(e)),t.buf.push(" "),t.buf.push(n),t.buf.push('="'),t.buf.push(C(e)),t.buf.push('"')}),this.buf.push(">")},e.prototype.endElement=function(e){var t=Ie.nodeName(e).toLowerCase();Fe.hasOwnProperty(t)&&!Ae.hasOwnProperty(t)&&(this.buf.push(""))},e.prototype.chars=function(e){this.buf.push(C(e))},e}(),Ue=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,$e=/([^\#-~ |!])/g,Ye=new RegExp("^([-,.\"'%_!# a-zA-Z0-9]+|(?:(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?|(?:rgb|hsl)a?|(?:repeating-)?(?:linear|radial)-gradient|(?:calc|attr))\\([-0-9.%, #a-zA-Z]+\\))$","g"),We=/^url\(([^)]+)\)$/,Ze=function(){function e(){}return e.prototype.sanitize=function(e,t){},e.prototype.bypassSecurityTrustHtml=function(e){},e.prototype.bypassSecurityTrustStyle=function(e){},e.prototype.bypassSecurityTrustScript=function(e){},e.prototype.bypassSecurityTrustUrl=function(e){},e.prototype.bypassSecurityTrustResourceUrl=function(e){},e}(),Xe=function(e){function t(t){var n=e.call(this)||this;return n._doc=t,n}return j.a(t,e),t.prototype.sanitize=function(e,t){if(null==t)return null;switch(e){case L.SecurityContext.NONE:return t;case L.SecurityContext.HTML:return t instanceof Je?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"HTML"),O(this._doc,String(t)));case L.SecurityContext.STYLE:return t instanceof Ke?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"Style"),M(t));case L.SecurityContext.SCRIPT:if(t instanceof Qe)return t.changingThisBreaksApplicationSecurity;throw this.checkNotSafeValue(t,"Script"),new Error("unsafe value used in a script context");case L.SecurityContext.URL:return t instanceof tt||t instanceof et?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"URL"),v(String(t)));case L.SecurityContext.RESOURCE_URL:if(t instanceof tt)return t.changingThisBreaksApplicationSecurity;throw this.checkNotSafeValue(t,"ResourceURL"),new Error("unsafe value used in a resource URL context (see http://g.co/ng/security#xss)");default:throw new Error("Unexpected SecurityContext "+e+" (see http://g.co/ng/security#xss)")}},t.prototype.checkNotSafeValue=function(e,t){if(e instanceof Ge)throw new Error("Required a safe "+t+", got a "+e.getTypeName()+" (see http://g.co/ng/security#xss)")},t.prototype.bypassSecurityTrustHtml=function(e){return new Je(e)},t.prototype.bypassSecurityTrustStyle=function(e){return new Ke(e)},t.prototype.bypassSecurityTrustScript=function(e){return new Qe(e)},t.prototype.bypassSecurityTrustUrl=function(e){return new et(e)},t.prototype.bypassSecurityTrustResourceUrl=function(e){return new tt(e)},t}(Ze);Xe.decorators=[{type:L.Injectable}],Xe.ctorParameters=function(){return[{type:void 0,decorators:[{type:L.Inject,args:[W]}]}]};var Ge=function(){function e(e){this.changingThisBreaksApplicationSecurity=e}return e.prototype.getTypeName=function(){},e.prototype.toString=function(){return"SafeValue must use [property]=binding: "+this.changingThisBreaksApplicationSecurity+" (see http://g.co/ng/security#xss)"},e}(),Je=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j.a(t,e),t.prototype.getTypeName=function(){return"HTML"},t}(Ge),Ke=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j.a(t,e),t.prototype.getTypeName=function(){return"Style"},t}(Ge),Qe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j.a(t,e),t.prototype.getTypeName=function(){return"Script"},t}(Ge),et=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j.a(t,e),t.prototype.getTypeName=function(){return"URL"},t}(Ge),tt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j.a(t,e),t.prototype.getTypeName=function(){return"ResourceURL"},t}(Ge),nt=[{provide:L.PLATFORM_ID,useValue:D["ɵPLATFORM_BROWSER_ID"]},{provide:L.PLATFORM_INITIALIZER,useValue:E,multi:!0},{provide:D.PlatformLocation,useClass:Z},{provide:W,useFactory:I,deps:[]}],rt=[{provide:L.Sanitizer,useExisting:Ze},{provide:Ze,useClass:Xe}],ot=Object(L.createPlatformFactory)(L.platformCore,"browser",nt),it=function(){function e(e){if(e)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}return e.withServerTransition=function(t){return{ngModule:e,providers:[{provide:L.APP_ID,useValue:t.appId},{provide:G,useExisting:L.APP_ID},J]}},e}();it.decorators=[{type:L.NgModule,args:[{providers:[rt,{provide:L.ErrorHandler,useFactory:T,deps:[]},{provide:ae,useClass:_e,multi:!0},{provide:ae,useClass:Pe,multi:!0},{provide:ae,useClass:Ce,multi:!0},{provide:xe,useClass:ke},ge,{provide:L.RendererFactory2,useExisting:ge},{provide:ue,useExisting:ce},ce,L.Testability,se,ie,X,Q],exports:[D.CommonModule,L.ApplicationModule]}]}],it.ctorParameters=function(){return[{type:it,decorators:[{type:L.Optional},{type:L.SkipSelf}]}]};var at="undefined"!=typeof window&&window||{},st=function(){function e(e,t){this.msPerTick=e,this.numTicks=t}return e}(),lt=function(){function e(e){this.appRef=e.injector.get(L.ApplicationRef)}return e.prototype.timeChangeDetection=function(e){var t=e&&e.record,n=null!=at.console.profile;t&&n&&at.console.profile("Change Detection");for(var o=r().performanceNow(),i=0;i<5||r().performanceNow()-o<500;)this.appRef.tick(),i++;var a=r().performanceNow();t&&n&&at.console.profileEnd("Change Detection");var s=(a-o)/i;return at.console.log("ran "+i+" change detection cycles"),at.console.log(s.toFixed(2)+" ms per check"),new st(s,i)},e}(),ut="profiler",ct=function(){function e(){}return e.all=function(){return function(e){return!0}},e.css=function(e){return function(t){return null!=t.nativeElement&&r().elementMatches(t.nativeElement,e)}},e.directive=function(e){return function(t){return-1!==t.providerTokens.indexOf(e)}},e}(),pt=new L.Version("4.4.6")},function(e,t,n){"use strict";function r(e){return e.discriminator||e["x-extendedDiscriminator"]}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(444),a=n(41),s=n(88),l=n(91),u=n(232),c=n(29),p=n(7),d=n(73),f=function(){function e(e){this._schema={},this.spec=new l.BehaviorSubject(null),this.options=e.options}return e.prototype.load=function(e){var t=this;return new Promise(function(n,r){t.parser=new i,t.parser.bundle(e,{http:{withCredentials:!1}}).then(function(o){"string"==typeof e&&(t.specUrl=e),t.rawSpec=o,t._schema=c.snapshot(o);try{t.init(),t.spec.next(t._schema),n(t._schema)}catch(e){r(e)}},function(e){return r(e)})})},e.prototype.init=function(){var e,t=this.specUrl?s.parse(s.resolve(window.location.href,this.specUrl)):{protocol:window.location.protocol,host:window.location.host},n=this._schema.schemes;n&&n.length?"http"===(e=n[0])&&n.indexOf("https")>=0&&(e="https"):e=t.protocol?t.protocol.slice(0,-1):"http";var r=this._schema.host||t.host;this.basePath=this._schema.basePath||"",this.apiUrl=e+"://"+r+this.basePath,this.apiProtocol=e,this.apiUrl.endsWith("/")&&(this.apiUrl=this.apiUrl.substr(0,this.apiUrl.length-1)),this.preprocess()},e.prototype.preprocess=function(){var e=new u.MdRenderer;if(!this._schema.info)throw Error('Specification Error: Required field "info" is not specified at the top level of the specification');if(this._schema.info.description||(this._schema.info.description=""),this._schema.securityDefinitions&&!this.options.noAutoAuth){var t=n(148).SecurityDefinitions;e.addPreprocessor(t.insertTagIntoDescription)}this._schema.info["x-redoc-html-description"]=e.renderMd(this._schema.info.description),this._schema.info["x-redoc-markdown-headers"]=e.headings},Object.defineProperty(e.prototype,"schema",{get:function(){return this._schema},set:function(e){this._schema=e,this.spec.next(this._schema)},enumerable:!0,configurable:!0}),e.prototype.byPointer=function(e){var t=null;if(void 0==e)return null;try{t=a.JsonPointer.get(this._schema,decodeURIComponent(e))}catch(n){"#"!==e.charAt(0)&&(e="#"+e);try{t=this.parser.$refs.get(decodeURIComponent(e))}catch(e){}}return t},e.prototype.resolveRefs=function(e){var t=this;return Object.keys(e).forEach(function(n){if(e[n].$ref){var r=t.byPointer(e[n].$ref);r._pointer=e[n].$ref,e[n]=r}}),e},e.prototype.getOperationParams=function(e){function t(e,t){if(!Array.isArray(e))throw new Error("parameters must be an array. Got "+typeof e+" at "+t);return e.map(function(e,n){return e._pointer=a.JsonPointer.join(t,n),e})}"parameters"===a.JsonPointer.baseName(e)&&(e=a.JsonPointer.dirName(e));var n=a.JsonPointer.join(a.JsonPointer.dirName(e),["parameters"]),r=this.byPointer(n)||[],o=a.JsonPointer.join(e,["parameters"]),i=this.byPointer(o)||[],s={};return i.forEach(function(e){return s[e.name]=!0}),r=r.filter(function(e){return!s[e.name]}),r=t(r,n),i=t(i,o),i=this.resolveRefs(i),r=this.resolveRefs(r),i.concat(r)},e.prototype.getTagsMap=function(){for(var e=this._schema.tags||[],t={},n=0,r=e;n-1&&i.push({name:a.JsonPointer.baseName(e),$ref:e})}var l,u=r["x-extendedDiscriminator"];if(r["x-derived-from"]){l=[e].concat(r["x-derived-from"].filter(function(e){if(!e)return!1;var t=n.byPointer(e);return t&&t.discriminator}))}else l=[e];for(var c=0,p=Object.keys(o);c=0)return"break"}(b))break}if(!(m<0)){var _=void 0;if(u){for(var w=h.allOf||[],x=0,k=w;x0?o(r(e),9007199254740991):0}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(11);t.SpecManager=r.SpecManager;var o=function(){function e(e){this.specMgr=e,this.componentSchema=null,this.dereferencedCache={}}return e.prototype.ngOnInit=function(){this.preinit()},e.prototype.preinit=function(){this.componentSchema=this.specMgr.byPointer(this.pointer||""),this.init()},e.prototype.ngOnDestroy=function(){this.destroy()},e.prototype.init=function(){},e.prototype.destroy=function(){},e}();t.BaseComponent=o;var i=function(e){function t(t,n){var r=e.call(this,t)||this;return r.specMgr=t,r.app=n,r}return __extends(t,e),t.prototype.subscribeForSearch=function(){var e=this;this.searchSubscription=this.app.searchContainingPointers.subscribe(function(t){for(var n=0;n=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function u(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function c(e,t){var n=0;return i(v,t)?v[t]:35===t.charCodeAt(0)&&y.test(t)&&(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10),l(n))?u(n):e}function p(e){return e.indexOf("&")<0?e:e.replace(m,c)}function d(e){return w[e]}function f(e){return b.test(e)?e.replace(_,d):e}var h=Object.prototype.hasOwnProperty,g=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g,m=/&([a-z#][a-z0-9]{1,31});/gi,y=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,v=n(233),b=/[&<>"]/,_=/[&<>"]/g,w={"&":"&","<":"<",">":">",'"':"""};t.assign=a,t.isString=o,t.has=i,t.unescapeMd=s,t.isValidEntityCode=l,t.fromCodePoint=u,t.replaceEntities=p,t.escapeHtml=f},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(5),o=n(25),i=n(19),a=n(56)("src"),s=Function.toString,l=(""+s).split("toString");n(8).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var u="function"==typeof n;u&&(i(n,"name")||o(n,"name",t)),e[t]!==n&&(u&&(i(n,a)||o(n,a,e[t]?""+e[t]:l.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t,n){var r=n(0),o=n(3),i=n(45),a=/"/g,s=function(e,t,n,r){var o=String(i(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+o+""};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*o(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t,n){"use strict";(function(e){function r(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(r()=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function g(e){return+e!=e&&(e=0),i.alloc(+e)}function m(e,t){if(i.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(r)return U(e).length;t=(""+t).toLowerCase(),r=!0}}function y(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,n);case"utf8":case"utf-8":return M(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return P(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=i.from(t,r)),i.isBuffer(t))return 0===t.length?-1:_(e,t,n,r,o);if("number"==typeof t)return t&=255,i.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):_(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function _(e,t,n,r,o){function i(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}var u;if(o){var c=-1;for(u=n;us&&(n=s-l),u=n;u>=0;u--){for(var p=!0,d=0;do&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a239?4:i>223?3:i>191?2:1;if(o+s<=n){var l,u,c,p;switch(s){case 1:i<128&&(a=i);break;case 2:l=e[o+1],128==(192&l)&&(p=(31&i)<<6|63&l)>127&&(a=p);break;case 3:l=e[o+1],u=e[o+2],128==(192&l)&&128==(192&u)&&(p=(15&i)<<12|(63&l)<<6|63&u)>2047&&(p<55296||p>57343)&&(a=p);break;case 4:l=e[o+1],u=e[o+2],c=e[o+3],128==(192&l)&&128==(192&u)&&128==(192&c)&&(p=(15&i)<<18|(63&l)<<12|(63&u)<<6|63&c)>65535&&p<1114112&&(a=p)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),o+=s}return E(r)}function E(e){var t=e.length;if(t<=Q)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,n,r,o,a){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function D(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function L(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function F(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function z(e,t,n,r,o){return o||F(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),J.write(e,t,n,r,23,4),n+4}function V(e,t,n,r,o){return o||F(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),J.write(e,t,n,r,52,8),n+8}function B(e){if(e=H(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function H(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function q(e){return e<16?"0"+e.toString(16):e.toString(16)}function U(e,t){t=t||1/0;for(var n,r=e.length,o=null,i=[],a=0;a55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function $(e){for(var t=[],n=0;n>8,o=n%256,i.push(o),i.push(r);return i}function W(e){return G.toByteArray(B(e))}function Z(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function X(e){return e!==e}var G=n(445),J=n(446),K=n(447);t.Buffer=i,t.SlowBuffer=g,t.INSPECT_MAX_BYTES=50,i.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=r(),i.poolSize=8192,i._augment=function(e){return e.__proto__=i.prototype,e},i.from=function(e,t,n){return a(null,e,t,n)},i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0})),i.alloc=function(e,t,n){return l(null,e,t,n)},i.allocUnsafe=function(e){return u(null,e)},i.allocUnsafeSlow=function(e){return u(null,e)},i.isBuffer=function(e){return!(null==e||!e._isBuffer)},i.compare=function(e,t){if(!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,a=Math.min(n,r);o0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},i.prototype.compare=function(e,t,n,r,o){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,o>>>=0,this===e)return 0;for(var a=o-r,s=n-t,l=Math.min(a,s),u=this.slice(r,o),c=e.slice(t,n),p=0;po)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":return k(this,e,t,n);case"latin1":case"binary":return C(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;i.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(o*=256);)r+=this[e+--t]*o;return r},i.prototype.readUInt8=function(e,t){return t||N(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return t||N(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return t||N(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,t){return t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||N(e,t,this.length);for(var r=this[e],o=1,i=0;++i=o&&(r-=Math.pow(2,8*t)),r},i.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||N(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},i.prototype.readInt8=function(e,t){return t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){t||N(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(e,t){t||N(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(e,t){return t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return t||N(e,4,this.length),J.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return t||N(e,4,this.length),J.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return t||N(e,8,this.length),J.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return t||N(e,8,this.length),J.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){j(this,e,t,n,Math.pow(2,8*n)-1,0)}var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},i.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,255,0),i.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},i.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},i.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},i.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):L(this,e,t,!0),t+4},i.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},i.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);j(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+n},i.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);j(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},i.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,127,-128),i.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},i.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},i.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):L(this,e,t,!0),t+4},i.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),i.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},i.prototype.writeFloatLE=function(e,t,n){return z(this,e,t,!0,n)},i.prototype.writeFloatBE=function(e,t,n){return z(this,e,t,!1,n)},i.prototype.writeDoubleLE=function(e,t,n){return V(this,e,t,!0,n)},i.prototype.writeDoubleBE=function(e,t,n){return V(this,e,t,!1,n)},i.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var a;if("number"==typeof e)for(a=t;a";return this.unstrustedSpec?n:this.sanitizer.bypassSecurityTrustHtml(n)},e=t=__decorate([r.Pipe({name:"marked"}),__metadata("design:paramtypes",[o.DomSanitizer,l.OptionsService])],e);var t}();t.MarkedPipe=d;var f=function(){function e(e){this.sanitizer=e}return e.prototype.transform=function(e){return i.isBlank(e)?e:i.isString(e)?this.sanitizer.bypassSecurityTrustHtml(e):e},e=__decorate([r.Pipe({name:"safe"}),__metadata("design:paramtypes",[o.DomSanitizer])],e)}();t.SafePipe=f;var h={"c++":"cpp","c#":"csharp","objective-c":"objectivec",shell:"bash",viml:"vim"},g=function(){function e(e){this.sanitizer=e}return t=e,e.prototype.transform=function(e,n){if(i.isBlank(n)||0===n.length)throw new u("Prism pipe requires one argument");if(i.isBlank(e))return e;if(!i.isString(e))throw new c(t,e);var r=n[0].toString().trim().toLowerCase();h[r]&&(r=h[r]);var o=Prism.languages[r];return o||(o=Prism.languages.clike),this.sanitizer.bypassSecurityTrustHtml(Prism.highlight(e,o))},e=t=__decorate([r.Pipe({name:"prism"}),__metadata("design:paramtypes",[o.DomSanitizer])],e);var t}();t.PrismPipe=g;var m=function(){function e(){}return t=e,e.prototype.transform=function(e){if(i.isBlank(e))return e;if(!i.isString(e))throw new c(t,e);return encodeURIComponent(e)},e=t=__decorate([r.Pipe({name:"encodeURIComponent"})],e);var t}();t.EncodeURIComponentPipe=m;var y={csv:"Comma Separated",ssv:"Space Separated",tsv:"Tab Separated",pipes:"Pipe Separated"},v=function(){function e(){}return e.prototype.transform=function(e){var t=e.collectionFormat;return t||(t="csv"),"multi"===t?"Multiple "+e.in+" params of":y[t]},e=__decorate([r.Pipe({name:"collectionFormat"})],e)}();t.CollectionFormatPipe=v,t.REDOC_PIPES=[d,f,g,m,s.JsonFormatter,p,v]},function(e,t,n){var r=n(12),o=n(57);e.exports=n(14)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(45);e.exports=function(e){return Object(r(e))}},function(e,t,n){"use strict";function r(e,t){function n(){e.classList.add("ps--focus")}function r(){e.classList.remove("ps--focus")}var o=this;o.settings=l();for(var i in t)o.settings[i]=t[i];o.containerWidth=null,o.containerHeight=null,o.contentWidth=null,o.contentHeight=null,o.isRtl="rtl"===u.css(e,"direction"),o.isNegativeScroll=function(){var t=e.scrollLeft,n=null;return e.scrollLeft=-1,n=e.scrollLeft<0,e.scrollLeft=t,n}(),o.negativeScrollAdjustment=o.isNegativeScroll?e.scrollWidth-e.clientWidth:0,o.event=new c,o.ownerDocument=e.ownerDocument||document,o.scrollbarXRail=u.appendTo(u.create("div","ps__scrollbar-x-rail"),e),o.scrollbarX=u.appendTo(u.create("div","ps__scrollbar-x"),o.scrollbarXRail),o.scrollbarX.setAttribute("tabindex",0),o.event.bind(o.scrollbarX,"focus",n),o.event.bind(o.scrollbarX,"blur",r),o.scrollbarXActive=null,o.scrollbarXWidth=null,o.scrollbarXLeft=null,o.scrollbarXBottom=s.toInt(u.css(o.scrollbarXRail,"bottom")),o.isScrollbarXUsingBottom=o.scrollbarXBottom===o.scrollbarXBottom,o.scrollbarXTop=o.isScrollbarXUsingBottom?null:s.toInt(u.css(o.scrollbarXRail,"top")),o.railBorderXWidth=s.toInt(u.css(o.scrollbarXRail,"borderLeftWidth"))+s.toInt(u.css(o.scrollbarXRail,"borderRightWidth")),u.css(o.scrollbarXRail,"display","block"),o.railXMarginWidth=s.toInt(u.css(o.scrollbarXRail,"marginLeft"))+s.toInt(u.css(o.scrollbarXRail,"marginRight")),u.css(o.scrollbarXRail,"display",""),o.railXWidth=null,o.railXRatio=null,o.scrollbarYRail=u.appendTo(u.create("div","ps__scrollbar-y-rail"),e),o.scrollbarY=u.appendTo(u.create("div","ps__scrollbar-y"),o.scrollbarYRail),o.scrollbarY.setAttribute("tabindex",0),o.event.bind(o.scrollbarY,"focus",n),o.event.bind(o.scrollbarY,"blur",r),o.scrollbarYActive=null,o.scrollbarYHeight=null,o.scrollbarYTop=null,o.scrollbarYRight=s.toInt(u.css(o.scrollbarYRail,"right")),o.isScrollbarYUsingRight=o.scrollbarYRight===o.scrollbarYRight,o.scrollbarYLeft=o.isScrollbarYUsingRight?null:s.toInt(u.css(o.scrollbarYRail,"left")),o.scrollbarYOuterWidth=o.isRtl?s.outerWidth(o.scrollbarY):null,o.railBorderYWidth=s.toInt(u.css(o.scrollbarYRail,"borderTopWidth"))+s.toInt(u.css(o.scrollbarYRail,"borderBottomWidth")),u.css(o.scrollbarYRail,"display","block"),o.railYMarginHeight=s.toInt(u.css(o.scrollbarYRail,"marginTop"))+s.toInt(u.css(o.scrollbarYRail,"marginBottom")),u.css(o.scrollbarYRail,"display",""),o.railYHeight=null,o.railYRatio=null}function o(e){return e.getAttribute("data-ps-id")}function i(e,t){e.setAttribute("data-ps-id",t)}function a(e){e.removeAttribute("data-ps-id")}var s=n(51),l=n(588),u=n(65),c=n(589),p=n(590),d={};t.add=function(e,t){var n=p();return i(e,n),d[n]=new r(e,t),d[n]},t.remove=function(e){delete d[o(e)],a(e)},t.get=function(e){return d[o(e)]}},function(e,t,n){"use strict";var r=n(3);e.exports=function(e,t){return!!e&&r(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t,n){"use strict";function r(e){return JSON.stringify(e)}function o(e){return"string"==typeof e}function i(e){return"function"==typeof e}function a(e){return void 0==e}function s(e){return e.endsWith("/")?e.substring(0,e.length-1):e}function l(e,t){return e.reduce(function(e,n){return w.call(e,n[t])?e[n[t]].push(n):e[n[t]]=[n],e},{})}function u(e,t){if(void 0===t&&(t=!1),"default"===e)return t?"error":"success";if(e<100||e>599)throw new Error("invalid HTTP code");var n="success";return e>=300&&e<400?n="redirect":e>=400?n="error":e<200&&(n="info"),n}function c(e,t){for(var n=Object.keys(t),r=-1,o=n.length;++r0||function(e){return"[object SafariRemoteNotification]"===e.toString()}(!window.safari||safari.pushNotification),t.snapshot=h,t.isJsonLike=g,t.isXmlLike=m,t.isTextLike=y,t.getJsonLikeSample=v,t.getXmlLikeSample=b,t.getTextLikeSample=_},function(e,t,n){var r=n(75),o=n(45);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(19),o=n(26),i=n(122)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(58),o=n(75),i=n(26),a=n(15),s=n(254);e.exports=function(e,t){var n=1==e,l=2==e,u=3==e,c=4==e,p=6==e,d=5==e||p,f=t||s;return function(t,s,h){for(var g,m,y=i(t),v=o(y),b=r(s,h,3),_=a(v.length),w=0,x=n?f(t,_):l?f(t,0):void 0;_>w;w++)if((d||w in v)&&(g=v[w],m=b(g,w,y),e))if(n)x[w]=m;else if(m)switch(e){case 3:return!0;case 5:return g;case 6:return w;case 2:x.push(g)}else if(c)return!1;return p?-1:u||c?c:x}}},function(e,t,n){var r=n(0),o=n(8),i=n(3);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*i(function(){n(1)}),"Object",a)}},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(e){if(p===clearTimeout)return clearTimeout(e);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function a(){g&&f&&(g=!1,f.length?h=f.concat(h):m=-1,h.length&&s())}function s(){if(!g){var e=o(a);g=!0;for(var t=h.length;t;){for(f=h,h=[];++m1)for(var n=1;n0?r:n)(e)}},function(e,t,n){var r=n(101),o=n(57),i=n(30),a=n(44),s=n(19),l=n(175),u=Object.getOwnPropertyDescriptor;t.f=n(14)?u:function(e,t){if(e=i(e),t=a(t,!0),l)try{return u(e,t)}catch(e){}if(s(e,t))return o(!r.f.call(e,t),e[t])}},function(e,t,n){"use strict";if(n(14)){var r=n(78),o=n(5),i=n(3),a=n(0),s=n(107),l=n(141),u=n(58),c=n(77),p=n(57),d=n(25),f=n(76),h=n(37),g=n(15),m=n(206),y=n(55),v=n(44),b=n(19),_=n(126),w=n(4),x=n(26),k=n(124),C=n(53),S=n(31),O=n(59).f,P=n(125),M=n(56),E=n(9),T=n(32),I=n(121),A=n(207),R=n(106),N=n(67),j=n(128),D=n(80),L=n(138),F=n(204),z=n(12),V=n(38),B=z.f,H=V.f,q=o.RangeError,U=o.TypeError,$=o.Uint8Array,Y=Array.prototype,W=l.ArrayBuffer,Z=l.DataView,X=T(0),G=T(2),J=T(3),K=T(4),Q=T(5),ee=T(6),te=I(!0),ne=I(!1),re=R.values,oe=R.keys,ie=R.entries,ae=Y.lastIndexOf,se=Y.reduce,le=Y.reduceRight,ue=Y.join,ce=Y.sort,pe=Y.slice,de=Y.toString,fe=Y.toLocaleString,he=E("iterator"),ge=E("toStringTag"),me=M("typed_constructor"),ye=M("def_constructor"),ve=s.CONSTR,be=s.TYPED,_e=s.VIEW,we=T(1,function(e,t){return Oe(A(e,e[ye]),t)}),xe=i(function(){return 1===new $(new Uint16Array([1]).buffer)[0]}),ke=!!$&&!!$.prototype.set&&i(function(){new $(1).set({})}),Ce=function(e,t){var n=h(e);if(n<0||n%t)throw q("Wrong offset!");return n},Se=function(e){if(w(e)&&be in e)return e;throw U(e+" is not a typed array!")},Oe=function(e,t){if(!(w(e)&&me in e))throw U("It is not a typed array constructor!");return new e(t)},Pe=function(e,t){return Me(A(e,e[ye]),t)},Me=function(e,t){for(var n=0,r=t.length,o=Oe(e,r);r>n;)o[n]=t[n++];return o},Ee=function(e,t,n){B(e,t,{get:function(){return this._d[n]}})},Te=function(e){var t,n,r,o,i,a,s=x(e),l=arguments.length,c=l>1?arguments[1]:void 0,p=void 0!==c,d=P(s);if(void 0!=d&&!k(d)){for(a=d.call(s),r=[],t=0;!(i=a.next()).done;t++)r.push(i.value);s=r}for(p&&l>2&&(c=u(c,arguments[2],2)),t=0,n=g(s.length),o=Oe(this,n);n>t;t++)o[t]=p?c(s[t],t):s[t];return o},Ie=function(){for(var e=0,t=arguments.length,n=Oe(this,t);t>e;)n[e]=arguments[e++];return n},Ae=!!$&&i(function(){fe.call(new $(1))}),Re=function(){return fe.apply(Ae?pe.call(Se(this)):Se(this),arguments)},Ne={copyWithin:function(e,t){return F.call(Se(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return K(Se(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return L.apply(Se(this),arguments)},filter:function(e){return Pe(this,G(Se(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return Q(Se(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ee(Se(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){X(Se(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return ne(Se(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return te(Se(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return ue.apply(Se(this),arguments)},lastIndexOf:function(e){return ae.apply(Se(this),arguments)},map:function(e){return we(Se(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return se.apply(Se(this),arguments)},reduceRight:function(e){return le.apply(Se(this),arguments)},reverse:function(){for(var e,t=this,n=Se(t).length,r=Math.floor(n/2),o=0;o1?arguments[1]:void 0)},sort:function(e){return ce.call(Se(this),e)},subarray:function(e,t){var n=Se(this),r=n.length,o=y(e,r);return new(A(n,n[ye]))(n.buffer,n.byteOffset+o*n.BYTES_PER_ELEMENT,g((void 0===t?r:y(t,r))-o))}},je=function(e,t){return Pe(this,pe.call(Se(this),e,t))},De=function(e){Se(this);var t=Ce(arguments[1],1),n=this.length,r=x(e),o=g(r.length),i=0;if(o+t>n)throw q("Wrong length!");for(;i255?255:255&r),o.v[f](n*t+o.o,r,xe)},E=function(e,t){B(e,t,{get:function(){return P(this,t)},set:function(e){return M(this,t,e)},enumerable:!0})};b?(h=n(function(e,n,r,o){c(e,h,u,"_d");var i,a,s,l,p=0,f=0;if(w(n)){if(!(n instanceof W||"ArrayBuffer"==(l=_(n))||"SharedArrayBuffer"==l))return be in n?Me(h,n):Te.call(h,n);i=n,f=Ce(r,t);var y=n.byteLength;if(void 0===o){if(y%t)throw q("Wrong length!");if((a=y-f)<0)throw q("Wrong length!")}else if((a=g(o)*t)+f>y)throw q("Wrong length!");s=a/t}else s=m(n),a=s*t,i=new W(a);for(d(e,"_d",{b:i,o:f,l:a,e:s,v:new Z(i)});p=0?e.substr(t).toLowerCase():""},t.getHash=function(e){var t=e.indexOf("#");return t>=0?e.substr(t):"#"},t.stripHash=function(e){var t=e.indexOf("#");return t>=0&&(e=e.substr(0,t)),e},t.isHttp=function(e){var t=s.getProtocol(e);return"http"===t||"https"===t||void 0===t&&r.browser},t.isFileSystemPath=function(e){if(r.browser)return!1;var t=s.getProtocol(e);return void 0===t||"file"===t},t.fromFileSystemPath=function(e){for(var t=0;to*r?t.INVIEW_POSITION.ABOVE:o*e.getBoundingClientRect().bottom<=o*r?t.INVIEW_POSITION.BELLOW:t.INVIEW_POSITION.INVIEW},e.prototype.scrollToPos=function(e){this.$scrollParent.scrollTo?this.$scrollParent.scrollTo(0,Math.floor(e)):this.$scrollParent.scrollTop=e},e.prototype.scrollTo=function(e,t){if(void 0===t&&(t=0),e){var n=e.getBoundingClientRect(),r=this.scrollY()+n.top-this.scrollYOffset()+t+1;return this.scrollToPos(r),r}},e.prototype.saveScroll=function(){var e=this._stickElement;if(e){var t=e.offsetParent;this._savedPosition=e.offsetTop+t.offsetTop}},e.prototype.setStickElement=function(e){this._stickElement=e},e.prototype.restoreScroll=function(){var e=this._stickElement;if(e){var t=e.offsetParent,n=e.offsetTop+t.offsetTop,r=this.scrollY()+(n-this._savedPosition);this.scrollToPos(r)}},e.prototype.relativeScrollPos=function(e){return-e.getBoundingClientRect().top+this.scrollYOffset()-1},e.prototype.scrollHandler=function(e){var t=this.scrollY()-this.prevOffsetY>0;this.prevOffsetY=this.scrollY(),this.scroll.next({isScrolledDown:t,evt:e})},e.prototype.bind=function(){var e=this;this.prevOffsetY=this.scrollY(),this._cancel=o.BrowserDomAdapter.onAndCancel(this.$scrollParent,"scroll",a.throttle(function(t){e.scrollHandler(t)},100,this))},e.prototype.unbind=function(){this._cancel()},e=__decorate([r.Injectable(),__metadata("design:paramtypes",[i.OptionsService])],e)}();t.ScrollService=s},function(e,t,n){"use strict";function r(e,t){return e.settings.minScrollbarLength&&(t=Math.max(t,e.settings.minScrollbarLength)),e.settings.maxScrollbarLength&&(t=Math.min(t,e.settings.maxScrollbarLength)),t}function o(e,t){var n={width:t.railXWidth};t.isRtl?n.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth-t.contentWidth:n.left=e.scrollLeft,t.isScrollbarXUsingBottom?n.bottom=t.scrollbarXBottom-e.scrollTop:n.top=t.scrollbarXTop+e.scrollTop,a.css(t.scrollbarXRail,n);var r={top:e.scrollTop,height:t.railYHeight};t.isScrollbarYUsingRight?t.isRtl?r.right=t.contentWidth-(t.negativeScrollAdjustment+e.scrollLeft)-t.scrollbarYRight-t.scrollbarYOuterWidth:r.right=t.scrollbarYRight-e.scrollLeft:t.isRtl?r.left=t.negativeScrollAdjustment+e.scrollLeft+2*t.containerWidth-t.contentWidth-t.scrollbarYLeft-t.scrollbarYOuterWidth:r.left=t.scrollbarYLeft+e.scrollLeft,a.css(t.scrollbarYRail,r),a.css(t.scrollbarX,{left:t.scrollbarXLeft,width:t.scrollbarXWidth-t.railBorderXWidth}),a.css(t.scrollbarY,{top:t.scrollbarYTop,height:t.scrollbarYHeight-t.railBorderYWidth})}var i=n(51),a=n(65),s=n(27),l=n(52);e.exports=function(e){var t=s.get(e);t.containerWidth=e.clientWidth,t.containerHeight=e.clientHeight,t.contentWidth=e.scrollWidth,t.contentHeight=e.scrollHeight;var n;e.contains(t.scrollbarXRail)||(n=a.queryChildren(e,".ps__scrollbar-x-rail"),n.length>0&&n.forEach(function(e){a.remove(e)}),a.appendTo(t.scrollbarXRail,e)),e.contains(t.scrollbarYRail)||(n=a.queryChildren(e,".ps__scrollbar-y-rail"),n.length>0&&n.forEach(function(e){a.remove(e)}),a.appendTo(t.scrollbarYRail,e)),!t.settings.suppressScrollX&&t.containerWidth+t.settings.scrollXMarginOffset=t.railXWidth-t.scrollbarXWidth&&(t.scrollbarXLeft=t.railXWidth-t.scrollbarXWidth),t.scrollbarYTop>=t.railYHeight-t.scrollbarYHeight&&(t.scrollbarYTop=t.railYHeight-t.scrollbarYHeight),o(e,t),t.scrollbarXActive?e.classList.add("ps--active-x"):(e.classList.remove("ps--active-x"),t.scrollbarXWidth=0,t.scrollbarXLeft=0,l(e,"left",0)),t.scrollbarYActive?e.classList.add("ps--active-y"):(e.classList.remove("ps--active-y"),t.scrollbarYHeight=0,t.scrollbarYTop=0,l(e,"top",0))}},function(e,t,n){var r=n(4);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(56)("meta"),o=n(4),i=n(19),a=n(12).f,s=0,l=Object.isExtensible||function(){return!0},u=!n(3)(function(){return l(Object.preventExtensions({}))}),c=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},p=function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!l(e))return"F";if(!t)return"E";c(e)}return e[r].i},d=function(e,t){if(!i(e,r)){if(!l(e))return!0;if(!t)return!1;c(e)}return e[r].w},f=function(e){return u&&h.NEED&&l(e)&&!i(e,r)&&c(e),e},h=e.exports={KEY:r,NEED:!1,fastKey:p,getWeak:d,onFreeze:f}},function(e,t,n){"use strict";var r=n(84),o=n(420),i=n(212),a=n(424),s=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this.operator,i=o.toSubscriber(e,t,n);if(r?r.call(i,this.source):i.add(this.source||!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.syncErrorThrown=!0,e.syncErrorValue=t,e.error(t)}},e.prototype.forEach=function(e,t){var n=this;if(t||(r.root.Rx&&r.root.Rx.config&&r.root.Rx.config.Promise?t=r.root.Rx.config.Promise:r.root.Promise&&(t=r.root.Promise)),!t)throw new Error("no Promise impl found");return new t(function(t,r){var o;o=n.subscribe(function(t){if(o)try{e(t)}catch(e){r(e),o.unsubscribe()}else e(t)},r,t)})},e.prototype._subscribe=function(e){return this.source.subscribe(e)},e.prototype[i.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t0&&(c=e.exports.formatter.apply(null,u)),n&&n.message&&(c+=(c?" \n":"")+n.message);var p=new t(c);return o(p,n),i(p),a(p,r),p}}function o(e,t){u(e,t),a(e,t)}function i(e){e.toJSON=s,e.inspect=l}function a(e,t){if(t&&"object"==typeof t)for(var n=Object.keys(t),r=0;r=0))try{e[o]=t[o]}catch(e){}}}function s(){var e={},t=Object.keys(this);t=t.concat(v);for(var n=0;n=0)return t.splice(n,1),t.join("\n")}return e}}function d(e){if(!b)return!1;var t=Object.getOwnPropertyDescriptor(e,"stack");return!!t&&"function"==typeof t.get}function f(e,t){var n=Object.getOwnPropertyDescriptor(e,"stack");Object.defineProperty(e,"stack",{get:function(){return c(n.get.apply(e),t.stack)},enumerable:!1,configurable:!0})}function h(e){var t=Object.getOwnPropertyDescriptor(e,"stack");Object.defineProperty(e,"stack",{get:function(){return p(t.get.apply(e))},enumerable:!1,configurable:!0})}var g=n(475),m=Array.prototype.slice,y=["name","message","stack"],v=["name","message","description","number","code","fileName","lineNumber","columnNumber","sourceURL","line","column","stack"];e.exports=r(Error),e.exports.error=r(Error),e.exports.eval=r(EvalError),e.exports.range=r(RangeError),e.exports.reference=r(ReferenceError),e.exports.syntax=r(SyntaxError),e.exports.type=r(TypeError),e.exports.uri=r(URIError),e.exports.formatter=g;var b=function(){return!(!Object.getOwnPropertyDescriptor||!Object.defineProperty||"undefined"!=typeof navigator&&/Android/.test(navigator.userAgent))}()},function(e,t,n){"use strict";function r(e){var t,n=["ps--in-scrolling"];return t=void 0===e?["ps--x","ps--y"]:["ps--"+e],n.concat(t)}var o=n(65),i=t.toInt=function(e){return parseInt(e,10)||0};t.isEditable=function(e){return o.matches(e,"input,[contenteditable]")||o.matches(e,"select,[contenteditable]")||o.matches(e,"textarea,[contenteditable]")||o.matches(e,"button,[contenteditable]")},t.removePsClasses=function(e){for(var t=0;t=i.contentHeight-i.containerHeight&&(n=i.contentHeight-i.containerHeight,n-e.scrollTop<=2?n=e.scrollTop:e.scrollTop=n,e.dispatchEvent(o("ps-y-reach-end"))),"left"===t&&n>=i.contentWidth-i.containerWidth&&(n=i.contentWidth-i.containerWidth,n-e.scrollLeft<=2?n=e.scrollLeft:e.scrollLeft=n,e.dispatchEvent(o("ps-x-reach-end"))),void 0===i.lastTop&&(i.lastTop=e.scrollTop),void 0===i.lastLeft&&(i.lastLeft=e.scrollLeft),"top"===t&&ni.lastTop&&e.dispatchEvent(o("ps-scroll-down")),"left"===t&&ni.lastLeft&&e.dispatchEvent(o("ps-scroll-right")),"top"===t&&n!==i.lastTop&&(e.scrollTop=i.lastTop=n,e.dispatchEvent(o("ps-scroll-y"))),"left"===t&&n!==i.lastLeft&&(e.scrollLeft=i.lastLeft=n,e.dispatchEvent(o("ps-scroll-x")))}},function(e,t,n){var r=n(2),o=n(177),i=n(123),a=n(122)("IE_PROTO"),s=function(){},l=function(){var e,t=n(176)("iframe"),r=i.length;for(t.style.display="none",n(179).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(" + + + + diff --git a/api/swagger/swagger.json b/api/swagger/swagger.json new file mode 120000 index 0000000000..0f2bf438e3 --- /dev/null +++ b/api/swagger/swagger.json @@ -0,0 +1 @@ +../inventory.swagger.json \ No newline at end of file