From: mdimado Date: Wed, 11 Feb 2026 19:13:34 +0000 (+0530) Subject: Fix CVE-2024-34036 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F08%2F15408%2F1;p=ric-plt%2Fsubmgr.git Fix CVE-2024-34036 1. CVE-2024-34036: Implemented a per-xApp, per-route token-bucket rate limiting system in ratelimiter.go and integrated it into control.go using a RateLimiterWrapper around REST and subscription handlers to prevent request flooding and subscription-based denial-of-service against submgr. Change-Id: I543b47940598d32c4afb3c5e73819ac65cc62015 Signed-off-by: Mohammed Imaduddin (cherry picked from commit d42f563c8cc9f5d2884ed38e4215587793f1a824) --- diff --git a/go.mod b/go.mod index 1971c08..70fc0f1 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module gerrit.o-ran-sc.org/r/ric-plt/submgr -go 1.22 +go 1.24.0 + +toolchain go1.24.6 replace gerrit.o-ran-sc.org/r/ric-plt/sdlgo => gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.8.0 @@ -15,10 +17,65 @@ require ( gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.2.8 gerrit.o-ran-sc.org/r/ric-plt/sdlgo v0.8.0 gerrit.o-ran-sc.org/r/ric-plt/xapp-frame v0.0.0-00010101000000-000000000000 - github.com/go-openapi/runtime v0.19.4 - github.com/go-openapi/strfmt v0.19.4 + github.com/go-openapi/errors v0.20.4 + github.com/go-openapi/runtime v0.26.0 + github.com/go-openapi/strfmt v0.21.7 + github.com/go-openapi/swag v0.22.3 + github.com/go-openapi/validate v0.22.1 github.com/gorilla/mux v1.7.1 github.com/segmentio/ksuid v1.0.3 github.com/spf13/viper v1.4.0 - github.com/stretchr/testify v1.5.1 + github.com/stretchr/testify v1.8.2 + golang.org/x/time v0.14.0 +) + +require ( + gerrit.o-ran-sc.org/r/com/golog v0.0.2 // indirect + gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.5.1-0.20211223104552-f7d2cf80e85c // indirect + gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.2.1 // indirect + gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.2.1 // indirect + github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect + github.com/beorn7/perks v1.0.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/docker/go-units v0.5.0 // indirect + github.com/fsnotify/fsnotify v1.4.9 // indirect + github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-openapi/analysis v0.21.4 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.20.0 // indirect + github.com/go-openapi/loads v0.21.2 // indirect + github.com/go-openapi/spec v0.20.8 // indirect + github.com/go-redis/redis v6.15.9+incompatible // indirect + github.com/golang/protobuf v1.4.2 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/jessevdk/go-flags v1.4.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/magiconair/properties v1.8.0 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/oklog/ulid v1.3.1 // indirect + github.com/opentracing/opentracing-go v1.2.0 // indirect + github.com/pelletier/go-toml v1.7.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v0.9.3 // indirect + github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 // indirect + github.com/prometheus/common v0.4.0 // indirect + github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 // indirect + github.com/spf13/afero v1.2.2 // indirect + github.com/spf13/cast v1.3.0 // indirect + github.com/spf13/jwalterweatherman v1.0.0 // indirect + github.com/spf13/pflag v1.0.3 // indirect + github.com/stretchr/objx v0.5.0 // indirect + go.mongodb.org/mongo-driver v1.11.3 // indirect + go.opentelemetry.io/otel v1.14.0 // indirect + go.opentelemetry.io/otel/trace v1.14.0 // indirect + golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/protobuf v1.23.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect ) diff --git a/go.sum b/go.sum index 9efd6d6..1b6a696 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,8 @@ gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.5.1-0.20211223104552-f7d2cf8 gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.5.1-0.20211223104552-f7d2cf80e85c/go.mod h1:4bLQ7iuVwDrQPdgv5CgSwJJQpYmWqt6cVPp5v7wbhbc= gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.2.1 h1:3FFbXx55BODThXfyWAiz6cPXVELXFICDQUmJi13EoxM= gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.2.1/go.mod h1:QJ1uPPZosGbhxUWpUpeM5fLqFHdnWTrVnvW2DgyOCes= -gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.2.1 h1:8Z60JRsPgcS1Ona4fEh6d0/03nLq1WHoZcNnBsni5+g= gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.2.1/go.mod h1:YaQ+XEI4PcAoISxp9wUpUr2TP0J7JihpQTD0G1Lpd4A= +gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.2.8 h1:9KLAcDI20l0lYsIbfzlVRMwWLU6iflJkgqG1FxmvcPM= gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.2.8/go.mod h1:8NTND7RCHfHPQtx1xk9oclqF/7usqDAX9aYBzt3Hynk= gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.2.1 h1:BG3kste8PLVTG0m8CRB/VP2tAV5JImKueBGuOsUNcR8= gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.2.1/go.mod h1:zX8rW6YEsagHrRGVW5YO50Ku/Csrpzsuvblhr4DbYi4= @@ -18,9 +18,7 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -28,8 +26,10 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -40,14 +40,16 @@ github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -58,62 +60,113 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.5 h1:8b2ZgKfKIUTVQpTb77MoRDIMEIwvDVw40o3aOXdfYzI= github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= +github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= +github.com/go-openapi/analysis v0.21.4 h1:ZDFLvSNxpDaomuCueM0BlSXxpANBlFYiBvr+GXrvIHc= +github.com/go-openapi/analysis v0.21.4/go.mod h1:4zQ35W4neeZTqh3ol0rv/O8JBbka9QyAgQRPp9y3pfo= github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= -github.com/go-openapi/errors v0.19.3 h1:7MGZI1ibQDLasvAz8HuhvYk9eNJbJkCOXWsSjjMS+Zc= github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/errors v0.20.4 h1:unTcVm6PispJsMECE3zWgvG4xTiKda1LIR5rCRWLG6M= +github.com/go-openapi/errors v0.20.4/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= +github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.4 h1:5I4CCSqoWzT+82bBkNIvmLc0UOsoKKQ4Fz+3VxOB7SY= github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= +github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= +github.com/go-openapi/loads v0.21.2 h1:r2a/xFIYeZ4Qd2TnGpWDIQNcP80dIaZgf704za8enro= +github.com/go-openapi/loads v0.21.2/go.mod h1:Jq58Os6SSGz0rzh62ptiu8Z31I+OTHqmULx5e/gJbNw= github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= -github.com/go-openapi/runtime v0.19.4 h1:csnOgcgAiuGoM/Po7PEpKDoNulCcF3FGbSnbHfxgjMI= github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= +github.com/go-openapi/runtime v0.26.0 h1:HYOFtG00FM1UvqrcxbEJg/SwvDRvYLQKGhw2zaQjTcc= +github.com/go-openapi/runtime v0.26.0/go.mod h1:QgRGeZwrUcSHdeh4Ka9Glvo0ug1LC5WyE+EV88plZrQ= github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= -github.com/go-openapi/spec v0.19.3 h1:0XRyw8kguri6Yw4SxhsQA/atC88yqrk0+G4YhI2wabc= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= +github.com/go-openapi/spec v0.20.6/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= +github.com/go-openapi/spec v0.20.8 h1:ubHmXNY3FCIOinT8RNrrPfGc9t7I1qhPtdOGoG2AxRU= +github.com/go-openapi/spec v0.20.8/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.4 h1:eRvaqAhpL0IL6Trh5fDsGnGhiXndzHFuA05w6sXH6/g= github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= +github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= +github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= +github.com/go-openapi/strfmt v0.21.3/go.mod h1:k+RzNO0Da+k3FrrynSNN8F7n/peCmQQqbbXjtDfvmGg= +github.com/go-openapi/strfmt v0.21.7 h1:rspiXgNWgeUzhjo1YU01do6qsahtJNByjLVbPLNHb8k= +github.com/go-openapi/strfmt v0.21.7/go.mod h1:adeGTkxE44sPyLk0JV235VQAO/ZXUr8KAzYjclFs3ew= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.7 h1:VRuXN2EnMSsZdauzdss6JBC29YotDqG59BZ+tdlIL1s= github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.6 h1:WsKw9J1WzYBVxWRYwLqEk3325RL6G0SSWksuamkk6q0= github.com/go-openapi/validate v0.19.6/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= +github.com/go-openapi/validate v0.22.1 h1:G+c2ub6q47kfX1sOBLwIQwzBVt8qmOAARyo/9Fqs9NU= +github.com/go-openapi/validate v0.22.1/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg= github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= +github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= +github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= +github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= +github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= +github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= +github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= +github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= +github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= +github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= +github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -128,16 +181,20 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/mux v1.7.1 h1:Dw4jY2nghMMRsh1ol8dv1axHkDwMQK2DHerMNJsIpJU= github.com/gorilla/mux v1.7.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= @@ -147,35 +204,54 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= @@ -184,12 +260,16 @@ github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.7.0 h1:7utD74fnzVc/cpcyy8sjrlFr5vYpypUixARcHIMIGuI= +github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -206,10 +286,16 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 h1:sofwID9zm4tzr github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/segmentio/ksuid v1.0.3 h1:FoResxvleQwYiPAVKe1tMUlEirodZqlqglIuFsdDntY= github.com/segmentio/ksuid v1.0.3/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= @@ -217,6 +303,7 @@ github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= @@ -225,33 +312,59 @@ github.com/spf13/viper v1.4.0 h1:yXHLWeravcrgGyFSyCgdYpXQ9dR9c/WED3pg1RhxqEU= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= +github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.2 h1:jxcFYjlkl8xaERsgLo+RNquI0epW6zuy/ZRQs6jnrFA= go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= +go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= +go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= +go.mongodb.org/mongo-driver v1.11.3 h1:Ql6K6qYHEzB6xvu4+AU0BoRoqf9vFPcc4o7MUIdPW8Y= +go.mongodb.org/mongo-driver v1.11.3/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= +go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= +go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= +go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= +go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= +go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= +go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -265,13 +378,19 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 h1:AeiKBIuRw3UomYXSbLy0Mc2dDLfdtbT/IVn4keq83P0= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -279,23 +398,42 @@ golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= +golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= @@ -313,8 +451,11 @@ google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyz google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= @@ -323,8 +464,16 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= diff --git a/pkg/control/control.go b/pkg/control/control.go index 1f769e1..98b71a2 100755 --- a/pkg/control/control.go +++ b/pkg/control/control.go @@ -76,19 +76,21 @@ var e2IEOrderCheckValue uint8 type Control struct { *xapp.RMRClient - e2ap *E2ap - registry *Registry - tracker *Tracker - restDuplicateCtrl *DuplicateCtrl - e2IfState *E2IfState - e2IfStateDb XappRnibInterface - e2SubsDb Sdlnterface - restSubsDb Sdlnterface - CntRecvMsg uint64 - ResetTestFlag bool - Counters map[string]xapp.Counter - LoggerLevel int - UTTesting bool + e2ap *E2ap + registry *Registry + tracker *Tracker + restDuplicateCtrl *DuplicateCtrl + e2IfState *E2IfState + e2IfStateDb XappRnibInterface + e2SubsDb Sdlnterface + restSubsDb Sdlnterface + CntRecvMsg uint64 + ResetTestFlag bool + Counters map[string]xapp.Counter + LoggerLevel int + UTTesting bool + rateLimiter *RateLimiter + rateLimiterWrapper *RateLimiterWrapper } type RMRMeid struct { @@ -139,35 +141,53 @@ func NewControl() *Control { e2IfState := new(E2IfState) - c := &Control{e2ap: new(E2ap), - registry: registry, - tracker: tracker, - restDuplicateCtrl: restDuplicateCtrl, - e2IfState: e2IfState, - e2IfStateDb: CreateXappRnibIfInstance(), - e2SubsDb: CreateSdl(), - restSubsDb: CreateRESTSdl(), - Counters: xapp.Metric.RegisterCounterGroup(GetMetricsOpts(), "SUBMGR"), - LoggerLevel: 1, + // Initialize rate limiter and wrapper + requestsPerSecond, burst, enabled := ReadRateLimiterConfig() + rl := NewRateLimiter(requestsPerSecond, burst, enabled) + rlw := NewRateLimiterWrapper(rl, ExtractXappServiceName) + + c := &Control{ + e2ap: new(E2ap), + registry: registry, + tracker: tracker, + restDuplicateCtrl: restDuplicateCtrl, + e2IfState: e2IfState, + e2IfStateDb: CreateXappRnibIfInstance(), + e2SubsDb: CreateSdl(), + restSubsDb: CreateRESTSdl(), + rateLimiter: rl, // NEW + rateLimiterWrapper: rlw, // NEW + Counters: xapp.Metric.RegisterCounterGroup(GetMetricsOpts(), "SUBMGR"), + LoggerLevel: 1, } e2IfState.Init(c) c.ReadConfigParameters("") // Register REST handler for testing support - xapp.Resource.InjectRoute("/ric/v1/symptomdata", c.SymptomDataHandler, "GET") - xapp.Resource.InjectRoute("/ric/v1/test/{testId}", c.TestRestHandler, "POST") - xapp.Resource.InjectRoute("/ric/v1/restsubscriptions", c.GetAllRestSubscriptions, "GET") - - xapp.Resource.InjectRoute("/ric/v1/get_all_e2nodes", c.GetAllE2Nodes, "GET") - xapp.Resource.InjectRoute("/ric/v1/get_e2node_rest_subscriptions/{ranName}", c.GetAllE2NodeRestSubscriptions, "GET") - - xapp.Resource.InjectRoute("/ric/v1/get_all_xapps", c.GetAllXapps, "GET") - xapp.Resource.InjectRoute("/ric/v1/get_xapp_rest_restsubscriptions/{xappServiceName}", c.GetAllXappRestSubscriptions, "GET") - xapp.Resource.InjectRoute("/ric/v1/get_e2subscriptions/{restId}", c.GetE2Subscriptions, "GET") - - xapp.Resource.InjectRoute("/ric/v1/delete_all_e2node_subscriptions/{ranName}", c.DeleteAllE2nodeSubscriptions, "DELETE") - xapp.Resource.InjectRoute("/ric/v1/delete_all_xapp_subscriptions/{xappServiceName}", c.DeleteAllXappSubscriptions, "DELETE") + xapp.Resource.InjectRoute("/ric/v1/symptomdata", + c.rateLimiterWrapper.WrapHandler(c.SymptomDataHandler), "GET") + xapp.Resource.InjectRoute("/ric/v1/test/{testId}", + c.rateLimiterWrapper.WrapHandler(c.TestRestHandler), "POST") + xapp.Resource.InjectRoute("/ric/v1/restsubscriptions", + c.rateLimiterWrapper.WrapHandler(c.GetAllRestSubscriptions), "GET") + + xapp.Resource.InjectRoute("/ric/v1/get_all_e2nodes", + c.rateLimiterWrapper.WrapHandler(c.GetAllE2Nodes), "GET") + xapp.Resource.InjectRoute("/ric/v1/get_e2node_rest_subscriptions/{ranName}", + c.rateLimiterWrapper.WrapHandler(c.GetAllE2NodeRestSubscriptions), "GET") + + xapp.Resource.InjectRoute("/ric/v1/get_all_xapps", + c.rateLimiterWrapper.WrapHandler(c.GetAllXapps), "GET") + xapp.Resource.InjectRoute("/ric/v1/get_xapp_rest_restsubscriptions/{xappServiceName}", + c.rateLimiterWrapper.WrapHandler(c.GetAllXappRestSubscriptions), "GET") + xapp.Resource.InjectRoute("/ric/v1/get_e2subscriptions/{restId}", + c.rateLimiterWrapper.WrapHandler(c.GetE2Subscriptions), "GET") + + xapp.Resource.InjectRoute("/ric/v1/delete_all_e2node_subscriptions/{ranName}", + c.rateLimiterWrapper.WrapHandler(c.DeleteAllE2nodeSubscriptions), "DELETE") + xapp.Resource.InjectRoute("/ric/v1/delete_all_xapp_subscriptions/{xappServiceName}", + c.rateLimiterWrapper.WrapHandler(c.DeleteAllXappSubscriptions), "DELETE") if readSubsFromDb == "true" { // Read subscriptions from db @@ -182,7 +202,10 @@ func NewControl() *Control { } go func() { - err := xapp.Subscription.Listen(c.RESTSubscriptionHandler, c.RESTQueryHandler, c.RESTSubscriptionDeleteHandler) + wrappedSubHandler := rlw.WrapRESTSubscriptionHandler(c.RESTSubscriptionHandler) + wrappedDelHandler := rlw.WrapRESTSubscriptionDeleteHandler(c.RESTSubscriptionDeleteHandler) + + err := xapp.Subscription.Listen(wrappedSubHandler, c.RESTQueryHandler, wrappedDelHandler) if err != nil { xapp.Logger.Error("xapp.Subscription.Listen failure: %s", err.Error()) } @@ -199,9 +222,9 @@ func (c *Control) SymptomDataHandler(w http.ResponseWriter, r *http.Request) { xapp.Resource.SendSymptomDataJson(w, r, subscriptions, "platform/subscriptions.json") } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) RESTQueryHandler() (models.SubscriptionList, error) { xapp.Logger.Debug("RESTQueryHandler() called") @@ -210,9 +233,9 @@ func (c *Control) RESTQueryHandler() (models.SubscriptionList, error) { return c.registry.QueryHandler() } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) ReadE2Subscriptions() error { var err error var subIds []uint32 @@ -234,9 +257,9 @@ func (c *Control) ReadE2Subscriptions() error { return err } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) ReadRESTSubscriptions() error { xapp.Logger.Debug("ReadRESTSubscriptions()") @@ -266,9 +289,9 @@ func (c *Control) ReadRESTSubscriptions() error { return err } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) ReadConfigParameters(f string) { xapp.Logger.Debug("ReadConfigParameters") @@ -356,9 +379,9 @@ func (c *Control) ReadConfigParameters(f string) { xapp.Logger.Debug("e2IEOrderCheck= %v", e2IEOrderCheckValue) } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) HandleUncompletedSubscriptions(register map[uint32]*Subscription) { xapp.Logger.Debug("HandleUncompletedSubscriptions. len(register) = %v", len(register)) @@ -386,9 +409,9 @@ func (c *Control) Run() { xapp.Run(c) } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) GetOrCreateRestSubscription(p *models.SubscriptionParams, md5sum string, xAppRmrEndpoint string, xAppServiceName string) (*RESTSubscription, string, error) { var restSubId string @@ -441,9 +464,9 @@ func (c *Control) GetOrCreateRestSubscription(p *models.SubscriptionParams, md5s return restSubscription, restSubId, nil } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) RESTSubscriptionHandler(params interface{}) (*models.SubscriptionResponse, int) { c.CntRecvMsg++ @@ -524,9 +547,9 @@ func (c *Control) RESTSubscriptionHandler(params interface{}) (*models.Subscript return &subResp, common.SubscribeCreatedCode } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) GetE2SubscriptionDirectives(p *models.SubscriptionParams) (*E2SubscriptionDirectives, error) { e2SubscriptionDirectives := &E2SubscriptionDirectives{} @@ -611,9 +634,9 @@ func (c *Control) processSubscriptionRequests(restSubscription *RESTSubscription } } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------ +// ------------------------------------------------------------------ func (c *Control) SubscriptionProcessingStartDelay() { if c.UTTesting == true { // This is temporary fix for the UT problem that notification arrives before subscription response @@ -624,9 +647,9 @@ func (c *Control) SubscriptionProcessingStartDelay() { } } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------ +// ------------------------------------------------------------------ func (c *Control) handleSubscriptionRequest(trans *TransactionXapp, subReqMsg *e2ap.E2APSubscriptionRequest, meid *string, restSubId string, e2SubscriptionDirectives *E2SubscriptionDirectives) (*e2ap.E2APSubscriptionResponse, *ErrorInfo, error) { @@ -705,9 +728,9 @@ func (c *Control) handleSubscriptionRequest(trans *TransactionXapp, subReqMsg *e return nil, &errorInfo, err } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) sendUnsuccesfullResponseNotification(restSubId *string, restSubscription *RESTSubscription, xAppEventInstanceID int64, err error, clientEndpoint *models.SubscriptionParamsClientEndpoint, trans *TransactionXapp, errorInfo *ErrorInfo) { @@ -751,9 +774,9 @@ func (c *Control) sendUnsuccesfullResponseNotification(restSubId *string, restSu } } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) sendSuccesfullResponseNotification(restSubId *string, restSubscription *RESTSubscription, xAppEventInstanceID int64, e2EventInstanceID int64, clientEndpoint *models.SubscriptionParamsClientEndpoint, trans *TransactionXapp, errorInfo *ErrorInfo) { @@ -789,9 +812,9 @@ func (c *Control) sendSuccesfullResponseNotification(restSubId *string, restSubs } } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) RESTSubscriptionDeleteHandler(restSubId string) int { c.CntRecvMsg++ @@ -842,9 +865,9 @@ func (c *Control) RESTSubscriptionDeleteHandler(restSubId string) int { return common.UnsubscribeNoContentCode } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) SubscriptionDeleteHandler(restSubId *string, endPoint *string, meid *string, instanceId uint32, waitRouteCleanupTime time.Duration) (int64, error) { var xAppEventInstanceID int64 @@ -966,9 +989,9 @@ func (c *Control) Consume(msg *xapp.RMRParams) (err error) { return } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // handle from XAPP Subscription Request -//------------------------------------------------------------------ +// ------------------------------------------------------------------ func (c *Control) handleXAPPSubscriptionRequest(params *xapp.RMRParams) { xapp.Logger.Debug("MSG from XAPP: %s", params.String()) c.UpdateCounter(cSubReqFromXapp) @@ -1005,9 +1028,9 @@ func (c *Control) handleXAPPSubscriptionRequest(params *xapp.RMRParams) { c.wakeSubscriptionRequest(subs, trans) } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // Wake Subscription Request to E2node -//------------------------------------------------------------------ +// ------------------------------------------------------------------ func (c *Control) wakeSubscriptionRequest(subs *Subscription, trans *TransactionXapp) { e2SubscriptionDirectives, err := c.GetE2SubscriptionDirectives(nil) @@ -1046,9 +1069,9 @@ func (c *Control) wakeSubscriptionRequest(subs *Subscription, trans *Transaction xapp.Logger.Debug("XAPP-SubReq: failed %s", idstring(err, trans, subs)) } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // handle from XAPP Subscription Delete Request -//------------------------------------------------------------------ +// ------------------------------------------------------------------ func (c *Control) handleXAPPSubscriptionDeleteRequest(params *xapp.RMRParams) { xapp.Logger.Debug("MSG from XAPP: %s", params.String()) c.UpdateCounter(cSubDelReqFromXapp) @@ -1114,9 +1137,9 @@ func (c *Control) handleXAPPSubscriptionDeleteRequest(params *xapp.RMRParams) { } } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // SUBS CREATE Handling -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) handleSubscriptionCreate(subs *Subscription, parentTrans *TransactionXapp, e2SubscriptionDirectives *E2SubscriptionDirectives, waitRouteCleanupTime time.Duration) { var event interface{} = nil @@ -1216,9 +1239,9 @@ func (c *Control) handleSubscriptionDelete(subs *Subscription, parentTrans *Tran parentTrans.SendEvent(nil, 0) } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // send to E2T Subscription Request -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) sendE2TSubscriptionRequest(subs *Subscription, trans *TransactionSubs, parentTrans *TransactionXapp, e2SubscriptionDirectives *E2SubscriptionDirectives) interface{} { var err error var event interface{} = nil @@ -1321,9 +1344,9 @@ func (c *Control) sendE2TSubscriptionDeleteRequest(subs *Subscription, trans *Tr return event } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // handle from E2T Subscription Response -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) handleE2TSubscriptionResponse(params *xapp.RMRParams) { xapp.Logger.Debug("MSG from E2T: %s", params.String()) c.UpdateCounter(cSubRespFromE2) @@ -1353,9 +1376,9 @@ func (c *Control) handleE2TSubscriptionResponse(params *xapp.RMRParams) { return } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // handle from E2T Subscription Failure -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) handleE2TSubscriptionFailure(params *xapp.RMRParams) { xapp.Logger.Debug("MSG from E2T: %s", params.String()) c.UpdateCounter(cSubFailFromE2) @@ -1383,9 +1406,9 @@ func (c *Control) handleE2TSubscriptionFailure(params *xapp.RMRParams) { return } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // handle from E2T Subscription Delete Response -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) handleE2TSubscriptionDeleteResponse(params *xapp.RMRParams) { xapp.Logger.Debug("MSG from E2T: %s", params.String()) c.UpdateCounter(cSubDelRespFromE2) @@ -1413,9 +1436,9 @@ func (c *Control) handleE2TSubscriptionDeleteResponse(params *xapp.RMRParams) { return } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // handle from E2T Subscription Delete Failure -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) handleE2TSubscriptionDeleteFailure(params *xapp.RMRParams) { xapp.Logger.Debug("MSG from E2T: %s", params.String()) c.UpdateCounter(cSubDelFailFromE2) @@ -1443,9 +1466,9 @@ func (c *Control) handleE2TSubscriptionDeleteFailure(params *xapp.RMRParams) { return } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func typeofSubsMessage(v interface{}) string { if v == nil { return "NIL" @@ -1468,9 +1491,9 @@ func typeofSubsMessage(v interface{}) string { } } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) WriteSubscriptionToDb(subs *Subscription) error { xapp.Logger.Debug("WriteSubscriptionToDb() subId = %v", subs.ReqId.InstanceId) err := c.WriteSubscriptionToSdl(subs.ReqId.InstanceId, subs) @@ -1481,9 +1504,9 @@ func (c *Control) WriteSubscriptionToDb(subs *Subscription) error { return nil } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) UpdateSubscriptionInDB(subs *Subscription, removeSubscriptionFromDb bool) error { if removeSubscriptionFromDb == true { @@ -1500,9 +1523,9 @@ func (c *Control) UpdateSubscriptionInDB(subs *Subscription, removeSubscriptionF return nil } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) RemoveSubscriptionFromDb(subs *Subscription) { xapp.Logger.Debug("RemoveSubscriptionFromDb() subId = %v", subs.ReqId.InstanceId) err := c.RemoveSubscriptionFromSdl(subs.ReqId.InstanceId) @@ -1511,9 +1534,9 @@ func (c *Control) RemoveSubscriptionFromDb(subs *Subscription) { } } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) WriteRESTSubscriptionToDb(restSubId string, restSubs *RESTSubscription) { xapp.Logger.Debug("WriteRESTSubscriptionToDb() restSubId = %s", restSubId) err := c.WriteRESTSubscriptionToSdl(restSubId, restSubs) @@ -1522,9 +1545,9 @@ func (c *Control) WriteRESTSubscriptionToDb(restSubId string, restSubs *RESTSubs } } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) UpdateRESTSubscriptionInDB(restSubId string, restSubs *RESTSubscription, removeRestSubscriptionFromDb bool) { if removeRestSubscriptionFromDb == true { @@ -1535,9 +1558,9 @@ func (c *Control) UpdateRESTSubscriptionInDB(restSubId string, restSubs *RESTSub } } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) RemoveRESTSubscriptionFromDb(restSubId string) { xapp.Logger.Debug("RemoveRESTSubscriptionFromDb() restSubId = %s", restSubId) err := c.RemoveRESTSubscriptionFromSdl(restSubId) @@ -1657,9 +1680,9 @@ func (c *Control) PrintRESTSubscriptionRequest(p *models.SubscriptionParams) { } } -//------------------------------------------------------------------- +// ------------------------------------------------------------------- // handle from E2T Subscription Delete Required -//------------------------------------------------------------------- +// ------------------------------------------------------------------- func (c *Control) handleE2TSubscriptionDeleteRequired(params *xapp.RMRParams) { xapp.Logger.Info("MSG from E2T: %s", params.String()) c.UpdateCounter(cSubDelRequFromE2) @@ -1694,10 +1717,10 @@ func (c *Control) handleE2TSubscriptionDeleteRequired(params *xapp.RMRParams) { } } -//----------------------------------------------------------------- +// ----------------------------------------------------------------- // Initiate RIC Subscription Delete Request after receiving // RIC Subscription Delete Required from E2T -//----------------------------------------------------------------- +// ----------------------------------------------------------------- func (c *Control) SendSubscriptionDeleteReqToE2T(subs *Subscription, params *xapp.RMRParams) { xapp.Logger.Debug("MSG TO E2T: %s", params.String()) c.UpdateCounter(cSubDelReqToE2) diff --git a/pkg/control/ratelimiter.go b/pkg/control/ratelimiter.go new file mode 100644 index 0000000..83425fd --- /dev/null +++ b/pkg/control/ratelimiter.go @@ -0,0 +1,185 @@ +package control + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "net/http" + "sync" + + "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/models" + "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp" + "github.com/spf13/viper" + "golang.org/x/time/rate" +) + +// per-key token bucket rate limiter for xApps +type RateLimiter struct { + limiters map[string]*rate.Limiter + mu sync.Mutex + rps float64 + burst int + enabled bool +} + +func NewRateLimiter(rps float64, burst int, enabled bool) *RateLimiter { + if rps <= 0 { + rps = 100.0 + } + if burst <= 0 { + burst = 20 + } + return &RateLimiter{ + limiters: make(map[string]*rate.Limiter), + rps: rps, + burst: burst, + enabled: enabled, + } +} + +func (r *RateLimiter) getLimiter(key string) *rate.Limiter { + r.mu.Lock() + defer r.mu.Unlock() + + l, ok := r.limiters[key] + if !ok { + l = rate.NewLimiter(rate.Limit(r.rps), r.burst) + r.limiters[key] = l + } + return l +} + +func (r *RateLimiter) Allow(key string) bool { + if !r.enabled { + return true + } + if key == "" { + return true + } + return r.getLimiter(key).Allow() +} + +// Wrapper that lets us add rate limiting to the normal RIC handlers +type RateLimiterWrapper struct { + limiter *RateLimiter + extractKey func(*http.Request) (string, error) +} + +func NewRateLimiterWrapper(rl *RateLimiter, extractor func(*http.Request) (string, error)) *RateLimiterWrapper { + return &RateLimiterWrapper{limiter: rl, extractKey: extractor} +} + +// Wraps InjectRoute handlers with rate limiting logic +func (w *RateLimiterWrapper) WrapHandler(handler func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) { + return func(rw http.ResponseWriter, r *http.Request) { + key, err := w.extractKey(r) + if err != nil { + xapp.Logger.Error("RateLimiter: failed to extract xApp service name: %v", err) + http.Error(rw, "Unable to identify xApp", http.StatusBadRequest) + return + } + + routeKey := fmt.Sprintf("%s|%s", key, r.URL.Path) + if !w.limiter.Allow(routeKey) { + xapp.Logger.Warn("RateLimiter: rate limit exceeded for %s", routeKey) + http.Error(rw, "Rate limit exceeded", http.StatusTooManyRequests) + return + } + + handler(rw, r) + } +} + +// Wraps subscription handler - maintains original signature: func(params interface{}) (*models.SubscriptionResponse, int) +func (w *RateLimiterWrapper) WrapRESTSubscriptionHandler( + handler func(params interface{}) (*models.SubscriptionResponse, int), +) func(params interface{}) (*models.SubscriptionResponse, int) { + return func(params interface{}) (*models.SubscriptionResponse, int) { + // Extract xApp service name from params + var xAppServiceName string + if p, ok := params.(*models.SubscriptionParams); ok && p.ClientEndpoint != nil { + xAppServiceName = p.ClientEndpoint.Host + } + + routeKey := fmt.Sprintf("%s|subscription", xAppServiceName) + if !w.limiter.Allow(routeKey) { + xapp.Logger.Warn("RateLimiter: rate limit exceeded for %s", routeKey) + // Return rate limit error + return nil, 429 // HTTP 429 Too Many Requests + } + + // Call the original handler + return handler(params) + } +} + +// Wraps subscription delete handler - maintains original signature: func(restSubId string) int +func (w *RateLimiterWrapper) WrapRESTSubscriptionDeleteHandler( + handler func(restSubId string) int, +) func(restSubId string) int { + return func(restSubId string) int { + // For delete operations, we can use restSubId as the key or extract from context + routeKey := fmt.Sprintf("%s|subscription_delete", restSubId) + if !w.limiter.Allow(routeKey) { + xapp.Logger.Warn("RateLimiter: rate limit exceeded for %s", routeKey) + // Return rate limit error + return 429 // HTTP 429 Too Many Requests + } + + // Call the original handler + return handler(restSubId) + } +} + +// Extracts xApp service name from JSON body and restores the body for downstream handlers. +func ExtractXappServiceName(r *http.Request) (string, error) { + if r == nil { + return "", fmt.Errorf("nil request") + } + + body, err := io.ReadAll(r.Body) + if err != nil { + return "", fmt.Errorf("read body: %w", err) + } + + _ = r.Body.Close() + r.Body = io.NopCloser(bytes.NewBuffer(body)) + + if len(body) == 0 { + return "", nil + } + + var params models.SubscriptionParams + if err := json.Unmarshal(body, ¶ms); err != nil { + return "", fmt.Errorf("unmarshal body: %w", err) + } + + if params.ClientEndpoint == nil || params.ClientEndpoint.Host == "" { + return "", fmt.Errorf("ClientEndpoint.Host not found") + } + + return params.ClientEndpoint.Host, nil +} + +// Reads limiter config (enabled, RPS, burst) from viper. +func ReadRateLimiterConfig() (float64, int, bool) { + enabled := viper.GetBool("ratelimiter.enabled") + rps := viper.GetFloat64("ratelimiter.requests_per_second") + burst := viper.GetInt("ratelimiter.burst") + + if rps <= 0 { + rps = 100.0 + } + if burst <= 0 { + burst = 20 + } + + return rps, burst, enabled +} + +func NewDefaultRateLimiterWrapper() *RateLimiterWrapper { + rps, burst, enabled := ReadRateLimiterConfig() + rl := NewRateLimiter(rps, burst, enabled) + return NewRateLimiterWrapper(rl, ExtractXappServiceName) +} diff --git a/pkg/rtmgr_client/debug/debug_client.go b/pkg/rtmgr_client/debug/debug_client.go new file mode 100644 index 0000000..453ce86 --- /dev/null +++ b/pkg/rtmgr_client/debug/debug_client.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package debug + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new debug API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for debug API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetDebuginfo(params *GetDebuginfoParams, opts ...ClientOption) (*GetDebuginfoOK, *GetDebuginfoCreated, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +GetDebuginfo gets information for debugging + +By performing a GET method, API caller is able to get the dump of routes tables, subcription list and E2T's +*/ +func (a *Client) GetDebuginfo(params *GetDebuginfoParams, opts ...ClientOption) (*GetDebuginfoOK, *GetDebuginfoCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetDebuginfoParams() + } + op := &runtime.ClientOperation{ + ID: "get_debuginfo", + Method: "GET", + PathPattern: "/getdebuginfo", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetDebuginfoReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *GetDebuginfoOK: + return value, nil, nil + case *GetDebuginfoCreated: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for debug: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/rtmgr_client/debug/get_debuginfo_parameters.go b/pkg/rtmgr_client/debug/get_debuginfo_parameters.go new file mode 100644 index 0000000..ef5b34c --- /dev/null +++ b/pkg/rtmgr_client/debug/get_debuginfo_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package debug + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetDebuginfoParams creates a new GetDebuginfoParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetDebuginfoParams() *GetDebuginfoParams { + return &GetDebuginfoParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetDebuginfoParamsWithTimeout creates a new GetDebuginfoParams object +// with the ability to set a timeout on a request. +func NewGetDebuginfoParamsWithTimeout(timeout time.Duration) *GetDebuginfoParams { + return &GetDebuginfoParams{ + timeout: timeout, + } +} + +// NewGetDebuginfoParamsWithContext creates a new GetDebuginfoParams object +// with the ability to set a context for a request. +func NewGetDebuginfoParamsWithContext(ctx context.Context) *GetDebuginfoParams { + return &GetDebuginfoParams{ + Context: ctx, + } +} + +// NewGetDebuginfoParamsWithHTTPClient creates a new GetDebuginfoParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetDebuginfoParamsWithHTTPClient(client *http.Client) *GetDebuginfoParams { + return &GetDebuginfoParams{ + HTTPClient: client, + } +} + +/* +GetDebuginfoParams contains all the parameters to send to the API endpoint + + for the get debuginfo operation. + + Typically these are written to a http.Request. +*/ +type GetDebuginfoParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get debuginfo params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDebuginfoParams) WithDefaults() *GetDebuginfoParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get debuginfo params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetDebuginfoParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get debuginfo params +func (o *GetDebuginfoParams) WithTimeout(timeout time.Duration) *GetDebuginfoParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get debuginfo params +func (o *GetDebuginfoParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get debuginfo params +func (o *GetDebuginfoParams) WithContext(ctx context.Context) *GetDebuginfoParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get debuginfo params +func (o *GetDebuginfoParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get debuginfo params +func (o *GetDebuginfoParams) WithHTTPClient(client *http.Client) *GetDebuginfoParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get debuginfo params +func (o *GetDebuginfoParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetDebuginfoParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/rtmgr_client/debug/get_debuginfo_responses.go b/pkg/rtmgr_client/debug/get_debuginfo_responses.go new file mode 100644 index 0000000..8f17785 --- /dev/null +++ b/pkg/rtmgr_client/debug/get_debuginfo_responses.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package debug + +// 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" + "github.com/go-openapi/strfmt" + + "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_models" +) + +// GetDebuginfoReader is a Reader for the GetDebuginfo structure. +type GetDebuginfoReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetDebuginfoReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetDebuginfoOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 201: + result := NewGetDebuginfoCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("[GET /getdebuginfo] get_debuginfo", response, response.Code()) + } +} + +// NewGetDebuginfoOK creates a GetDebuginfoOK with default headers values +func NewGetDebuginfoOK() *GetDebuginfoOK { + return &GetDebuginfoOK{} +} + +/* +GetDebuginfoOK describes a response with status code 200, with default header values. + +Debug Info from routing manager +*/ +type GetDebuginfoOK struct { + Payload *rtmgr_models.Debuginfo +} + +// IsSuccess returns true when this get debuginfo o k response has a 2xx status code +func (o *GetDebuginfoOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get debuginfo o k response has a 3xx status code +func (o *GetDebuginfoOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get debuginfo o k response has a 4xx status code +func (o *GetDebuginfoOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get debuginfo o k response has a 5xx status code +func (o *GetDebuginfoOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get debuginfo o k response a status code equal to that given +func (o *GetDebuginfoOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get debuginfo o k response +func (o *GetDebuginfoOK) Code() int { + return 200 +} + +func (o *GetDebuginfoOK) Error() string { + return fmt.Sprintf("[GET /getdebuginfo][%d] getDebuginfoOK %+v", 200, o.Payload) +} + +func (o *GetDebuginfoOK) String() string { + return fmt.Sprintf("[GET /getdebuginfo][%d] getDebuginfoOK %+v", 200, o.Payload) +} + +func (o *GetDebuginfoOK) GetPayload() *rtmgr_models.Debuginfo { + return o.Payload +} + +func (o *GetDebuginfoOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(rtmgr_models.Debuginfo) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetDebuginfoCreated creates a GetDebuginfoCreated with default headers values +func NewGetDebuginfoCreated() *GetDebuginfoCreated { + return &GetDebuginfoCreated{} +} + +/* +GetDebuginfoCreated describes a response with status code 201, with default header values. + +Error while fetching Debug data +*/ +type GetDebuginfoCreated struct { +} + +// IsSuccess returns true when this get debuginfo created response has a 2xx status code +func (o *GetDebuginfoCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get debuginfo created response has a 3xx status code +func (o *GetDebuginfoCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get debuginfo created response has a 4xx status code +func (o *GetDebuginfoCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this get debuginfo created response has a 5xx status code +func (o *GetDebuginfoCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this get debuginfo created response a status code equal to that given +func (o *GetDebuginfoCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the get debuginfo created response +func (o *GetDebuginfoCreated) Code() int { + return 201 +} + +func (o *GetDebuginfoCreated) Error() string { + return fmt.Sprintf("[GET /getdebuginfo][%d] getDebuginfoCreated ", 201) +} + +func (o *GetDebuginfoCreated) String() string { + return fmt.Sprintf("[GET /getdebuginfo][%d] getDebuginfoCreated ", 201) +} + +func (o *GetDebuginfoCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/rtmgr_client/handle/add_rmr_route_parameters.go b/pkg/rtmgr_client/handle/add_rmr_route_parameters.go new file mode 100644 index 0000000..a99f873 --- /dev/null +++ b/pkg/rtmgr_client/handle/add_rmr_route_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_models" +) + +// NewAddRmrRouteParams creates a new AddRmrRouteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewAddRmrRouteParams() *AddRmrRouteParams { + return &AddRmrRouteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAddRmrRouteParamsWithTimeout creates a new AddRmrRouteParams object +// with the ability to set a timeout on a request. +func NewAddRmrRouteParamsWithTimeout(timeout time.Duration) *AddRmrRouteParams { + return &AddRmrRouteParams{ + timeout: timeout, + } +} + +// NewAddRmrRouteParamsWithContext creates a new AddRmrRouteParams object +// with the ability to set a context for a request. +func NewAddRmrRouteParamsWithContext(ctx context.Context) *AddRmrRouteParams { + return &AddRmrRouteParams{ + Context: ctx, + } +} + +// NewAddRmrRouteParamsWithHTTPClient creates a new AddRmrRouteParams object +// with the ability to set a custom HTTPClient for a request. +func NewAddRmrRouteParamsWithHTTPClient(client *http.Client) *AddRmrRouteParams { + return &AddRmrRouteParams{ + HTTPClient: client, + } +} + +/* +AddRmrRouteParams contains all the parameters to send to the API endpoint + + for the add rmr route operation. + + Typically these are written to a http.Request. +*/ +type AddRmrRouteParams struct { + + /* RoutesList. + + list of routes to add + */ + RoutesList rtmgr_models.Routelist + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the add rmr route params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddRmrRouteParams) WithDefaults() *AddRmrRouteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add rmr route params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddRmrRouteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the add rmr route params +func (o *AddRmrRouteParams) WithTimeout(timeout time.Duration) *AddRmrRouteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the add rmr route params +func (o *AddRmrRouteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the add rmr route params +func (o *AddRmrRouteParams) WithContext(ctx context.Context) *AddRmrRouteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the add rmr route params +func (o *AddRmrRouteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the add rmr route params +func (o *AddRmrRouteParams) WithHTTPClient(client *http.Client) *AddRmrRouteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the add rmr route params +func (o *AddRmrRouteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRoutesList adds the routesList to the add rmr route params +func (o *AddRmrRouteParams) WithRoutesList(routesList rtmgr_models.Routelist) *AddRmrRouteParams { + o.SetRoutesList(routesList) + return o +} + +// SetRoutesList adds the routesList to the add rmr route params +func (o *AddRmrRouteParams) SetRoutesList(routesList rtmgr_models.Routelist) { + o.RoutesList = routesList +} + +// WriteToRequest writes these params to a swagger request +func (o *AddRmrRouteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.RoutesList != nil { + if err := r.SetBodyParam(o.RoutesList); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/rtmgr_client/handle/add_rmr_route_responses.go b/pkg/rtmgr_client/handle/add_rmr_route_responses.go new file mode 100644 index 0000000..97082ef --- /dev/null +++ b/pkg/rtmgr_client/handle/add_rmr_route_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// AddRmrRouteReader is a Reader for the AddRmrRoute structure. +type AddRmrRouteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AddRmrRouteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewAddRmrRouteCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewAddRmrRouteBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /handles/addrmrroute] add_rmr_route", response, response.Code()) + } +} + +// NewAddRmrRouteCreated creates a AddRmrRouteCreated with default headers values +func NewAddRmrRouteCreated() *AddRmrRouteCreated { + return &AddRmrRouteCreated{} +} + +/* +AddRmrRouteCreated describes a response with status code 201, with default header values. + +rmr routes added +*/ +type AddRmrRouteCreated struct { +} + +// IsSuccess returns true when this add rmr route created response has a 2xx status code +func (o *AddRmrRouteCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this add rmr route created response has a 3xx status code +func (o *AddRmrRouteCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this add rmr route created response has a 4xx status code +func (o *AddRmrRouteCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this add rmr route created response has a 5xx status code +func (o *AddRmrRouteCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this add rmr route created response a status code equal to that given +func (o *AddRmrRouteCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the add rmr route created response +func (o *AddRmrRouteCreated) Code() int { + return 201 +} + +func (o *AddRmrRouteCreated) Error() string { + return fmt.Sprintf("[POST /handles/addrmrroute][%d] addRmrRouteCreated ", 201) +} + +func (o *AddRmrRouteCreated) String() string { + return fmt.Sprintf("[POST /handles/addrmrroute][%d] addRmrRouteCreated ", 201) +} + +func (o *AddRmrRouteCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewAddRmrRouteBadRequest creates a AddRmrRouteBadRequest with default headers values +func NewAddRmrRouteBadRequest() *AddRmrRouteBadRequest { + return &AddRmrRouteBadRequest{} +} + +/* +AddRmrRouteBadRequest describes a response with status code 400, with default header values. + +Invalid data +*/ +type AddRmrRouteBadRequest struct { +} + +// IsSuccess returns true when this add rmr route bad request response has a 2xx status code +func (o *AddRmrRouteBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this add rmr route bad request response has a 3xx status code +func (o *AddRmrRouteBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this add rmr route bad request response has a 4xx status code +func (o *AddRmrRouteBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this add rmr route bad request response has a 5xx status code +func (o *AddRmrRouteBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this add rmr route bad request response a status code equal to that given +func (o *AddRmrRouteBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the add rmr route bad request response +func (o *AddRmrRouteBadRequest) Code() int { + return 400 +} + +func (o *AddRmrRouteBadRequest) Error() string { + return fmt.Sprintf("[POST /handles/addrmrroute][%d] addRmrRouteBadRequest ", 400) +} + +func (o *AddRmrRouteBadRequest) String() string { + return fmt.Sprintf("[POST /handles/addrmrroute][%d] addRmrRouteBadRequest ", 400) +} + +func (o *AddRmrRouteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/rtmgr_client/handle/associate_ran_to_e2t_handle_parameters.go b/pkg/rtmgr_client/handle/associate_ran_to_e2t_handle_parameters.go new file mode 100644 index 0000000..ed3727b --- /dev/null +++ b/pkg/rtmgr_client/handle/associate_ran_to_e2t_handle_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_models" +) + +// NewAssociateRanToE2tHandleParams creates a new AssociateRanToE2tHandleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewAssociateRanToE2tHandleParams() *AssociateRanToE2tHandleParams { + return &AssociateRanToE2tHandleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAssociateRanToE2tHandleParamsWithTimeout creates a new AssociateRanToE2tHandleParams object +// with the ability to set a timeout on a request. +func NewAssociateRanToE2tHandleParamsWithTimeout(timeout time.Duration) *AssociateRanToE2tHandleParams { + return &AssociateRanToE2tHandleParams{ + timeout: timeout, + } +} + +// NewAssociateRanToE2tHandleParamsWithContext creates a new AssociateRanToE2tHandleParams object +// with the ability to set a context for a request. +func NewAssociateRanToE2tHandleParamsWithContext(ctx context.Context) *AssociateRanToE2tHandleParams { + return &AssociateRanToE2tHandleParams{ + Context: ctx, + } +} + +// NewAssociateRanToE2tHandleParamsWithHTTPClient creates a new AssociateRanToE2tHandleParams object +// with the ability to set a custom HTTPClient for a request. +func NewAssociateRanToE2tHandleParamsWithHTTPClient(client *http.Client) *AssociateRanToE2tHandleParams { + return &AssociateRanToE2tHandleParams{ + HTTPClient: client, + } +} + +/* +AssociateRanToE2tHandleParams contains all the parameters to send to the API endpoint + + for the associate ran to e2t handle operation. + + Typically these are written to a http.Request. +*/ +type AssociateRanToE2tHandleParams struct { + + /* RanE2tList. + + ran to e2t mapping + */ + RanE2tList rtmgr_models.RanE2tMap + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the associate ran to e2t handle params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AssociateRanToE2tHandleParams) WithDefaults() *AssociateRanToE2tHandleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the associate ran to e2t handle params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AssociateRanToE2tHandleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the associate ran to e2t handle params +func (o *AssociateRanToE2tHandleParams) WithTimeout(timeout time.Duration) *AssociateRanToE2tHandleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the associate ran to e2t handle params +func (o *AssociateRanToE2tHandleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the associate ran to e2t handle params +func (o *AssociateRanToE2tHandleParams) WithContext(ctx context.Context) *AssociateRanToE2tHandleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the associate ran to e2t handle params +func (o *AssociateRanToE2tHandleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the associate ran to e2t handle params +func (o *AssociateRanToE2tHandleParams) WithHTTPClient(client *http.Client) *AssociateRanToE2tHandleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the associate ran to e2t handle params +func (o *AssociateRanToE2tHandleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRanE2tList adds the ranE2tList to the associate ran to e2t handle params +func (o *AssociateRanToE2tHandleParams) WithRanE2tList(ranE2tList rtmgr_models.RanE2tMap) *AssociateRanToE2tHandleParams { + o.SetRanE2tList(ranE2tList) + return o +} + +// SetRanE2tList adds the ranE2tList to the associate ran to e2t handle params +func (o *AssociateRanToE2tHandleParams) SetRanE2tList(ranE2tList rtmgr_models.RanE2tMap) { + o.RanE2tList = ranE2tList +} + +// WriteToRequest writes these params to a swagger request +func (o *AssociateRanToE2tHandleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.RanE2tList != nil { + if err := r.SetBodyParam(o.RanE2tList); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/rtmgr_client/handle/associate_ran_to_e2t_handle_responses.go b/pkg/rtmgr_client/handle/associate_ran_to_e2t_handle_responses.go new file mode 100644 index 0000000..a2675f4 --- /dev/null +++ b/pkg/rtmgr_client/handle/associate_ran_to_e2t_handle_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// AssociateRanToE2tHandleReader is a Reader for the AssociateRanToE2tHandle structure. +type AssociateRanToE2tHandleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AssociateRanToE2tHandleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewAssociateRanToE2tHandleCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewAssociateRanToE2tHandleBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /handles/associate-ran-to-e2t] associate_ran_to_e2t_handle", response, response.Code()) + } +} + +// NewAssociateRanToE2tHandleCreated creates a AssociateRanToE2tHandleCreated with default headers values +func NewAssociateRanToE2tHandleCreated() *AssociateRanToE2tHandleCreated { + return &AssociateRanToE2tHandleCreated{} +} + +/* +AssociateRanToE2tHandleCreated describes a response with status code 201, with default header values. + +e2t ran mapping recieved, platform routes +*/ +type AssociateRanToE2tHandleCreated struct { +} + +// IsSuccess returns true when this associate ran to e2t handle created response has a 2xx status code +func (o *AssociateRanToE2tHandleCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this associate ran to e2t handle created response has a 3xx status code +func (o *AssociateRanToE2tHandleCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this associate ran to e2t handle created response has a 4xx status code +func (o *AssociateRanToE2tHandleCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this associate ran to e2t handle created response has a 5xx status code +func (o *AssociateRanToE2tHandleCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this associate ran to e2t handle created response a status code equal to that given +func (o *AssociateRanToE2tHandleCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the associate ran to e2t handle created response +func (o *AssociateRanToE2tHandleCreated) Code() int { + return 201 +} + +func (o *AssociateRanToE2tHandleCreated) Error() string { + return fmt.Sprintf("[POST /handles/associate-ran-to-e2t][%d] associateRanToE2tHandleCreated ", 201) +} + +func (o *AssociateRanToE2tHandleCreated) String() string { + return fmt.Sprintf("[POST /handles/associate-ran-to-e2t][%d] associateRanToE2tHandleCreated ", 201) +} + +func (o *AssociateRanToE2tHandleCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewAssociateRanToE2tHandleBadRequest creates a AssociateRanToE2tHandleBadRequest with default headers values +func NewAssociateRanToE2tHandleBadRequest() *AssociateRanToE2tHandleBadRequest { + return &AssociateRanToE2tHandleBadRequest{} +} + +/* +AssociateRanToE2tHandleBadRequest describes a response with status code 400, with default header values. + +Invalid data +*/ +type AssociateRanToE2tHandleBadRequest struct { +} + +// IsSuccess returns true when this associate ran to e2t handle bad request response has a 2xx status code +func (o *AssociateRanToE2tHandleBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this associate ran to e2t handle bad request response has a 3xx status code +func (o *AssociateRanToE2tHandleBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this associate ran to e2t handle bad request response has a 4xx status code +func (o *AssociateRanToE2tHandleBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this associate ran to e2t handle bad request response has a 5xx status code +func (o *AssociateRanToE2tHandleBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this associate ran to e2t handle bad request response a status code equal to that given +func (o *AssociateRanToE2tHandleBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the associate ran to e2t handle bad request response +func (o *AssociateRanToE2tHandleBadRequest) Code() int { + return 400 +} + +func (o *AssociateRanToE2tHandleBadRequest) Error() string { + return fmt.Sprintf("[POST /handles/associate-ran-to-e2t][%d] associateRanToE2tHandleBadRequest ", 400) +} + +func (o *AssociateRanToE2tHandleBadRequest) String() string { + return fmt.Sprintf("[POST /handles/associate-ran-to-e2t][%d] associateRanToE2tHandleBadRequest ", 400) +} + +func (o *AssociateRanToE2tHandleBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/rtmgr_client/handle/create_new_e2t_handle_parameters.go b/pkg/rtmgr_client/handle/create_new_e2t_handle_parameters.go new file mode 100644 index 0000000..1bf2486 --- /dev/null +++ b/pkg/rtmgr_client/handle/create_new_e2t_handle_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_models" +) + +// NewCreateNewE2tHandleParams creates a new CreateNewE2tHandleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateNewE2tHandleParams() *CreateNewE2tHandleParams { + return &CreateNewE2tHandleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateNewE2tHandleParamsWithTimeout creates a new CreateNewE2tHandleParams object +// with the ability to set a timeout on a request. +func NewCreateNewE2tHandleParamsWithTimeout(timeout time.Duration) *CreateNewE2tHandleParams { + return &CreateNewE2tHandleParams{ + timeout: timeout, + } +} + +// NewCreateNewE2tHandleParamsWithContext creates a new CreateNewE2tHandleParams object +// with the ability to set a context for a request. +func NewCreateNewE2tHandleParamsWithContext(ctx context.Context) *CreateNewE2tHandleParams { + return &CreateNewE2tHandleParams{ + Context: ctx, + } +} + +// NewCreateNewE2tHandleParamsWithHTTPClient creates a new CreateNewE2tHandleParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateNewE2tHandleParamsWithHTTPClient(client *http.Client) *CreateNewE2tHandleParams { + return &CreateNewE2tHandleParams{ + HTTPClient: client, + } +} + +/* +CreateNewE2tHandleParams contains all the parameters to send to the API endpoint + + for the create new e2t handle operation. + + Typically these are written to a http.Request. +*/ +type CreateNewE2tHandleParams struct { + + /* E2tData. + + FQDN of the newly joined E2T instance + */ + E2tData *rtmgr_models.E2tData + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create new e2t handle params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNewE2tHandleParams) WithDefaults() *CreateNewE2tHandleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create new e2t handle params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateNewE2tHandleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create new e2t handle params +func (o *CreateNewE2tHandleParams) WithTimeout(timeout time.Duration) *CreateNewE2tHandleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create new e2t handle params +func (o *CreateNewE2tHandleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create new e2t handle params +func (o *CreateNewE2tHandleParams) WithContext(ctx context.Context) *CreateNewE2tHandleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create new e2t handle params +func (o *CreateNewE2tHandleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create new e2t handle params +func (o *CreateNewE2tHandleParams) WithHTTPClient(client *http.Client) *CreateNewE2tHandleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create new e2t handle params +func (o *CreateNewE2tHandleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithE2tData adds the e2tData to the create new e2t handle params +func (o *CreateNewE2tHandleParams) WithE2tData(e2tData *rtmgr_models.E2tData) *CreateNewE2tHandleParams { + o.SetE2tData(e2tData) + return o +} + +// SetE2tData adds the e2tData to the create new e2t handle params +func (o *CreateNewE2tHandleParams) SetE2tData(e2tData *rtmgr_models.E2tData) { + o.E2tData = e2tData +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateNewE2tHandleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.E2tData != nil { + if err := r.SetBodyParam(o.E2tData); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/rtmgr_client/handle/create_new_e2t_handle_responses.go b/pkg/rtmgr_client/handle/create_new_e2t_handle_responses.go new file mode 100644 index 0000000..811cf59 --- /dev/null +++ b/pkg/rtmgr_client/handle/create_new_e2t_handle_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateNewE2tHandleReader is a Reader for the CreateNewE2tHandle structure. +type CreateNewE2tHandleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateNewE2tHandleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateNewE2tHandleCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateNewE2tHandleBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /handles/e2t] create_new_e2t_handle", response, response.Code()) + } +} + +// NewCreateNewE2tHandleCreated creates a CreateNewE2tHandleCreated with default headers values +func NewCreateNewE2tHandleCreated() *CreateNewE2tHandleCreated { + return &CreateNewE2tHandleCreated{} +} + +/* +CreateNewE2tHandleCreated describes a response with status code 201, with default header values. + +new e2t instance is considered and platform routes are established +*/ +type CreateNewE2tHandleCreated struct { +} + +// IsSuccess returns true when this create new e2t handle created response has a 2xx status code +func (o *CreateNewE2tHandleCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create new e2t handle created response has a 3xx status code +func (o *CreateNewE2tHandleCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create new e2t handle created response has a 4xx status code +func (o *CreateNewE2tHandleCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create new e2t handle created response has a 5xx status code +func (o *CreateNewE2tHandleCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create new e2t handle created response a status code equal to that given +func (o *CreateNewE2tHandleCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the create new e2t handle created response +func (o *CreateNewE2tHandleCreated) Code() int { + return 201 +} + +func (o *CreateNewE2tHandleCreated) Error() string { + return fmt.Sprintf("[POST /handles/e2t][%d] createNewE2tHandleCreated ", 201) +} + +func (o *CreateNewE2tHandleCreated) String() string { + return fmt.Sprintf("[POST /handles/e2t][%d] createNewE2tHandleCreated ", 201) +} + +func (o *CreateNewE2tHandleCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewCreateNewE2tHandleBadRequest creates a CreateNewE2tHandleBadRequest with default headers values +func NewCreateNewE2tHandleBadRequest() *CreateNewE2tHandleBadRequest { + return &CreateNewE2tHandleBadRequest{} +} + +/* +CreateNewE2tHandleBadRequest describes a response with status code 400, with default header values. + +Invalid data +*/ +type CreateNewE2tHandleBadRequest struct { +} + +// IsSuccess returns true when this create new e2t handle bad request response has a 2xx status code +func (o *CreateNewE2tHandleBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create new e2t handle bad request response has a 3xx status code +func (o *CreateNewE2tHandleBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create new e2t handle bad request response has a 4xx status code +func (o *CreateNewE2tHandleBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create new e2t handle bad request response has a 5xx status code +func (o *CreateNewE2tHandleBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create new e2t handle bad request response a status code equal to that given +func (o *CreateNewE2tHandleBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the create new e2t handle bad request response +func (o *CreateNewE2tHandleBadRequest) Code() int { + return 400 +} + +func (o *CreateNewE2tHandleBadRequest) Error() string { + return fmt.Sprintf("[POST /handles/e2t][%d] createNewE2tHandleBadRequest ", 400) +} + +func (o *CreateNewE2tHandleBadRequest) String() string { + return fmt.Sprintf("[POST /handles/e2t][%d] createNewE2tHandleBadRequest ", 400) +} + +func (o *CreateNewE2tHandleBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/rtmgr_client/handle/del_rmr_route_parameters.go b/pkg/rtmgr_client/handle/del_rmr_route_parameters.go new file mode 100644 index 0000000..2052e81 --- /dev/null +++ b/pkg/rtmgr_client/handle/del_rmr_route_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_models" +) + +// NewDelRmrRouteParams creates a new DelRmrRouteParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDelRmrRouteParams() *DelRmrRouteParams { + return &DelRmrRouteParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDelRmrRouteParamsWithTimeout creates a new DelRmrRouteParams object +// with the ability to set a timeout on a request. +func NewDelRmrRouteParamsWithTimeout(timeout time.Duration) *DelRmrRouteParams { + return &DelRmrRouteParams{ + timeout: timeout, + } +} + +// NewDelRmrRouteParamsWithContext creates a new DelRmrRouteParams object +// with the ability to set a context for a request. +func NewDelRmrRouteParamsWithContext(ctx context.Context) *DelRmrRouteParams { + return &DelRmrRouteParams{ + Context: ctx, + } +} + +// NewDelRmrRouteParamsWithHTTPClient creates a new DelRmrRouteParams object +// with the ability to set a custom HTTPClient for a request. +func NewDelRmrRouteParamsWithHTTPClient(client *http.Client) *DelRmrRouteParams { + return &DelRmrRouteParams{ + HTTPClient: client, + } +} + +/* +DelRmrRouteParams contains all the parameters to send to the API endpoint + + for the del rmr route operation. + + Typically these are written to a http.Request. +*/ +type DelRmrRouteParams struct { + + /* RoutesList. + + list of routes to delete + */ + RoutesList rtmgr_models.Routelist + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the del rmr route params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DelRmrRouteParams) WithDefaults() *DelRmrRouteParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the del rmr route params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DelRmrRouteParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the del rmr route params +func (o *DelRmrRouteParams) WithTimeout(timeout time.Duration) *DelRmrRouteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the del rmr route params +func (o *DelRmrRouteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the del rmr route params +func (o *DelRmrRouteParams) WithContext(ctx context.Context) *DelRmrRouteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the del rmr route params +func (o *DelRmrRouteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the del rmr route params +func (o *DelRmrRouteParams) WithHTTPClient(client *http.Client) *DelRmrRouteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the del rmr route params +func (o *DelRmrRouteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRoutesList adds the routesList to the del rmr route params +func (o *DelRmrRouteParams) WithRoutesList(routesList rtmgr_models.Routelist) *DelRmrRouteParams { + o.SetRoutesList(routesList) + return o +} + +// SetRoutesList adds the routesList to the del rmr route params +func (o *DelRmrRouteParams) SetRoutesList(routesList rtmgr_models.Routelist) { + o.RoutesList = routesList +} + +// WriteToRequest writes these params to a swagger request +func (o *DelRmrRouteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.RoutesList != nil { + if err := r.SetBodyParam(o.RoutesList); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/rtmgr_client/handle/del_rmr_route_responses.go b/pkg/rtmgr_client/handle/del_rmr_route_responses.go new file mode 100644 index 0000000..6ed7290 --- /dev/null +++ b/pkg/rtmgr_client/handle/del_rmr_route_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DelRmrRouteReader is a Reader for the DelRmrRoute structure. +type DelRmrRouteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DelRmrRouteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewDelRmrRouteCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewDelRmrRouteBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[DELETE /handles/delrmrroute] del_rmr_route", response, response.Code()) + } +} + +// NewDelRmrRouteCreated creates a DelRmrRouteCreated with default headers values +func NewDelRmrRouteCreated() *DelRmrRouteCreated { + return &DelRmrRouteCreated{} +} + +/* +DelRmrRouteCreated describes a response with status code 201, with default header values. + +rmr routes added +*/ +type DelRmrRouteCreated struct { +} + +// IsSuccess returns true when this del rmr route created response has a 2xx status code +func (o *DelRmrRouteCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this del rmr route created response has a 3xx status code +func (o *DelRmrRouteCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this del rmr route created response has a 4xx status code +func (o *DelRmrRouteCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this del rmr route created response has a 5xx status code +func (o *DelRmrRouteCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this del rmr route created response a status code equal to that given +func (o *DelRmrRouteCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the del rmr route created response +func (o *DelRmrRouteCreated) Code() int { + return 201 +} + +func (o *DelRmrRouteCreated) Error() string { + return fmt.Sprintf("[DELETE /handles/delrmrroute][%d] delRmrRouteCreated ", 201) +} + +func (o *DelRmrRouteCreated) String() string { + return fmt.Sprintf("[DELETE /handles/delrmrroute][%d] delRmrRouteCreated ", 201) +} + +func (o *DelRmrRouteCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDelRmrRouteBadRequest creates a DelRmrRouteBadRequest with default headers values +func NewDelRmrRouteBadRequest() *DelRmrRouteBadRequest { + return &DelRmrRouteBadRequest{} +} + +/* +DelRmrRouteBadRequest describes a response with status code 400, with default header values. + +Invalid data +*/ +type DelRmrRouteBadRequest struct { +} + +// IsSuccess returns true when this del rmr route bad request response has a 2xx status code +func (o *DelRmrRouteBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this del rmr route bad request response has a 3xx status code +func (o *DelRmrRouteBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this del rmr route bad request response has a 4xx status code +func (o *DelRmrRouteBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this del rmr route bad request response has a 5xx status code +func (o *DelRmrRouteBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this del rmr route bad request response a status code equal to that given +func (o *DelRmrRouteBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the del rmr route bad request response +func (o *DelRmrRouteBadRequest) Code() int { + return 400 +} + +func (o *DelRmrRouteBadRequest) Error() string { + return fmt.Sprintf("[DELETE /handles/delrmrroute][%d] delRmrRouteBadRequest ", 400) +} + +func (o *DelRmrRouteBadRequest) String() string { + return fmt.Sprintf("[DELETE /handles/delrmrroute][%d] delRmrRouteBadRequest ", 400) +} + +func (o *DelRmrRouteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/rtmgr_client/handle/delete_e2t_handle_parameters.go b/pkg/rtmgr_client/handle/delete_e2t_handle_parameters.go new file mode 100644 index 0000000..23be055 --- /dev/null +++ b/pkg/rtmgr_client/handle/delete_e2t_handle_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_models" +) + +// NewDeleteE2tHandleParams creates a new DeleteE2tHandleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteE2tHandleParams() *DeleteE2tHandleParams { + return &DeleteE2tHandleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteE2tHandleParamsWithTimeout creates a new DeleteE2tHandleParams object +// with the ability to set a timeout on a request. +func NewDeleteE2tHandleParamsWithTimeout(timeout time.Duration) *DeleteE2tHandleParams { + return &DeleteE2tHandleParams{ + timeout: timeout, + } +} + +// NewDeleteE2tHandleParamsWithContext creates a new DeleteE2tHandleParams object +// with the ability to set a context for a request. +func NewDeleteE2tHandleParamsWithContext(ctx context.Context) *DeleteE2tHandleParams { + return &DeleteE2tHandleParams{ + Context: ctx, + } +} + +// NewDeleteE2tHandleParamsWithHTTPClient creates a new DeleteE2tHandleParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteE2tHandleParamsWithHTTPClient(client *http.Client) *DeleteE2tHandleParams { + return &DeleteE2tHandleParams{ + HTTPClient: client, + } +} + +/* +DeleteE2tHandleParams contains all the parameters to send to the API endpoint + + for the delete e2t handle operation. + + Typically these are written to a http.Request. +*/ +type DeleteE2tHandleParams struct { + + /* E2tData. + + FQDN of the newly joined E2T instance + */ + E2tData *rtmgr_models.E2tDeleteData + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete e2t handle params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteE2tHandleParams) WithDefaults() *DeleteE2tHandleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete e2t handle params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteE2tHandleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete e2t handle params +func (o *DeleteE2tHandleParams) WithTimeout(timeout time.Duration) *DeleteE2tHandleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete e2t handle params +func (o *DeleteE2tHandleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete e2t handle params +func (o *DeleteE2tHandleParams) WithContext(ctx context.Context) *DeleteE2tHandleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete e2t handle params +func (o *DeleteE2tHandleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete e2t handle params +func (o *DeleteE2tHandleParams) WithHTTPClient(client *http.Client) *DeleteE2tHandleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete e2t handle params +func (o *DeleteE2tHandleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithE2tData adds the e2tData to the delete e2t handle params +func (o *DeleteE2tHandleParams) WithE2tData(e2tData *rtmgr_models.E2tDeleteData) *DeleteE2tHandleParams { + o.SetE2tData(e2tData) + return o +} + +// SetE2tData adds the e2tData to the delete e2t handle params +func (o *DeleteE2tHandleParams) SetE2tData(e2tData *rtmgr_models.E2tDeleteData) { + o.E2tData = e2tData +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteE2tHandleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.E2tData != nil { + if err := r.SetBodyParam(o.E2tData); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/rtmgr_client/handle/delete_e2t_handle_responses.go b/pkg/rtmgr_client/handle/delete_e2t_handle_responses.go new file mode 100644 index 0000000..326ea59 --- /dev/null +++ b/pkg/rtmgr_client/handle/delete_e2t_handle_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteE2tHandleReader is a Reader for the DeleteE2tHandle structure. +type DeleteE2tHandleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteE2tHandleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewDeleteE2tHandleCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewDeleteE2tHandleBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[DELETE /handles/e2t] delete_e2t_handle", response, response.Code()) + } +} + +// NewDeleteE2tHandleCreated creates a DeleteE2tHandleCreated with default headers values +func NewDeleteE2tHandleCreated() *DeleteE2tHandleCreated { + return &DeleteE2tHandleCreated{} +} + +/* +DeleteE2tHandleCreated describes a response with status code 201, with default header values. + +new e2t instance is considered and platform routes are established +*/ +type DeleteE2tHandleCreated struct { +} + +// IsSuccess returns true when this delete e2t handle created response has a 2xx status code +func (o *DeleteE2tHandleCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete e2t handle created response has a 3xx status code +func (o *DeleteE2tHandleCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete e2t handle created response has a 4xx status code +func (o *DeleteE2tHandleCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete e2t handle created response has a 5xx status code +func (o *DeleteE2tHandleCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this delete e2t handle created response a status code equal to that given +func (o *DeleteE2tHandleCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the delete e2t handle created response +func (o *DeleteE2tHandleCreated) Code() int { + return 201 +} + +func (o *DeleteE2tHandleCreated) Error() string { + return fmt.Sprintf("[DELETE /handles/e2t][%d] deleteE2tHandleCreated ", 201) +} + +func (o *DeleteE2tHandleCreated) String() string { + return fmt.Sprintf("[DELETE /handles/e2t][%d] deleteE2tHandleCreated ", 201) +} + +func (o *DeleteE2tHandleCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteE2tHandleBadRequest creates a DeleteE2tHandleBadRequest with default headers values +func NewDeleteE2tHandleBadRequest() *DeleteE2tHandleBadRequest { + return &DeleteE2tHandleBadRequest{} +} + +/* +DeleteE2tHandleBadRequest describes a response with status code 400, with default header values. + +Invalid data +*/ +type DeleteE2tHandleBadRequest struct { +} + +// IsSuccess returns true when this delete e2t handle bad request response has a 2xx status code +func (o *DeleteE2tHandleBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete e2t handle bad request response has a 3xx status code +func (o *DeleteE2tHandleBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete e2t handle bad request response has a 4xx status code +func (o *DeleteE2tHandleBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete e2t handle bad request response has a 5xx status code +func (o *DeleteE2tHandleBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this delete e2t handle bad request response a status code equal to that given +func (o *DeleteE2tHandleBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the delete e2t handle bad request response +func (o *DeleteE2tHandleBadRequest) Code() int { + return 400 +} + +func (o *DeleteE2tHandleBadRequest) Error() string { + return fmt.Sprintf("[DELETE /handles/e2t][%d] deleteE2tHandleBadRequest ", 400) +} + +func (o *DeleteE2tHandleBadRequest) String() string { + return fmt.Sprintf("[DELETE /handles/e2t][%d] deleteE2tHandleBadRequest ", 400) +} + +func (o *DeleteE2tHandleBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/rtmgr_client/handle/delete_xapp_subscription_handle_parameters.go b/pkg/rtmgr_client/handle/delete_xapp_subscription_handle_parameters.go new file mode 100644 index 0000000..67beae0 --- /dev/null +++ b/pkg/rtmgr_client/handle/delete_xapp_subscription_handle_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_models" +) + +// NewDeleteXappSubscriptionHandleParams creates a new DeleteXappSubscriptionHandleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteXappSubscriptionHandleParams() *DeleteXappSubscriptionHandleParams { + return &DeleteXappSubscriptionHandleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteXappSubscriptionHandleParamsWithTimeout creates a new DeleteXappSubscriptionHandleParams object +// with the ability to set a timeout on a request. +func NewDeleteXappSubscriptionHandleParamsWithTimeout(timeout time.Duration) *DeleteXappSubscriptionHandleParams { + return &DeleteXappSubscriptionHandleParams{ + timeout: timeout, + } +} + +// NewDeleteXappSubscriptionHandleParamsWithContext creates a new DeleteXappSubscriptionHandleParams object +// with the ability to set a context for a request. +func NewDeleteXappSubscriptionHandleParamsWithContext(ctx context.Context) *DeleteXappSubscriptionHandleParams { + return &DeleteXappSubscriptionHandleParams{ + Context: ctx, + } +} + +// NewDeleteXappSubscriptionHandleParamsWithHTTPClient creates a new DeleteXappSubscriptionHandleParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteXappSubscriptionHandleParamsWithHTTPClient(client *http.Client) *DeleteXappSubscriptionHandleParams { + return &DeleteXappSubscriptionHandleParams{ + HTTPClient: client, + } +} + +/* +DeleteXappSubscriptionHandleParams contains all the parameters to send to the API endpoint + + for the delete xapp subscription handle operation. + + Typically these are written to a http.Request. +*/ +type DeleteXappSubscriptionHandleParams struct { + + /* XappSubscriptionData. + + xApp related subscription data + */ + XappSubscriptionData *rtmgr_models.XappSubscriptionData + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete xapp subscription handle params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteXappSubscriptionHandleParams) WithDefaults() *DeleteXappSubscriptionHandleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete xapp subscription handle params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteXappSubscriptionHandleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete xapp subscription handle params +func (o *DeleteXappSubscriptionHandleParams) WithTimeout(timeout time.Duration) *DeleteXappSubscriptionHandleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete xapp subscription handle params +func (o *DeleteXappSubscriptionHandleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete xapp subscription handle params +func (o *DeleteXappSubscriptionHandleParams) WithContext(ctx context.Context) *DeleteXappSubscriptionHandleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete xapp subscription handle params +func (o *DeleteXappSubscriptionHandleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete xapp subscription handle params +func (o *DeleteXappSubscriptionHandleParams) WithHTTPClient(client *http.Client) *DeleteXappSubscriptionHandleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete xapp subscription handle params +func (o *DeleteXappSubscriptionHandleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithXappSubscriptionData adds the xappSubscriptionData to the delete xapp subscription handle params +func (o *DeleteXappSubscriptionHandleParams) WithXappSubscriptionData(xappSubscriptionData *rtmgr_models.XappSubscriptionData) *DeleteXappSubscriptionHandleParams { + o.SetXappSubscriptionData(xappSubscriptionData) + return o +} + +// SetXappSubscriptionData adds the xappSubscriptionData to the delete xapp subscription handle params +func (o *DeleteXappSubscriptionHandleParams) SetXappSubscriptionData(xappSubscriptionData *rtmgr_models.XappSubscriptionData) { + o.XappSubscriptionData = xappSubscriptionData +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteXappSubscriptionHandleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.XappSubscriptionData != nil { + if err := r.SetBodyParam(o.XappSubscriptionData); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/rtmgr_client/handle/delete_xapp_subscription_handle_responses.go b/pkg/rtmgr_client/handle/delete_xapp_subscription_handle_responses.go new file mode 100644 index 0000000..31263a9 --- /dev/null +++ b/pkg/rtmgr_client/handle/delete_xapp_subscription_handle_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DeleteXappSubscriptionHandleReader is a Reader for the DeleteXappSubscriptionHandle structure. +type DeleteXappSubscriptionHandleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteXappSubscriptionHandleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDeleteXappSubscriptionHandleOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 204: + result := NewDeleteXappSubscriptionHandleNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("[DELETE /handles/xapp-subscription-handle] delete_xapp_subscription_handle", response, response.Code()) + } +} + +// NewDeleteXappSubscriptionHandleOK creates a DeleteXappSubscriptionHandleOK with default headers values +func NewDeleteXappSubscriptionHandleOK() *DeleteXappSubscriptionHandleOK { + return &DeleteXappSubscriptionHandleOK{} +} + +/* +DeleteXappSubscriptionHandleOK describes a response with status code 200, with default header values. + +Xapp Subscription deleted +*/ +type DeleteXappSubscriptionHandleOK struct { +} + +// IsSuccess returns true when this delete xapp subscription handle o k response has a 2xx status code +func (o *DeleteXappSubscriptionHandleOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete xapp subscription handle o k response has a 3xx status code +func (o *DeleteXappSubscriptionHandleOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete xapp subscription handle o k response has a 4xx status code +func (o *DeleteXappSubscriptionHandleOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete xapp subscription handle o k response has a 5xx status code +func (o *DeleteXappSubscriptionHandleOK) IsServerError() bool { + return false +} + +// IsCode returns true when this delete xapp subscription handle o k response a status code equal to that given +func (o *DeleteXappSubscriptionHandleOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the delete xapp subscription handle o k response +func (o *DeleteXappSubscriptionHandleOK) Code() int { + return 200 +} + +func (o *DeleteXappSubscriptionHandleOK) Error() string { + return fmt.Sprintf("[DELETE /handles/xapp-subscription-handle][%d] deleteXappSubscriptionHandleOK ", 200) +} + +func (o *DeleteXappSubscriptionHandleOK) String() string { + return fmt.Sprintf("[DELETE /handles/xapp-subscription-handle][%d] deleteXappSubscriptionHandleOK ", 200) +} + +func (o *DeleteXappSubscriptionHandleOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteXappSubscriptionHandleNoContent creates a DeleteXappSubscriptionHandleNoContent with default headers values +func NewDeleteXappSubscriptionHandleNoContent() *DeleteXappSubscriptionHandleNoContent { + return &DeleteXappSubscriptionHandleNoContent{} +} + +/* +DeleteXappSubscriptionHandleNoContent describes a response with status code 204, with default header values. + +Content not found +*/ +type DeleteXappSubscriptionHandleNoContent struct { +} + +// IsSuccess returns true when this delete xapp subscription handle no content response has a 2xx status code +func (o *DeleteXappSubscriptionHandleNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete xapp subscription handle no content response has a 3xx status code +func (o *DeleteXappSubscriptionHandleNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete xapp subscription handle no content response has a 4xx status code +func (o *DeleteXappSubscriptionHandleNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete xapp subscription handle no content response has a 5xx status code +func (o *DeleteXappSubscriptionHandleNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete xapp subscription handle no content response a status code equal to that given +func (o *DeleteXappSubscriptionHandleNoContent) IsCode(code int) bool { + return code == 204 +} + +// Code gets the status code for the delete xapp subscription handle no content response +func (o *DeleteXappSubscriptionHandleNoContent) Code() int { + return 204 +} + +func (o *DeleteXappSubscriptionHandleNoContent) Error() string { + return fmt.Sprintf("[DELETE /handles/xapp-subscription-handle][%d] deleteXappSubscriptionHandleNoContent ", 204) +} + +func (o *DeleteXappSubscriptionHandleNoContent) String() string { + return fmt.Sprintf("[DELETE /handles/xapp-subscription-handle][%d] deleteXappSubscriptionHandleNoContent ", 204) +} + +func (o *DeleteXappSubscriptionHandleNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/rtmgr_client/handle/dissociate_ran_parameters.go b/pkg/rtmgr_client/handle/dissociate_ran_parameters.go new file mode 100644 index 0000000..d6f4138 --- /dev/null +++ b/pkg/rtmgr_client/handle/dissociate_ran_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_models" +) + +// NewDissociateRanParams creates a new DissociateRanParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDissociateRanParams() *DissociateRanParams { + return &DissociateRanParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDissociateRanParamsWithTimeout creates a new DissociateRanParams object +// with the ability to set a timeout on a request. +func NewDissociateRanParamsWithTimeout(timeout time.Duration) *DissociateRanParams { + return &DissociateRanParams{ + timeout: timeout, + } +} + +// NewDissociateRanParamsWithContext creates a new DissociateRanParams object +// with the ability to set a context for a request. +func NewDissociateRanParamsWithContext(ctx context.Context) *DissociateRanParams { + return &DissociateRanParams{ + Context: ctx, + } +} + +// NewDissociateRanParamsWithHTTPClient creates a new DissociateRanParams object +// with the ability to set a custom HTTPClient for a request. +func NewDissociateRanParamsWithHTTPClient(client *http.Client) *DissociateRanParams { + return &DissociateRanParams{ + HTTPClient: client, + } +} + +/* +DissociateRanParams contains all the parameters to send to the API endpoint + + for the dissociate ran operation. + + Typically these are written to a http.Request. +*/ +type DissociateRanParams struct { + + /* DissociateList. + + list of RAN to dissociate + */ + DissociateList rtmgr_models.RanE2tMap + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the dissociate ran params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DissociateRanParams) WithDefaults() *DissociateRanParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the dissociate ran params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DissociateRanParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the dissociate ran params +func (o *DissociateRanParams) WithTimeout(timeout time.Duration) *DissociateRanParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dissociate ran params +func (o *DissociateRanParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dissociate ran params +func (o *DissociateRanParams) WithContext(ctx context.Context) *DissociateRanParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dissociate ran params +func (o *DissociateRanParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dissociate ran params +func (o *DissociateRanParams) WithHTTPClient(client *http.Client) *DissociateRanParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dissociate ran params +func (o *DissociateRanParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDissociateList adds the dissociateList to the dissociate ran params +func (o *DissociateRanParams) WithDissociateList(dissociateList rtmgr_models.RanE2tMap) *DissociateRanParams { + o.SetDissociateList(dissociateList) + return o +} + +// SetDissociateList adds the dissociateList to the dissociate ran params +func (o *DissociateRanParams) SetDissociateList(dissociateList rtmgr_models.RanE2tMap) { + o.DissociateList = dissociateList +} + +// WriteToRequest writes these params to a swagger request +func (o *DissociateRanParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.DissociateList != nil { + if err := r.SetBodyParam(o.DissociateList); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/rtmgr_client/handle/dissociate_ran_responses.go b/pkg/rtmgr_client/handle/dissociate_ran_responses.go new file mode 100644 index 0000000..5bfcdf4 --- /dev/null +++ b/pkg/rtmgr_client/handle/dissociate_ran_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// DissociateRanReader is a Reader for the DissociateRan structure. +type DissociateRanReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DissociateRanReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewDissociateRanCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewDissociateRanBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /handles/dissociate-ran] dissociate_ran", response, response.Code()) + } +} + +// NewDissociateRanCreated creates a DissociateRanCreated with default headers values +func NewDissociateRanCreated() *DissociateRanCreated { + return &DissociateRanCreated{} +} + +/* +DissociateRanCreated describes a response with status code 201, with default header values. + +ran instances disociated +*/ +type DissociateRanCreated struct { +} + +// IsSuccess returns true when this dissociate ran created response has a 2xx status code +func (o *DissociateRanCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this dissociate ran created response has a 3xx status code +func (o *DissociateRanCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this dissociate ran created response has a 4xx status code +func (o *DissociateRanCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this dissociate ran created response has a 5xx status code +func (o *DissociateRanCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this dissociate ran created response a status code equal to that given +func (o *DissociateRanCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the dissociate ran created response +func (o *DissociateRanCreated) Code() int { + return 201 +} + +func (o *DissociateRanCreated) Error() string { + return fmt.Sprintf("[POST /handles/dissociate-ran][%d] dissociateRanCreated ", 201) +} + +func (o *DissociateRanCreated) String() string { + return fmt.Sprintf("[POST /handles/dissociate-ran][%d] dissociateRanCreated ", 201) +} + +func (o *DissociateRanCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDissociateRanBadRequest creates a DissociateRanBadRequest with default headers values +func NewDissociateRanBadRequest() *DissociateRanBadRequest { + return &DissociateRanBadRequest{} +} + +/* +DissociateRanBadRequest describes a response with status code 400, with default header values. + +Invalid data +*/ +type DissociateRanBadRequest struct { +} + +// IsSuccess returns true when this dissociate ran bad request response has a 2xx status code +func (o *DissociateRanBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this dissociate ran bad request response has a 3xx status code +func (o *DissociateRanBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this dissociate ran bad request response has a 4xx status code +func (o *DissociateRanBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this dissociate ran bad request response has a 5xx status code +func (o *DissociateRanBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this dissociate ran bad request response a status code equal to that given +func (o *DissociateRanBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the dissociate ran bad request response +func (o *DissociateRanBadRequest) Code() int { + return 400 +} + +func (o *DissociateRanBadRequest) Error() string { + return fmt.Sprintf("[POST /handles/dissociate-ran][%d] dissociateRanBadRequest ", 400) +} + +func (o *DissociateRanBadRequest) String() string { + return fmt.Sprintf("[POST /handles/dissociate-ran][%d] dissociateRanBadRequest ", 400) +} + +func (o *DissociateRanBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/rtmgr_client/handle/get_handles_parameters.go b/pkg/rtmgr_client/handle/get_handles_parameters.go new file mode 100644 index 0000000..f8684ce --- /dev/null +++ b/pkg/rtmgr_client/handle/get_handles_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetHandlesParams creates a new GetHandlesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetHandlesParams() *GetHandlesParams { + return &GetHandlesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetHandlesParamsWithTimeout creates a new GetHandlesParams object +// with the ability to set a timeout on a request. +func NewGetHandlesParamsWithTimeout(timeout time.Duration) *GetHandlesParams { + return &GetHandlesParams{ + timeout: timeout, + } +} + +// NewGetHandlesParamsWithContext creates a new GetHandlesParams object +// with the ability to set a context for a request. +func NewGetHandlesParamsWithContext(ctx context.Context) *GetHandlesParams { + return &GetHandlesParams{ + Context: ctx, + } +} + +// NewGetHandlesParamsWithHTTPClient creates a new GetHandlesParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetHandlesParamsWithHTTPClient(client *http.Client) *GetHandlesParams { + return &GetHandlesParams{ + HTTPClient: client, + } +} + +/* +GetHandlesParams contains all the parameters to send to the API endpoint + + for the get handles operation. + + Typically these are written to a http.Request. +*/ +type GetHandlesParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get handles params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetHandlesParams) WithDefaults() *GetHandlesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get handles params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetHandlesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get handles params +func (o *GetHandlesParams) WithTimeout(timeout time.Duration) *GetHandlesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get handles params +func (o *GetHandlesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get handles params +func (o *GetHandlesParams) WithContext(ctx context.Context) *GetHandlesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get handles params +func (o *GetHandlesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get handles params +func (o *GetHandlesParams) WithHTTPClient(client *http.Client) *GetHandlesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get handles params +func (o *GetHandlesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetHandlesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/rtmgr_client/handle/get_handles_responses.go b/pkg/rtmgr_client/handle/get_handles_responses.go new file mode 100644 index 0000000..a5a0a63 --- /dev/null +++ b/pkg/rtmgr_client/handle/get_handles_responses.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// GetHandlesReader is a Reader for the GetHandles structure. +type GetHandlesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetHandlesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetHandlesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("[GET /handles] get_handles", response, response.Code()) + } +} + +// NewGetHandlesOK creates a GetHandlesOK with default headers values +func NewGetHandlesOK() *GetHandlesOK { + return &GetHandlesOK{} +} + +/* +GetHandlesOK describes a response with status code 200, with default header values. + +Dummy response +*/ +type GetHandlesOK struct { +} + +// IsSuccess returns true when this get handles o k response has a 2xx status code +func (o *GetHandlesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get handles o k response has a 3xx status code +func (o *GetHandlesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get handles o k response has a 4xx status code +func (o *GetHandlesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get handles o k response has a 5xx status code +func (o *GetHandlesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get handles o k response a status code equal to that given +func (o *GetHandlesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get handles o k response +func (o *GetHandlesOK) Code() int { + return 200 +} + +func (o *GetHandlesOK) Error() string { + return fmt.Sprintf("[GET /handles][%d] getHandlesOK ", 200) +} + +func (o *GetHandlesOK) String() string { + return fmt.Sprintf("[GET /handles][%d] getHandlesOK ", 200) +} + +func (o *GetHandlesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/rtmgr_client/handle/handle_client.go b/pkg/rtmgr_client/handle/handle_client.go new file mode 100644 index 0000000..e7e59c4 --- /dev/null +++ b/pkg/rtmgr_client/handle/handle_client.go @@ -0,0 +1,502 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new handle API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for handle API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + AddRmrRoute(params *AddRmrRouteParams, opts ...ClientOption) (*AddRmrRouteCreated, error) + + AssociateRanToE2tHandle(params *AssociateRanToE2tHandleParams, opts ...ClientOption) (*AssociateRanToE2tHandleCreated, error) + + CreateNewE2tHandle(params *CreateNewE2tHandleParams, opts ...ClientOption) (*CreateNewE2tHandleCreated, error) + + DelRmrRoute(params *DelRmrRouteParams, opts ...ClientOption) (*DelRmrRouteCreated, error) + + DeleteE2tHandle(params *DeleteE2tHandleParams, opts ...ClientOption) (*DeleteE2tHandleCreated, error) + + DeleteXappSubscriptionHandle(params *DeleteXappSubscriptionHandleParams, opts ...ClientOption) (*DeleteXappSubscriptionHandleOK, *DeleteXappSubscriptionHandleNoContent, error) + + DissociateRan(params *DissociateRanParams, opts ...ClientOption) (*DissociateRanCreated, error) + + GetHandles(params *GetHandlesParams, opts ...ClientOption) (*GetHandlesOK, error) + + ProvideXappHandle(params *ProvideXappHandleParams, opts ...ClientOption) (*ProvideXappHandleCreated, error) + + ProvideXappSubscriptionHandle(params *ProvideXappSubscriptionHandleParams, opts ...ClientOption) (*ProvideXappSubscriptionHandleCreated, error) + + UpdateXappSubscriptionHandle(params *UpdateXappSubscriptionHandleParams, opts ...ClientOption) (*UpdateXappSubscriptionHandleCreated, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +AddRmrRoute APIs to add r m r routes + +By performing a POST method to add RMR routes +*/ +func (a *Client) AddRmrRoute(params *AddRmrRouteParams, opts ...ClientOption) (*AddRmrRouteCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAddRmrRouteParams() + } + op := &runtime.ClientOperation{ + ID: "add_rmr_route", + Method: "POST", + PathPattern: "/handles/addrmrroute", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &AddRmrRouteReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*AddRmrRouteCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for add_rmr_route: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +AssociateRanToE2tHandle APIs for associating a ran to e2t instance + +By performing a POST method on rane2tmapping, the API caller is able to update the Routing manager about the ran to e2t mapping which would be finally used to distribute routes to corresponding xApp and E2T instance +*/ +func (a *Client) AssociateRanToE2tHandle(params *AssociateRanToE2tHandleParams, opts ...ClientOption) (*AssociateRanToE2tHandleCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAssociateRanToE2tHandleParams() + } + op := &runtime.ClientOperation{ + ID: "associate_ran_to_e2t_handle", + Method: "POST", + PathPattern: "/handles/associate-ran-to-e2t", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &AssociateRanToE2tHandleReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*AssociateRanToE2tHandleCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for associate_ran_to_e2t_handle: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +CreateNewE2tHandle APIs for establishing platform routes when a new e2t instance gets added to platform + +E2T updates its FQDN to E2M during its initialisation, hence after E2M informs routing manager about new E2T instances FQDN. At this point Routing Mgr would establish platform routes +*/ +func (a *Client) CreateNewE2tHandle(params *CreateNewE2tHandleParams, opts ...ClientOption) (*CreateNewE2tHandleCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateNewE2tHandleParams() + } + op := &runtime.ClientOperation{ + ID: "create_new_e2t_handle", + Method: "POST", + PathPattern: "/handles/e2t", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CreateNewE2tHandleReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateNewE2tHandleCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for create_new_e2t_handle: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DelRmrRoute APIs to delete r m r routes + +By performing a DELETE method to add RMR routes +*/ +func (a *Client) DelRmrRoute(params *DelRmrRouteParams, opts ...ClientOption) (*DelRmrRouteCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDelRmrRouteParams() + } + op := &runtime.ClientOperation{ + ID: "del_rmr_route", + Method: "DELETE", + PathPattern: "/handles/delrmrroute", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DelRmrRouteReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DelRmrRouteCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for del_rmr_route: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteE2tHandle APIs for clearing routes specific to a particular e2 t instance + +E2M would monitor E2T instances using its keep alive based mechanism during this time if an E2T instance is detected to be dead, E2M would distribute already associated ran's to other available/healthy E2T instances. Here E2M would share E2T instance address to be removed OR which is unhealthy and list of RAN instances to be dissociated and an association list which contains E2T FQDN and associated RAN names +*/ +func (a *Client) DeleteE2tHandle(params *DeleteE2tHandleParams, opts ...ClientOption) (*DeleteE2tHandleCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteE2tHandleParams() + } + op := &runtime.ClientOperation{ + ID: "delete_e2t_handle", + Method: "DELETE", + PathPattern: "/handles/e2t", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteE2tHandleReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteE2tHandleCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for delete_e2t_handle: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DeleteXappSubscriptionHandle APIs for deleting an xapp subscription + +By performing the delete operation on xapp-subscription-handle resource, the API caller will be able to update routing manager about the deletion of an xapp's subscription +*/ +func (a *Client) DeleteXappSubscriptionHandle(params *DeleteXappSubscriptionHandleParams, opts ...ClientOption) (*DeleteXappSubscriptionHandleOK, *DeleteXappSubscriptionHandleNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteXappSubscriptionHandleParams() + } + op := &runtime.ClientOperation{ + ID: "delete_xapp_subscription_handle", + Method: "DELETE", + PathPattern: "/handles/xapp-subscription-handle", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteXappSubscriptionHandleReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, nil, err + } + switch value := result.(type) { + case *DeleteXappSubscriptionHandleOK: + return value, nil, nil + case *DeleteXappSubscriptionHandleNoContent: + return nil, value, nil + } + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for handle: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +DissociateRan APIs to dissociate ran from e2t + +By performing a POST method on rane2tmapping, routing manager will dissociate ran name from e2t instance by updating or clearing routes +*/ +func (a *Client) DissociateRan(params *DissociateRanParams, opts ...ClientOption) (*DissociateRanCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDissociateRanParams() + } + op := &runtime.ClientOperation{ + ID: "dissociate_ran", + Method: "POST", + PathPattern: "/handles/dissociate-ran", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DissociateRanReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DissociateRanCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for dissociate_ran: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +GetHandles placeholders for further usage + +Placeholder for further usage. +*/ +func (a *Client) GetHandles(params *GetHandlesParams, opts ...ClientOption) (*GetHandlesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetHandlesParams() + } + op := &runtime.ClientOperation{ + ID: "get_handles", + Method: "GET", + PathPattern: "/handles", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetHandlesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetHandlesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for get_handles: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ProvideXappHandle provides callback + +By performing a POST method on the xapp-handle resource, the API caller is able to perform a callback on Routing Manager. +*/ +func (a *Client) ProvideXappHandle(params *ProvideXappHandleParams, opts ...ClientOption) (*ProvideXappHandleCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewProvideXappHandleParams() + } + op := &runtime.ClientOperation{ + ID: "provide_xapp_handle", + Method: "POST", + PathPattern: "/handles/xapp-handle", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ProvideXappHandleReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ProvideXappHandleCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for provide_xapp_handle: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ProvideXappSubscriptionHandle APIs for updating about new xapp subscription + +By performing a POST method on the xapp-subscription-handle resource, the API caller is able to update the Routing manager about the creation of new subscription by an Xapp instance. +*/ +func (a *Client) ProvideXappSubscriptionHandle(params *ProvideXappSubscriptionHandleParams, opts ...ClientOption) (*ProvideXappSubscriptionHandleCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewProvideXappSubscriptionHandleParams() + } + op := &runtime.ClientOperation{ + ID: "provide_xapp_subscription_handle", + Method: "POST", + PathPattern: "/handles/xapp-subscription-handle", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ProvideXappSubscriptionHandleReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ProvideXappSubscriptionHandleCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for provide_xapp_subscription_handle: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +UpdateXappSubscriptionHandle APIs for updating the subscriber x app list + +By performing a PUT method on a xapp-subscription-handle/{subscription_id} resource, the API caller is able to update the Routing manager about the list of subscriber xApps related to the subscription denoted by the {subsription_id}. +*/ +func (a *Client) UpdateXappSubscriptionHandle(params *UpdateXappSubscriptionHandleParams, opts ...ClientOption) (*UpdateXappSubscriptionHandleCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateXappSubscriptionHandleParams() + } + op := &runtime.ClientOperation{ + ID: "update_xapp_subscription_handle", + Method: "PUT", + PathPattern: "/handles/xapp-subscription-handle/{subscription_id}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateXappSubscriptionHandleReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateXappSubscriptionHandleCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for update_xapp_subscription_handle: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/rtmgr_client/handle/provide_xapp_handle_parameters.go b/pkg/rtmgr_client/handle/provide_xapp_handle_parameters.go new file mode 100644 index 0000000..b297e05 --- /dev/null +++ b/pkg/rtmgr_client/handle/provide_xapp_handle_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_models" +) + +// NewProvideXappHandleParams creates a new ProvideXappHandleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewProvideXappHandleParams() *ProvideXappHandleParams { + return &ProvideXappHandleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewProvideXappHandleParamsWithTimeout creates a new ProvideXappHandleParams object +// with the ability to set a timeout on a request. +func NewProvideXappHandleParamsWithTimeout(timeout time.Duration) *ProvideXappHandleParams { + return &ProvideXappHandleParams{ + timeout: timeout, + } +} + +// NewProvideXappHandleParamsWithContext creates a new ProvideXappHandleParams object +// with the ability to set a context for a request. +func NewProvideXappHandleParamsWithContext(ctx context.Context) *ProvideXappHandleParams { + return &ProvideXappHandleParams{ + Context: ctx, + } +} + +// NewProvideXappHandleParamsWithHTTPClient creates a new ProvideXappHandleParams object +// with the ability to set a custom HTTPClient for a request. +func NewProvideXappHandleParamsWithHTTPClient(client *http.Client) *ProvideXappHandleParams { + return &ProvideXappHandleParams{ + HTTPClient: client, + } +} + +/* +ProvideXappHandleParams contains all the parameters to send to the API endpoint + + for the provide xapp handle operation. + + Typically these are written to a http.Request. +*/ +type ProvideXappHandleParams struct { + + /* XappCallbackData. + + xApp related callback data + */ + XappCallbackData *rtmgr_models.XappCallbackData + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the provide xapp handle params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ProvideXappHandleParams) WithDefaults() *ProvideXappHandleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the provide xapp handle params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ProvideXappHandleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the provide xapp handle params +func (o *ProvideXappHandleParams) WithTimeout(timeout time.Duration) *ProvideXappHandleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the provide xapp handle params +func (o *ProvideXappHandleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the provide xapp handle params +func (o *ProvideXappHandleParams) WithContext(ctx context.Context) *ProvideXappHandleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the provide xapp handle params +func (o *ProvideXappHandleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the provide xapp handle params +func (o *ProvideXappHandleParams) WithHTTPClient(client *http.Client) *ProvideXappHandleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the provide xapp handle params +func (o *ProvideXappHandleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithXappCallbackData adds the xappCallbackData to the provide xapp handle params +func (o *ProvideXappHandleParams) WithXappCallbackData(xappCallbackData *rtmgr_models.XappCallbackData) *ProvideXappHandleParams { + o.SetXappCallbackData(xappCallbackData) + return o +} + +// SetXappCallbackData adds the xappCallbackData to the provide xapp handle params +func (o *ProvideXappHandleParams) SetXappCallbackData(xappCallbackData *rtmgr_models.XappCallbackData) { + o.XappCallbackData = xappCallbackData +} + +// WriteToRequest writes these params to a swagger request +func (o *ProvideXappHandleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.XappCallbackData != nil { + if err := r.SetBodyParam(o.XappCallbackData); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/rtmgr_client/handle/provide_xapp_handle_responses.go b/pkg/rtmgr_client/handle/provide_xapp_handle_responses.go new file mode 100644 index 0000000..266fde6 --- /dev/null +++ b/pkg/rtmgr_client/handle/provide_xapp_handle_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ProvideXappHandleReader is a Reader for the ProvideXappHandle structure. +type ProvideXappHandleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ProvideXappHandleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewProvideXappHandleCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewProvideXappHandleBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /handles/xapp-handle] provide_xapp_handle", response, response.Code()) + } +} + +// NewProvideXappHandleCreated creates a ProvideXappHandleCreated with default headers values +func NewProvideXappHandleCreated() *ProvideXappHandleCreated { + return &ProvideXappHandleCreated{} +} + +/* +ProvideXappHandleCreated describes a response with status code 201, with default header values. + +Callback received +*/ +type ProvideXappHandleCreated struct { +} + +// IsSuccess returns true when this provide xapp handle created response has a 2xx status code +func (o *ProvideXappHandleCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this provide xapp handle created response has a 3xx status code +func (o *ProvideXappHandleCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this provide xapp handle created response has a 4xx status code +func (o *ProvideXappHandleCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this provide xapp handle created response has a 5xx status code +func (o *ProvideXappHandleCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this provide xapp handle created response a status code equal to that given +func (o *ProvideXappHandleCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the provide xapp handle created response +func (o *ProvideXappHandleCreated) Code() int { + return 201 +} + +func (o *ProvideXappHandleCreated) Error() string { + return fmt.Sprintf("[POST /handles/xapp-handle][%d] provideXappHandleCreated ", 201) +} + +func (o *ProvideXappHandleCreated) String() string { + return fmt.Sprintf("[POST /handles/xapp-handle][%d] provideXappHandleCreated ", 201) +} + +func (o *ProvideXappHandleCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewProvideXappHandleBadRequest creates a ProvideXappHandleBadRequest with default headers values +func NewProvideXappHandleBadRequest() *ProvideXappHandleBadRequest { + return &ProvideXappHandleBadRequest{} +} + +/* +ProvideXappHandleBadRequest describes a response with status code 400, with default header values. + +Invalid data +*/ +type ProvideXappHandleBadRequest struct { +} + +// IsSuccess returns true when this provide xapp handle bad request response has a 2xx status code +func (o *ProvideXappHandleBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this provide xapp handle bad request response has a 3xx status code +func (o *ProvideXappHandleBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this provide xapp handle bad request response has a 4xx status code +func (o *ProvideXappHandleBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this provide xapp handle bad request response has a 5xx status code +func (o *ProvideXappHandleBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this provide xapp handle bad request response a status code equal to that given +func (o *ProvideXappHandleBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the provide xapp handle bad request response +func (o *ProvideXappHandleBadRequest) Code() int { + return 400 +} + +func (o *ProvideXappHandleBadRequest) Error() string { + return fmt.Sprintf("[POST /handles/xapp-handle][%d] provideXappHandleBadRequest ", 400) +} + +func (o *ProvideXappHandleBadRequest) String() string { + return fmt.Sprintf("[POST /handles/xapp-handle][%d] provideXappHandleBadRequest ", 400) +} + +func (o *ProvideXappHandleBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/rtmgr_client/handle/provide_xapp_subscription_handle_parameters.go b/pkg/rtmgr_client/handle/provide_xapp_subscription_handle_parameters.go new file mode 100644 index 0000000..f38fb5a --- /dev/null +++ b/pkg/rtmgr_client/handle/provide_xapp_subscription_handle_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_models" +) + +// NewProvideXappSubscriptionHandleParams creates a new ProvideXappSubscriptionHandleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewProvideXappSubscriptionHandleParams() *ProvideXappSubscriptionHandleParams { + return &ProvideXappSubscriptionHandleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewProvideXappSubscriptionHandleParamsWithTimeout creates a new ProvideXappSubscriptionHandleParams object +// with the ability to set a timeout on a request. +func NewProvideXappSubscriptionHandleParamsWithTimeout(timeout time.Duration) *ProvideXappSubscriptionHandleParams { + return &ProvideXappSubscriptionHandleParams{ + timeout: timeout, + } +} + +// NewProvideXappSubscriptionHandleParamsWithContext creates a new ProvideXappSubscriptionHandleParams object +// with the ability to set a context for a request. +func NewProvideXappSubscriptionHandleParamsWithContext(ctx context.Context) *ProvideXappSubscriptionHandleParams { + return &ProvideXappSubscriptionHandleParams{ + Context: ctx, + } +} + +// NewProvideXappSubscriptionHandleParamsWithHTTPClient creates a new ProvideXappSubscriptionHandleParams object +// with the ability to set a custom HTTPClient for a request. +func NewProvideXappSubscriptionHandleParamsWithHTTPClient(client *http.Client) *ProvideXappSubscriptionHandleParams { + return &ProvideXappSubscriptionHandleParams{ + HTTPClient: client, + } +} + +/* +ProvideXappSubscriptionHandleParams contains all the parameters to send to the API endpoint + + for the provide xapp subscription handle operation. + + Typically these are written to a http.Request. +*/ +type ProvideXappSubscriptionHandleParams struct { + + /* XappSubscriptionData. + + xApp related subscription data + */ + XappSubscriptionData *rtmgr_models.XappSubscriptionData + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the provide xapp subscription handle params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ProvideXappSubscriptionHandleParams) WithDefaults() *ProvideXappSubscriptionHandleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the provide xapp subscription handle params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ProvideXappSubscriptionHandleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the provide xapp subscription handle params +func (o *ProvideXappSubscriptionHandleParams) WithTimeout(timeout time.Duration) *ProvideXappSubscriptionHandleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the provide xapp subscription handle params +func (o *ProvideXappSubscriptionHandleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the provide xapp subscription handle params +func (o *ProvideXappSubscriptionHandleParams) WithContext(ctx context.Context) *ProvideXappSubscriptionHandleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the provide xapp subscription handle params +func (o *ProvideXappSubscriptionHandleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the provide xapp subscription handle params +func (o *ProvideXappSubscriptionHandleParams) WithHTTPClient(client *http.Client) *ProvideXappSubscriptionHandleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the provide xapp subscription handle params +func (o *ProvideXappSubscriptionHandleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithXappSubscriptionData adds the xappSubscriptionData to the provide xapp subscription handle params +func (o *ProvideXappSubscriptionHandleParams) WithXappSubscriptionData(xappSubscriptionData *rtmgr_models.XappSubscriptionData) *ProvideXappSubscriptionHandleParams { + o.SetXappSubscriptionData(xappSubscriptionData) + return o +} + +// SetXappSubscriptionData adds the xappSubscriptionData to the provide xapp subscription handle params +func (o *ProvideXappSubscriptionHandleParams) SetXappSubscriptionData(xappSubscriptionData *rtmgr_models.XappSubscriptionData) { + o.XappSubscriptionData = xappSubscriptionData +} + +// WriteToRequest writes these params to a swagger request +func (o *ProvideXappSubscriptionHandleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.XappSubscriptionData != nil { + if err := r.SetBodyParam(o.XappSubscriptionData); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/rtmgr_client/handle/provide_xapp_subscription_handle_responses.go b/pkg/rtmgr_client/handle/provide_xapp_subscription_handle_responses.go new file mode 100644 index 0000000..d150150 --- /dev/null +++ b/pkg/rtmgr_client/handle/provide_xapp_subscription_handle_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// ProvideXappSubscriptionHandleReader is a Reader for the ProvideXappSubscriptionHandle structure. +type ProvideXappSubscriptionHandleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ProvideXappSubscriptionHandleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewProvideXappSubscriptionHandleCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewProvideXappSubscriptionHandleBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /handles/xapp-subscription-handle] provide_xapp_subscription_handle", response, response.Code()) + } +} + +// NewProvideXappSubscriptionHandleCreated creates a ProvideXappSubscriptionHandleCreated with default headers values +func NewProvideXappSubscriptionHandleCreated() *ProvideXappSubscriptionHandleCreated { + return &ProvideXappSubscriptionHandleCreated{} +} + +/* +ProvideXappSubscriptionHandleCreated describes a response with status code 201, with default header values. + +Xapp Subscription data received +*/ +type ProvideXappSubscriptionHandleCreated struct { +} + +// IsSuccess returns true when this provide xapp subscription handle created response has a 2xx status code +func (o *ProvideXappSubscriptionHandleCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this provide xapp subscription handle created response has a 3xx status code +func (o *ProvideXappSubscriptionHandleCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this provide xapp subscription handle created response has a 4xx status code +func (o *ProvideXappSubscriptionHandleCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this provide xapp subscription handle created response has a 5xx status code +func (o *ProvideXappSubscriptionHandleCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this provide xapp subscription handle created response a status code equal to that given +func (o *ProvideXappSubscriptionHandleCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the provide xapp subscription handle created response +func (o *ProvideXappSubscriptionHandleCreated) Code() int { + return 201 +} + +func (o *ProvideXappSubscriptionHandleCreated) Error() string { + return fmt.Sprintf("[POST /handles/xapp-subscription-handle][%d] provideXappSubscriptionHandleCreated ", 201) +} + +func (o *ProvideXappSubscriptionHandleCreated) String() string { + return fmt.Sprintf("[POST /handles/xapp-subscription-handle][%d] provideXappSubscriptionHandleCreated ", 201) +} + +func (o *ProvideXappSubscriptionHandleCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewProvideXappSubscriptionHandleBadRequest creates a ProvideXappSubscriptionHandleBadRequest with default headers values +func NewProvideXappSubscriptionHandleBadRequest() *ProvideXappSubscriptionHandleBadRequest { + return &ProvideXappSubscriptionHandleBadRequest{} +} + +/* +ProvideXappSubscriptionHandleBadRequest describes a response with status code 400, with default header values. + +Invalid data +*/ +type ProvideXappSubscriptionHandleBadRequest struct { +} + +// IsSuccess returns true when this provide xapp subscription handle bad request response has a 2xx status code +func (o *ProvideXappSubscriptionHandleBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this provide xapp subscription handle bad request response has a 3xx status code +func (o *ProvideXappSubscriptionHandleBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this provide xapp subscription handle bad request response has a 4xx status code +func (o *ProvideXappSubscriptionHandleBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this provide xapp subscription handle bad request response has a 5xx status code +func (o *ProvideXappSubscriptionHandleBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this provide xapp subscription handle bad request response a status code equal to that given +func (o *ProvideXappSubscriptionHandleBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the provide xapp subscription handle bad request response +func (o *ProvideXappSubscriptionHandleBadRequest) Code() int { + return 400 +} + +func (o *ProvideXappSubscriptionHandleBadRequest) Error() string { + return fmt.Sprintf("[POST /handles/xapp-subscription-handle][%d] provideXappSubscriptionHandleBadRequest ", 400) +} + +func (o *ProvideXappSubscriptionHandleBadRequest) String() string { + return fmt.Sprintf("[POST /handles/xapp-subscription-handle][%d] provideXappSubscriptionHandleBadRequest ", 400) +} + +func (o *ProvideXappSubscriptionHandleBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/rtmgr_client/handle/update_xapp_subscription_handle_parameters.go b/pkg/rtmgr_client/handle/update_xapp_subscription_handle_parameters.go new file mode 100644 index 0000000..fd70047 --- /dev/null +++ b/pkg/rtmgr_client/handle/update_xapp_subscription_handle_parameters.go @@ -0,0 +1,178 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_models" +) + +// NewUpdateXappSubscriptionHandleParams creates a new UpdateXappSubscriptionHandleParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateXappSubscriptionHandleParams() *UpdateXappSubscriptionHandleParams { + return &UpdateXappSubscriptionHandleParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateXappSubscriptionHandleParamsWithTimeout creates a new UpdateXappSubscriptionHandleParams object +// with the ability to set a timeout on a request. +func NewUpdateXappSubscriptionHandleParamsWithTimeout(timeout time.Duration) *UpdateXappSubscriptionHandleParams { + return &UpdateXappSubscriptionHandleParams{ + timeout: timeout, + } +} + +// NewUpdateXappSubscriptionHandleParamsWithContext creates a new UpdateXappSubscriptionHandleParams object +// with the ability to set a context for a request. +func NewUpdateXappSubscriptionHandleParamsWithContext(ctx context.Context) *UpdateXappSubscriptionHandleParams { + return &UpdateXappSubscriptionHandleParams{ + Context: ctx, + } +} + +// NewUpdateXappSubscriptionHandleParamsWithHTTPClient creates a new UpdateXappSubscriptionHandleParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateXappSubscriptionHandleParamsWithHTTPClient(client *http.Client) *UpdateXappSubscriptionHandleParams { + return &UpdateXappSubscriptionHandleParams{ + HTTPClient: client, + } +} + +/* +UpdateXappSubscriptionHandleParams contains all the parameters to send to the API endpoint + + for the update xapp subscription handle operation. + + Typically these are written to a http.Request. +*/ +type UpdateXappSubscriptionHandleParams struct { + + /* SubscriptionID. + + Subscription ID + + Format: uint16 + */ + SubscriptionID uint16 + + /* XappList. + + xApp list + */ + XappList rtmgr_models.XappList + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update xapp subscription handle params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateXappSubscriptionHandleParams) WithDefaults() *UpdateXappSubscriptionHandleParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update xapp subscription handle params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateXappSubscriptionHandleParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update xapp subscription handle params +func (o *UpdateXappSubscriptionHandleParams) WithTimeout(timeout time.Duration) *UpdateXappSubscriptionHandleParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update xapp subscription handle params +func (o *UpdateXappSubscriptionHandleParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update xapp subscription handle params +func (o *UpdateXappSubscriptionHandleParams) WithContext(ctx context.Context) *UpdateXappSubscriptionHandleParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update xapp subscription handle params +func (o *UpdateXappSubscriptionHandleParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update xapp subscription handle params +func (o *UpdateXappSubscriptionHandleParams) WithHTTPClient(client *http.Client) *UpdateXappSubscriptionHandleParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update xapp subscription handle params +func (o *UpdateXappSubscriptionHandleParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSubscriptionID adds the subscriptionID to the update xapp subscription handle params +func (o *UpdateXappSubscriptionHandleParams) WithSubscriptionID(subscriptionID uint16) *UpdateXappSubscriptionHandleParams { + o.SetSubscriptionID(subscriptionID) + return o +} + +// SetSubscriptionID adds the subscriptionId to the update xapp subscription handle params +func (o *UpdateXappSubscriptionHandleParams) SetSubscriptionID(subscriptionID uint16) { + o.SubscriptionID = subscriptionID +} + +// WithXappList adds the xappList to the update xapp subscription handle params +func (o *UpdateXappSubscriptionHandleParams) WithXappList(xappList rtmgr_models.XappList) *UpdateXappSubscriptionHandleParams { + o.SetXappList(xappList) + return o +} + +// SetXappList adds the xappList to the update xapp subscription handle params +func (o *UpdateXappSubscriptionHandleParams) SetXappList(xappList rtmgr_models.XappList) { + o.XappList = xappList +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateXappSubscriptionHandleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param subscription_id + if err := r.SetPathParam("subscription_id", swag.FormatUint16(o.SubscriptionID)); err != nil { + return err + } + if o.XappList != nil { + if err := r.SetBodyParam(o.XappList); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/rtmgr_client/handle/update_xapp_subscription_handle_responses.go b/pkg/rtmgr_client/handle/update_xapp_subscription_handle_responses.go new file mode 100644 index 0000000..19f0b0a --- /dev/null +++ b/pkg/rtmgr_client/handle/update_xapp_subscription_handle_responses.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package handle + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateXappSubscriptionHandleReader is a Reader for the UpdateXappSubscriptionHandle structure. +type UpdateXappSubscriptionHandleReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateXappSubscriptionHandleReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewUpdateXappSubscriptionHandleCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateXappSubscriptionHandleBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PUT /handles/xapp-subscription-handle/{subscription_id}] update_xapp_subscription_handle", response, response.Code()) + } +} + +// NewUpdateXappSubscriptionHandleCreated creates a UpdateXappSubscriptionHandleCreated with default headers values +func NewUpdateXappSubscriptionHandleCreated() *UpdateXappSubscriptionHandleCreated { + return &UpdateXappSubscriptionHandleCreated{} +} + +/* +UpdateXappSubscriptionHandleCreated describes a response with status code 201, with default header values. + +Xapp list received +*/ +type UpdateXappSubscriptionHandleCreated struct { +} + +// IsSuccess returns true when this update xapp subscription handle created response has a 2xx status code +func (o *UpdateXappSubscriptionHandleCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update xapp subscription handle created response has a 3xx status code +func (o *UpdateXappSubscriptionHandleCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update xapp subscription handle created response has a 4xx status code +func (o *UpdateXappSubscriptionHandleCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this update xapp subscription handle created response has a 5xx status code +func (o *UpdateXappSubscriptionHandleCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this update xapp subscription handle created response a status code equal to that given +func (o *UpdateXappSubscriptionHandleCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the update xapp subscription handle created response +func (o *UpdateXappSubscriptionHandleCreated) Code() int { + return 201 +} + +func (o *UpdateXappSubscriptionHandleCreated) Error() string { + return fmt.Sprintf("[PUT /handles/xapp-subscription-handle/{subscription_id}][%d] updateXappSubscriptionHandleCreated ", 201) +} + +func (o *UpdateXappSubscriptionHandleCreated) String() string { + return fmt.Sprintf("[PUT /handles/xapp-subscription-handle/{subscription_id}][%d] updateXappSubscriptionHandleCreated ", 201) +} + +func (o *UpdateXappSubscriptionHandleCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewUpdateXappSubscriptionHandleBadRequest creates a UpdateXappSubscriptionHandleBadRequest with default headers values +func NewUpdateXappSubscriptionHandleBadRequest() *UpdateXappSubscriptionHandleBadRequest { + return &UpdateXappSubscriptionHandleBadRequest{} +} + +/* +UpdateXappSubscriptionHandleBadRequest describes a response with status code 400, with default header values. + +Invalid data +*/ +type UpdateXappSubscriptionHandleBadRequest struct { +} + +// IsSuccess returns true when this update xapp subscription handle bad request response has a 2xx status code +func (o *UpdateXappSubscriptionHandleBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update xapp subscription handle bad request response has a 3xx status code +func (o *UpdateXappSubscriptionHandleBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update xapp subscription handle bad request response has a 4xx status code +func (o *UpdateXappSubscriptionHandleBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update xapp subscription handle bad request response has a 5xx status code +func (o *UpdateXappSubscriptionHandleBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update xapp subscription handle bad request response a status code equal to that given +func (o *UpdateXappSubscriptionHandleBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update xapp subscription handle bad request response +func (o *UpdateXappSubscriptionHandleBadRequest) Code() int { + return 400 +} + +func (o *UpdateXappSubscriptionHandleBadRequest) Error() string { + return fmt.Sprintf("[PUT /handles/xapp-subscription-handle/{subscription_id}][%d] updateXappSubscriptionHandleBadRequest ", 400) +} + +func (o *UpdateXappSubscriptionHandleBadRequest) String() string { + return fmt.Sprintf("[PUT /handles/xapp-subscription-handle/{subscription_id}][%d] updateXappSubscriptionHandleBadRequest ", 400) +} + +func (o *UpdateXappSubscriptionHandleBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/rtmgr_client/health/get_health_parameters.go b/pkg/rtmgr_client/health/get_health_parameters.go new file mode 100644 index 0000000..31a9377 --- /dev/null +++ b/pkg/rtmgr_client/health/get_health_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package health + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetHealthParams creates a new GetHealthParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetHealthParams() *GetHealthParams { + return &GetHealthParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetHealthParamsWithTimeout creates a new GetHealthParams object +// with the ability to set a timeout on a request. +func NewGetHealthParamsWithTimeout(timeout time.Duration) *GetHealthParams { + return &GetHealthParams{ + timeout: timeout, + } +} + +// NewGetHealthParamsWithContext creates a new GetHealthParams object +// with the ability to set a context for a request. +func NewGetHealthParamsWithContext(ctx context.Context) *GetHealthParams { + return &GetHealthParams{ + Context: ctx, + } +} + +// NewGetHealthParamsWithHTTPClient creates a new GetHealthParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetHealthParamsWithHTTPClient(client *http.Client) *GetHealthParams { + return &GetHealthParams{ + HTTPClient: client, + } +} + +/* +GetHealthParams contains all the parameters to send to the API endpoint + + for the get health operation. + + Typically these are written to a http.Request. +*/ +type GetHealthParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get health params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetHealthParams) WithDefaults() *GetHealthParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get health params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetHealthParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get health params +func (o *GetHealthParams) WithTimeout(timeout time.Duration) *GetHealthParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get health params +func (o *GetHealthParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get health params +func (o *GetHealthParams) WithContext(ctx context.Context) *GetHealthParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get health params +func (o *GetHealthParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get health params +func (o *GetHealthParams) WithHTTPClient(client *http.Client) *GetHealthParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get health params +func (o *GetHealthParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetHealthParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/rtmgr_client/health/get_health_responses.go b/pkg/rtmgr_client/health/get_health_responses.go new file mode 100644 index 0000000..9c712ad --- /dev/null +++ b/pkg/rtmgr_client/health/get_health_responses.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package health + +// 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" + "github.com/go-openapi/strfmt" + + "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_models" +) + +// GetHealthReader is a Reader for the GetHealth structure. +type GetHealthReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetHealthReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetHealthOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + return nil, runtime.NewAPIError("[GET /health] get_health", response, response.Code()) + } +} + +// NewGetHealthOK creates a GetHealthOK with default headers values +func NewGetHealthOK() *GetHealthOK { + return &GetHealthOK{} +} + +/* +GetHealthOK describes a response with status code 200, with default header values. + +The health of the system +*/ +type GetHealthOK struct { + Payload *rtmgr_models.HealthStatus +} + +// IsSuccess returns true when this get health o k response has a 2xx status code +func (o *GetHealthOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get health o k response has a 3xx status code +func (o *GetHealthOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get health o k response has a 4xx status code +func (o *GetHealthOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get health o k response has a 5xx status code +func (o *GetHealthOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get health o k response a status code equal to that given +func (o *GetHealthOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get health o k response +func (o *GetHealthOK) Code() int { + return 200 +} + +func (o *GetHealthOK) Error() string { + return fmt.Sprintf("[GET /health][%d] getHealthOK %+v", 200, o.Payload) +} + +func (o *GetHealthOK) String() string { + return fmt.Sprintf("[GET /health][%d] getHealthOK %+v", 200, o.Payload) +} + +func (o *GetHealthOK) GetPayload() *rtmgr_models.HealthStatus { + return o.Payload +} + +func (o *GetHealthOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(rtmgr_models.HealthStatus) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/rtmgr_client/health/health_client.go b/pkg/rtmgr_client/health/health_client.go new file mode 100644 index 0000000..7237636 --- /dev/null +++ b/pkg/rtmgr_client/health/health_client.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package health + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new health API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for health API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetHealth(params *GetHealthParams, opts ...ClientOption) (*GetHealthOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +GetHealth retrives the health of routing manager + +By performing a GET method on the health resource, the API caller is able to retrieve the health of Routing Manager +*/ +func (a *Client) GetHealth(params *GetHealthParams, opts ...ClientOption) (*GetHealthOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetHealthParams() + } + op := &runtime.ClientOperation{ + ID: "get_health", + Method: "GET", + PathPattern: "/health", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetHealthReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetHealthOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for get_health: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/rtmgr_client/routing_manager_client.go b/pkg/rtmgr_client/routing_manager_client.go new file mode 100644 index 0000000..6152ea2 --- /dev/null +++ b/pkg/rtmgr_client/routing_manager_client.go @@ -0,0 +1,122 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package rtmgr_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" + "github.com/go-openapi/strfmt" + + "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_client/debug" + "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_client/handle" + "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_client/health" +) + +// Default routing manager HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "rtmgr" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/ric/v1" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new routing manager HTTP client. +func NewHTTPClient(formats strfmt.Registry) *RoutingManager { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new routing manager HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *RoutingManager { + // 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 routing manager client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *RoutingManager { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(RoutingManager) + cli.Transport = transport + cli.Debug = debug.New(transport, formats) + cli.Handle = handle.New(transport, formats) + cli.Health = health.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 +} + +// RoutingManager is a client for routing manager +type RoutingManager struct { + Debug debug.ClientService + + Handle handle.ClientService + + Health health.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *RoutingManager) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.Debug.SetTransport(transport) + c.Handle.SetTransport(transport) + c.Health.SetTransport(transport) +} diff --git a/pkg/rtmgr_models/add_rmr_route.go b/pkg/rtmgr_models/add_rmr_route.go new file mode 100644 index 0000000..17777eb --- /dev/null +++ b/pkg/rtmgr_models/add_rmr_route.go @@ -0,0 +1,94 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package rtmgr_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// AddRmrRoute add rmr route +// +// swagger:model add-rmr-route +type AddRmrRoute struct { + + // message type + // Required: true + MessageType *uint32 `json:"MessageType"` + + // sender end point + SenderEndPoint string `json:"SenderEndPoint,omitempty"` + + // subscription ID + SubscriptionID int32 `json:"SubscriptionID,omitempty"` + + // target end point + // Required: true + TargetEndPoint *string `json:"TargetEndPoint"` +} + +// Validate validates this add rmr route +func (m *AddRmrRoute) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMessageType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTargetEndPoint(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *AddRmrRoute) validateMessageType(formats strfmt.Registry) error { + + if err := validate.Required("MessageType", "body", m.MessageType); err != nil { + return err + } + + return nil +} + +func (m *AddRmrRoute) validateTargetEndPoint(formats strfmt.Registry) error { + + if err := validate.Required("TargetEndPoint", "body", m.TargetEndPoint); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this add rmr route based on context it is used +func (m *AddRmrRoute) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *AddRmrRoute) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *AddRmrRoute) UnmarshalBinary(b []byte) error { + var res AddRmrRoute + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/rtmgr_models/debuginfo.go b/pkg/rtmgr_models/debuginfo.go new file mode 100644 index 0000000..ed0abd5 --- /dev/null +++ b/pkg/rtmgr_models/debuginfo.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package rtmgr_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Debuginfo debuginfo +// +// swagger:model debuginfo +type Debuginfo struct { + + // route configs + RouteConfigs string `json:"RouteConfigs,omitempty"` + + // route table + // Required: true + RouteTable []string `json:"RouteTable"` +} + +// Validate validates this debuginfo +func (m *Debuginfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRouteTable(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Debuginfo) validateRouteTable(formats strfmt.Registry) error { + + if err := validate.Required("RouteTable", "body", m.RouteTable); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this debuginfo based on context it is used +func (m *Debuginfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Debuginfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Debuginfo) UnmarshalBinary(b []byte) error { + var res Debuginfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/rtmgr_models/e2t_data.go b/pkg/rtmgr_models/e2t_data.go new file mode 100644 index 0000000..f3a648f --- /dev/null +++ b/pkg/rtmgr_models/e2t_data.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package rtmgr_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// E2tData e2t data +// +// swagger:model e2t-data +type E2tData struct { + + // e2 t address + // Required: true + E2TAddress *string `json:"E2TAddress"` + + // ran namelist + RanNamelist RanNamelist `json:"ranNamelist,omitempty"` +} + +// Validate validates this e2t data +func (m *E2tData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateE2TAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRanNamelist(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *E2tData) validateE2TAddress(formats strfmt.Registry) error { + + if err := validate.Required("E2TAddress", "body", m.E2TAddress); err != nil { + return err + } + + return nil +} + +func (m *E2tData) validateRanNamelist(formats strfmt.Registry) error { + if swag.IsZero(m.RanNamelist) { // not required + return nil + } + + if err := m.RanNamelist.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ranNamelist") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ranNamelist") + } + return err + } + + return nil +} + +// ContextValidate validate this e2t data based on the context it is used +func (m *E2tData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRanNamelist(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *E2tData) contextValidateRanNamelist(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RanNamelist.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ranNamelist") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ranNamelist") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *E2tData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *E2tData) UnmarshalBinary(b []byte) error { + var res E2tData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/rtmgr_models/e2t_delete_data.go b/pkg/rtmgr_models/e2t_delete_data.go new file mode 100644 index 0000000..3dde091 --- /dev/null +++ b/pkg/rtmgr_models/e2t_delete_data.go @@ -0,0 +1,160 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package rtmgr_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// E2tDeleteData e2t delete data +// +// swagger:model e2t-delete-data +type E2tDeleteData struct { + + // e2 t address + // Required: true + E2TAddress *string `json:"E2TAddress"` + + // ran assoc list + RanAssocList RanE2tMap `json:"ranAssocList,omitempty"` + + // ran namelist tobe dissociated + RanNamelistTobeDissociated RanNamelist `json:"ranNamelistTobeDissociated,omitempty"` +} + +// Validate validates this e2t delete data +func (m *E2tDeleteData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateE2TAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRanAssocList(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRanNamelistTobeDissociated(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *E2tDeleteData) validateE2TAddress(formats strfmt.Registry) error { + + if err := validate.Required("E2TAddress", "body", m.E2TAddress); err != nil { + return err + } + + return nil +} + +func (m *E2tDeleteData) validateRanAssocList(formats strfmt.Registry) error { + if swag.IsZero(m.RanAssocList) { // not required + return nil + } + + if err := m.RanAssocList.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ranAssocList") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ranAssocList") + } + return err + } + + return nil +} + +func (m *E2tDeleteData) validateRanNamelistTobeDissociated(formats strfmt.Registry) error { + if swag.IsZero(m.RanNamelistTobeDissociated) { // not required + return nil + } + + if err := m.RanNamelistTobeDissociated.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ranNamelistTobeDissociated") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ranNamelistTobeDissociated") + } + return err + } + + return nil +} + +// ContextValidate validate this e2t delete data based on the context it is used +func (m *E2tDeleteData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRanAssocList(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRanNamelistTobeDissociated(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *E2tDeleteData) contextValidateRanAssocList(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RanAssocList.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ranAssocList") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ranAssocList") + } + return err + } + + return nil +} + +func (m *E2tDeleteData) contextValidateRanNamelistTobeDissociated(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RanNamelistTobeDissociated.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ranNamelistTobeDissociated") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ranNamelistTobeDissociated") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *E2tDeleteData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *E2tDeleteData) UnmarshalBinary(b []byte) error { + var res E2tDeleteData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/rtmgr_models/endpoint.go b/pkg/rtmgr_models/endpoint.go new file mode 100644 index 0000000..281013c --- /dev/null +++ b/pkg/rtmgr_models/endpoint.go @@ -0,0 +1,85 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package rtmgr_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Endpoint endpoint +// +// swagger:model endpoint +type Endpoint struct { + + // end point fqdn + EndPointFqdn string `json:"EndPointFqdn,omitempty"` + + // end point name + EndPointName string `json:"EndPointName,omitempty"` + + // end point port + // Maximum: 65535 + // Minimum: 0 + EndPointPort *uint16 `json:"EndPointPort,omitempty"` +} + +// Validate validates this endpoint +func (m *Endpoint) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEndPointPort(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Endpoint) validateEndPointPort(formats strfmt.Registry) error { + if swag.IsZero(m.EndPointPort) { // not required + return nil + } + + if err := validate.MinimumUint("EndPointPort", "body", uint64(*m.EndPointPort), 0, false); err != nil { + return err + } + + if err := validate.MaximumUint("EndPointPort", "body", uint64(*m.EndPointPort), 65535, false); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this endpoint based on context it is used +func (m *Endpoint) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Endpoint) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Endpoint) UnmarshalBinary(b []byte) error { + var res Endpoint + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/rtmgr_models/health_status.go b/pkg/rtmgr_models/health_status.go new file mode 100644 index 0000000..a553f19 --- /dev/null +++ b/pkg/rtmgr_models/health_status.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package rtmgr_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// HealthStatus health status +// +// swagger:model health-status +type HealthStatus struct { + + // status + // Enum: [healthy unhealthy] + Status string `json:"status,omitempty"` +} + +// Validate validates this health status +func (m *HealthStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var healthStatusTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["healthy","unhealthy"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + healthStatusTypeStatusPropEnum = append(healthStatusTypeStatusPropEnum, v) + } +} + +const ( + + // HealthStatusStatusHealthy captures enum value "healthy" + HealthStatusStatusHealthy string = "healthy" + + // HealthStatusStatusUnhealthy captures enum value "unhealthy" + HealthStatusStatusUnhealthy string = "unhealthy" +) + +// prop value enum +func (m *HealthStatus) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, healthStatusTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *HealthStatus) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this health status based on context it is used +func (m *HealthStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *HealthStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *HealthStatus) UnmarshalBinary(b []byte) error { + var res HealthStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/rtmgr_models/ran_e2t_element.go b/pkg/rtmgr_models/ran_e2t_element.go new file mode 100644 index 0000000..9d4ffe0 --- /dev/null +++ b/pkg/rtmgr_models/ran_e2t_element.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package rtmgr_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RanE2tElement ran e2t element +// +// swagger:model ran-e2t-element +type RanE2tElement struct { + + // e2 t address + // Required: true + E2TAddress *string `json:"E2TAddress"` + + // ran namelist + RanNamelist RanNamelist `json:"ranNamelist,omitempty"` +} + +// Validate validates this ran e2t element +func (m *RanE2tElement) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateE2TAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRanNamelist(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RanE2tElement) validateE2TAddress(formats strfmt.Registry) error { + + if err := validate.Required("E2TAddress", "body", m.E2TAddress); err != nil { + return err + } + + return nil +} + +func (m *RanE2tElement) validateRanNamelist(formats strfmt.Registry) error { + if swag.IsZero(m.RanNamelist) { // not required + return nil + } + + if err := m.RanNamelist.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ranNamelist") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ranNamelist") + } + return err + } + + return nil +} + +// ContextValidate validate this ran e2t element based on the context it is used +func (m *RanE2tElement) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRanNamelist(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RanE2tElement) contextValidateRanNamelist(ctx context.Context, formats strfmt.Registry) error { + + if err := m.RanNamelist.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ranNamelist") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ranNamelist") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RanE2tElement) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RanE2tElement) UnmarshalBinary(b []byte) error { + var res RanE2tElement + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/rtmgr_models/ran_e2t_map.go b/pkg/rtmgr_models/ran_e2t_map.go new file mode 100644 index 0000000..a2ead3d --- /dev/null +++ b/pkg/rtmgr_models/ran_e2t_map.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package rtmgr_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// RanE2tMap ran e2t map +// +// swagger:model ran-e2t-map +type RanE2tMap []*RanE2tElement + +// Validate validates this ran e2t map +func (m RanE2tMap) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this ran e2t map based on the context it is used +func (m RanE2tMap) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/rtmgr_models/ran_namelist.go b/pkg/rtmgr_models/ran_namelist.go new file mode 100644 index 0000000..377f64c --- /dev/null +++ b/pkg/rtmgr_models/ran_namelist.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package rtmgr_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// RanNamelist ran namelist +// +// swagger:model ranNamelist +type RanNamelist []string + +// Validate validates this ran namelist +func (m RanNamelist) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this ran namelist based on context it is used +func (m RanNamelist) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/rtmgr_models/routelist.go b/pkg/rtmgr_models/routelist.go new file mode 100644 index 0000000..497ea7f --- /dev/null +++ b/pkg/rtmgr_models/routelist.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package rtmgr_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Routelist routelist +// +// swagger:model routelist +type Routelist []*AddRmrRoute + +// Validate validates this routelist +func (m Routelist) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this routelist based on the context it is used +func (m Routelist) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/rtmgr_models/xapp_callback_data.go b/pkg/rtmgr_models/xapp_callback_data.go new file mode 100644 index 0000000..05fbaa3 --- /dev/null +++ b/pkg/rtmgr_models/xapp_callback_data.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package rtmgr_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// XappCallbackData xapp callback data +// +// swagger:model xapp-callback-data +type XappCallbackData struct { + + // event + Event string `json:"event,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // version + Version int64 `json:"version,omitempty"` + + // x apps + XApps string `json:"xApps,omitempty"` +} + +// Validate validates this xapp callback data +func (m *XappCallbackData) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this xapp callback data based on context it is used +func (m *XappCallbackData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *XappCallbackData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *XappCallbackData) UnmarshalBinary(b []byte) error { + var res XappCallbackData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/rtmgr_models/xapp_element.go b/pkg/rtmgr_models/xapp_element.go new file mode 100644 index 0000000..a0c198e --- /dev/null +++ b/pkg/rtmgr_models/xapp_element.go @@ -0,0 +1,98 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package rtmgr_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// XappElement xapp element +// +// swagger:model xapp-element +type XappElement struct { + + // address + // Required: true + Address *string `json:"address"` + + // port + // Required: true + // Maximum: 65535 + // Minimum: 0 + Port *uint16 `json:"port"` +} + +// Validate validates this xapp element +func (m *XappElement) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePort(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *XappElement) validateAddress(formats strfmt.Registry) error { + + if err := validate.Required("address", "body", m.Address); err != nil { + return err + } + + return nil +} + +func (m *XappElement) validatePort(formats strfmt.Registry) error { + + if err := validate.Required("port", "body", m.Port); err != nil { + return err + } + + if err := validate.MinimumUint("port", "body", uint64(*m.Port), 0, false); err != nil { + return err + } + + if err := validate.MaximumUint("port", "body", uint64(*m.Port), 65535, false); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this xapp element based on context it is used +func (m *XappElement) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *XappElement) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *XappElement) UnmarshalBinary(b []byte) error { + var res XappElement + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/rtmgr_models/xapp_list.go b/pkg/rtmgr_models/xapp_list.go new file mode 100644 index 0000000..0d9f1b9 --- /dev/null +++ b/pkg/rtmgr_models/xapp_list.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package rtmgr_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// XappList xapp list +// +// swagger:model xapp-list +type XappList []*XappElement + +// Validate validates this xapp list +func (m XappList) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this xapp list based on the context it is used +func (m XappList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/rtmgr_models/xapp_subscription_data.go b/pkg/rtmgr_models/xapp_subscription_data.go new file mode 100644 index 0000000..85463cb --- /dev/null +++ b/pkg/rtmgr_models/xapp_subscription_data.go @@ -0,0 +1,115 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package rtmgr_models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// XappSubscriptionData xapp subscription data +// +// swagger:model xapp-subscription-data +type XappSubscriptionData struct { + + // address + // Required: true + Address *string `json:"address"` + + // port + // Required: true + // Maximum: 65535 + // Minimum: 0 + Port *uint16 `json:"port"` + + // subscription id + // Required: true + SubscriptionID *int32 `json:"subscription_id"` +} + +// Validate validates this xapp subscription data +func (m *XappSubscriptionData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePort(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubscriptionID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *XappSubscriptionData) validateAddress(formats strfmt.Registry) error { + + if err := validate.Required("address", "body", m.Address); err != nil { + return err + } + + return nil +} + +func (m *XappSubscriptionData) validatePort(formats strfmt.Registry) error { + + if err := validate.Required("port", "body", m.Port); err != nil { + return err + } + + if err := validate.MinimumUint("port", "body", uint64(*m.Port), 0, false); err != nil { + return err + } + + if err := validate.MaximumUint("port", "body", uint64(*m.Port), 65535, false); err != nil { + return err + } + + return nil +} + +func (m *XappSubscriptionData) validateSubscriptionID(formats strfmt.Registry) error { + + if err := validate.Required("subscription_id", "body", m.SubscriptionID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this xapp subscription data based on context it is used +func (m *XappSubscriptionData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *XappSubscriptionData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *XappSubscriptionData) UnmarshalBinary(b []byte) error { + var res XappSubscriptionData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +}