From: agrawalgaurav Date: Thu, 29 Oct 2020 08:53:14 +0000 (+0530) Subject: MEC management and edge platform from upstream X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=fe55aea1d0fd7db059d182f6ec80b5c623fb43f5;p=ealt-edge.git MEC management and edge platform from upstream Signed-off-by: agrawalgaurav Change-Id: I0cbbec67a90aac2cb1481faeebc3614eb75cbffb --- diff --git a/mecm/mepm/applcm/broker/README.md b/mecm/mepm/applcm/broker/README.md deleted file mode 100644 index 9e7e8d6..0000000 --- a/mecm/mepm/applcm/broker/README.md +++ /dev/null @@ -1,4 +0,0 @@ - -APPLCM broker exposes interface to provide lifecycle maintenance of edge applications. - - diff --git a/mecm/mepm/applcm/broker/build/Dockerfile b/mecm/mepm/applcm/broker/build/Dockerfile deleted file mode 100644 index 7991e57..0000000 --- a/mecm/mepm/applcm/broker/build/Dockerfile +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM golang:1.13.4-alpine3.10 as builder - -ENV GOPROXY https://goproxy.io -ENV GO111MODULE on -ENV HOME=/go/release - -RUN apk update && apk upgrade && \ - apk add --no-cache bash git openssh - -RUN mkdir -p $HOME - -WORKDIR /go/cache - -ADD go.mod . -ADD go.sum . -RUN go mod download - -WORKDIR $HOME -RUN mkdir -p /go/release/application/packages - -ADD . . - -RUN GOOS=linux CGO_ENABLED=0 go build -ldflags="-s -w" -installsuffix cgo -o app cmd/broker/main.go - -FROM golang:1.13.4-alpine3.10 - -RUN mkdir -p /go/release - -ENV HOME=/go/release -ENV APP_HOME=/go/release -ENV UID=166 -ENV GID=166 -ENV USER_NAME=ealtuser -ENV GROUP_NAME=ealtgroup - -RUN apk update &&\ - apk add shadow &&\ - groupadd -r -g $GID $GROUP_NAME &&\ - useradd -r -u $UID -g $GID -d $HOME -s /sbin/nologin -c "Docker image user" $USER_NAME &&\ - chown -R $USER_NAME:$GROUP_NAME $HOME - -WORKDIR $APP_HOME - -USER $USER_NAME - -COPY --chown=ealtuser:ealtgroup --from=builder $HOME/app $APP_HOME -COPY --chown=ealtuser:ealtgroup --from=builder $HOME/start.sh $APP_HOME - -RUN mkdir -p /go/release/application/packages - -RUN chmod 750 $HOME &&\ - chmod 550 $HOME/app &&\ - chmod 550 $HOME/start.sh - -EXPOSE 8081 - -ENTRYPOINT ["./app"] diff --git a/mecm/mepm/applcm/broker/build_image.sh b/mecm/mepm/applcm/broker/build_image.sh deleted file mode 100755 index 838053d..0000000 --- a/mecm/mepm/applcm/broker/build_image.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DOCKER_BUILD_DIR=`pwd` -MECM_VERSION=latest -IMAGE_NAME=applcm-broker -REPO_NAME=ealtedge - -echo "DOCKER_BUILD_DIR=${DOCKER_BUILD_DIR}" -echo "In Build and Push Broker" - -function build_image { - docker build --no-cache -t ${REPO_NAME}/${IMAGE_NAME}:${MECM_VERSION} -f build/Dockerfile . -} - -build_image diff --git a/mecm/mepm/applcm/broker/build_push_image.sh b/mecm/mepm/applcm/broker/build_push_image.sh deleted file mode 100644 index e4ecbdd..0000000 --- a/mecm/mepm/applcm/broker/build_push_image.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -unset REPO_USER -unset REPO_PWD -echo -n "REPO_USER:" -read REPO_USER -echo -n "REPO_PWD:" -read REPO_PWD - -DOCKER_BUILD_DIR=`pwd` -MECM_VERSION=latest -IMAGE_NAME=applcm-broker -REPO_NAME=ealtedge - -echo "DOCKER_BUILD_DIR=${DOCKER_BUILD_DIR}" -echo "In Build and Push Broker" - -function build_image { - docker build --no-cache -t ${REPO_NAME}/${IMAGE_NAME}:${MECM_VERSION} -f build/Dockerfile . -} - -function push_image { - docker login -u ${REPO_USER} -p ${REPO_PWD} - docker push ${REPO_NAME}/${IMAGE_NAME}:${MECM_VERSION} -} - -build_image -push_image \ No newline at end of file diff --git a/mecm/mepm/applcm/broker/cmd/broker/main.go b/mecm/mepm/applcm/broker/cmd/broker/main.go deleted file mode 100644 index 1783b6f..0000000 --- a/mecm/mepm/applcm/broker/cmd/broker/main.go +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "broker/pkg/handlers" - "broker/pkg/util" - "os" - - "github.com/sirupsen/logrus" -) - -// Variables to be defined in deployment file -var ( - logFile = os.Getenv("LOGFILE_PATH") - loggerLevel = os.Getenv("LOGGER_LEVEL") - applcmAddress = os.Getenv("ADDRESS") -) - -func main() { - // Prepare logger - file, err := os.Create(logFile) - if err != nil { - logrus.Fatal(err) - } - defer file.Close() - - level, err := logrus.ParseLevel(loggerLevel) - var logger = util.GetLogger(logFile, level, file) - - handler := &handlers.Handlers{} - handler.Initialize(logger) - handler.Run(applcmAddress) -} diff --git a/mecm/mepm/applcm/broker/go.mod b/mecm/mepm/applcm/broker/go.mod deleted file mode 100644 index 9a6f12c..0000000 --- a/mecm/mepm/applcm/broker/go.mod +++ /dev/null @@ -1,18 +0,0 @@ -module broker - -go 1.14 - -require ( - github.com/buger/jsonparser v0.0.0-20200322175846-f7e751efca13 - github.com/ghodss/yaml v1.0.0 - github.com/go-sql-driver/mysql v1.5.0 // indirect - github.com/golang/protobuf v1.4.0 - github.com/google/uuid v1.1.1 - github.com/gorilla/mux v1.7.4 - github.com/jinzhu/gorm v1.9.12 - github.com/sirupsen/logrus v1.6.0 - golang.org/x/net v0.0.0-20200506145744-7e3656a0809f - google.golang.org/grpc v1.29.1 - google.golang.org/protobuf v1.22.0 - gopkg.in/yaml.v2 v2.2.8 // indirect -) diff --git a/mecm/mepm/applcm/broker/go.sum b/mecm/mepm/applcm/broker/go.sum deleted file mode 100644 index c7070df..0000000 --- a/mecm/mepm/applcm/broker/go.sum +++ /dev/null @@ -1,119 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/buger/jsonparser v0.0.0-20200322175846-f7e751efca13 h1:+qUNY4VRkEH46bLUwxCyUU+iOGJMQBVibAaYzWiwWcg= -github.com/buger/jsonparser v0.0.0-20200322175846-f7e751efca13/go.mod h1:tgcrVJ81GPSF0mz+0nu1Xaz0fazGPrmmJfJtxjbHhUQ= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -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/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd h1:83Wprp6ROGeiHFAP8WJdI2RoxALQYgdllERc3N5N2DM= -github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= -github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0 h1:oOuy+ugB+P/kBdUnG5QaMXSIyJ1q38wWSojYCb3z5VQ= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -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 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -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/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= -github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/jinzhu/gorm v1.9.12 h1:Drgk1clyWT9t9ERbzHza6Mj/8FY/CqMyVzOiHviMo6Q= -github.com/jinzhu/gorm v1.9.12/go.mod h1:vhTjlKSJUTWNtcbQtrMBFCxy7eXTzeCAzfL5fBZT/Qs= -github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= -github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= -github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M= -github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= -github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4= -github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/mattn/go-sqlite3 v2.0.1+incompatible h1:xQ15muvnzGBHpIpdrNi1DA5x0+TcBZzsIDwmw9uTHzw= -github.com/mattn/go-sqlite3 v2.0.1+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -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_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd h1:GGJVjV8waZKRHrgwvtH66z9ZGVurTD1MT0n1Bb+q4aM= -golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f h1:QBjCr1Fz5kw158VqdE9JfI9cJnl/ymnJWAdMuinqL7Y= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0 h1:cJv5/xdbk1NnMPR1VP9+HU6gupuG9MLBoH1r6RHZ2MY= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/mecm/mepm/applcm/broker/internal/lcmservice/lcmservice.pb.go b/mecm/mepm/applcm/broker/internal/lcmservice/lcmservice.pb.go deleted file mode 100644 index 3ffd097..0000000 --- a/mecm/mepm/applcm/broker/internal/lcmservice/lcmservice.pb.go +++ /dev/null @@ -1,742 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.22.0-devel -// protoc v3.11.4 -// source: lcmservice.proto - -package lcmservice - -import ( - context "context" - reflect "reflect" - sync "sync" - - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -type InstantiateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Data: - // *InstantiateRequest_HostIp - // *InstantiateRequest_Package - Data isInstantiateRequest_Data `protobuf_oneof:"data"` -} - -func (x *InstantiateRequest) Reset() { - *x = InstantiateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_lcmservice_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InstantiateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InstantiateRequest) ProtoMessage() {} - -func (x *InstantiateRequest) ProtoReflect() protoreflect.Message { - mi := &file_lcmservice_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InstantiateRequest.ProtoReflect.Descriptor instead. -func (*InstantiateRequest) Descriptor() ([]byte, []int) { - return file_lcmservice_proto_rawDescGZIP(), []int{0} -} - -func (m *InstantiateRequest) GetData() isInstantiateRequest_Data { - if m != nil { - return m.Data - } - return nil -} - -func (x *InstantiateRequest) GetHostIp() string { - if x, ok := x.GetData().(*InstantiateRequest_HostIp); ok { - return x.HostIp - } - return "" -} - -func (x *InstantiateRequest) GetPackage() []byte { - if x, ok := x.GetData().(*InstantiateRequest_Package); ok { - return x.Package - } - return nil -} - -type isInstantiateRequest_Data interface { - isInstantiateRequest_Data() -} - -type InstantiateRequest_HostIp struct { - HostIp string `protobuf:"bytes,1,opt,name=hostIp,proto3,oneof"` -} - -type InstantiateRequest_Package struct { - Package []byte `protobuf:"bytes,2,opt,name=package,proto3,oneof"` -} - -func (*InstantiateRequest_HostIp) isInstantiateRequest_Data() {} - -func (*InstantiateRequest_Package) isInstantiateRequest_Data() {} - -type InstantiateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - WorkloadId string `protobuf:"bytes,1,opt,name=workloadId,proto3" json:"workloadId,omitempty"` - Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` -} - -func (x *InstantiateResponse) Reset() { - *x = InstantiateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_lcmservice_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InstantiateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InstantiateResponse) ProtoMessage() {} - -func (x *InstantiateResponse) ProtoReflect() protoreflect.Message { - mi := &file_lcmservice_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InstantiateResponse.ProtoReflect.Descriptor instead. -func (*InstantiateResponse) Descriptor() ([]byte, []int) { - return file_lcmservice_proto_rawDescGZIP(), []int{1} -} - -func (x *InstantiateResponse) GetWorkloadId() string { - if x != nil { - return x.WorkloadId - } - return "" -} - -func (x *InstantiateResponse) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -type TerminateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - HostIp string `protobuf:"bytes,1,opt,name=hostIp,proto3" json:"hostIp,omitempty"` - WorkloadId string `protobuf:"bytes,2,opt,name=workloadId,proto3" json:"workloadId,omitempty"` -} - -func (x *TerminateRequest) Reset() { - *x = TerminateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_lcmservice_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TerminateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TerminateRequest) ProtoMessage() {} - -func (x *TerminateRequest) ProtoReflect() protoreflect.Message { - mi := &file_lcmservice_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TerminateRequest.ProtoReflect.Descriptor instead. -func (*TerminateRequest) Descriptor() ([]byte, []int) { - return file_lcmservice_proto_rawDescGZIP(), []int{2} -} - -func (x *TerminateRequest) GetHostIp() string { - if x != nil { - return x.HostIp - } - return "" -} - -func (x *TerminateRequest) GetWorkloadId() string { - if x != nil { - return x.WorkloadId - } - return "" -} - -type TerminateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` -} - -func (x *TerminateResponse) Reset() { - *x = TerminateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_lcmservice_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TerminateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TerminateResponse) ProtoMessage() {} - -func (x *TerminateResponse) ProtoReflect() protoreflect.Message { - mi := &file_lcmservice_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TerminateResponse.ProtoReflect.Descriptor instead. -func (*TerminateResponse) Descriptor() ([]byte, []int) { - return file_lcmservice_proto_rawDescGZIP(), []int{3} -} - -func (x *TerminateResponse) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -type QueryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - HostIp string `protobuf:"bytes,1,opt,name=hostIp,proto3" json:"hostIp,omitempty"` - WorkloadId string `protobuf:"bytes,2,opt,name=workloadId,proto3" json:"workloadId,omitempty"` -} - -func (x *QueryRequest) Reset() { - *x = QueryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_lcmservice_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryRequest) ProtoMessage() {} - -func (x *QueryRequest) ProtoReflect() protoreflect.Message { - mi := &file_lcmservice_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead. -func (*QueryRequest) Descriptor() ([]byte, []int) { - return file_lcmservice_proto_rawDescGZIP(), []int{4} -} - -func (x *QueryRequest) GetHostIp() string { - if x != nil { - return x.HostIp - } - return "" -} - -func (x *QueryRequest) GetWorkloadId() string { - if x != nil { - return x.WorkloadId - } - return "" -} - -type QueryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` -} - -func (x *QueryResponse) Reset() { - *x = QueryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_lcmservice_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryResponse) ProtoMessage() {} - -func (x *QueryResponse) ProtoReflect() protoreflect.Message { - mi := &file_lcmservice_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead. -func (*QueryResponse) Descriptor() ([]byte, []int) { - return file_lcmservice_proto_rawDescGZIP(), []int{5} -} - -func (x *QueryResponse) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -var File_lcmservice_proto protoreflect.FileDescriptor - -var file_lcmservice_proto_rawDesc = []byte{ - 0x0a, 0x10, 0x6c, 0x63, 0x6d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x0a, 0x6c, 0x63, 0x6d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x52, - 0x0a, 0x12, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x70, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x70, 0x12, 0x1a, - 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, - 0x00, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x22, 0x4d, 0x0a, 0x13, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x77, 0x6f, 0x72, - 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x77, - 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x22, 0x4a, 0x0a, 0x10, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x70, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x70, 0x12, 0x1e, 0x0a, - 0x0a, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x22, 0x2b, 0x0a, - 0x11, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x46, 0x0a, 0x0c, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x6f, - 0x73, 0x74, 0x49, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, - 0x49, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, - 0x49, 0x64, 0x22, 0x27, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0xe8, 0x01, 0x0a, 0x06, - 0x41, 0x70, 0x70, 0x4c, 0x43, 0x4d, 0x12, 0x52, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, - 0x74, 0x69, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x2e, 0x6c, 0x63, 0x6d, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6c, 0x63, 0x6d, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x12, 0x4a, 0x0a, 0x09, 0x74, 0x65, - 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x2e, 0x6c, 0x63, 0x6d, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6c, 0x63, 0x6d, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, - 0x18, 0x2e, 0x6c, 0x63, 0x6d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6c, 0x63, 0x6d, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_lcmservice_proto_rawDescOnce sync.Once - file_lcmservice_proto_rawDescData = file_lcmservice_proto_rawDesc -) - -func file_lcmservice_proto_rawDescGZIP() []byte { - file_lcmservice_proto_rawDescOnce.Do(func() { - file_lcmservice_proto_rawDescData = protoimpl.X.CompressGZIP(file_lcmservice_proto_rawDescData) - }) - return file_lcmservice_proto_rawDescData -} - -var file_lcmservice_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_lcmservice_proto_goTypes = []interface{}{ - (*InstantiateRequest)(nil), // 0: lcmservice.InstantiateRequest - (*InstantiateResponse)(nil), // 1: lcmservice.InstantiateResponse - (*TerminateRequest)(nil), // 2: lcmservice.TerminateRequest - (*TerminateResponse)(nil), // 3: lcmservice.TerminateResponse - (*QueryRequest)(nil), // 4: lcmservice.QueryRequest - (*QueryResponse)(nil), // 5: lcmservice.QueryResponse -} -var file_lcmservice_proto_depIdxs = []int32{ - 0, // 0: lcmservice.AppLCM.instantiate:input_type -> lcmservice.InstantiateRequest - 2, // 1: lcmservice.AppLCM.terminate:input_type -> lcmservice.TerminateRequest - 4, // 2: lcmservice.AppLCM.query:input_type -> lcmservice.QueryRequest - 1, // 3: lcmservice.AppLCM.instantiate:output_type -> lcmservice.InstantiateResponse - 3, // 4: lcmservice.AppLCM.terminate:output_type -> lcmservice.TerminateResponse - 5, // 5: lcmservice.AppLCM.query:output_type -> lcmservice.QueryResponse - 3, // [3:6] is the sub-list for method output_type - 0, // [0:3] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_lcmservice_proto_init() } -func file_lcmservice_proto_init() { - if File_lcmservice_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_lcmservice_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InstantiateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_lcmservice_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InstantiateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_lcmservice_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TerminateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_lcmservice_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TerminateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_lcmservice_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_lcmservice_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_lcmservice_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*InstantiateRequest_HostIp)(nil), - (*InstantiateRequest_Package)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_lcmservice_proto_rawDesc, - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_lcmservice_proto_goTypes, - DependencyIndexes: file_lcmservice_proto_depIdxs, - MessageInfos: file_lcmservice_proto_msgTypes, - }.Build() - File_lcmservice_proto = out.File - file_lcmservice_proto_rawDesc = nil - file_lcmservice_proto_goTypes = nil - file_lcmservice_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// AppLCMClient is the client API for AppLCM service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AppLCMClient interface { - Instantiate(ctx context.Context, opts ...grpc.CallOption) (AppLCM_InstantiateClient, error) - Terminate(ctx context.Context, in *TerminateRequest, opts ...grpc.CallOption) (*TerminateResponse, error) - Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) -} - -type appLCMClient struct { - cc grpc.ClientConnInterface -} - -func NewAppLCMClient(cc grpc.ClientConnInterface) AppLCMClient { - return &appLCMClient{cc} -} - -func (c *appLCMClient) Instantiate(ctx context.Context, opts ...grpc.CallOption) (AppLCM_InstantiateClient, error) { - stream, err := c.cc.NewStream(ctx, &_AppLCM_serviceDesc.Streams[0], "/lcmservice.AppLCM/instantiate", opts...) - if err != nil { - return nil, err - } - x := &appLCMInstantiateClient{stream} - return x, nil -} - -type AppLCM_InstantiateClient interface { - Send(*InstantiateRequest) error - CloseAndRecv() (*InstantiateResponse, error) - grpc.ClientStream -} - -type appLCMInstantiateClient struct { - grpc.ClientStream -} - -func (x *appLCMInstantiateClient) Send(m *InstantiateRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *appLCMInstantiateClient) CloseAndRecv() (*InstantiateResponse, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(InstantiateResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *appLCMClient) Terminate(ctx context.Context, in *TerminateRequest, opts ...grpc.CallOption) (*TerminateResponse, error) { - out := new(TerminateResponse) - err := c.cc.Invoke(ctx, "/lcmservice.AppLCM/terminate", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appLCMClient) Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { - out := new(QueryResponse) - err := c.cc.Invoke(ctx, "/lcmservice.AppLCM/query", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AppLCMServer is the server API for AppLCM service. -type AppLCMServer interface { - Instantiate(AppLCM_InstantiateServer) error - Terminate(context.Context, *TerminateRequest) (*TerminateResponse, error) - Query(context.Context, *QueryRequest) (*QueryResponse, error) -} - -// UnimplementedAppLCMServer can be embedded to have forward compatible implementations. -type UnimplementedAppLCMServer struct { -} - -func (*UnimplementedAppLCMServer) Instantiate(AppLCM_InstantiateServer) error { - return status.Errorf(codes.Unimplemented, "method Instantiate not implemented") -} -func (*UnimplementedAppLCMServer) Terminate(context.Context, *TerminateRequest) (*TerminateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Terminate not implemented") -} -func (*UnimplementedAppLCMServer) Query(context.Context, *QueryRequest) (*QueryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Query not implemented") -} - -func RegisterAppLCMServer(s *grpc.Server, srv AppLCMServer) { - s.RegisterService(&_AppLCM_serviceDesc, srv) -} - -func _AppLCM_Instantiate_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(AppLCMServer).Instantiate(&appLCMInstantiateServer{stream}) -} - -type AppLCM_InstantiateServer interface { - SendAndClose(*InstantiateResponse) error - Recv() (*InstantiateRequest, error) - grpc.ServerStream -} - -type appLCMInstantiateServer struct { - grpc.ServerStream -} - -func (x *appLCMInstantiateServer) SendAndClose(m *InstantiateResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *appLCMInstantiateServer) Recv() (*InstantiateRequest, error) { - m := new(InstantiateRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _AppLCM_Terminate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TerminateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppLCMServer).Terminate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lcmservice.AppLCM/Terminate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppLCMServer).Terminate(ctx, req.(*TerminateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppLCM_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppLCMServer).Query(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lcmservice.AppLCM/Query", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppLCMServer).Query(ctx, req.(*QueryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _AppLCM_serviceDesc = grpc.ServiceDesc{ - ServiceName: "lcmservice.AppLCM", - HandlerType: (*AppLCMServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "terminate", - Handler: _AppLCM_Terminate_Handler, - }, - { - MethodName: "query", - Handler: _AppLCM_Query_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "instantiate", - Handler: _AppLCM_Instantiate_Handler, - ClientStreams: true, - }, - }, - Metadata: "lcmservice.proto", -} diff --git a/mecm/mepm/applcm/broker/internal/lcmservice/lcmservice.proto b/mecm/mepm/applcm/broker/internal/lcmservice/lcmservice.proto deleted file mode 100644 index 888c1a5..0000000 --- a/mecm/mepm/applcm/broker/internal/lcmservice/lcmservice.proto +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2020 Huawei Technologies Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package lcmservice; - -message InstantiateRequest { - oneof data { - string hostIp = 1; - bytes package = 2; - }; -} - -message InstantiateResponse { - string workloadId = 1; - string status = 2; -} - -message TerminateRequest { - string hostIp = 1; - string workloadId = 2; -} - -message TerminateResponse { - string status = 1; -} - -message QueryRequest { - string hostIp = 1; - string workloadId = 2; -} - -message QueryResponse { - string status = 1; -} - -service AppLCM { - rpc instantiate (stream InstantiateRequest) returns (InstantiateResponse) {} - rpc terminate (TerminateRequest) returns (TerminateResponse) {} - rpc query (QueryRequest) returns (QueryResponse) {} -} \ No newline at end of file diff --git a/mecm/mepm/applcm/broker/pkg/handlers/adapter/dbAdapter/dbAdapter.go b/mecm/mepm/applcm/broker/pkg/handlers/adapter/dbAdapter/dbAdapter.go deleted file mode 100644 index 23fb49e..0000000 --- a/mecm/mepm/applcm/broker/pkg/handlers/adapter/dbAdapter/dbAdapter.go +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package dbAdapter - -import ( - "broker/pkg/handlers/model" - "fmt" - "github.com/jinzhu/gorm" - _ "github.com/jinzhu/gorm/dialects/postgres" - "github.com/sirupsen/logrus" - "os" -) - -var ( - username = os.Getenv("POSTGRES_USER") - password = os.Getenv("POSTGRES_PASSWORD") - dbName = os.Getenv("POSTGRES_DATABASE") - dbHost = os.Getenv("DBHOST") - -) - -// Database adapter -type DbAdapter struct { - logger *logrus.Logger - db *gorm.DB -} - -func NewDbAdapter(logger *logrus.Logger) *DbAdapter { - return &DbAdapter{logger: logger} -} - -// Creates database -func (adapter *DbAdapter) CreateDatabase() { - adapter.logger.Infof("creating Database...") - - dbUri := fmt.Sprintf("host=%s user=%s dbname=%s sslmode=disable password=%s", dbHost, username, dbName, password) //Build connection string - - conn, err := gorm.Open("postgres", dbUri) - if err != nil { - fmt.Print(err) - } - - db := conn - db.AutoMigrate(&model.AppPackageInfo{}) - db.AutoMigrate(&model.AppInstanceInfo{}) - adapter.db = db -} - -func (adapter *DbAdapter) InsertAppInstanceInfo(n model.AppInstanceInfo) { - adapter.logger.Infof("Insert App Instance Info (%v, %T)\n", n, n) - adapter.db.Create(&model.AppInstanceInfo{ID: n.ID, AppInstanceName: n.AppInstanceName, AppInstanceDescription: n.AppInstanceDescription, - AppDID: n.AppDID, AppProvider: n.AppProvider, AppName: n.AppName, AppSoftVersion: n.AppSoftVersion, AppDVersion: n.AppDVersion, AppPkgID: n.AppPkgID, InstantiationState: n.InstantiationState}) - - adapter.logger.Infof("Inserting Done") -} - -func (adapter *DbAdapter) GetAppInstanceInfo(key string) (appInstInfo model.AppInstanceInfo) { - adapter.logger.Infof("Get App Instance Info %s", key) - var appInstanceInfo model.AppInstanceInfo - returnVal := adapter.db.First(&appInstanceInfo, "id=?", key).Error - if returnVal != nil { - return - } - - return appInstanceInfo -} - -func (adapter *DbAdapter) UpdateAppInstanceInfoInstStatusHostAndWorkloadId(id string, instantiationState string, host string, workloadId string) { - adapter.logger.Infof("update into DB (%v, %T)\n", id, instantiationState, host, workloadId) - - var appInstInfo model.AppInstanceInfo - adapter.db.Where("id=?", id).First(&appInstInfo).Update("instantiationState", instantiationState).Update("host", host).Update("workloadID", workloadId) - adapter.logger.Infof("AppName: %s\nAppDID: %s\nAppInstanceDescription:%t\n\n", - appInstInfo.AppName, appInstInfo.AppDID, appInstInfo.AppInstanceDescription) - - adapter.logger.Infof("Update Done") -} - -func (adapter *DbAdapter) UpdateAppInstanceInfoInstStatusAndWorkload(id string, instantiationState string, workloadId string) { - adapter.logger.Infof("update DB (%v, %T)\n", id, instantiationState) - - var appInstInfo model.AppInstanceInfo - adapter.db.Where("id=?", id).First(&appInstInfo).Update("instantiationState", instantiationState).Update("workloadID", workloadId) - adapter.logger.Infof("AppName: %s\nAppDID: %s\nAppInstanceDescription:%t\n\n", - appInstInfo.AppName, appInstInfo.AppDID, appInstInfo.AppInstanceDescription) - adapter.logger.Infof("Update Done") -} - -func (adapter *DbAdapter) DeleteAppInstanceInfo(key string) { - adapter.db.Where("id=?", key).Delete(&model.AppInstanceInfo{}) - adapter.logger.Infof("Delete App Instance Info: $s", key) -} - -func (adapter *DbAdapter) InsertAppPackageInfo(n model.AppPackageInfo) { - adapter.logger.Infof("Insert App Package Info (%v, %T)\n", n, n) - adapter.db.Create(&model.AppPackageInfo{ID: n.ID, AppDID: n.AppDID, AppProvider: n.AppProvider, - AppName: n.AppName, AppSoftwareVersion: n.AppSoftwareVersion, AppDVersion: n.AppDVersion, - OnboardingState: n.OnboardingState, DeployType: n.DeployType, AppPackage: n.AppPackage}) - adapter.logger.Infof("Inserting done") -} - -func (adapter *DbAdapter) GetAppPackageInfo(key string) (appPackageInfo model.AppPackageInfo) { - adapter.logger.Infof("Get App Package Info: %s", key) - var appPkgInfo model.AppPackageInfo - err := adapter.db.First(&appPkgInfo, "id=?", key).Error - if err != nil { - return - } - return appPkgInfo -} - -func (adapter *DbAdapter) DeleteAppPackageInfo(key string) { - adapter.logger.Infof("Delete App Package Info: %s", key) - adapter.db.Where("id=?", key).Delete(&model.AppPackageInfo{}) - adapter.logger.Infof("Delete App Package Info: $s", key) -} diff --git a/mecm/mepm/applcm/broker/pkg/handlers/adapter/pluginAdapter/pluginAdapter.go b/mecm/mepm/applcm/broker/pkg/handlers/adapter/pluginAdapter/pluginAdapter.go deleted file mode 100644 index ff3ca99..0000000 --- a/mecm/mepm/applcm/broker/pkg/handlers/adapter/pluginAdapter/pluginAdapter.go +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package pluginAdapter - -import ( - "broker/pkg/plugin" - "context" - "time" - - "github.com/sirupsen/logrus" -) - -const ( - chunkSize = 1024 - rootCertificate = "" -) - -// Plugin adapter which decides a specific client based on plugin info -// TODO PluginInfo to have other information about plugins to find the client and implementation to handle accordingly. -type PluginAdapter struct { - pluginInfo string - logger *logrus.Logger -} - -// Constructor of PluginAdapter -func NewPluginAdapter(pluginInfo string, logger *logrus.Logger) *PluginAdapter { - return &PluginAdapter{pluginInfo: pluginInfo, logger: logger} -} - -// Instantiate application -func (c *PluginAdapter) Instantiate(pluginInfo string, host string, deployArtifact string) (workloadId string, error error, status string) { - c.logger.Infof("Instantation started") - clientConfig := plugin.ClientGRPCConfig{Address: pluginInfo, ChunkSize: chunkSize, RootCertificate: rootCertificate, Logger: c.logger} - var client, err = plugin.NewClientGRPC(clientConfig) - if err != nil { - c.logger.Errorf("failed to create client: %v", err) - return "", err, "Failure" - } - - ctx, cancel := context.WithTimeout(context.Background(), 50*time.Second) - defer cancel() - - //Instantiate - workloadId, status, err = client.Instantiate(ctx, deployArtifact, host) - if err != nil { - c.logger.Errorf("server failed to respond %s", err.Error()) - return "", err, "Failure" - } - c.logger.Infof("Instantiation completed with workloadId %s, status: %s ", workloadId, status) - return workloadId, nil, status -} - -// Query application -func (c *PluginAdapter) Query(pluginInfo string, host string, workloadId string) (status string, error error) { - c.logger.Infof("Query started") - clientConfig := plugin.ClientGRPCConfig{Address: pluginInfo, ChunkSize: chunkSize, RootCertificate: rootCertificate} - var client, err = plugin.NewClientGRPC(clientConfig) - if err != nil { - c.logger.Errorf("failed to create client: %v", err) - return "", err - } - - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) - defer cancel() - - //Query - status, err = client.Query(ctx, host, workloadId) - if err != nil { - c.logger.Errorf("failed to query: %v", err) - return "", err - } - c.logger.Infof("query status: ", status) - return status, nil -} - -// Terminate application -func (c *PluginAdapter) Terminate(pluginInfo string, host string, workloadId string) (status string, error error) { - c.logger.Infof("Terminate started") - clientConfig := plugin.ClientGRPCConfig{Address: pluginInfo, ChunkSize: chunkSize, RootCertificate: rootCertificate} - var client, err = plugin.NewClientGRPC(clientConfig) - if err != nil { - c.logger.Errorf("failed to create client: %v", err) - return "Failure", err - } - - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) - defer cancel() - - //Terminate - status, err = client.Terminate(ctx, host, workloadId) - - if err != nil { - c.logger.Errorf("failed to instantiate: %v", err) - return "Failure", err - } - - c.logger.Infof("termination success with status: ", status) - return status, nil -} diff --git a/mecm/mepm/applcm/broker/pkg/handlers/handlers.go b/mecm/mepm/applcm/broker/pkg/handlers/handlers.go deleted file mode 100644 index 022f73c..0000000 --- a/mecm/mepm/applcm/broker/pkg/handlers/handlers.go +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package handlers - -import ( - "net/http" - "os" - - "github.com/gorilla/mux" - "github.com/sirupsen/logrus" -) - -// URLS -const ( - CreateAppInstance = "/ealtedge/mepm/app_lcm/v1/app_instances" - InstantiateAppInstance = "/ealtedge/mepm/app_lcm/v1/app_instances/{appInstanceId}/instantiate" - QueryAppInstanceInfo = "/ealtedge/mepm/app_lcm/v1/app_instances/{appInstanceId}" - QueryAppLcmOperationStatus = "/ealtedge/mepm/app_lcm/v1/app_lcm_op_occs" - TerminateAppIns = "/ealtedge/mepm/app_lcm/v1/app_instances/{appInstanceId}/terminate" - DeleteAppInstanceIdentifier = "/ealtedge/mepm/app_lcm/v1/app_instances/{appInstanceId}" - OnboardPackage = "/ealtedge/mepm/app_pkgm/v1/app_packages" - QueryOnboardPackage = "/ealtedge/mepm/app_pkgm/v1/app_packages/{appPkgId}" - // Https flag value true - HTTPSFlagValue = "true" -) - -var ( - PackageFolderPath = os.Getenv("PACKAGE_PATH") - PackageArtifactPath = os.Getenv("PACKAGE_ARTIFACT_PATH") -) - -// Handler of REST APIs -type Handlers struct { - router *mux.Router - logger *logrus.Logger - impl HandlerImpl -} - -// Initialize initializes the handler -func (hdlr *Handlers) Initialize(logger *logrus.Logger) { - hdlr.router = mux.NewRouter() - hdlr.logger = logger - hdlr.setRouters() - hdlr.impl = newHandlerImpl(hdlr.logger) -} - -// Run on it's router -func (hdlr *Handlers) Run(host string) { - hdlr.logger.Infof("Server is running on port %s", host) - var err error - var httpflag = os.Getenv("HTTPS_FLAG") - if httpflag == HTTPSFlagValue { - err = http.ListenAndServeTLS(host, os.Getenv("CERTIFICATE_PATH"), os.Getenv("KEY_PATH"), hdlr.router) - } else { - err = http.ListenAndServe(host, hdlr.router) - } - if err != nil { - hdlr.logger.Fatalf("Server couldn't run on port %s", host) - } -} - -// SetRouters sets the all required routers -func (hdlr *Handlers) setRouters() { - // Routing for handling the requests - hdlr.Post(OnboardPackage, hdlr.handleRequest(hdlr.impl.UploadPackage)) - hdlr.Get(QueryOnboardPackage, hdlr.handleRequest(hdlr.impl.QueryAppPackageInfo)) - hdlr.Post(CreateAppInstance, hdlr.handleRequest(hdlr.impl.CreateAppInstance)) - hdlr.Delete(QueryOnboardPackage, hdlr.handleRequest(hdlr.impl.DeleteAppPackage)) - hdlr.Post(InstantiateAppInstance, hdlr.handleRequest(hdlr.impl.InstantiateAppInstance)) - hdlr.Get(QueryAppInstanceInfo, hdlr.handleRequest(hdlr.impl.QueryAppInstanceInfo)) - hdlr.Get(QueryAppLcmOperationStatus, hdlr.handleRequest(hdlr.impl.QueryAppLcmOperationStatus)) - hdlr.Post(TerminateAppIns, hdlr.handleRequest(hdlr.impl.TerminateAppInstance)) - hdlr.Delete(DeleteAppInstanceIdentifier, hdlr.handleRequest(hdlr.impl.DeleteAppInstanceIdentifier)) -} - -// Get wraps the router for GET method -func (hdlr *Handlers) Get(path string, f func(w http.ResponseWriter, r *http.Request)) { - hdlr.router.HandleFunc(path, f).Methods("GET") -} - -// Post wraps the router for POST method -func (hdlr *Handlers) Post(path string, f func(w http.ResponseWriter, r *http.Request)) { - hdlr.router.HandleFunc(path, f).Methods("POST") -} - -// Put wraps the router for PUT method -func (hdlr *Handlers) Put(path string, f func(w http.ResponseWriter, r *http.Request)) { - hdlr.router.HandleFunc(path, f).Methods("PUT") -} - -// Delete wraps the router for DELETE method -func (hdlr *Handlers) Delete(path string, f func(w http.ResponseWriter, r *http.Request)) { - hdlr.router.HandleFunc(path, f).Methods("DELETE") -} - -type RequestHandlerFunction func(w http.ResponseWriter, r *http.Request) - -func (hdlr *Handlers) handleRequest(handler RequestHandlerFunction) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - handler(w, r) - } -} diff --git a/mecm/mepm/applcm/broker/pkg/handlers/handlersImpl.go b/mecm/mepm/applcm/broker/pkg/handlers/handlersImpl.go deleted file mode 100644 index 6867b2c..0000000 --- a/mecm/mepm/applcm/broker/pkg/handlers/handlersImpl.go +++ /dev/null @@ -1,483 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package handlers - -import ( - "archive/zip" - "broker/pkg/handlers/adapter/dbAdapter" - "broker/pkg/handlers/adapter/pluginAdapter" - "broker/pkg/handlers/model" - "bytes" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net/http" - "os" - "path/filepath" - "strings" - - "github.com/buger/jsonparser" - "github.com/ghodss/yaml" - "github.com/google/uuid" - "github.com/gorilla/mux" - "github.com/sirupsen/logrus" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -// Handler of REST APIs -type HandlerImpl struct { - logger *logrus.Logger - dbAdapter *dbAdapter.DbAdapter -} - -// Creates handler implementation -func newHandlerImpl(logger *logrus.Logger) (impl HandlerImpl) { - impl.logger = logger - impl.dbAdapter = dbAdapter.NewDbAdapter(logger) - impl.dbAdapter.CreateDatabase() - return -} - -// Uploads package -func (impl *HandlerImpl) UploadPackage(w http.ResponseWriter, r *http.Request) { - - file, header, err := r.FormFile("file") - defer file.Close() - if err != nil { - respondError(w, http.StatusBadRequest, err.Error()) - return - } - - buf := bytes.NewBuffer(nil) - if _, err := io.Copy(buf, file); err != nil { - respondError(w, http.StatusBadRequest, err.Error()) - return - } - - var packageName = "" - f := strings.Split(header.Filename, ".") - if len(f) > 0 { - packageName = f[0] - } - impl.logger.Infof(packageName) - - pkgPath := PackageFolderPath + header.Filename - newFile, err := os.Create(pkgPath) - if err != nil { - respondError(w, http.StatusInternalServerError, err.Error()) - return - } - - defer newFile.Close() - if _, err := newFile.Write(buf.Bytes()); err != nil { - respondError(w, http.StatusInternalServerError, err.Error()) - return - } - - /* Unzip package to decode appDescriptor */ - impl.openPackage(w, pkgPath) - - var yamlFile = PackageFolderPath + packageName + "/Definitions/" + "MainServiceTemplate.yaml" - appPkgInfo := impl.decodeApplicationDescriptor(w, yamlFile) - appPkgInfo.AppPackage = header.Filename - appPkgInfo.OnboardingState = "ONBOARDED" - - impl.logger.Infof("Application package info from package") - defer r.Body.Close() - - impl.dbAdapter.InsertAppPackageInfo(appPkgInfo) - - /*http.StatusOK*/ - respondJSON(w, http.StatusCreated, appPkgInfo) -} - -// Opens package -func (impl *HandlerImpl) openPackage(w http.ResponseWriter, packagePath string) { - zipReader, _ := zip.OpenReader(packagePath) - for _, file := range zipReader.Reader.File { - - zippedFile, err := file.Open() - if err != nil { - respondError(w, http.StatusBadRequest, err.Error()) - } - defer zippedFile.Close() - - targetDir := PackageFolderPath + "/" - extractedFilePath := filepath.Join( - targetDir, - file.Name, - ) - - if file.FileInfo().IsDir() { - os.MkdirAll(extractedFilePath, file.Mode()) - } else { - outputFile, err := os.OpenFile( - extractedFilePath, - os.O_WRONLY|os.O_CREATE|os.O_TRUNC, - file.Mode(), - ) - if err != nil { - respondError(w, http.StatusBadRequest, err.Error()) - } - defer outputFile.Close() - - _, err = io.Copy(outputFile, zippedFile) - if err != nil { - respondError(w, http.StatusBadRequest, err.Error()) - } - } - } -} - -// Decodes application descriptor -func (impl *HandlerImpl) decodeApplicationDescriptor(w http.ResponseWriter, serviceTemplate string) model.AppPackageInfo { - - yamlFile, err := ioutil.ReadFile(serviceTemplate) - if err != nil { - respondError(w, http.StatusBadRequest, err.Error()) - } - - jsondata, err := yaml.YAMLToJSON(yamlFile) - if err != nil { - respondError(w, http.StatusBadRequest, err.Error()) - } - - appDId, _, _, _ := jsonparser.Get(jsondata, "topology_template", "node_templates", "face_recognition", "properties", "appDId") - appProvider, _, _, _ := jsonparser.Get(jsondata, "topology_template", "node_templates", "face_recognition", "properties", "appProvider") - appInfoName, _, _, _ := jsonparser.Get(jsondata, "topology_template", "node_templates", "face_recognition", "properties", "appInfoName") - appSoftVersion, _, _, _ := jsonparser.Get(jsondata, "topology_template", "node_templates", "face_recognition", "properties", "appSoftVersion") - appDVersion, _, _, _ := jsonparser.Get(jsondata, "topology_template", "node_templates", "face_recognition", "properties", "appDVersion") - deployType, _, _, _ := jsonparser.Get(jsondata, "topology_template", "node_templates", "face_recognition", "properties", "type") - - appPkgInfo := model.AppPackageInfo{ - ID: string(appDId), - AppDID: string(appDId), - AppProvider: string(appProvider), - AppName: string(appInfoName), - AppSoftwareVersion: string(appSoftVersion), - AppDVersion: string(appDVersion), - DeployType: string(deployType), - } - - //return appPackageInfo - return appPkgInfo -} - -// Query application package information -func (impl *HandlerImpl) QueryAppPackageInfo(w http.ResponseWriter, r *http.Request) { - params := mux.Vars(r) - appPkgId := params["appPkgId"] - appPkgInfo := impl.dbAdapter.GetAppPackageInfo(appPkgId) - if appPkgInfo.ID == "" { - respondJSON(w, http.StatusNotFound, "ID not exist") - return - } - respondJSON(w, http.StatusAccepted, json.NewEncoder(w).Encode(appPkgInfo)) -} - -// Deletes application package -func (impl *HandlerImpl) DeleteAppPackage(w http.ResponseWriter, r *http.Request) { - params := mux.Vars(r) - appPkgId := params["appPkgId"] - appPackageInfo := impl.dbAdapter.GetAppPackageInfo(appPkgId) - if appPackageInfo.ID == "" { - respondJSON(w, http.StatusNotFound, "ID not exist") - return - } - impl.dbAdapter.DeleteAppPackageInfo(appPkgId) - - deletePackage := PackageFolderPath + appPackageInfo.AppPackage - - /* Delete ZIP*/ - os.Remove(deletePackage) - f := strings.Split(appPackageInfo.AppPackage, ".") - if len(f) > 0 { - packageName := f[0] - /*Delete unzipped*/ - os.Remove(packageName) - } - respondJSON(w, http.StatusAccepted, json.NewEncoder(w).Encode("")) -} - -// Creates application instance -func (impl *HandlerImpl) CreateAppInstance(w http.ResponseWriter, r *http.Request) { - var req model.CreateApplicationReq - err := json.NewDecoder(r.Body).Decode(&req) - if err != nil { - respondError(w, http.StatusInternalServerError, err.Error()) - return - } - - appPkgInfo := impl.dbAdapter.GetAppPackageInfo(req.AppDID) - if appPkgInfo.ID == "" { - respondJSON(w, http.StatusNotFound, "ID not exist") - return - } - impl.logger.Infof("Query appPkg Info:", appPkgInfo) - - appInstanceId, err := uuid.NewUUID() - if err != nil { - respondError(w, http.StatusInternalServerError, err.Error()) - } - - appInstanceInfo := model.AppInstanceInfo{ - - ID: appInstanceId.String(), - AppInstanceName: req.AppInstancename, - AppInstanceDescription: req.AppInstanceDescriptor, - AppDID: req.AppDID, - AppProvider: appPkgInfo.AppProvider, - AppName: appPkgInfo.AppName, - AppSoftVersion: appPkgInfo.AppSoftwareVersion, - AppDVersion: appPkgInfo.AppDVersion, - AppPkgID: appPkgInfo.AppDID, - InstantiationState: "NOT_INSTANTIATED", - } - impl.dbAdapter.InsertAppInstanceInfo(appInstanceInfo) - impl.logger.Infof("CreateAppInstance:", req) - /*http.StatusOK*/ - respondJSON(w, http.StatusCreated, json.NewEncoder(w).Encode(appInstanceInfo)) -} - -// Instantiates application instance -func (impl *HandlerImpl) InstantiateAppInstance(w http.ResponseWriter, r *http.Request) { - var req model.InstantiateApplicationReq - err := json.NewDecoder(r.Body).Decode(&req) - if err != nil { - respondError(w, http.StatusInternalServerError, err.Error()) - return - } - - params := mux.Vars(r) - appInstanceId := params["appInstanceId"] - - appInstanceInfo := impl.dbAdapter.GetAppInstanceInfo(appInstanceId) - appPackageInfo := impl.dbAdapter.GetAppPackageInfo(appInstanceInfo.AppDID) - if appInstanceInfo.ID == "" || appPackageInfo.ID == "" { - respondJSON(w, http.StatusNotFound, "ID not exist") - return - } - - if appInstanceInfo.InstantiationState == "INSTANTIATED" { - respondError(w, http.StatusInternalServerError, "Application already instantiated") - return - } - - //remove extension - var packageName = "" - f := strings.Split(appPackageInfo.AppPackage, ".") - if len(f) > 0 { - packageName = f[0] - } - impl.logger.Infof(packageName) - - var artifact string - var pluginInfo string - - switch appPackageInfo.DeployType { - case "helm": - pkgPath := PackageFolderPath + packageName + PackageArtifactPath + "Charts" - artifact = impl.getDeploymentArtifact(pkgPath, ".tar") - if artifact == "" { - respondError(w, http.StatusInternalServerError, "artifact not available in application package") - return - } - pluginInfo = "helmplugin" + ":" + os.Getenv("HELM_PLUGIN_PORT") - impl.logger.Infof("Plugin Info ", pluginInfo) - case "kubernetes": - pkgPath := PackageFolderPath + packageName + PackageArtifactPath + "Kubernetes" - artifact = impl.getDeploymentArtifact(pkgPath, "*.yaml") - if artifact == "" { - respondError(w, http.StatusInternalServerError, "artifact not available in application package") - return - } - pluginInfo = "kubernetes.plugin" + ":" + os.Getenv("KUBERNETES_PLUGIN_PORT") - default: - respondError(w, http.StatusInternalServerError, "Deployment type not supported") - return - } - impl.logger.Infof("Artifact to deploy:", artifact) - - adapter := pluginAdapter.NewPluginAdapter(pluginInfo, impl.logger) - workloadId, err, resStatus := adapter.Instantiate(pluginInfo, req.SelectedMECHostInfo.HostID, artifact) - if err != nil { - st, ok := status.FromError(err) - if ok && st.Code() == codes.InvalidArgument { - respondError(w, http.StatusBadRequest, err.Error()) - return - } else { - respondError(w, http.StatusInternalServerError, err.Error()) - } - } - - if resStatus == "Failure" { - respondError(w, http.StatusInternalServerError, err.Error()) - } - - impl.dbAdapter.UpdateAppInstanceInfoInstStatusHostAndWorkloadId(appInstanceId, "INSTANTIATED", req.SelectedMECHostInfo.HostID, workloadId) - respondJSON(w, http.StatusAccepted, json.NewEncoder(w).Encode(workloadId)) -} - -// Gets deployment artifact -func (impl *HandlerImpl) getDeploymentArtifact(dir string, ext string) string { - d, err := os.Open(dir) - if err != nil { - impl.logger.Infof("Error: ", err) - return "" - } - defer d.Close() - - files, err := d.Readdir(-1) - if err != nil { - impl.logger.Infof("Error: ", err) - return "" - } - - impl.logger.Infof("Directory to read " + dir) - - for _, file := range files { - if file.Mode().IsRegular() { - if filepath.Ext(file.Name()) == ext || filepath.Ext(file.Name()) == ".gz" { - impl.logger.Infof(file.Name()) - impl.logger.Infof(dir + "/" + file.Name()) - return dir + "/" + file.Name() - } - } - } - return "" -} - -// Queries application instance information -func (impl *HandlerImpl) QueryAppInstanceInfo(w http.ResponseWriter, r *http.Request) { - - params := mux.Vars(r) - appInstanceId := params["appInstanceId"] - - appInstanceInfo := impl.dbAdapter.GetAppInstanceInfo(appInstanceId) - appPackageInfo := impl.dbAdapter.GetAppPackageInfo(appInstanceInfo.AppDID) - if appInstanceInfo.ID == "" || appPackageInfo.ID == "" { - respondJSON(w, http.StatusNotFound, "ID not exist") - return - } - var instantiatedAppState string - if appInstanceInfo.InstantiationState == "INSTANTIATED" { - - var pluginInfo string - - switch appPackageInfo.DeployType { - case "helm": - pluginInfo = "helmplugin" + ":" + os.Getenv("HELM_PLUGIN_PORT") - case "kubernetes": - pluginInfo = "kubernetes.plugin" + ":" + os.Getenv("KUBERNETES_PLUGIN_PORT") - default: - respondError(w, http.StatusInternalServerError, "Deployment type not supported") - return - } - - adapter := pluginAdapter.NewPluginAdapter(pluginInfo, impl.logger) - state, err := adapter.Query(pluginInfo, appInstanceInfo.Host, appInstanceInfo.WorkloadID) - if err != nil { - respondError(w, http.StatusInternalServerError, err.Error()) - return - } - instantiatedAppState = state - } - appInstanceInfo.InstantiatedAppState = instantiatedAppState - - respondJSON(w, http.StatusCreated, json.NewEncoder(w).Encode(appInstanceInfo)) -} - -// Queries application lcm operation status -func (impl *HandlerImpl) QueryAppLcmOperationStatus(w http.ResponseWriter, r *http.Request) { - var req model.QueryApplicationLCMOperStatusReq - err := json.NewDecoder(r.Body).Decode(&req) - if err != nil { - respondError(w, http.StatusInternalServerError, err.Error()) - return - } - - fmt.Fprintf(w, "QueryApplicationLCMOperStatus: %+v", req) -} - -// Terminates application instance -func (impl *HandlerImpl) TerminateAppInstance(w http.ResponseWriter, r *http.Request) { - impl.logger.Infof("TerminateAppInstance...") - params := mux.Vars(r) - appInstanceId := params["appInstanceId"] - - appInstanceInfo := impl.dbAdapter.GetAppInstanceInfo(appInstanceId) - appPackageInfo := impl.dbAdapter.GetAppPackageInfo(appInstanceInfo.AppDID) - if appInstanceInfo.ID == "" || appPackageInfo.ID == "" { - respondJSON(w, http.StatusNotFound, "ID not exist") - return - } - - if appInstanceInfo.InstantiationState == "NOT_INSTANTIATED" { - respondError(w, http.StatusNotAcceptable, "instantiationState: NOT_INSTANTIATED") - return - } - - var pluginInfo string - switch appPackageInfo.DeployType { - case "helm": - pluginInfo = "helmplugin" + ":" + os.Getenv("HELM_PLUGIN_PORT") - case "kubernetes": - pluginInfo = "kubernetes.plugin" + ":" + os.Getenv("KUBERNETES_PLUGIN_PORT") - default: - respondError(w, http.StatusInternalServerError, "Deployment type not supported") - return - } - - adapter := pluginAdapter.NewPluginAdapter(pluginInfo, impl.logger) - _, err := adapter.Terminate(pluginInfo, appInstanceInfo.Host, appInstanceInfo.WorkloadID) - if err != nil { - respondError(w, http.StatusInternalServerError, err.Error()) - return - } - impl.dbAdapter.UpdateAppInstanceInfoInstStatusAndWorkload(appInstanceId, "NOT_INSTANTIATED", "") - - respondJSON(w, http.StatusAccepted, json.NewEncoder(w).Encode("")) -} - -// Deletes application instance identifier -func (impl *HandlerImpl) DeleteAppInstanceIdentifier(w http.ResponseWriter, r *http.Request) { - impl.logger.Infof("DeleteAppInstanceIdentifier:") - params := mux.Vars(r) - appInstanceId := params["appInstanceId"] - - impl.dbAdapter.DeleteAppInstanceInfo(appInstanceId) - respondJSON(w, http.StatusOK, json.NewEncoder(w).Encode("")) -} - -// It makes the JSON -func respondJSON(w http.ResponseWriter, status int, payload interface{}) { - response, err := json.Marshal(payload) - if err != nil { - w.WriteHeader(http.StatusInternalServerError) - w.Write([]byte(err.Error())) - return - } - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(status) - w.Write([]byte(response)) -} - -// RespondError makes the error response with payload as json format -func respondError(w http.ResponseWriter, code int, message string) { - respondJSON(w, code, map[string]string{"error": message}) -} diff --git a/mecm/mepm/applcm/broker/pkg/handlers/model/model.go b/mecm/mepm/applcm/broker/pkg/handlers/model/model.go deleted file mode 100644 index dad1358..0000000 --- a/mecm/mepm/applcm/broker/pkg/handlers/model/model.go +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package model - -import ( - _ "github.com/jinzhu/gorm/dialects/mysql" -) - -type CreateApplicationReq struct { - AppDID string `yaml:"appDId"` - AppInstancename string `yaml:"appInstancename"` - AppInstanceDescriptor string `yaml:"appInstanceDescriptor"` -} - -type CreateApplicationRsp struct { - AppInstanceID string `yaml:"appInstanceId"` -} - -type OnBoardPkgApplicationRsp struct { - AppPkgID string `yaml:"appPkgId"` -} - -type InstantiateApplicationReq struct { - SelectedMECHostInfo struct { - HostName string `yaml:"hostName"` - HostID string `yaml:"hostId"` - } `yaml:"selectedMECHostInfo"` -} - -type QueryApplicationInstanceInfoReq struct { - Filter string `yaml:"filter"` - AttributeSelector string `yaml:"attributeSelector"` -} - -type QueryApplicationLCMOperStatusReq struct { - LifecycleOperationOccurrenceID string `yaml:"lifecycleOperationOccurrenceId"` -} - -// User represents a user account -type AppPackageInfo struct { - //gorm.Model - ID string `gorm:"primary_key;not null;unique"` - AppDID string `yaml:"appDId"` - AppProvider string `yaml:"appProvider"` - AppName string `yaml:"appName"` - AppSoftwareVersion string `yaml:"appSoftwareVersion"` - AppDVersion string `yaml:"appDVersion"` - OnboardingState string `yaml:"onboardingState"` - DeployType string `yaml:"deployType"` - AppPackage string `yaml:"appPackage"` -} - -// Task represents a task for the user -type AppInstanceInfo struct { - //gorm.Model - ID string `gorm:"primary_key;not null;unique"` - AppInstanceName string `yaml:"appInstanceName"` - AppInstanceDescription string `yaml:"appInstanceDescription"` - AppDID string `yaml:"appDId"` - AppProvider string `yaml:"appProvider"` - AppName string `yaml:"appName"` - AppSoftVersion string `yaml:"appSoftVersion"` - AppDVersion string `yaml:"appDVersion"` - AppPkgID string `yaml:"appPkgId"` - InstantiationState string `yaml:"instantiationState"` - Host string `yaml:"host"` - WorkloadID string `yaml:"workloadId"` - InstantiatedAppState string `yaml:"instantiatedAppState"` -} diff --git a/mecm/mepm/applcm/broker/pkg/plugin/grpcclient.go b/mecm/mepm/applcm/broker/pkg/plugin/grpcclient.go deleted file mode 100644 index e778367..0000000 --- a/mecm/mepm/applcm/broker/pkg/plugin/grpcclient.go +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package plugin - -import ( - "broker/internal/lcmservice" - "io" - "os" - - "github.com/sirupsen/logrus" - "golang.org/x/net/context" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - _ "google.golang.org/grpc/encoding/gzip" -) - -// GRPC client to different GRPC supported plugins -type ClientGRPC struct { - conn *grpc.ClientConn - client lcmservice.AppLCMClient - chunkSize int - logger *logrus.Logger -} - -type ClientGRPCConfig struct { - Address string - ChunkSize int - RootCertificate string - Logger *logrus.Logger -} - -// Create a GRPC client -func NewClientGRPC(cfg ClientGRPCConfig) (c ClientGRPC, err error) { - - var ( - grpcOpts = []grpc.DialOption{} - grpcCreds credentials.TransportCredentials - ) - - c.chunkSize = cfg.ChunkSize - c.logger = cfg.Logger - - if cfg.RootCertificate != "" { - grpcCreds, err = credentials.NewClientTLSFromFile(cfg.RootCertificate, "localhost") - if err != nil { - c.logger.Errorf("failed to create grpc tls client via provided root-cert ", err) - return c, err - } - grpcOpts = append(grpcOpts, grpc.WithTransportCredentials(grpcCreds)) - } else { - grpcOpts = append(grpcOpts, grpc.WithInsecure()) - } - - c.conn, err = grpc.Dial(cfg.Address, grpcOpts...) - if err != nil { - c.logger.Errorf("failed to start grpc connection with address: ", cfg.Address) - return c, err - } - - c.client = lcmservice.NewAppLCMClient(c.conn) - return c, nil -} - -// Instantiate application -func (c *ClientGRPC) Instantiate(ctx context.Context, deployArtifact string, hostIP string) (workloadId string, status string, error error) { - var ( - writing = true - buf []byte - n int - file *os.File - ) - c.logger.Infof("deployArtifact: ", deployArtifact) - - // Get a file handle for the file we - // want to upload - file, err := os.Open(deployArtifact) - if err != nil { - c.logger.Errorf("failed to open package file: %s. Err: %s", deployArtifact, err.Error()) - return "", "Failure", err - } - defer file.Close() - - // Open a stream-based connection with the - // gRPC server - stream, err := c.client.Instantiate(ctx) - - if err != nil { - c.logger.Errorf("failed to upload stream: %s. Err: %s", deployArtifact, err.Error()) - return "", "Failure", err - } - defer stream.CloseSend() - - //send metadata information - req := &lcmservice.InstantiateRequest{ - - Data: &lcmservice.InstantiateRequest_HostIp{ - HostIp: hostIP, - }, - } - - err = stream.Send(req) - if err != nil { - c.logger.Errorf("failed to send metadata information: ", deployArtifact) - return "", "Failure", err - } - - // Allocate a buffer with `chunkSize` as the capacity - // and length (making a 0 array of the size of `chunkSize`) - buf = make([]byte, c.chunkSize) - for writing { - // put as many bytes as `chunkSize` into the - // buf array. - n, err = file.Read(buf) - if err != nil { - // ... if `eof` --> `writing=false`... - if err == io.EOF { - writing = false - err = nil - continue - } - c.logger.Errorf("errored while copying from file to buf: ", err) - return "", "Failure", err - } - - req := &lcmservice.InstantiateRequest{ - Data: &lcmservice.InstantiateRequest_Package{ - Package: buf[:n], - }, - } - - err = stream.Send(req) - - if err != nil { - c.logger.Errorf("failed to send chunk via stream: ", err) - return "", "Failure", err - } - } - - res, err := stream.CloseAndRecv() - if err != nil { - c.logger.Errorf("failed to receive upstream status response: ", err) - return "", "Failure", err - } - c.logger.Infof("Instantiation Completed with workloadId %s and status", res.GetWorkloadId(), res.GetStatus()) - return res.GetWorkloadId(), res.GetStatus(), err -} - -// Query application -func (c *ClientGRPC) Query(ctx context.Context, hostIP string, workloadId string) (status string, error error) { - - req := &lcmservice.QueryRequest{ - HostIp: hostIP, - WorkloadId: workloadId, - } - resp, err := c.client.Query(ctx, req) - if err != nil { - return "", err - } - return resp.Status, err -} - -// Terminate application -func (c *ClientGRPC) Terminate(ctx context.Context, hostIP string, workloadId string) (status string, error error) { - - req := &lcmservice.TerminateRequest{ - HostIp: hostIP, - WorkloadId: workloadId, - } - resp, err := c.client.Terminate(ctx, req) - if err != nil { - return "", err - } - return resp.Status, err -} - -func (c *ClientGRPC) Close() { - if c.conn != nil { - c.conn.Close() - } -} diff --git a/mecm/mepm/applcm/broker/pkg/util/logger.go b/mecm/mepm/applcm/broker/pkg/util/logger.go deleted file mode 100644 index 16173d0..0000000 --- a/mecm/mepm/applcm/broker/pkg/util/logger.go +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package util - -import ( - "os" - - "github.com/sirupsen/logrus" -) - -func GetLogger(logFile string, loggerLevel logrus.Level, file *os.File) *logrus.Logger { - - logger := logrus.New() - logger.SetOutput(file) - logger.SetFormatter(&logrus.TextFormatter{ - DisableColors: true, - FullTimestamp: true, - }) - logger.SetLevel(loggerLevel) - logger.Infof("logger created") - return logger -} diff --git a/mecm/mepm/applcm/broker/start.sh b/mecm/mepm/applcm/broker/start.sh deleted file mode 100755 index 4b909b9..0000000 --- a/mecm/mepm/applcm/broker/start.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -cd / -#set +e -#sed -i "s/^httpaddr.*=.*$/httpaddr = $(hostname)/g" conf/app.conf -#sed -i "s/^ssl_mode.*=.*$/ssl_mode = ${MEP_SSL_MODE:-0}/g" conf/app.conf -#sed -i "s/^ssl_verify_client.*=.*$/ssl_verify_client = 0/g" conf/app.conf -#set -e - -./app diff --git a/mecm/mepm/applcm/broker/version/version.go b/mecm/mepm/applcm/broker/version/version.go deleted file mode 100644 index e3e130b..0000000 --- a/mecm/mepm/applcm/broker/version/version.go +++ /dev/null @@ -1,5 +0,0 @@ -package version - -var ( - Version = "0.0.1" -) diff --git a/mecm/mepm/applcm/k8shelm/build/Dockerfile b/mecm/mepm/applcm/k8shelm/build/Dockerfile deleted file mode 100644 index a0d8a8f..0000000 --- a/mecm/mepm/applcm/k8shelm/build/Dockerfile +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM golang:1.13.4-alpine3.10 as builder - -ENV GOPROXY https://goproxy.io -ENV GO111MODULE on -ENV HOME=/go/release - -RUN mkdir -p $HOME - -WORKDIR /go/cache - -ADD go.mod . -ADD go.sum . -RUN go mod download - -WORKDIR $HOME - -RUN mkdir charts -RUN mkdir kubeconfig - -ADD . . - -RUN GOOS=linux CGO_ENABLED=0 go build -ldflags="-s -w" -installsuffix cgo -o app cmd/helm/main.go - -FROM golang:1.13.4-alpine3.10 - -RUN mkdir -p /go/release - -ENV HOME=/go/release -ENV APP_HOME=/go/release -ENV UID=166 -ENV GID=166 -ENV USER_NAME=ealtuser -ENV GROUP_NAME=ealtgroup - -RUN apk update &&\ - apk add shadow &&\ - groupadd -r -g $GID $GROUP_NAME &&\ - useradd -r -u $UID -g $GID -d $HOME -s /sbin/nologin -c "Docker image user" $USER_NAME &&\ - chown -R $USER_NAME:$GROUP_NAME $HOME - -WORKDIR $APP_HOME - -USER $USER_NAME - -COPY --chown=ealtuser:ealtgroup --from=builder $HOME/app $APP_HOME -COPY --chown=ealtuser:ealtgroup --from=builder $HOME/start.sh $APP_HOME - -RUN mkdir charts -RUN mkdir kubeconfig - -RUN chmod 750 $HOME &&\ - chmod 550 $HOME/app &&\ - chmod 550 $HOME/start.sh - -EXPOSE 50051 - -ENTRYPOINT ["./app"] diff --git a/mecm/mepm/applcm/k8shelm/build_image.sh b/mecm/mepm/applcm/k8shelm/build_image.sh deleted file mode 100755 index 15c94cb..0000000 --- a/mecm/mepm/applcm/k8shelm/build_image.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DOCKER_BUILD_DIR=`pwd` -MECM_VERSION=latest -IMAGE_NAME=helmplugin -REPO_NAME=ealtedge - -echo "DOCKER_BUILD_DIR=${DOCKER_BUILD_DIR}" -echo "In Build and Push K8s Help Plugin" - -function build_image { - docker build --no-cache -t ${REPO_NAME}/${IMAGE_NAME}:${MECM_VERSION} -f build/Dockerfile . -} - -build_image diff --git a/mecm/mepm/applcm/k8shelm/build_push_image.sh b/mecm/mepm/applcm/k8shelm/build_push_image.sh deleted file mode 100644 index 2d3e4cd..0000000 --- a/mecm/mepm/applcm/k8shelm/build_push_image.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -unset REPO_USER -unset REPO_PWD -echo -n "REPO_USER:" -read REPO_USER -echo -n "REPO_PWD:" -read REPO_PWD - -DOCKER_BUILD_DIR=`pwd` -MECM_VERSION=latest -IMAGE_NAME=helmplugin -REPO_NAME=ealtedge - -echo "DOCKER_BUILD_DIR=${DOCKER_BUILD_DIR}" -echo "In Build and Push K8s Helm Plugin" - -function build_image { - docker build --no-cache -t ${REPO_NAME}/${IMAGE_NAME}:${MECM_VERSION} -f build/Dockerfile . -} - -function push_image { - docker login -u ${REPO_USER} -p ${REPO_PWD} - docker push ${REPO_NAME}/${IMAGE_NAME}:${MECM_VERSION} -} - -build_image -push_image \ No newline at end of file diff --git a/mecm/mepm/applcm/k8shelm/cmd/helm/main.go b/mecm/mepm/applcm/k8shelm/cmd/helm/main.go deleted file mode 100644 index 84b2a12..0000000 --- a/mecm/mepm/applcm/k8shelm/cmd/helm/main.go +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "k8shelm/pkg/plugin" - "os" - "strconv" - - "github.com/sirupsen/logrus" -) - -// Variables to be defined in deployment file -var ( - serverPort = os.Getenv("HELM_PLUGIN_PORT") - logFile = os.Getenv("LOGFILE_PATH") - loggerLevel = os.Getenv("LOGGER_LEVEL") - certificate = os.Getenv("CERTIFICATE_PATH") - key = os.Getenv("KEY_PATH") -) - -func main() { - // Prepare logger - file, err := os.Create(logFile) - if err != nil { - logrus.Fatal(err) - } - defer file.Close() - - level, err := logrus.ParseLevel(loggerLevel) - var logger = plugin.GetLogger(logFile, level, file) - - // Create GRPC server - sp, err := strconv.Atoi(serverPort) - serverConfig := plugin.ServerGRPCConfig{Certificate: certificate, Port: sp, Key: key, Logger: logger} - server := plugin.NewServerGRPC(serverConfig) - - // Start listening - err = server.Listen() - if err != nil { - logger.Fatalf("failed to listen: %v", err) - } -} diff --git a/mecm/mepm/applcm/k8shelm/go.mod b/mecm/mepm/applcm/k8shelm/go.mod deleted file mode 100644 index 342eb67..0000000 --- a/mecm/mepm/applcm/k8shelm/go.mod +++ /dev/null @@ -1,12 +0,0 @@ -module k8shelm - -go 1.14 - -require ( - github.com/golang/protobuf v1.4.1 - github.com/sirupsen/logrus v1.4.2 - google.golang.org/grpc v1.29.1 - google.golang.org/protobuf v1.22.0 - helm.sh/helm/v3 v3.2.0 - rsc.io/letsencrypt v0.0.3 // indirect -) diff --git a/mecm/mepm/applcm/k8shelm/go.sum b/mecm/mepm/applcm/k8shelm/go.sum deleted file mode 100644 index 732ca07..0000000 --- a/mecm/mepm/applcm/k8shelm/go.sum +++ /dev/null @@ -1,764 +0,0 @@ -bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DATA-DOG/go-sqlmock v1.4.1 h1:ThlnYciV1iM/V0OSF/dtkqWb6xo5qITT1TJBG1MRDJM= -github.com/DATA-DOG/go-sqlmock v1.4.1/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd h1:sjQovDkwrZp8u+gxLtPgKGjk5hCxuy2hrRejBTA9xFU= -github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E= -github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= -github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.1.0 h1:Y2lUDsFKVRSYGojLJ1yLxSXdMmMYTYls0rCvoqmMUQk= -github.com/Masterminds/semver/v3 v3.1.0/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/sprig/v3 v3.1.0 h1:j7GpgZ7PdFqNsmncycTHsLmVPf5/3wJtlgW9TNDYD9Y= -github.com/Masterminds/sprig/v3 v3.1.0/go.mod h1:ONGMf7UfYGAbMXCZmQLy8x3lCDIPrEZE/rU8pmrbihA= -github.com/Masterminds/squirrel v1.2.0 h1:K1NhbTO21BWG47IVR0OnIZuE0LZcXAYqywrC3Ko53KI= -github.com/Masterminds/squirrel v1.2.0/go.mod h1:yaPeOnPG5ZRwL9oKdTsO/prlkPbXWZlRVMQ/gGlzIuA= -github.com/Masterminds/vcs v1.13.1/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHSmwVJjcKA= -github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 h1:ygIc8M6trr62pF5DucadTWGdEB4mEyvzi0e2nbcmcyA= -github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/hcsshim v0.8.7 h1:ptnOoufxGSzauVTsdE+wMYnCWA301PdoN4xg5oRdZpg= -github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -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-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -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/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d h1:UrqY+r/OJnIp5u0s1SbQ8dVfLCZJsnvazdBP5hS4iRs= -github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= -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= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -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/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 h1:zV3ejI06GQ59hwDQAvmK1qxOQGB3WuVTRoY0okPTAv0= -github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -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= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y= -github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= -github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/bshuster-repo/logrus-logstash-hook v0.4.1 h1:pgAtgj+A31JBVtEHu2uHuEx0n+2ukqUJnS2vVe5pQNA= -github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= -github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd h1:rFt+Y/IK1aEZkEHchZRSq9OQbsSzIT/OrI8YFFmRIng= -github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= -github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b h1:otBG+dV+YK+Soembjv71DPz3uX/V/6MMlSyD9JBQ6kQ= -github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= -github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0 h1:nvj0OLI3YqYXer/kZD8Ri1aaunCxIEsOst1BVJswV0o= -github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f h1:tSNMc+rJDfmYntojat8lljbt1mgKNpTxUZJsSzJ9Y1s= -github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= -github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.2 h1:ForxmXkA6tPIvffbrDAcPUIB32QgXkt2XFj+F0UxetA= -github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20200107194136-26c1120b8d41 h1:kIFnQBO7rQ0XkMe6xEwbybYHBEaWmh/f++laI6Emt7M= -github.com/containerd/continuity v0.0.0-20200107194136-26c1120b8d41/go.mod h1:Dq467ZllaHgAtVp4p1xUQWBrFXR9s/wyoTpG8zOJGkY= -github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/cyphar/filepath-securejoin v0.2.2 h1:jCwT2GTP+PY5nBz3c/YL5PAIbusElVrPujOBSCj8xRg= -github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= -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/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd/go.mod h1:dv4zxwHi5C/8AeI+4gX4dCWOIvNi7I6JCSX0HvlKPgE= -github.com/deislabs/oras v0.8.1 h1:If674KraJVpujYR00rzdi0QAmW4BxzMJPVAZJKuhQ0c= -github.com/deislabs/oras v0.8.1/go.mod h1:Mx0rMSbBNaNfY9hjpccEnxkOqJL6KGjtxNHPLC4G4As= -github.com/denisenkom/go-mssqldb v0.0.0-20191001013358-cfbb681360f0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= -github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -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/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/docker/cli v0.0.0-20200130152716-5d0cf8839492 h1:FwssHbCDJD025h+BchanCwE1Q8fyMgqDr2mOQAWOLGw= -github.com/docker/cli v0.0.0-20200130152716-5d0cf8839492/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v0.0.0-20191216044856-a8371794149d/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= -github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v1.4.2-0.20200203170920-46ec8731fbce h1:KXS1Jg+ddGcWA8e1N7cupxaHHZhit5rB9tfDU+mfjyY= -github.com/docker/docker v1.4.2-0.20200203170920-46ec8731fbce/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.6.3 h1:zI2p9+1NQYdnG6sMU26EX4aVGlqbInSQxQXLvzJ4RPQ= -github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916 h1:yWHOI+vFjEsAakUTSrtqc/SAHrhSkmn48pqjidZX3QA= -github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= -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/libtrust v0.0.0-20150114040149-fa567046d9b1 h1:ZClxb8laGDf5arXfYcAtECDFgAgHklGI8CxgjHnXKJ4= -github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96 h1:cenwrSVm+Z7QLSV/BsnenAOcDXdX4cMv4wP0B/5QbPg= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= -github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwCFad8crR9dcMQWvV9Hvulu6hwUh4tWPJnM= -github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= -github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7 h1:LofdAjjjqCSXMwLGgOgnE+rdPuvX9DxCqaHwKy7i/ko= -github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -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-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/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -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/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -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/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -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/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/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= -github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= -github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.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/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/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -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 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -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.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA= -github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.1 h1:OQl5ys5MBea7OGCdvPbBJWRgnhC/fGona6QKfvFeau8= -github.com/gobuffalo/envy v1.7.1/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w= -github.com/gobuffalo/logger v1.0.1 h1:ZEgyRGgAm4ZAhAO45YXMs5Fp+bzGLESFewzAVBMKuTg= -github.com/gobuffalo/logger v1.0.1/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= -github.com/gobuffalo/packd v0.3.0 h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4= -github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= -github.com/gobuffalo/packr/v2 v2.7.1 h1:n3CIW5T17T8v4GGK5sWXLVWJhCz7b5aNLSxW6gYim4o= -github.com/gobuffalo/packr/v2 v2.7.1/go.mod h1:qYEvAazPaVxy7Y7KR0W8qYEE+RymX74kETFqjFoFlOc= -github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= -github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= -github.com/gofrs/flock v0.7.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -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/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef h1:veQD95Isof8w9/WXiA+pa3tz3fJXkt5B7QaRBrM62gk= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1 h1:ZFgWrT+bLgsYPirOnRfKLYJLvssAegOj/hgyMFdJZe0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450/go.mod h1:Bk6SMAONeMXrxql8uvOKuAZSu8aM5RUGv+1C6IJaEho= -github.com/golangplus/fmt v0.0.0-20150411045040-2a5d6d7d2995/go.mod h1:lJgMEyOkYFkPcDKwRXegd+iM6E7matEszMG5HhwytU8= -github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= -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 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -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/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.1.0 h1:rVsPeBmXbYv4If/cumu1AzZPwV58q433hvONV1UEZoI= -github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33 h1:893HsJqtxp9z1SF76gg6hY70hRY1wVlTSnC/h1yUDCo= -github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/mux v1.7.2 h1:zoNxOV7WjqXptQOVngLmcSQgXmgk4NMz1HibBchjl/I= -github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gosuri/uitable v0.0.4 h1:IG2xLKRvErL3uhY6e1BylFzG+aJiwQviDDTfOKeKTpY= -github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/xstrings v1.3.1 h1:4jgBlKK6tLKFvO8u5pmYjG91cqytmDCDvGh7ECVFfFs= -github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= -github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmoiron/sqlx v1.2.0 h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA= -github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= -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/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -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 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= -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/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw= -github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= -github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= -github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU= -github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= -github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= -github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -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/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= -github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= -github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.12.0 h1:u/x3mp++qUxvYfulZ4HKOvVO0JWhk7HtE8lWhbGz/Do= -github.com/mattn/go-sqlite3 v1.12.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -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/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f h1:2+myh5ml7lgEU/51gbeLHfKGNfgEQQIWrlbdaOsidbQ= -github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= -github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= -github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v0.1.1 h1:GlxAyO6x8rfZYN9Tt0Kti5a/cP41iuiO2yYT0IJGY8Y= -github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 h1:JhzVVoYvbOACxoUmOs6V/G4D5nPVUW73rKvXxP4XUJc= -github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1 h1:K0MGApIoQvMw27RTdJkPbr3JZ7DNbtxQNyi5STVM6Kw= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8= -github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -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.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.4.0 h1:LUa41nrWTQNGhzdsZ5lTnkwbNjj6rXTdazA1cSdjkOY= -github.com/rogpeppe/go-internal v1.4.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rubenv/sql-migrate v0.0.0-20200212082348-64f95ea68aa3 h1:xkBtI5JktwbW/vf4vopBbhYsRFTGfQWHYXzC0/qYwxI= -github.com/rubenv/sql-migrate v0.0.0-20200212082348-64f95ea68aa3/go.mod h1:rtQlpHw+eR6UrqaS3kX1VYeaCxzCVdimDS7g5Ln4pPc= -github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= -github.com/sirupsen/logrus v1.2.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 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -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= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -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/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -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/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= -github.com/xeipuuv/gojsonschema v1.1.0 h1:ngVtJC9TY/lg0AA/1k48FYhBrhRoFlEmWzsehpNAaZg= -github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/handysort v0.0.0-20150421192137-fb3537ed64a1/go.mod h1:QcJo0QPSfTONNIgpN5RA8prR7fF8nkF6cTWTcNerRO8= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43 h1:+lm10QQTNSBd8DVTNGHx7o/IKu9HYDvLMffDhbyLccI= -github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= -github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50 h1:hlE8//ciYMztlGpl/VA+Zm1AcTPHYkHJPbHqE6WJUXE= -github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= -github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f h1:ERexzlUfuTvpE74urLSbIQW0Z/6hF9t8U4NsJLaioAY= -github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= -github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs= -github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -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/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/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-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/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-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -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-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200414173820-0848c9571904 h1:bXoxMPcSLOq08zI3/c5dEBT6lE4eh+jOh886GHrn6V8= -golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 h1:rjwSpXsdiK0dV8/Naq3kAw9ymfAeJIyd0upUIElB+lI= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -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-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7 h1:HmbHVPwrPEKPGLAcHSrMe6+hqSUlvZU0rab6x5EXfGU= -golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/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/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -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-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-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-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0 h1:cJv5/xdbk1NnMPR1VP9+HU6gupuG9MLBoH1r6RHZ2MY= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= -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-20141024133853-64131543e789/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/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= -gopkg.in/gorp.v1 v1.7.2 h1:j3DWlAyGVv8whO7AcIWznQ2Yj7yJkn34B8s63GViAAw= -gopkg.in/gorp.v1 v1.7.2/go.mod h1:Wo3h+DBQZIxATwftsglhdD/62zRFPhGhTiu5jUJmCaw= -gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -helm.sh/helm/v3 v3.2.0 h1:V12EGAmr2DJ/fWrPo2fPdXWSIXvlXm51vGkQIXMeymE= -helm.sh/helm/v3 v3.2.0/go.mod h1:ZaXz/vzktgwjyGGFbUWtIQkscfE7WYoRGP2szqAFHR0= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.18.0 h1:lwYk8Vt7rsVTwjRU6pzEsa9YNhThbmbocQlKvNBB4EQ= -k8s.io/api v0.18.0/go.mod h1:q2HRQkfDzHMBZL9l/y9rH63PkQl4vae0xRT+8prbrK8= -k8s.io/apiextensions-apiserver v0.18.0 h1:HN4/P8vpGZFvB5SOMuPPH2Wt9Y/ryX+KRvIyAkchu1Q= -k8s.io/apiextensions-apiserver v0.18.0/go.mod h1:18Cwn1Xws4xnWQNC00FLq1E350b9lUF+aOdIWDOZxgo= -k8s.io/apimachinery v0.18.0 h1:fuPfYpk3cs1Okp/515pAf0dNhL66+8zk8RLbSX+EgAE= -k8s.io/apimachinery v0.18.0/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= -k8s.io/apiserver v0.18.0/go.mod h1:3S2O6FeBBd6XTo0njUrLxiqk8GNy6wWOftjhJcXYnjw= -k8s.io/cli-runtime v0.18.0 h1:jG8XpSqQ5TrV0N+EZ3PFz6+gqlCk71dkggWCCq9Mq34= -k8s.io/cli-runtime v0.18.0/go.mod h1:1eXfmBsIJosjn9LjEBUd2WVPoPAY9XGTqTFcPMIBsUQ= -k8s.io/client-go v0.18.0 h1:yqKw4cTUQraZK3fcVCMeSa+lqKwcjZ5wtcOIPnxQno4= -k8s.io/client-go v0.18.0/go.mod h1:uQSYDYs4WhVZ9i6AIoEZuwUggLVEF64HOD37boKAtF8= -k8s.io/code-generator v0.18.0/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= -k8s.io/component-base v0.18.0 h1:I+lP0fNfsEdTDpHaL61bCAqTZLoiWjEEP304Mo5ZQgE= -k8s.io/component-base v0.18.0/go.mod h1:u3BCg0z1uskkzrnAKFzulmYaEpZF7XC9Pf/uFyb1v2c= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= -k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c h1:/KUFqjjqAcY4Us6luF5RDNZ16KJtb49HfR3ZHB9qYXM= -k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= -k8s.io/kubectl v0.18.0 h1:hu52Ndq/d099YW+3sS3VARxFz61Wheiq8K9S7oa82Dk= -k8s.io/kubectl v0.18.0/go.mod h1:LOkWx9Z5DXMEg5KtOjHhRiC1fqJPLyCr3KtQgEolCkU= -k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/metrics v0.18.0/go.mod h1:8aYTW18koXqjLVKL7Ds05RPMX9ipJZI3mywYvBOxXd4= -k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89 h1:d4vVOjXm687F1iLSP2q3lyPPuyvTUt3aVoBpi2DqRsU= -k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -rsc.io/letsencrypt v0.0.3 h1:H7xDfhkaFFSYEJlKeq38RwX2jYcnTeHuDQyT+mMNMwM= -rsc.io/letsencrypt v0.0.3/go.mod h1:buyQKZ6IXrRnB7TdkHP0RyEybLx18HHyOSoTyoOLqNY= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= -sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0= -sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= -sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= -sigs.k8s.io/structured-merge-diff/v3 v3.0.0 h1:dOmIZBMfhcHS09XZkMyUgkq5trg3/jRyJYFZUiaOp8E= -sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc/go.mod h1:so/NYdZXCz+E3ZpW0uAoCj6uzU2+8OWDFv/HxUSs7kI= diff --git a/mecm/mepm/applcm/k8shelm/internal/lcmservice/lcmservice.pb.go b/mecm/mepm/applcm/k8shelm/internal/lcmservice/lcmservice.pb.go deleted file mode 100644 index bc75e6e..0000000 --- a/mecm/mepm/applcm/k8shelm/internal/lcmservice/lcmservice.pb.go +++ /dev/null @@ -1,743 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.22.0 -// protoc v3.11.4 -// source: lcmservice.proto - -package lcmservice - -import ( - context "context" - reflect "reflect" - sync "sync" - - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -type InstantiateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Data: - // *InstantiateRequest_HostIp - // *InstantiateRequest_Package - Data isInstantiateRequest_Data `protobuf_oneof:"data"` -} - -func (x *InstantiateRequest) Reset() { - *x = InstantiateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_lcmservice_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InstantiateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InstantiateRequest) ProtoMessage() {} - -func (x *InstantiateRequest) ProtoReflect() protoreflect.Message { - mi := &file_lcmservice_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InstantiateRequest.ProtoReflect.Descriptor instead. -func (*InstantiateRequest) Descriptor() ([]byte, []int) { - return file_lcmservice_proto_rawDescGZIP(), []int{0} -} - -func (m *InstantiateRequest) GetData() isInstantiateRequest_Data { - if m != nil { - return m.Data - } - return nil -} - -func (x *InstantiateRequest) GetHostIp() string { - if x, ok := x.GetData().(*InstantiateRequest_HostIp); ok { - return x.HostIp - } - return "" -} - -func (x *InstantiateRequest) GetPackage() []byte { - if x, ok := x.GetData().(*InstantiateRequest_Package); ok { - return x.Package - } - return nil -} - -type isInstantiateRequest_Data interface { - isInstantiateRequest_Data() -} - -type InstantiateRequest_HostIp struct { - HostIp string `protobuf:"bytes,1,opt,name=hostIp,proto3,oneof"` -} - -type InstantiateRequest_Package struct { - Package []byte `protobuf:"bytes,2,opt,name=package,proto3,oneof"` -} - -func (*InstantiateRequest_HostIp) isInstantiateRequest_Data() {} - -func (*InstantiateRequest_Package) isInstantiateRequest_Data() {} - -type InstantiateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - WorkloadId string `protobuf:"bytes,1,opt,name=workloadId,proto3" json:"workloadId,omitempty"` - Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` -} - -func (x *InstantiateResponse) Reset() { - *x = InstantiateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_lcmservice_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InstantiateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InstantiateResponse) ProtoMessage() {} - -func (x *InstantiateResponse) ProtoReflect() protoreflect.Message { - mi := &file_lcmservice_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InstantiateResponse.ProtoReflect.Descriptor instead. -func (*InstantiateResponse) Descriptor() ([]byte, []int) { - return file_lcmservice_proto_rawDescGZIP(), []int{1} -} - -func (x *InstantiateResponse) GetWorkloadId() string { - if x != nil { - return x.WorkloadId - } - return "" -} - -func (x *InstantiateResponse) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -type TerminateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - HostIp string `protobuf:"bytes,1,opt,name=hostIp,proto3" json:"hostIp,omitempty"` - WorkloadId string `protobuf:"bytes,2,opt,name=workloadId,proto3" json:"workloadId,omitempty"` -} - -func (x *TerminateRequest) Reset() { - *x = TerminateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_lcmservice_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TerminateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TerminateRequest) ProtoMessage() {} - -func (x *TerminateRequest) ProtoReflect() protoreflect.Message { - mi := &file_lcmservice_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TerminateRequest.ProtoReflect.Descriptor instead. -func (*TerminateRequest) Descriptor() ([]byte, []int) { - return file_lcmservice_proto_rawDescGZIP(), []int{2} -} - -func (x *TerminateRequest) GetHostIp() string { - if x != nil { - return x.HostIp - } - return "" -} - -func (x *TerminateRequest) GetWorkloadId() string { - if x != nil { - return x.WorkloadId - } - return "" -} - -type TerminateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` -} - -func (x *TerminateResponse) Reset() { - *x = TerminateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_lcmservice_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TerminateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TerminateResponse) ProtoMessage() {} - -func (x *TerminateResponse) ProtoReflect() protoreflect.Message { - mi := &file_lcmservice_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TerminateResponse.ProtoReflect.Descriptor instead. -func (*TerminateResponse) Descriptor() ([]byte, []int) { - return file_lcmservice_proto_rawDescGZIP(), []int{3} -} - -func (x *TerminateResponse) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -type QueryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - HostIp string `protobuf:"bytes,1,opt,name=hostIp,proto3" json:"hostIp,omitempty"` - WorkloadId string `protobuf:"bytes,2,opt,name=workloadId,proto3" json:"workloadId,omitempty"` -} - -func (x *QueryRequest) Reset() { - *x = QueryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_lcmservice_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryRequest) ProtoMessage() {} - -func (x *QueryRequest) ProtoReflect() protoreflect.Message { - mi := &file_lcmservice_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead. -func (*QueryRequest) Descriptor() ([]byte, []int) { - return file_lcmservice_proto_rawDescGZIP(), []int{4} -} - -func (x *QueryRequest) GetHostIp() string { - if x != nil { - return x.HostIp - } - return "" -} - -func (x *QueryRequest) GetWorkloadId() string { - if x != nil { - return x.WorkloadId - } - return "" -} - -type QueryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` -} - -func (x *QueryResponse) Reset() { - *x = QueryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_lcmservice_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryResponse) ProtoMessage() {} - -func (x *QueryResponse) ProtoReflect() protoreflect.Message { - mi := &file_lcmservice_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead. -func (*QueryResponse) Descriptor() ([]byte, []int) { - return file_lcmservice_proto_rawDescGZIP(), []int{5} -} - -func (x *QueryResponse) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -var File_lcmservice_proto protoreflect.FileDescriptor - -var file_lcmservice_proto_rawDesc = []byte{ - 0x0a, 0x10, 0x6c, 0x63, 0x6d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x0a, 0x6c, 0x63, 0x6d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x52, - 0x0a, 0x12, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x70, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x70, 0x12, 0x1a, - 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, - 0x00, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x22, 0x4d, 0x0a, 0x13, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x77, 0x6f, 0x72, - 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x77, - 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x22, 0x4a, 0x0a, 0x10, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x70, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, 0x49, 0x70, 0x12, 0x1e, 0x0a, - 0x0a, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x22, 0x2b, 0x0a, - 0x11, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x46, 0x0a, 0x0c, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x6f, - 0x73, 0x74, 0x49, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x6f, 0x73, 0x74, - 0x49, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, - 0x49, 0x64, 0x22, 0x27, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0xe8, 0x01, 0x0a, 0x06, - 0x41, 0x70, 0x70, 0x4c, 0x43, 0x4d, 0x12, 0x52, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, - 0x74, 0x69, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x2e, 0x6c, 0x63, 0x6d, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6c, 0x63, 0x6d, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x12, 0x4a, 0x0a, 0x09, 0x74, 0x65, - 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x2e, 0x6c, 0x63, 0x6d, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6c, 0x63, 0x6d, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2e, 0x54, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, - 0x18, 0x2e, 0x6c, 0x63, 0x6d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6c, 0x63, 0x6d, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0e, 0x5a, 0x0c, 0x2e, 0x3b, 0x6c, 0x63, 0x6d, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_lcmservice_proto_rawDescOnce sync.Once - file_lcmservice_proto_rawDescData = file_lcmservice_proto_rawDesc -) - -func file_lcmservice_proto_rawDescGZIP() []byte { - file_lcmservice_proto_rawDescOnce.Do(func() { - file_lcmservice_proto_rawDescData = protoimpl.X.CompressGZIP(file_lcmservice_proto_rawDescData) - }) - return file_lcmservice_proto_rawDescData -} - -var file_lcmservice_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_lcmservice_proto_goTypes = []interface{}{ - (*InstantiateRequest)(nil), // 0: lcmservice.InstantiateRequest - (*InstantiateResponse)(nil), // 1: lcmservice.InstantiateResponse - (*TerminateRequest)(nil), // 2: lcmservice.TerminateRequest - (*TerminateResponse)(nil), // 3: lcmservice.TerminateResponse - (*QueryRequest)(nil), // 4: lcmservice.QueryRequest - (*QueryResponse)(nil), // 5: lcmservice.QueryResponse -} -var file_lcmservice_proto_depIdxs = []int32{ - 0, // 0: lcmservice.AppLCM.instantiate:input_type -> lcmservice.InstantiateRequest - 2, // 1: lcmservice.AppLCM.terminate:input_type -> lcmservice.TerminateRequest - 4, // 2: lcmservice.AppLCM.query:input_type -> lcmservice.QueryRequest - 1, // 3: lcmservice.AppLCM.instantiate:output_type -> lcmservice.InstantiateResponse - 3, // 4: lcmservice.AppLCM.terminate:output_type -> lcmservice.TerminateResponse - 5, // 5: lcmservice.AppLCM.query:output_type -> lcmservice.QueryResponse - 3, // [3:6] is the sub-list for method output_type - 0, // [0:3] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_lcmservice_proto_init() } -func file_lcmservice_proto_init() { - if File_lcmservice_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_lcmservice_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InstantiateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_lcmservice_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InstantiateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_lcmservice_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TerminateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_lcmservice_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TerminateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_lcmservice_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_lcmservice_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_lcmservice_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*InstantiateRequest_HostIp)(nil), - (*InstantiateRequest_Package)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_lcmservice_proto_rawDesc, - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_lcmservice_proto_goTypes, - DependencyIndexes: file_lcmservice_proto_depIdxs, - MessageInfos: file_lcmservice_proto_msgTypes, - }.Build() - File_lcmservice_proto = out.File - file_lcmservice_proto_rawDesc = nil - file_lcmservice_proto_goTypes = nil - file_lcmservice_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// AppLCMClient is the client API for AppLCM service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AppLCMClient interface { - Instantiate(ctx context.Context, opts ...grpc.CallOption) (AppLCM_InstantiateClient, error) - Terminate(ctx context.Context, in *TerminateRequest, opts ...grpc.CallOption) (*TerminateResponse, error) - Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) -} - -type appLCMClient struct { - cc grpc.ClientConnInterface -} - -func NewAppLCMClient(cc grpc.ClientConnInterface) AppLCMClient { - return &appLCMClient{cc} -} - -func (c *appLCMClient) Instantiate(ctx context.Context, opts ...grpc.CallOption) (AppLCM_InstantiateClient, error) { - stream, err := c.cc.NewStream(ctx, &_AppLCM_serviceDesc.Streams[0], "/lcmservice.AppLCM/instantiate", opts...) - if err != nil { - return nil, err - } - x := &appLCMInstantiateClient{stream} - return x, nil -} - -type AppLCM_InstantiateClient interface { - Send(*InstantiateRequest) error - CloseAndRecv() (*InstantiateResponse, error) - grpc.ClientStream -} - -type appLCMInstantiateClient struct { - grpc.ClientStream -} - -func (x *appLCMInstantiateClient) Send(m *InstantiateRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *appLCMInstantiateClient) CloseAndRecv() (*InstantiateResponse, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(InstantiateResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *appLCMClient) Terminate(ctx context.Context, in *TerminateRequest, opts ...grpc.CallOption) (*TerminateResponse, error) { - out := new(TerminateResponse) - err := c.cc.Invoke(ctx, "/lcmservice.AppLCM/terminate", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appLCMClient) Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { - out := new(QueryResponse) - err := c.cc.Invoke(ctx, "/lcmservice.AppLCM/query", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AppLCMServer is the server API for AppLCM service. -type AppLCMServer interface { - Instantiate(AppLCM_InstantiateServer) error - Terminate(context.Context, *TerminateRequest) (*TerminateResponse, error) - Query(context.Context, *QueryRequest) (*QueryResponse, error) -} - -// UnimplementedAppLCMServer can be embedded to have forward compatible implementations. -type UnimplementedAppLCMServer struct { -} - -func (*UnimplementedAppLCMServer) Instantiate(AppLCM_InstantiateServer) error { - return status.Errorf(codes.Unimplemented, "method Instantiate not implemented") -} -func (*UnimplementedAppLCMServer) Terminate(context.Context, *TerminateRequest) (*TerminateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Terminate not implemented") -} -func (*UnimplementedAppLCMServer) Query(context.Context, *QueryRequest) (*QueryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Query not implemented") -} - -func RegisterAppLCMServer(s *grpc.Server, srv AppLCMServer) { - s.RegisterService(&_AppLCM_serviceDesc, srv) -} - -func _AppLCM_Instantiate_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(AppLCMServer).Instantiate(&appLCMInstantiateServer{stream}) -} - -type AppLCM_InstantiateServer interface { - SendAndClose(*InstantiateResponse) error - Recv() (*InstantiateRequest, error) - grpc.ServerStream -} - -type appLCMInstantiateServer struct { - grpc.ServerStream -} - -func (x *appLCMInstantiateServer) SendAndClose(m *InstantiateResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *appLCMInstantiateServer) Recv() (*InstantiateRequest, error) { - m := new(InstantiateRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _AppLCM_Terminate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TerminateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppLCMServer).Terminate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lcmservice.AppLCM/Terminate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppLCMServer).Terminate(ctx, req.(*TerminateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppLCM_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppLCMServer).Query(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/lcmservice.AppLCM/Query", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppLCMServer).Query(ctx, req.(*QueryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _AppLCM_serviceDesc = grpc.ServiceDesc{ - ServiceName: "lcmservice.AppLCM", - HandlerType: (*AppLCMServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "terminate", - Handler: _AppLCM_Terminate_Handler, - }, - { - MethodName: "query", - Handler: _AppLCM_Query_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "instantiate", - Handler: _AppLCM_Instantiate_Handler, - ClientStreams: true, - }, - }, - Metadata: "lcmservice.proto", -} diff --git a/mecm/mepm/applcm/k8shelm/internal/lcmservice/lcmservice.proto b/mecm/mepm/applcm/k8shelm/internal/lcmservice/lcmservice.proto deleted file mode 100644 index 92d834d..0000000 --- a/mecm/mepm/applcm/k8shelm/internal/lcmservice/lcmservice.proto +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2020 Huawei Technologies Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package lcmservice; - -option go_package = ".;lcmservice"; - -message InstantiateRequest { - oneof data { - string hostIp = 1; - bytes package = 2; - }; -} - -message InstantiateResponse { - string workloadId = 1; - string status = 2; -} - -message TerminateRequest { - string hostIp = 1; - string workloadId = 2; -} - -message TerminateResponse { - string status = 1; -} - -message QueryRequest { - string hostIp = 1; - string workloadId = 2; -} - -message QueryResponse { - string status = 1; -} - -service AppLCM { - rpc instantiate (stream InstantiateRequest) returns (InstantiateResponse) {} - rpc terminate (TerminateRequest) returns (TerminateResponse) {} - rpc query (QueryRequest) returns (QueryResponse) {} -} \ No newline at end of file diff --git a/mecm/mepm/applcm/k8shelm/pkg/plugin/grpcserver.go b/mecm/mepm/applcm/k8shelm/pkg/plugin/grpcserver.go deleted file mode 100644 index d2b4d4a..0000000 --- a/mecm/mepm/applcm/k8shelm/pkg/plugin/grpcserver.go +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package plugin - -import ( - "bytes" - "context" - "io" - "k8shelm/internal/lcmservice" - "net" - "os" - "strconv" - - "github.com/sirupsen/logrus" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/credentials" - _ "google.golang.org/grpc/encoding/gzip" - "google.golang.org/grpc/status" -) - -// GRPC server -type ServerGRPC struct { - server *grpc.Server - port int - certificate string - key string - logger *logrus.Logger -} - -// GRPC service configuration used to create GRPC server -type ServerGRPCConfig struct { - Certificate string - Key string - Port int - Logger *logrus.Logger -} - -// Constructor to GRPC server -func NewServerGRPC(cfg ServerGRPCConfig) (s ServerGRPC) { - s.logger = cfg.Logger - s.port = cfg.Port - s.certificate = cfg.Certificate - s.key = cfg.Key - s.logger.Infof("Binding is successful") - return -} - -// Start GRPC server and start listening on the port -func (s *ServerGRPC) Listen() (err error) { - var ( - listener net.Listener - grpcOpts = []grpc.ServerOption{} - grpcCreds credentials.TransportCredentials - ) - - // Listen announces on the network address - listener, err = net.Listen("tcp", ":"+strconv.Itoa(s.port)) - if err != nil { - s.logger.Fatalf("failed to listen on specified port") - } - s.logger.Infof("Server started listening on specified port") - - // Secure connection if asked - if s.certificate != "" && s.key != "" { - grpcCreds, err = credentials.NewServerTLSFromFile( - s.certificate, s.key) - if err != nil { - s.logger.Fatalf("failed to create tls grpc server using given cert and key") - } - grpcOpts = append(grpcOpts, grpc.Creds(grpcCreds)) - } - - // Register server with GRPC - s.server = grpc.NewServer(grpcOpts...) - lcmservice.RegisterAppLCMServer(s.server, s) - - s.logger.Infof("Server registered with GRPC") - - // Server start serving - err = s.server.Serve(listener) - if err != nil { - s.logger.Fatalf("failed to listen for grpc connections. Err: %s", err) - return err - } - return -} - -// Query HELM chart -func (s *ServerGRPC) Query(ctx context.Context, req *lcmservice.QueryRequest) (resp *lcmservice.QueryResponse, err error) { - - // Input validation - if (req.GetHostIp() == "") || (req.GetWorkloadId() == "") { - return nil, s.logError(status.Errorf(codes.InvalidArgument, "HostIP & WorkloadId can't be null", err)) - } - - // Create HELM Client - hc, err := NewHelmClient(req.GetHostIp(), s.logger) - if os.IsNotExist(err) { - return nil, s.logError(status.Errorf(codes.InvalidArgument, "Kubeconfig corresponding to given Edge can't be found. "+ - "Err: %s", err)) - } - - // Query Chart - r, err := hc.queryChart(req.GetWorkloadId()) - if err != nil { - return nil, s.logError(status.Errorf(codes.NotFound, "Chart not found for workloadId: %s. Err: %s", - req.GetWorkloadId(), err)) - } - resp = &lcmservice.QueryResponse{ - Status: r, - } - return resp, nil -} - -// Terminate HELM charts -func (s *ServerGRPC) Terminate(ctx context.Context, req *lcmservice.TerminateRequest) (resp *lcmservice.TerminateResponse, err error) { - // Input validation - if (req.GetHostIp() == "") || (req.GetWorkloadId() == "") { - return nil, s.logError(status.Errorf(codes.InvalidArgument, "HostIP & WorkloadId can't be null", err)) - } - - // Create HELM client - hc, err := NewHelmClient(req.GetHostIp(), s.logger) - if os.IsNotExist(err) { - return nil, s.logError(status.Errorf(codes.InvalidArgument, "Kubeconfig corresponding to given Edge can't be found. "+ - "Err: %s", err)) - } - - // Uninstall chart - err = hc.uninstallChart(req.GetWorkloadId()) - - if err != nil { - resp = &lcmservice.TerminateResponse{ - Status: "Failure", - } - return resp, s.logError(status.Errorf(codes.NotFound, "Chart not found for workloadId: %s. Err: %s", - req.GetWorkloadId(), err)) - } else { - resp = &lcmservice.TerminateResponse{ - Status: "Success", - } - return resp, nil - } -} - -// Instantiate HELM Chart -func (s *ServerGRPC) Instantiate(stream lcmservice.AppLCM_InstantiateServer) (err error) { - - // Recieve metadata which is host ip - req, err := stream.Recv() - if err != nil { - s.logger.Errorf("Cannot receive package metadata. Err: %s", err) - return - } - - hostIP := req.GetHostIp() - s.logger.Infof("Recieved instantiate request") - - // Host validation - if hostIP == "" { - return s.logError(status.Errorf(codes.InvalidArgument, "HostIP & WorkloadId can't be null", err)) - } - - // Receive package - helmPkg := bytes.Buffer{} - for { - err := s.contextError(stream.Context()) - if err != nil { - return err - } - - s.logger.Debug("Waiting to receive more data") - - req, err := stream.Recv() - if err == io.EOF { - s.logger.Debug("No more data") - break - } - if err != nil { - return s.logError(status.Errorf(codes.Unknown, "cannot receive chunk data: %v", err)) - } - - // Receive chunk and write to helm package - chunk := req.GetPackage() - - s.logger.Infof("Recieved chunk") - - _, err = helmPkg.Write(chunk) - if err != nil { - return s.logError(status.Errorf(codes.Internal, "cannot write chunk data: %v", err)) - } - } - - // Create HELM client - hc, err := NewHelmClient(req.GetHostIp(), s.logger) - if os.IsNotExist(err) { - return s.logError(status.Errorf(codes.InvalidArgument, "Kubeconfig corresponding to edge can't be found. "+ - "Err: %s", err)) - } - - relName, err := hc.installChart(helmPkg) - - var res lcmservice.InstantiateResponse - res.WorkloadId = relName - - if err != nil { - res.Status = "Failure" - s.logger.Infof("Instantiation Failed") - } else { - res.Status = "Success" - s.logger.Infof("Successful Instantiation") - } - - err = stream.SendAndClose(&res) - if err != nil { - return s.logError(status.Errorf(codes.Unknown, "cannot send response: %v", err)) - } - return -} - -func (s *ServerGRPC) contextError(ctx context.Context) error { - switch ctx.Err() { - case context.Canceled: - return s.logError(status.Error(codes.Canceled, "request is canceled")) - case context.DeadlineExceeded: - return s.logError(status.Error(codes.DeadlineExceeded, "deadline is exceeded")) - default: - return nil - } -} - -func (s *ServerGRPC) logError(err error) error { - if err != nil { - s.logger.Errorf("Error Information: ", err) - } - return err -} diff --git a/mecm/mepm/applcm/k8shelm/pkg/plugin/helmclient.go b/mecm/mepm/applcm/k8shelm/pkg/plugin/helmclient.go deleted file mode 100644 index d756ef9..0000000 --- a/mecm/mepm/applcm/k8shelm/pkg/plugin/helmclient.go +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package plugin - -import ( - "bytes" - "fmt" - "os" - - "github.com/sirupsen/logrus" - "helm.sh/helm/v3/pkg/action" - "helm.sh/helm/v3/pkg/chart/loader" - "helm.sh/helm/v3/pkg/kube" -) - -// Variables to be defined in deployment file -var ( - chartPath = os.Getenv("CHART_PATH") - kubeconfigPath = os.Getenv("KUBECONFIG_DIR_PATH") - releaseNamespace = os.Getenv("RELEASE_NAMESPACE") -) - -// Helm client -type HelmClient struct { - hostIP string - kubeconfig string - logger *logrus.Logger -} - -// Constructor of helm client for a given host IP -func NewHelmClient(hostIP string, logger *logrus.Logger) (*HelmClient, error) { - // Kubeconfig file will be picked based on host IP and will be check for existence - exists, err := fileExists(kubeconfigPath + hostIP) - if exists { - return &HelmClient{hostIP: hostIP, kubeconfig: kubeconfigPath + hostIP, logger: logger}, nil - } else { - logger.Errorf("No file exist with name: %s. Err: %s", kubeconfigPath+hostIP) - return nil, err - } -} - -// Install a given helm chart -func (hc *HelmClient) installChart(helmPkg bytes.Buffer) (string, error) { - hc.logger.Debug("Inside helm client") - - // Create temporary file to hold helm chart - file, err := os.Create(chartPath + "temp.tar.gz") - if err != nil { - hc.logger.Errorf("Unable to create file: %s. Err: %s", chartPath+"temp.tar.gz", err) - return "", err - } - defer os.Remove(chartPath + "temp.tar.gz") - - // Write input bytes to temp file - _, err = helmPkg.WriteTo(file) - if err != nil { - hc.logger.Errorf("Unable to write to file: %s. Err: %s", chartPath+"temp.tar.gz", err) - return "", err - } - - // Load the file to chart - chart, err := loader.Load(chartPath + "temp.tar.gz") - if err != nil { - hc.logger.Errorf("Unable to load chart from file: %s. Err: %s", chartPath+"temp.tar.gz", err) - return "", err - } - - // Release name will be taken from the name in chart's metadata - relName := chart.Metadata.Name - - // Initialize action config - actionConfig := new(action.Configuration) - if err := actionConfig.Init(kube.GetConfig(hc.kubeconfig, "", releaseNamespace), releaseNamespace, - os.Getenv("HELM_DRIVER"), func(format string, v ...interface{}) { - fmt.Sprintf(format, v) - }); err != nil { - hc.logger.Errorf("Unable to initialize action config Err: %s", err) - return "", err - } - - // Prepare chart install action and install chart - installer := action.NewInstall(actionConfig) - installer.Namespace = releaseNamespace - installer.ReleaseName = relName - rel, err := installer.Run(chart, nil) - if err != nil { - hc.logger.Errorf("Unable to install chart with release name: %s. Err: %s", relName, err) - return "", err - } - hc.logger.Infof("Successfully create chart with release name: %s", relName) - return rel.Name, err -} - -// Un-Install a given helm chart -func (hc *HelmClient) uninstallChart(relName string) error { - // Prepare action config and uninstall chart - actionConfig := new(action.Configuration) - if err := actionConfig.Init(kube.GetConfig(hc.kubeconfig, "", releaseNamespace), releaseNamespace, - os.Getenv("HELM_DRIVER"), func(format string, v ...interface{}) { - fmt.Sprintf(format, v) - }); err != nil { - hc.logger.Errorf("Unable to initialize action config Err: %s", err) - return err - } - - ui := action.NewUninstall(actionConfig) - res, err := ui.Run(relName) - if err != nil { - hc.logger.Errorf("Unable to uninstall chart with release name: %s. Err: %s", relName, err) - return err - } - hc.logger.Infof("Successfully uninstalled chart with release name: %s. Response Info: %s", res.Release.Name, res.Info) - return nil -} - -// Query a given chart -func (hc *HelmClient) queryChart(relName string) (string, error) { - actionConfig := new(action.Configuration) - if err := actionConfig.Init(kube.GetConfig(hc.kubeconfig, "", releaseNamespace), releaseNamespace, - os.Getenv("HELM_DRIVER"), func(format string, v ...interface{}) { - fmt.Sprintf(format, v) - }); err != nil { - hc.logger.Errorf("Unable to initialize action config Err: %s", err) - return "", err - } - s := action.NewStatus(actionConfig) - res, err := s.Run(relName) - if err != nil { - hc.logger.Errorf("Unable to query chart with release name: %s. Err: %s", relName, err) - return "", err - } - return res.Info.Status.String(), nil -} - -// fileExists checks if a file exists and is not a directory before we -// try using it to prevent further errors. -func fileExists(filename string) (bool, error) { - info, err := os.Stat(filename) - if os.IsNotExist(err) { - return false, err - } - return !info.IsDir(), nil -} diff --git a/mecm/mepm/applcm/k8shelm/pkg/plugin/logger.go b/mecm/mepm/applcm/k8shelm/pkg/plugin/logger.go deleted file mode 100644 index 4cebdb6..0000000 --- a/mecm/mepm/applcm/k8shelm/pkg/plugin/logger.go +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package plugin - -import ( - "os" - - "github.com/sirupsen/logrus" -) - -func GetLogger(logFile string, loggerLevel logrus.Level, file *os.File) *logrus.Logger { - - logger := logrus.New() - logger.SetOutput(file) - logger.SetFormatter(&logrus.TextFormatter{ - DisableColors: true, - FullTimestamp: true, - }) - logger.SetLevel(loggerLevel) - logger.Infof("logger created") - return logger -} diff --git a/mecm/mepm/applcm/k8shelm/start.sh b/mecm/mepm/applcm/k8shelm/start.sh deleted file mode 100755 index 0e35d37..0000000 --- a/mecm/mepm/applcm/k8shelm/start.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -cd / -#set +e -#sed -i "s/^httpaddr.*=.*$/httpaddr = $(hostname)/g" conf/app.conf -#sed -i "s/^ssl_mode.*=.*$/ssl_mode = ${MEP_SSL_MODE:-0}/g" conf/app.conf -#sed -i "s/^ssl_verify_client.*=.*$/ssl_verify_client = 0/g" conf/app.conf -#set -e -./app diff --git a/mecm/mepm/applcm/k8shelm/version/version.go b/mecm/mepm/applcm/k8shelm/version/version.go deleted file mode 100644 index e3e130b..0000000 --- a/mecm/mepm/applcm/k8shelm/version/version.go +++ /dev/null @@ -1,5 +0,0 @@ -package version - -var ( - Version = "0.0.1" -) diff --git a/mecm/mepm/applcm/resources/deployment/applcm-broker-deployment.yaml b/mecm/mepm/applcm/resources/deployment/applcm-broker-deployment.yaml deleted file mode 100644 index 74bb34a..0000000 --- a/mecm/mepm/applcm/resources/deployment/applcm-broker-deployment.yaml +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# yamllint disable -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert - kompose.version: 1.21.0 (992df58d8) - creationTimestamp: null - labels: - io.kompose.service: applcm-broker - name: applcm-broker -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: applcm-broker - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert - kompose.version: 1.21.0 (992df58d8) - creationTimestamp: null - labels: - io.kompose.service: applcm-broker - spec: - containers: - - env: - - name: ADDRESS - value: 0.0.0.0:8081 - - name: HELM_PLUGIN_PORT - value: "50051" - - name: KUBERNETES_PLUGIN_PORT - value: "50052" - - name: LOGFILE_PATH - value: /go/release/logfile - - name: LOGGER_LEVEL - value: info - - name: POSTGRES_DATABASE - value: mecmdb - - name: DBHOST - value: mecmdb - - name: POSTGRES_PASSWORD - value: password - - name: POSTGRES_ROOT_PASSWORD - value: password - - name: POSTGRES_USER - value: root - - name: PACKAGE_ARTIFACT_PATH - value: /Artifacts/Deployment/ - - name: PACKAGE_PATH - value: /go/release/application/packages/ - image: ealtedge/applcm-broker:latest - imagePullPolicy: "" - name: applcm-broker - ports: - - containerPort: 8081 - resources: {} - restartPolicy: Always - serviceAccountName: "" - volumes: null -status: {} - -# yamllint enable diff --git a/mecm/mepm/applcm/resources/deployment/applcm-broker-service.yaml b/mecm/mepm/applcm/resources/deployment/applcm-broker-service.yaml deleted file mode 100644 index 737611b..0000000 --- a/mecm/mepm/applcm/resources/deployment/applcm-broker-service.yaml +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# yamllint disable -apiVersion: v1 -kind: Service -metadata: - annotations: - kompose.cmd: kompose convert - kompose.version: 1.21.0 (992df58d8) - creationTimestamp: null - labels: - io.kompose.service: applcm-broker - name: applcm-broker -spec: - type: NodePort - ports: - - name: "28081" - port: 8081 - targetPort: 8081 - nodePort: 30001 - selector: - io.kompose.service: applcm-broker -status: - loadBalancer: {} - -# yamllint enable diff --git a/mecm/mepm/applcm/resources/deployment/build_push_image.sh b/mecm/mepm/applcm/resources/deployment/build_push_image.sh deleted file mode 100644 index 24ffcb3..0000000 --- a/mecm/mepm/applcm/resources/deployment/build_push_image.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -CURRENT_DIR=`pwd` - -echo "DOCKER_BUILD_DIR=${CURRENT_DIR}" -echo "Build and Push APP LCM" - -# Build and push broker -cd ${CURRENT_DIR} -cd ../../broker/ -. build_push_image.sh - -# Build and push k8s helm plugin -cd ${CURRENT_DIR} -cd ../../k8shelm/ -. build_push_image.sh - diff --git a/mecm/mepm/applcm/resources/deployment/deploy.sh b/mecm/mepm/applcm/resources/deployment/deploy.sh deleted file mode 100644 index c767eee..0000000 --- a/mecm/mepm/applcm/resources/deployment/deploy.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -kubectl apply -f dbhost.yaml -kubectl apply -f helm-plugin.yaml -kubectl apply -f applcm-broker.yaml \ No newline at end of file diff --git a/mecm/mepm/applcm/resources/deployment/helm-plugin-deployment.yaml b/mecm/mepm/applcm/resources/deployment/helm-plugin-deployment.yaml deleted file mode 100644 index c87b5e6..0000000 --- a/mecm/mepm/applcm/resources/deployment/helm-plugin-deployment.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# yamllint disable -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - kompose.cmd: kompose convert - kompose.version: 1.21.0 (992df58d8) - creationTimestamp: null - labels: - io.kompose.service: helm-plugin - name: helm-plugin -spec: - replicas: 1 - selector: - matchLabels: - io.kompose.service: helm-plugin - strategy: {} - template: - metadata: - annotations: - kompose.cmd: kompose convert - kompose.version: 1.21.0 (992df58d8) - creationTimestamp: null - labels: - io.kompose.service: helm-plugin - spec: - containers: - - env: - - name: CERTIFICATE_PATH - - name: CHART_PATH - value: /go/release/charts/ - - name: HELM_PLUGIN_PORT - value: "50051" - - name: KEY_PATH - - name: KUBECONFIG_DIR_PATH - value: /go/release/kubeconfig/ - - name: LOGFILE_PATH - value: /go/release/logfile - - name: LOGGER_LEVEL - value: info - - name: RELEASE_NAMESPACE - value: default - image: ealtedge/helmplugin:latest - imagePullPolicy: "" - name: helmplugin - ports: - - containerPort: 50051 - resources: {} - volumeMounts: - - mountPath: /go/release/kubeconfig/ - name: config-dir - restartPolicy: Always - serviceAccountName: "" - volumes: - - name: config-dir - hostPath: - path: /kubeconfig - type: DirectoryOrCreate -status: {} - -# yamllint enable diff --git a/mecm/mepm/applcm/resources/deployment/helm-plugin-service.yaml b/mecm/mepm/applcm/resources/deployment/helm-plugin-service.yaml deleted file mode 100644 index cd9543e..0000000 --- a/mecm/mepm/applcm/resources/deployment/helm-plugin-service.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# yamllint disable -apiVersion: v1 -kind: Service -metadata: - annotations: - kompose.cmd: kompose convert - kompose.version: 1.21.0 (992df58d8) - creationTimestamp: null - labels: - io.kompose.service: helm-plugin - name: helmplugin -spec: - ports: - - name: "50051" - port: 50051 - targetPort: 50051 - selector: - io.kompose.service: helm-plugin -status: - loadBalancer: {} - -# yamllint enable diff --git a/mecm/mepm/applcm/resources/deployment/postgres-config.yaml b/mecm/mepm/applcm/resources/deployment/postgres-config.yaml deleted file mode 100644 index 7cc87a3..0000000 --- a/mecm/mepm/applcm/resources/deployment/postgres-config.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# configmap ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: postgres-config - labels: - app: postgres -data: - POSTGRES_DB: mecmdb - POSTGRES_USER: root - POSTGRES_PASSWORD: password diff --git a/mecm/mepm/applcm/resources/deployment/postgres-k8s.yaml b/mecm/mepm/applcm/resources/deployment/postgres-k8s.yaml deleted file mode 100644 index 3846778..0000000 --- a/mecm/mepm/applcm/resources/deployment/postgres-k8s.yaml +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -# postgres database ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: postgres-db - namespace: default - labels: - app: postgres-db -spec: - replicas: 1 - selector: - matchLabels: - app: postgres-db - template: - metadata: - labels: - app: postgres-db - spec: - containers: - - name: postgres - image: postgres:13 - imagePullPolicy: "Always" - envFrom: - - configMapRef: - name: postgres-config - volumeMounts: - - mountPath: /var/lib/postgresql/data - name: postgredb - ports: - - containerPort: 5432 - volumes: - - name: postgredb - persistentVolumeClaim: - claimName: postgres-pv-claim diff --git a/mecm/mepm/applcm/resources/deployment/postgres-service.yaml b/mecm/mepm/applcm/resources/deployment/postgres-service.yaml deleted file mode 100644 index 59e6147..0000000 --- a/mecm/mepm/applcm/resources/deployment/postgres-service.yaml +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# postgres-service ---- -apiVersion: v1 -kind: Service -metadata: - name: mecmdb - namespace: default - labels: - app: postgres -spec: - selector: - app: postgres-db - ports: - - name: "5432" - port: 5432 - targetPort: 5432 diff --git a/mecm/mepm/applcm/resources/deployment/postgres-storage.yaml b/mecm/mepm/applcm/resources/deployment/postgres-storage.yaml deleted file mode 100644 index 9119282..0000000 --- a/mecm/mepm/applcm/resources/deployment/postgres-storage.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# persistent volume ---- -kind: PersistentVolume -apiVersion: v1 -metadata: - name: postgres-pv-volume - labels: - type: local - app: postgres -spec: - storageClassName: manual - capacity: - storage: 5Gi - accessModes: - - ReadWriteMany - hostPath: - path: "/mnt/data" ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: postgres-pv-claim - labels: - app: postgres -spec: - storageClassName: manual - accessModes: - - ReadWriteMany - resources: - requests: - storage: 5Gi diff --git a/mecm/mepm/applcm/resources/test/MEPM.postman_collection.json b/mecm/mepm/applcm/resources/test/MEPM.postman_collection.json deleted file mode 100644 index d61f8fa..0000000 --- a/mecm/mepm/applcm/resources/test/MEPM.postman_collection.json +++ /dev/null @@ -1,1706 +0,0 @@ -{ - "info": { - "_postman_id": "74738ee4-546f-4424-b29a-870cf0f98349", - "name": "MEPM", - "description": "The ETSI MEC ISG MEC016 UE Application Interface API described using OpenAPI\n\nContact Support:\n Email: cti_support@etsi.org", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": [ - { - "name": "Intefaces", - "item": [ - { - "name": "Mm3 Interface", - "item": [ - { - "name": "UploadAppPackage", - "request": { - "auth": { - "type": "oauth2" - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "multipart/form-data" - }, - { - "key": "", - "value": "multipart/form-data", - "type": "text", - "disabled": true - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "file", - "type": "file", - "src": "/home/root1/akriano-mepm/face_reconigition_app.csar" - } - ], - "options": { - "raw": {} - } - }, - "url": { - "raw": "{{baseUrl}}/ealtedge/mepm/app_pkgm/v1/app_packages", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "ealtedge", - "mepm", - "app_pkgm", - "v1", - "app_packages" - ] - }, - "description": "The PUT method is used to update the callback reference of the existing application context. Upon successful operation, the target resource is updated with new callback reference." - }, - "response": [ - { - "name": "No Content.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "No Content", - "code": 204, - "_postman_previewlanguage": "text", - "header": [ - { - "key": "Content-Type", - "value": "text/plain" - } - ], - "cookie": [], - "body": "" - }, - { - "name": "Unauthorized. It is used when the client did not submit the appropriate credentials.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "Bad Request. It is used to indicate that incorrect parameters were passed to the request.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "Not Found. It is used when a client provided a URI that cannot be mapped to a valid resource URI.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Not Found", - "code": 404, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "Forbidden. The operation is not allowed given the current status of the resource. ", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Forbidden", - "code": 403, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - } - ] - }, - { - "name": "QueryAppPkg user->MEPM", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "auth": { - "type": "oauth2" - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "multipart/form-data" - }, - { - "key": "", - "type": "text", - "value": "multipart/form-data", - "disabled": true - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "file", - "type": "file", - "src": "/home/root1/akriano-mepm/face_reconigition_app.csar" - } - ], - "options": { - "raw": {} - } - }, - "url": { - "raw": "{{baseUrl}}/ealtedge/mepm/app_pkgm/v1/app_packages/b1bb0ce7-ebca-4fa7-95ed-4840d70a1177", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "ealtedge", - "mepm", - "app_pkgm", - "v1", - "app_packages", - "b1bb0ce7-ebca-4fa7-95ed-4840d70a1177" - ] - }, - "description": "The PUT method is used to update the callback reference of the existing application context. Upon successful operation, the target resource is updated with new callback reference." - }, - "response": [ - { - "name": "Bad Request. It is used to indicate that incorrect parameters were passed to the request.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "No Content.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "No Content", - "code": 204, - "_postman_previewlanguage": "text", - "header": [ - { - "key": "Content-Type", - "value": "text/plain" - } - ], - "cookie": [], - "body": "" - }, - { - "name": "Unauthorized. It is used when the client did not submit the appropriate credentials.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "Forbidden. The operation is not allowed given the current status of the resource. ", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Forbidden", - "code": 403, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "Not Found. It is used when a client provided a URI that cannot be mapped to a valid resource URI.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Not Found", - "code": 404, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - } - ] - }, - { - "name": "DeleteAppPackage user->MEPM", - "request": { - "auth": { - "type": "oauth2" - }, - "method": "DELETE", - "header": [ - { - "key": "Content-Type", - "value": "multipart/form-data" - }, - { - "key": "", - "type": "text", - "value": "multipart/form-data", - "disabled": true - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "file", - "type": "file", - "src": "/home/root1/akriano-mepm/face_reconigition_app.csar" - } - ], - "options": { - "raw": {} - } - }, - "url": { - "raw": "{{baseUrl}}/ealtedge/mepm/app_pkgm/v1/app_packages/b1bb0ce7-ebca-4fa7-95ed-4840d70a1177", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "ealtedge", - "mepm", - "app_pkgm", - "v1", - "app_packages", - "b1bb0ce7-ebca-4fa7-95ed-4840d70a1177" - ] - }, - "description": "The PUT method is used to update the callback reference of the existing application context. Upon successful operation, the target resource is updated with new callback reference." - }, - "response": [ - { - "name": "Bad Request. It is used to indicate that incorrect parameters were passed to the request.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "No Content.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "No Content", - "code": 204, - "_postman_previewlanguage": "text", - "header": [ - { - "key": "Content-Type", - "value": "text/plain" - } - ], - "cookie": [], - "body": "" - }, - { - "name": "Unauthorized. It is used when the client did not submit the appropriate credentials.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "Forbidden. The operation is not allowed given the current status of the resource. ", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Forbidden", - "code": 403, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "Not Found. It is used when a client provided a URI that cannot be mapped to a valid resource URI.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Not Found", - "code": 404, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - } - ] - }, - { - "name": "CreateAppinstance MEO->MEPM", - "request": { - "auth": { - "type": "oauth2" - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"appDId\": \"b1bb0ce7-ebca-4fa7-95ed-4840d70a1177\",\n \"appInstancename\": \"abc\",\n \"appInstanceDescriptor\": \"ID1\"\n}", - "options": { - "raw": {} - } - }, - "url": { - "raw": "{{baseUrl}}/ealtedge/mepm/app_lcm/v1/app_instances", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "ealtedge", - "mepm", - "app_lcm", - "v1", - "app_instances" - ] - }, - "description": "The PUT method is used to update the callback reference of the existing application context. Upon successful operation, the target resource is updated with new callback reference." - }, - "response": [ - { - "name": "Unauthorized. It is used when the client did not submit the appropriate credentials.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "Bad Request. It is used to indicate that incorrect parameters were passed to the request.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "Not Found. It is used when a client provided a URI that cannot be mapped to a valid resource URI.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Not Found", - "code": 404, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "Forbidden. The operation is not allowed given the current status of the resource. ", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Forbidden", - "code": 403, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "No Content.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "No Content", - "code": 204, - "_postman_previewlanguage": "text", - "header": [ - { - "key": "Content-Type", - "value": "text/plain" - } - ], - "cookie": [], - "body": "" - } - ] - }, - { - "name": "InstantiateAppInstance MEO->MEPM", - "request": { - "auth": { - "type": "oauth2" - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"selectedMECHostInfo\": {\n \"hostName\": \"bangalore.com\",\n \"hostId\": \"127.0.0.1\"\n }\n}", - "options": { - "raw": {} - } - }, - "url": { - "raw": "{{baseUrl}}/ealtedge/mepm/app_lcm/v1/app_instances/3aa4b795-92a7-11ea-a837-0242ac160004/instantiate", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "ealtedge", - "mepm", - "app_lcm", - "v1", - "app_instances", - "3aa4b795-92a7-11ea-a837-0242ac160004", - "instantiate" - ] - }, - "description": "The PUT method is used to update the callback reference of the existing application context. Upon successful operation, the target resource is updated with new callback reference." - }, - "response": [ - { - "name": "Unauthorized. It is used when the client did not submit the appropriate credentials.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "Forbidden. The operation is not allowed given the current status of the resource. ", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Forbidden", - "code": 403, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "Bad Request. It is used to indicate that incorrect parameters were passed to the request.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "No Content.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "No Content", - "code": 204, - "_postman_previewlanguage": "text", - "header": [ - { - "key": "Content-Type", - "value": "text/plain" - } - ], - "cookie": [], - "body": "" - }, - { - "name": "Not Found. It is used when a client provided a URI that cannot be mapped to a valid resource URI.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Not Found", - "code": 404, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - } - ] - }, - { - "name": "QueryAppInstanceInfo MEO->MEPM", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "auth": { - "type": "oauth2" - }, - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": {} - } - }, - "url": { - "raw": "{{baseUrl}}/ealtedge/mepm/app_lcm/v1/app_instances/f74d49a0-9223-11ea-a242-68f7281fe142", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "ealtedge", - "mepm", - "app_lcm", - "v1", - "app_instances", - "f74d49a0-9223-11ea-a242-68f7281fe142" - ] - }, - "description": "The PUT method is used to update the callback reference of the existing application context. Upon successful operation, the target resource is updated with new callback reference." - }, - "response": [ - { - "name": "Unauthorized. It is used when the client did not submit the appropriate credentials.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "No Content.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "No Content", - "code": 204, - "_postman_previewlanguage": "text", - "header": [ - { - "key": "Content-Type", - "value": "text/plain" - } - ], - "cookie": [], - "body": "" - }, - { - "name": "Bad Request. It is used to indicate that incorrect parameters were passed to the request.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "Not Found. It is used when a client provided a URI that cannot be mapped to a valid resource URI.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Not Found", - "code": 404, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "Forbidden. The operation is not allowed given the current status of the resource. ", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Forbidden", - "code": 403, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - } - ] - }, - { - "name": "TerminateAppIns MEO->MEPM", - "request": { - "auth": { - "type": "oauth2" - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": {} - } - }, - "url": { - "raw": "{{baseUrl}}/ealtedge/mepm/app_lcm/v1/app_instances/f74d49a0-9223-11ea-a242-68f7281fe142/terminate", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "ealtedge", - "mepm", - "app_lcm", - "v1", - "app_instances", - "f74d49a0-9223-11ea-a242-68f7281fe142", - "terminate" - ] - }, - "description": "The PUT method is used to update the callback reference of the existing application context. Upon successful operation, the target resource is updated with new callback reference." - }, - "response": [ - { - "name": "Not Found. It is used when a client provided a URI that cannot be mapped to a valid resource URI.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Not Found", - "code": 404, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "Forbidden. The operation is not allowed given the current status of the resource. ", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Forbidden", - "code": 403, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "Unauthorized. It is used when the client did not submit the appropriate credentials.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "No Content.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "No Content", - "code": 204, - "_postman_previewlanguage": "text", - "header": [ - { - "key": "Content-Type", - "value": "text/plain" - } - ], - "cookie": [], - "body": "" - }, - { - "name": "Bad Request. It is used to indicate that incorrect parameters were passed to the request.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - } - ] - }, - { - "name": "DeleteAppInstanceIdentifier MEO->MEPM", - "request": { - "auth": { - "type": "oauth2" - }, - "method": "DELETE", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": {} - } - }, - "url": { - "raw": "{{baseUrl}}/ealtedge/mepm/app_lcm/v1/app_instances/{{ID}}", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "ealtedge", - "mepm", - "app_lcm", - "v1", - "app_instances", - "{{ID}}" - ] - }, - "description": "The PUT method is used to update the callback reference of the existing application context. Upon successful operation, the target resource is updated with new callback reference." - }, - "response": [ - { - "name": "Bad Request. It is used to indicate that incorrect parameters were passed to the request.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Bad Request", - "code": 400, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "No Content.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "No Content", - "code": 204, - "_postman_previewlanguage": "text", - "header": [ - { - "key": "Content-Type", - "value": "text/plain" - } - ], - "cookie": [], - "body": "" - }, - { - "name": "Not Found. It is used when a client provided a URI that cannot be mapped to a valid resource URI.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Not Found", - "code": 404, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "Forbidden. The operation is not allowed given the current status of the resource. ", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Forbidden", - "code": 403, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - }, - { - "name": "Unauthorized. It is used when the client did not submit the appropriate credentials.", - "originalRequest": { - "method": "PUT", - "header": [], - "url": { - "raw": "{{baseUrl}}/app_contexts/:contextId", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "app_contexts", - ":contextId" - ], - "variable": [ - { - "key": "contextId" - } - ] - } - }, - "status": "Unauthorized", - "code": 401, - "_postman_previewlanguage": "json", - "header": [ - { - "key": "Content-Type", - "value": "application/problem+json" - } - ], - "cookie": [], - "body": "{\n \"type\": \"\",\n \"title\": \"\",\n \"status\": \"\",\n \"detail\": \"\",\n \"instance\": \"\"\n}" - } - ] - } - ], - "protocolProfileBehavior": {}, - "_postman_isSubFolder": true - } - ], - "protocolProfileBehavior": {} - } - ], - "variable": [ - { - "id": "baseUrl", - "key": "baseUrl", - "value": "http://127.0.0.1:8081/mx2/v2", - "type": "string" - } - ], - "protocolProfileBehavior": {} -} \ No newline at end of file diff --git a/mecm/mepm/applcm/resources/test/README.md b/mecm/mepm/applcm/resources/test/README.md deleted file mode 100644 index cde1404..0000000 --- a/mecm/mepm/applcm/resources/test/README.md +++ /dev/null @@ -1,2 +0,0 @@ -This folder contains test artifacts to try out applcm in local machine -Note: For production k8s based deployment will be used, this folder is just for local testing. \ No newline at end of file diff --git a/mecm/mepm/applcm/resources/test/akriano-mepm.postman_environment.json b/mecm/mepm/applcm/resources/test/akriano-mepm.postman_environment.json deleted file mode 100644 index 94bd4bd..0000000 --- a/mecm/mepm/applcm/resources/test/akriano-mepm.postman_environment.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "id": "133f53c6-e57a-4541-a3d2-48647d6c2d92", - "name": "akriano-mepm", - "values": [ - { - "key": "baseUrl", - "value": "https://172.60.2.21:30233", - "enabled": true - } - ], - "_postman_variable_scope": "environment", - "_postman_exported_at": "2020-05-10T16:58:23.211Z", - "_postman_exported_using": "Postman/7.16.1" -} \ No newline at end of file diff --git a/mecm/mepm/applcm/resources/test/build_run.sh b/mecm/mepm/applcm/resources/test/build_run.sh deleted file mode 100644 index d15d99c..0000000 --- a/mecm/mepm/applcm/resources/test/build_run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#AppLcm broker compile and build docker image -cd ../broker -. docker-build.sh - -#helmplugin compile and build docker image -cd ../k8shelm -. docker-build.sh - -#Run docker images: -cd ../resources -sudo docker-compose up -d diff --git a/mecm/mepm/applcm/resources/test/docker-compose.yaml b/mecm/mepm/applcm/resources/test/docker-compose.yaml deleted file mode 100644 index 4de78db..0000000 --- a/mecm/mepm/applcm/resources/test/docker-compose.yaml +++ /dev/null @@ -1,95 +0,0 @@ -# yamllint disable -version: '3.3' - -networks: - bridge: - external: true - -volumes: - my-db: - -services: - mecmdb: - network_mode: bridge - image: postgres:9.6 - environment: - POSTGRES_DB: 'mecmdb' - POSTGRES_USER: 'root' - POSTGRES_PASSWORD: 'password' - POSTGRES_ROOT_PASSWORD: 'password' - ports: - - '5432:5432' - expose: - - '5432' - volumes: - - my-db:/var/lib/postgresql/data - logging: - driver: "json-file" - options: - max-size: "30m" - max-file: "5" - ################################################################################# - applcm-broker: - network_mode: bridge - image: ealtedge/applcm-broker:latest - depends_on: - - mecmdb - - helm-plugin - links: - - mecmdb:mecmdb - - helm-plugin:helmplugin - restart: always - container_name: applcm-broker - environment: - POSTGRES_DATABASE: 'mecmdb' - DBHOST: 'mecmdb' - POSTGRES_USER: 'root' - POSTGRES_PASSWORD: 'password' - POSTGRES_ROOT_PASSWORD: 'password' - HELM_PLUGIN_PORT: '50051' - KUBERNETES_PLUGIN_PORT: '50052' - LOGFILE_PATH: "/go/release/logfile" - LOGGER_LEVEL: "info" - ADDRESS: "0.0.0.0:8081" - PACKAGE_PATH: "/go/release/application/packages/" - PACKAGE_ARTIFACT_PATH: "/Artifacts/Deployment/" - CERTIFICATE_PATH: "" - KEY_PATH: "" - ports: - - '28081:8081' - expose: - - '8081' - logging: - driver: "json-file" - options: - max-size: "30m" - max-file: "5" - ################################################################################# - helm-plugin: - network_mode: bridge - image: ealtedge/helmplugin:latest - restart: always - container_name: helmplugin - environment: - HELM_PLUGIN_PORT: '50051' - # Log file path, also to match dockerfile - LOGFILE_PATH: "/go/release/logfile" - LOGGER_LEVEL: "info" - CERTIFICATE_PATH: "" - KEY_PATH: "" - # Temp chart file path, to be created in dockerfile - CHART_PATH: "/go/release/charts/" - # Kubeconfig based directory path, to be created in dockerfile, to hold kubeconfig of hosts with - KUBECONFIG_DIR_PATH: "/go/release/kubeconfig/" - # Presently all application to be deployed in same namespace, in future it can be an input while app creation - RELEASE_NAMESPACE: "default" - ports: - - '50051:50051' - expose: - - '50051' - logging: - driver: "json-file" - options: - max-size: "30m" - max-file: "5" -# yamllint enable diff --git a/mecm/mepm/applcm/resources/test/local-setup b/mecm/mepm/applcm/resources/test/local-setup deleted file mode 100644 index bc32338..0000000 --- a/mecm/mepm/applcm/resources/test/local-setup +++ /dev/null @@ -1,28 +0,0 @@ - -MIKI kube install: -curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \ -&& chmod +x minikube -sudo mkdir -p /usr/local/bin/ -sudo install minikube /usr/local/bin/ -minikube start - -sudo minikube start --driver=docker - -Kubectl install: -curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl -chmod +x ./kubectl -sudo mv ./kubectl /usr/local/bin/kubectl - - -copy from local envi to helmplugin docker to the same location in docker -/home/root1/.minikube/profiles/minikube/client.crt -/home/root1/.minikube/profiles/minikube/client.key -/home/root1/.minikube/ca.crt - -Copy kubeconfig: -.kube/config to /go/release/kubeconfig/{hostIp} - - - - - diff --git a/mecm/mepm/applcm/resources/test/sample_app.csar b/mecm/mepm/applcm/resources/test/sample_app.csar deleted file mode 100644 index 40c66aa..0000000 Binary files a/mecm/mepm/applcm/resources/test/sample_app.csar and /dev/null differ diff --git a/mep/mepagent/README.md b/mep/mepagent/README.md deleted file mode 100644 index f3ec851..0000000 --- a/mep/mepagent/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# mep_agent_lib -Agent lib for mep service regsitration API - - -## Introduction - -MEP agent library and sample application is provide for quickly develop applications on MEP platform. -Code is devided in 2 part. -- SampleApp -- Service registration pkg. -- config file for setting application configuration -- docker file , build and k8s yaml files - -* SampleApp - - sample application for service regsitration to MEP - - contains main function and call service registration function from provided pkg - - It has config file for setting application configuration - -* pkg for service registration - - pkg can be used to register developer applications to MEP. - - support http and https connection to MEP - - configuration can be enabled/disbaled in config files when start mep agent - -## Configuration -mainly below configuration supported - - MEP GW details - - IP: IP of MEP Gateway - - HTTPS port: GW HTTPS proxy port - - HTTP port: GW HTTP proxy port - - App instance ID - - service registration sample data as per ETSI mp1 interface. - -## Usages -Developer who develp applications for MEP, can leverage sample application and pkg freamework to support mp1 interface for service registration. -In future this library can be extened to support all mp1 interface like discovery, service avaiibilty. -MEP support mp1 interfaces as per ETSI compliant. - -* Steps - - configure MEP GW IP and port in path meagent/SampleApp/conf/app_instance_info.yaml - - based on deplyment mode(development/production) provide HTTP/HTTPS port - - kong API GW run as K8s service, check corresponding port and config accordingly - - Kong has admin and proxy port. - - use proxy port and configure - - Build go applicaion with below cmd: - - cd mepagent/SampleApp - - CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' src/main/main.go - - Build docker and push to docker - - sudo ./docker-build.sh - - Deploy Application - - In mep-k8s.yaml - - enable/disable ssl which is env. variable in k8s yaml file - - APP_SSL_MODE "1" to enable ssl. - - By default app run in normal mode. - - generate k8s secret with ca.crt file which is root CA used by MEP. - - MEP provide cert-manager and vault to automate it. Plz refer corresponding document. - - diff --git a/mep/mepagent/SampleApp/LICENSE b/mep/mepagent/SampleApp/LICENSE deleted file mode 100644 index 607e48e..0000000 --- a/mep/mepagent/SampleApp/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2020 Huawei Technologies Co., Ltd. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/mep/mepagent/SampleApp/README.md b/mep/mepagent/SampleApp/README.md deleted file mode 100644 index f0a5238..0000000 --- a/mep/mepagent/SampleApp/README.md +++ /dev/null @@ -1,17 +0,0 @@ -1. Download sample mep app: -git clone "ssh://gerrit.akraino.org:29418/ealt-edge" - ``` - -2. Build sampel mep app: - ``` - CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' src/main/main.go - ``` - -3. Docker build: - -4. config file: - -5. run as pod: - - - diff --git a/mep/mepagent/SampleApp/conf/app_info.yaml b/mep/mepagent/SampleApp/conf/app_info.yaml deleted file mode 100644 index ad6a655..0000000 --- a/mep/mepagent/SampleApp/conf/app_info.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#ssl_cipher configuration -sslCiphers: > - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 diff --git a/mep/mepagent/SampleApp/conf/app_instance_info.yaml b/mep/mepagent/SampleApp/conf/app_instance_info.yaml deleted file mode 100644 index b284c61..0000000 --- a/mep/mepagent/SampleApp/conf/app_instance_info.yaml +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - ---- -appInstanceId: id12345 -mepGWIP: 159.138.22.15 -httpGWPORT: 30010 -httpsGWPORT: 30011 -mepGWROUTES: /mp1 -serviceInfoPosts: - - serName: ExampleService - serInstanceId: - serCategory: - href: "/example/catalogue1" - id: id12345 - name: RNI - version: version1 - version: ServiceVersion1 - state: ACTIVE - transportId: Rest1 - transportInfo: - id: TransId12345 - name: REST - description: REST API - type: REST_HTTP - protocol: HTTP - version: '2.0' - endpoint: - uris: - - http://ExampleService:30005 - implSpecificInfo: {} - serializer: JSON - scopeOfLocality: MEC_SYSTEM - consumedLocalOnly: false - isLocal: true -serAvailabilityNotificationSubscriptions: - - subscriptionType: SerAvailabilityNotificationSubscription - callbackReference: string - links: - self: - href: /mecSerMgmtApi/example - filteringCriteria: - serInstanceIds: - - ServiceInstance123 - serNames: - - ExampleService - serCategories: - - href: /example/catalogue1 - id: id12345 - name: RNI - version: version1 - states: - - ACTIVE - isLocal: true diff --git a/mep/mepagent/SampleApp/docker-build.sh b/mep/mepagent/SampleApp/docker-build.sh deleted file mode 100755 index 309890f..0000000 --- a/mep/mepagent/SampleApp/docker-build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -MEP_VERSION=latest -docker build --no-cache -t ealtedge/mepagent:${MEP_VERSION} -f docker/Dockerfile . diff --git a/mep/mepagent/SampleApp/docker/Dockerfile b/mep/mepagent/SampleApp/docker/Dockerfile deleted file mode 100644 index 2568074..0000000 --- a/mep/mepagent/SampleApp/docker/Dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -FROM alpine:latest - -## CREATE APP USER ## -# Create the home directory for the new app user. -RUN mkdir -p /usr/app - -# Create an app user so our program doesn't run as root. -RUN apk update &&\ - apk add shadow &&\ - groupadd -r app &&\ - useradd -r -g app -d /usr/app -s /sbin/nologin -c "Docker image user" app - -# Set the home directory to our app user's home. -ENV HOME=/usr/app -ENV APP_HOME=/usr/app/ - -## SETTING UP THE APP ## -WORKDIR $APP_HOME - -# Copy in the application code. -COPY --chown=app:app . $APP_HOME -CMD ["./main"] - -# Change to the app user. -USER app diff --git a/mep/mepagent/SampleApp/go.mod b/mep/mepagent/SampleApp/go.mod deleted file mode 100644 index 8195cb6..0000000 --- a/mep/mepagent/SampleApp/go.mod +++ /dev/null @@ -1,7 +0,0 @@ -module mep-agent - -go 1.14 - -require ( - gopkg.in/yaml.v2 v2.2.8 // indirect -) diff --git a/mep/mepagent/SampleApp/mepagent.yaml b/mep/mepagent/SampleApp/mepagent.yaml deleted file mode 100755 index a8df546..0000000 --- a/mep/mepagent/SampleApp/mepagent.yaml +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -# mep pod ---- -apiVersion: v1 -kind: Pod -metadata: - name: mepagent - namespace: mep - labels: - app: mepagent -spec: - containers: - - image: ealtedge/mepagent:latest - imagePullPolicy: Always - name: mepagent-pod - env: - - name: CA_CERT_DOMAIN_NAME - value: "www.ealtedge.org" - - name: SSL_ROOT - value: "/etc/mepagent_ssl/trust.cer" - - name: APP_SSL_MODE - value: "0" - ports: - - containerPort: 80 - #volumeMounts: - #- name: mepagentssl - #mountPath: "/etc/mepagent_ssl" - #readOnly: true - #volumes: - #- name: mepagentssl - #secret: - #secretName: mepagentssl-secret diff --git a/mep/mepagent/SampleApp/src/main/main.go b/mep/mepagent/SampleApp/src/main/main.go deleted file mode 100644 index 9f536e5..0000000 --- a/mep/mepagent/SampleApp/src/main/main.go +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "github.com/akraino-edge-stack/ealt-edge/mep/mepagent/pkg/service" - "time" -) - -func main() { - _, _ = service.SvcReg("./conf/app_instance_info.yaml") - Heart() -} - -func Heart() { - time.Sleep(time.Hour) -} - diff --git a/mep/mepagent/pkg/model/appconf.go b/mep/mepagent/pkg/model/appconf.go deleted file mode 100644 index b5fd5e2..0000000 --- a/mep/mepagent/pkg/model/appconf.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package model - -type AppConf struct { - SslCipherSuite string `yaml:"sslCiphers" json:"sslCiphers"` -} diff --git a/mep/mepagent/pkg/model/instance.go b/mep/mepagent/pkg/model/instance.go deleted file mode 100644 index d51009d..0000000 --- a/mep/mepagent/pkg/model/instance.go +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// define the type information -package model - -type AppInstanceInfo struct { - AppInstanceId string `yaml:"appInstanceId" json:"appInstanceId"` - MepGWIP string `yaml:"mepGWIP" json:"mepGWIP"` - HttpGWPORT string `yaml:"httpGWPORT" json:"httpGWPORT"` - HttpsGWPORT string `yaml:"httpsGWPORT" json:"httpsGWPORT"` - MepGWROUTES string `yaml:"mepGWROUTES" json:"mepGWROUTES"` - ServiceInfoPosts []ServiceInfoPost `yaml:"serviceInfoPosts" json:"serviceInfoPosts"` - SerAvailabilityNotificationSubscriptions []SerAvailabilityNotificationSubscription `yaml:"serAvailabilityNotificationSubscriptions" json:"serAvailabilityNotificationSubscriptions"` -} - -type ServiceInfoPost struct { - SerInstanceId string `yaml:"serInstanceId" json:"serInstanceId"` - SerName string `yaml:"serName" json:"serName"` - SerCategory CategoryRef `yaml:"serCategory" json:"serCategory"` - Version string `yaml:"version" json:"version"` - State ServiceState `yaml:"state" json:"state"` - TransportId string `yaml:"transportId" json:"transportId"` - TransportInfo TransportInfo `yaml:"transportInfo" json:"transportInfo"` - Serializer SerializerType `yaml:"serializer" json:"serializer"` - ScopeOfLocality LocalityType `yaml:"scopeOfLocality" json:"scopeOfLocality"` - ConsumedLocalOnly bool `yaml:"consumedLocalOnly" json:"consumedLocalOnly"` - IsLocal bool `yaml:"isLocal" json:"isLocal"` -} - -type CategoryRef struct { - Href string `yaml:"href" json:"href"` - Id string `yaml:"id" json:"id"` - Name string `yaml:"name" json:"name"` - Version string `yaml:"version" json:"version"` -} - -type ServiceState string - -const ( - ACTIVE ServiceState = "ACTIVE" - INACTIVE ServiceState = "INACTIVE" -) - -type TransportInfo struct { - Id string `yaml:"id" json:"id"` - Name string `yaml:"name" json:"name"` - Description string `yaml:"description" json:"description"` - TransportType TransportType `yaml:"type" json:"type"` - Protocol string `yaml:"protocol" json:"protocol"` - Version string `yaml:"version" json:"version"` - Endpoint EndPointInfoUris `yaml:"endpoint" json:"endpoint"` - Security SecurityInfo `yaml:"security" json:"security"` - ImplSpecificInfo ImplSpecificInfo `yaml:"implSpecificInfo" json:"implSpecificInfo"` -} - -type TransportType string - -const ( - REST_HTTP TransportType = "REST_HTTP" - MB_TOPIC_BASED TransportType = "MB_TOPIC_BASED" - MB_ROUTING TransportType = "MB_ROUTING" - MB_PUBSUB TransportType = "MB_PUBSUB" - RPC TransportType = "RPC" - RPC_STREAMING TransportType = "RPC_STREAMING" - WEBSOCKET TransportType = "WEBSOCKET" -) - -type EndPointInfoUris struct { - Uris []string `yaml:"uris" json:"uris"` -} - -type SecurityInfo struct { - OAuth2Info SecurityInfoOAuth2Info `yaml:"oAuth2Info" json:"oAuth2Info"` -} - -type SecurityInfoOAuth2Info struct { - GrantTypes []SecurityInfoOAuth2InfoGrantType `yaml:"grantTypes" json:"grantTypes"` - TokenEndpoint string `yaml:"tokenEndpoint" json:"tokenEndpoint"` -} - -type SecurityInfoOAuth2InfoGrantType string - -const ( - AUTHORIZATION_CODE SecurityInfoOAuth2InfoGrantType = "OAUTH2_AUTHORIZATION_CODE" - IMPLICIT_GRANT SecurityInfoOAuth2InfoGrantType = "OAUTH2_IMPLICIT_GRANT" - RESOURCE_OWNER SecurityInfoOAuth2InfoGrantType = "OAUTH2_RESOURCE_OWNER" - CLIENT_CREDENTIALS SecurityInfoOAuth2InfoGrantType = "OAUTH2_CLIENT_CREDENTIALS" -) - -type ImplSpecificInfo struct { -} - -type SerializerType string - -const ( - JSON SerializerType = "JSON" - XML SerializerType = "XML" - PROTOBUF3 SerializerType = "PROTOBUF3" -) - -type LocalityType string - -const ( - MEC_SYSTEM LocalityType = "MEC_SYSTEM" - MEC_HOST LocalityType = "MEC_HOST" - NFVI_POP LocalityType = "NFVI_POP" - ZONE LocalityType = "ZONE" - ZONE_GROUP LocalityType = "ZONE_GROUP" - NFVI_NODE LocalityType = "NFVI_NODE" -) - -type SerAvailabilityNotificationSubscription struct { - SubscriptionType string `yaml:"subscriptionType" json:"subscriptionType"` - CallbackReference string `yaml:"callbackReference" json:"callbackReference"` - Links Self `yaml:"links" json:"links"` - FilteringCriteria SerAvailabilityNotificationSubscriptionFilteringCriteria `yaml:"filteringCriteria" json:"filteringCriteria"` -} - -type Self struct { - Self LinkType `yaml:"self" json:"self"` -} - -type LinkType struct { - Href string `yaml:"href" json:"href"` -} - -type SerAvailabilityNotificationSubscriptionFilteringCriteria struct { - SerInstanceIds []string `yaml:"serInstanceIds" json:"serInstanceIds"` - SerNames []string `yaml:"serNames" json:"serNames"` - SerCategories []CategoryRef `yaml:"serCategories" json:"serCategories"` - States []ServiceState `yaml:"states" json:"states"` - IsLocal bool `yaml:"isLocal" json:"isLocal"` -} diff --git a/mep/mepagent/pkg/service/register.go b/mep/mepagent/pkg/service/register.go deleted file mode 100644 index 5dd6dc3..0000000 --- a/mep/mepagent/pkg/service/register.go +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package service - -import ( - "encoding/json" - "log" - "os" - "strconv" - "time" -) - -func SvcReg(confPath string) (string, error) { - var urlProto string - var gwPORT string - - conf, err := GetConf(confPath) - if err != nil { - log.Println(err.Error()) - return "", err - } - - appInstanceId := conf.AppInstanceId - serviceInfos := conf.ServiceInfoPosts - gwRoutes := conf.MepGWROUTES - gwIP := conf.MepGWIP - - sslMode := os.Getenv("APP_SSL_MODE") - //if ssl mode is enabled, then config tls - if sslMode == "0" { - gwPORT = conf.HttpGWPORT - urlProto = "http://" - } else { - gwPORT = conf.HttpsGWPORT - urlProto = "https://" - } - - url := urlProto + gwIP + ":" + gwPORT + gwRoutes + "/mep/mec_service_mgmt/v1/applications/" + appInstanceId + "/services" - log.Println("Register url is" + url) - - for _, serviceInfo := range serviceInfos { - data, e := json.Marshal(serviceInfo) - if e != nil { - log.Println("Failed to marshal service info to object") - continue - } - - for i := 1; i <= 5; i++ { // if register failed, then retry five times - _, err := RegisterToMep(string(data), url) - if err != nil { - log.Println("Failed to register to mep, appInstanceId is" + appInstanceId + ", serviceName is " + serviceInfo.SerName) - } else { - log.Println("Register mep main to mep success, appInstanceId is" + appInstanceId + ", serviceName is " + serviceInfo.SerName) - break - } - log.Println("Failed to register mep main to mep, will retry 5 times, retry interval is 30 s, already retry " + strconv.Itoa(i) + " time") - time.Sleep(30 * time.Second) // register failed , 30 seconds after try again - } - } - - return "", nil -} diff --git a/mep/mepagent/pkg/service/request.go b/mep/mepagent/pkg/service/request.go deleted file mode 100644 index 1d40c40..0000000 --- a/mep/mepagent/pkg/service/request.go +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package service - -import ( - "crypto/tls" - "crypto/x509" - "errors" - "io/ioutil" - "log" - "net/http" - "os" - "strconv" - "strings" -) - -// const -var cipherSuiteMap = map[string]uint16{ - "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256": tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384": tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, -} - -// register to mep -func RegisterToMep(param string, url string) (string, error) { - response, errPost := DoPost(param, url) - if errPost != nil { - log.Println("Failed to send request") - return "", errPost - } - defer response.Body.Close() - - if response.StatusCode != http.StatusCreated { - return "", errors.New("request failed, status is " + strconv.Itoa(response.StatusCode)) - } - body, err := ioutil.ReadAll(response.Body) - if err != nil { - log.Println("Failed to read response") - return "", err - } - - return string(body), nil -} - -func DoPost(param string, url string) (*http.Response, error) { - sslMode := os.Getenv("APP_SSL_MODE") - - //if ssl mode is enabled, then config tls - if sslMode == "0" { - response, errPost := http.Post(url, "application/json", strings.NewReader(param)) - if errPost != nil { - log.Println("Failed to create http request") - return nil, errPost - } - return response, nil - } else { - req, errReq := http.NewRequest("POST", url, strings.NewReader(param)) - if errReq != nil { - log.Println("Failed to create https request") - return nil, errReq - } - response, errDo := DoRegister(req) - if errDo != nil { - log.Println("Failed to post https request %s", errDo) - return nil, errDo - } - return response, nil - } -} - -func DoRegister(req *http.Request) (*http.Response, error) { - config, err := TlsConfig() - if err != nil { - log.Println("Failed to config HTTPS") - return nil, err - } - - trans := &http.Transport{ - TLSClientConfig: config, - } - - client := &http.Client{Transport: trans} - - return client.Do(req) -} - -func TlsConfig() (*tls.Config, error) { - caCert, err := ioutil.ReadFile(os.Getenv("SSL_ROOT")) - if err != nil { - log.Println("Failed to read cert from file") - return nil, err - } - - CACERT := x509.NewCertPool() - CACERT.AppendCertsFromPEM(caCert) - - appconf, err1 := GetAppConf("./conf/app_info.yaml") - if err1 != nil { - log.Println("Failed to read cipher from file") - return nil, err1 - } - - cipherslist := appconf.SslCipherSuite - if cipherslist == "" { - log.Println("no cipher provided in conf") - return nil, err - } - - ciphermap := getcipher(cipherslist) - if ciphermap == nil { - return nil, err - } - - return &tls.Config{ - RootCAs: CACERT, - ServerName: os.Getenv("CA_CERT_DOMAIN_NAME"), - CipherSuites: ciphermap, - MinVersion: tls.VersionTLS12, - }, nil -} - -func getcipher(ciphers string) []uint16 { - ciphersmap := make([]uint16, 0) - cipherlist := strings.Split(ciphers, ",") - for _, ciphername := range cipherlist { - ciphernametrim := strings.TrimSpace(ciphername) - if len(ciphernametrim) == 0 { - continue - } - - ciphervalue, ok := cipherSuiteMap[ciphernametrim] - if !ok { - log.Println("not recommended cipher") - return nil - } - ciphersmap = append(ciphersmap, ciphervalue) - } - - if len(ciphersmap) <= 0 { - log.Println("no cipher in list") - return nil - } - - return ciphersmap -} diff --git a/mep/mepagent/pkg/service/util.go b/mep/mepagent/pkg/service/util.go deleted file mode 100644 index 9cfe217..0000000 --- a/mep/mepagent/pkg/service/util.go +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package service - -import ( - "gopkg.in/yaml.v2" - "io/ioutil" - "github.com/akraino-edge-stack/ealt-edge/mep/mepagent/pkg/model" -) - -// get yaml and parse to struct -func GetConf(path string) (model.AppInstanceInfo, error) { - yamlFile, err := ioutil.ReadFile(path) - var info model.AppInstanceInfo - if err != nil { - return info, err - } - - err = yaml.UnmarshalStrict(yamlFile, &info) - - if err != nil { - return info, err - } - - return info, nil -} - -func GetAppConf(FilePath string) (model.AppConf, error) { - var AppInfo model.AppConf - yamlFile, err := ioutil.ReadFile(FilePath) - if err != nil { - return AppInfo, err - } - - err1 := yaml.UnmarshalStrict(yamlFile, &AppInfo) - if err1 != nil { - return AppInfo, err - } - - return AppInfo, nil - -} diff --git a/mep/mepagent/test/register_test.go b/mep/mepagent/test/register_test.go deleted file mode 100644 index 2bababf..0000000 --- a/mep/mepagent/test/register_test.go +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package test - -import ( - "github.com/agiledragon/gomonkey" - "github.com/smartystreets/goconvey/convey" - "pkg/service" - "testing" -) - -func TestStartSuccess(t *testing.T) { - - convey.Convey("RegisterToMepTest", t, func() { - patch := gomonkey.ApplyFunc(service.RegisterToMep, func(param string, url string) (string, error) { - return "", nil - }) - - _, err := service.SvcReg("../../conf/app_instance_info.yaml") - if err != nil { - t.Error("error") - } - defer patch.Reset() - - }) - -} diff --git a/mep/mepagent/test/util_test.go b/mep/mepagent/test/util_test.go deleted file mode 100644 index f8f9d87..0000000 --- a/mep/mepagent/test/util_test.go +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package test - -import ( - "encoding/json" - "pkg/service" - "net/http" - "net/http/httptest" - "testing" -) - -func TestGetConfSuccess(t *testing.T) { - _, err := service.GetConf("../../conf/app_instance_info.yaml") - if err != nil { - t.Error("Read conf file failed") - } -} - -func TestGetConfFail(t *testing.T) { - _, err := service.GetConf("../conf/app_instance_info.yaml") - if err == nil { - t.Error("Read conf file failed") - } -} - -func TestRegisterToMepSuccess(t *testing.T) { - httpResponse := "response body" - var httpResponseBytes, err1 = json.Marshal(httpResponse) - if err1 != nil { - t.Error("Marshal http Response Error") - } - - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusCreated) - _, err2 := w.Write(httpResponseBytes) - - if err2 != nil { - t.Error("Write Response Error") - } - if r.Method != "POST" { - t.Error("UnExcepted Method") - } - })) - - defer ts.Close() - api := ts.URL - - _, err := service.RegisterToMep("param", api) - if err != nil { - t.Error("error") - } -} - -func TestRegisterToMepFail1(t *testing.T) { - httpResponse := "response body" - var httpResponseBytes, err1 = json.Marshal(httpResponse) - if err1 != nil { - t.Error("Marshal http Response Error") - } - - ts2 := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusBadRequest) - _, err2 := w.Write(httpResponseBytes) - - if err2 != nil { - t.Error("Write Response Error") - } - if r.Method != "POST" { - t.Error("UnExcepted Method") - } - })) - - defer ts2.Close() - api := ts2.URL - - _, err := service.RegisterToMep("param", api) - if err == nil { - t.Error("error") - } -} - diff --git a/mep/mepserver/conf/app.conf b/mep/mepserver/conf/app.conf deleted file mode 100644 index 8e5cced..0000000 --- a/mep/mepserver/conf/app.conf +++ /dev/null @@ -1,166 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -component_name = service_center -#run mode could be many options to specify the env like prod,dev -runmode = dev - -################################################################### -# Frontend Configurations -################################################################### -frontend_host_ip = 127.0.0.1 -frontend_host_port = 30103 - -################################################################### -# sever options -################################################################### -# if you want to listen at ipv6 address, then set the httpaddr value like: -# httpaddr = 2400:A480:AAAA:200::159 (global scope) -# httpaddr = fe80::f816:3eff:fe17:c38b%eth0 (link-local scope) -httpaddr = 127.0.0.1 -httpport = 8088 - -read_header_timeout = 60s -read_timeout = 60s -idle_timeout = 60s -write_timeout = 60s -# 32K -max_header_bytes = 32768 -# 2M -max_body_bytes = 2097152 - -enable_pprof = 0 - -################################################################### -# plugin options -################################################################### -plugins_dir = ./plugins - -# pluggable discovery service -discovery_plugin = etcd -# the discovery plugins are part of aggregator -aggregate_mode = "" - -# enable to register service center to backend registry -self_register = 1 - -# pluggable registry service -# 'etcd' means app running as an etcd agent -# 'embeded_etcd' means app running as an etcd server -registry_plugin = embeded_etcd - -# registry address -# 1. if registry_plugin equals to 'embeded_etcd' -manager_name = "sc-0" -manager_addr = "http://127.0.0.1:2380" -manager_cluster = "sc-0=http://127.0.0.1:2380" -# 2. if registry_plugin equals to 'etcd' -# manager_cluster = "127.0.0.1:2379" -# manager_cluster = "127.0.0.1:2381 - -# heartbeat that sync synchronizes client's endpoints with the known endpoints from -# the etcd membership, unit is second and value must greater then 1s, it is set -# default 30s if value less then 0 -auto_sync_interval = 30s - -# the timeout for failing to establish a connection -connect_timeout = 10s -# the timeout for failing to read response of registry -registry_timeout = 30s - -# indicate how many revision you want to keep in etcd -compact_index_delta = 100 -compact_interval = 12h - -# registry cache, if this option value set 0, service center can run -# in lower memory but no longer push the events to client. -enable_cache = 1 - -# pluggable cipher -cipher_plugin = "" - -# suppot buildin, unlimit -# in buildin mode(default): microservice capacity is 50000 -# instance capacity is 150000 -# schema capacity of single microservice is 100 -# rule capacity of single microservice is 100 -# tag capacity of single microservice is 100 -# in unlimit mode: all resource capacities are unlimited, including -# microservices, instances, schemas, rules, tags -quota_plugin = "" - -#access control plugin -auth_plugin = "" - -#support om, manage -auditlog_plugin = "" - -#tracing: buildin(zipkin) -# buildin(zipkin): Can export TRACING_COLLECTOR env variable to select -# collector type, 'server' means report trace data -# to zipkin server address specified by TRACING_SERVER_ADDRESS -# env variable; 'file' means just output a file stored -# in path specified by TRACING_FILE_PATH env variable -trace_plugin = "" - -#customize the uuid format -uuid_plugin = "mp1context" - -################################################################### -# rate limit options -################################################################### -#ttl=m, s, ms -limit_ttl = "s" -#set 0 to disable rate limit -limit_conns = 0 -#list of places to look for IP address -limit_iplookups = "RemoteAddr,X-Forwarded-For,X-Real-IP" - -################################################################### -# ssl/tls options -################################################################### -ssl_plugin = "" -# 0=Non-SSL mode, 1==SSL mode -ssl_mode = 0 -ssl_verify_client = 1 -# minimal tls protocol, [TLSv1.0, TLSv1.1, TLSv1.2] -ssl_min_version = TLSv1.2 -ssl_ciphers = TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_128_GCM_SHA256 - -################################################################### -# log options -################################################################### -# MaxSize of a log file before rotate. By M Bytes. -log_rotate_size = 20 -# Max counts to keep of a log's backup files. -log_backup_count = 50 -# log format(text or json type) -log_format = text -# whether enable record syslog -log_sys = false - -################################################################### -# above is the global configurations -# you can overide above configuration in specific env -################################################################### -[prod] -# DEBUG, INFO, WARN, ERROR, FATAL -loglevel = INFO -logfile = ./service-center.log -## dev env, if you are a operator,ignore this env -[dev] -loglevel = DEBUG -logfile = "" -enable_pprof = 1 \ No newline at end of file diff --git a/mep/mepserver/create_mep_secret.sh b/mep/mepserver/create_mep_secret.sh deleted file mode 100755 index d9500cb..0000000 --- a/mep/mepserver/create_mep_secret.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -kubectl create namespace mep -kubectl create secret --namespace mep generic mepssl-secret --from-file=server.cer --from-file=server_key.pem --from-file=trust.cer -kubectl create secret --namespace mep generic kongssl-secret --from-file=server.cer --from-file=server_key.pem --from-file=trust.cer -kubectl create secret --namespace mep generic mepagentssl_secret --from-file=server.cer --from-file=server_key.pem --from-file=trust.cer diff --git a/mep/mepserver/deploy.sh b/mep/mepserver/deploy.sh deleted file mode 100755 index e0ba349..0000000 --- a/mep/mepserver/deploy.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#Create secret for mep server and kong -./create_mep_secret.sh - -#deploy PGDB, mep server and Kong services - kubectl apply -f mep-basic.yaml - kubectl apply -f postgres-k8s.yaml - kubectl apply -f kong-k8s.yaml - kubectl apply -f mep-k8s.yaml diff --git a/mep/mepserver/docker-build.sh b/mep/mepserver/docker-build.sh deleted file mode 100755 index 07ab76f..0000000 --- a/mep/mepserver/docker-build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -MEP_VERSION=latest -docker build --no-cache -t ealtedge/mep:${MEP_VERSION} -f docker/Dockerfile . diff --git a/mep/mepserver/docker/Dockerfile b/mep/mepserver/docker/Dockerfile deleted file mode 100644 index 4c0b7e9..0000000 --- a/mep/mepserver/docker/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM golang:1.14.2-alpine3.11 - -ENV GOPROXY https://goproxy.io -ENV GO111MODULE on - -WORKDIR /go/cache - -ADD go.mod . -ADD go.sum . -RUN go mod download - -WORKDIR /go/release - -ADD . . -RUN apk update && apk add --no-cache musl-dev gcc build-base - -RUN GOOS=linux CGO_ENABLED=0 go build -buildmode=pie -ldflags="-s -w" -installsuffix cgo -o app main.go - -RUN cp -r conf/ / && cp app start.sh / - -EXPOSE 8088 - -CMD ["/start.sh"] diff --git a/mep/mepserver/go.mod b/mep/mepserver/go.mod deleted file mode 100644 index 86bf510..0000000 --- a/mep/mepserver/go.mod +++ /dev/null @@ -1,24 +0,0 @@ -module mepserver - -go 1.14 - -replace ( - github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b => github.com/go-chassis/glog v0.0.0-20180920075250-95a09b2413e9 - go.uber.org/zap v1.9.0 => github.com/uber-go/zap v1.9.0 - golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 => github.com/golang/crypto v0.0.0-20180904163835-0709b304e793 - golang.org/x/net v0.0.0-20180824152047-4bcd98cce591 => github.com/golang/net v0.0.0-20180824152047-4bcd98cce591 - golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 => github.com/golang/sys v0.0.0-20180905080454-ebe1bf3edb33 - golang.org/x/text v0.0.0-20170627122817-6353ef0f9243 => github.com/golang/text v0.0.0-20170627122817-6353ef0f9243 - golang.org/x/time v0.0.0-20170424234030-8be79e1e0910 => github.com/golang/time v0.0.0-20170424234030-8be79e1e0910 - google.golang.org/genproto v0.0.0-20170531203552-aa2eb687b4d3 => github.com/google/go-genproto v0.0.0-20170531203552-aa2eb687b4d3 - google.golang.org/grpc v1.7.5 => github.com/grpc/grpc-go v1.7.5 - k8s.io/api v0.0.0-20180601181742-8b7507fac302 => github.com/kubernetes/api v0.0.0-20180601181742-8b7507fac302 - k8s.io/apimachinery v0.0.0-20180601181227-17529ec7eadb => github.com/kubernetes/apimachinery v0.0.0-20180601181227-17529ec7eadb - k8s.io/client-go v2.0.0-alpha.0.0.20180817174322-745ca8300397+incompatible => github.com/kubernetes/client-go v0.0.0-20180817174322-745ca8300397 -) - -require ( - github.com/apache/servicecomb-service-center v0.0.0-20191027084911-c2dc0caef706 - github.com/satori/go.uuid v1.1.0 - golang.org/x/net v0.0.0-20190620200207-3b0461eec859 -) diff --git a/mep/mepserver/go.sum b/mep/mepserver/go.sum deleted file mode 100644 index d0d9818..0000000 --- a/mep/mepserver/go.sum +++ /dev/null @@ -1,253 +0,0 @@ -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/NYTimes/gziphandler v1.0.2-0.20180820182813-253f1acb9d9f h1:JliTHSbyp6SvSqw5Kdkd+kq2jJueTlDNQCyyr+4+/0o= -github.com/NYTimes/gziphandler v1.0.2-0.20180820182813-253f1acb9d9f/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/Shopify/sarama v1.18.0 h1:Ha2FAOngREft7C44ouUXDxSZ/Y/77IDCMV1YS4AnUkI= -github.com/Shopify/sarama v1.18.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/agiledragon/gomonkey v2.0.1+incompatible/go.mod h1:2NGfXu1a80LLr2cmWXGBDaHEjb1idR6+FVlX5T3D9hw= -github.com/apache/servicecomb-service-center v0.0.0-20191027084911-c2dc0caef706 h1:1Hl0mbyGTW6r7eFxohtbLpPW6ylyI7l2tKa9JtegGSU= -github.com/apache/servicecomb-service-center v0.0.0-20191027084911-c2dc0caef706/go.mod h1:zS5Wr+3WHz5as1qL8WSzzlKr7TIxuZiUXC8JjgMKJ8M= -github.com/apache/thrift v0.0.0-20180125231006-3d556248a8b9 h1:ymi1nHra1RZXqjg5xvka4YVyK+3uKPk2B9HUlPRIiBc= -github.com/apache/thrift v0.0.0-20180125231006-3d556248a8b9/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/astaxie/beego v1.8.0 h1:Rc5qRXMy5fpxq3FEi+4nmykYIMtANthRJ8hcoY+1VWM= -github.com/astaxie/beego v1.8.0/go.mod h1:0R4++1tUqERR0WYFWdfkcrsyoVBCG4DgpDGokT3yb+U= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/cheggaaa/pb v1.0.25/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= -github.com/coreos/bbolt v1.3.1-coreos.6 h1:uTXKg9gY70s9jMAKdfljFQcuh4e/BXOM+V+d00KFj3A= -github.com/coreos/bbolt v1.3.1-coreos.6/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.6+incompatible h1:4tm4wgWV5rLFlAV4K6kj2zhSBH3bWvzQUyn88VgN3fE= -github.com/coreos/etcd v3.3.6+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0 h1:3Jm3tLmsgAYcjC+4Up7hJrFBPr+n7rAqYeSw/SZazuY= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180828140353-eee3db372b31 h1:wRzCUSYhBIk1KvRIlx+nvScCRIxX0iIhSU5h9xj7MUU= -github.com/coreos/go-systemd v0.0.0-20180828140353-eee3db372b31/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea h1:n2Ltr3SrfQlf/9nOna1DoGKxLx3qTSI8Ttl6Xrqp6mw= -github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -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 h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/eapache/go-resiliency v1.1.0 h1:1NtRmCAqadE2FN4ZcN6g90TP3uk8cg9rn9eNK2197aU= -github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= -github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= -github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-chassis/glog v0.0.0-20180920075250-95a09b2413e9 h1:z6ezGZIJVMl2Yo0gOJlv8jOvCDFi9W3TLADQvJ6Z2t0= -github.com/go-chassis/glog v0.0.0-20180920075250-95a09b2413e9/go.mod h1:tfdQUl8deEC8YmpbYjbSZJv7Y/7hC0ag9n3RVrjIoJs= -github.com/go-chassis/paas-lager v0.0.0-20180727081842-50655443dc96 h1:VViSMNCEKU0iqveFWVJpmel5aGgE6UOOUr/ZHhWa8B4= -github.com/go-chassis/paas-lager v0.0.0-20180727081842-50655443dc96/go.mod h1:tILYbn3+0jjCxhY6/ue9L8eRq+VJ60U6VYIdugqchB4= -github.com/go-chassis/paas-lager v1.1.1 h1:/6wqawUGjPCpd57A/tzJzgC4MnEhNuigbayQS+2VWPQ= -github.com/go-logfmt/logfmt v0.3.0 h1:8HUsc87TaSWLKwrnumgC8/YconD2fJQsRJAsWaPg2ic= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/golang/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:uZvAcrsnNaCxlh1HorK5dUQHGmEKPh2H/Rl1kehswPo= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef h1:veQD95Isof8w9/WXiA+pa3tz3fJXkt5B7QaRBrM62gk= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/lint v0.0.0-20190409202823-5614ed5bae6fb75893070bdc0996a68765fdd275/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= -github.com/golang/protobuf v1.0.0 h1:lsek0oXi8iFE9L+EXARyHIjU5rlWIhhTkjDz3vHhWWQ= -github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:5JyrLPvD/ZdaYkT7IqKhsP5xt7aLjA99KXRtk4EIYDk= -github.com/golang/text v0.0.0-20170627122817-6353ef0f9243 h1:XALJSS9xekVi8gprnX9Bm+egyMT107ApTqio589gHqc= -github.com/golang/text v0.0.0-20170627122817-6353ef0f9243/go.mod h1:GUiq9pdJKRKKAZXiVgWFEvocYuREvC14NhI4OPgEjeE= -github.com/golang/time v0.0.0-20170424234030-8be79e1e0910 h1:NRc7Ti3G99vV7XdCoaollLoBOW94daQlaJsyer2qBOg= -github.com/golang/time v0.0.0-20170424234030-8be79e1e0910/go.mod h1:Goyxmr1dEyuE8J10MyNptB/4WJaypDxCpNr2pf27wjI= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c h1:964Od4U6p2jUkFxvCydnIczKteheJEzHRToSGK3Bnlw= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-genproto v0.0.0-20170531203552-aa2eb687b4d3 h1:E2Y5VV8z8bqe066M0lrEmYXCXgsU4SQvIeGct4zPkn4= -github.com/google/go-genproto v0.0.0-20170531203552-aa2eb687b4d3/go.mod h1:3Rcd9jSoLVkV/osPrt5CogLvLiarfI8U9/x78NwhuDU= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g= -github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/gorilla/websocket v1.2.0 h1:VJtLvh6VQym50czpZzx07z/kw9EgAxI3x1ZB8taTMQQ= -github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.3.0 h1:HJtP6RRwj2EpPCD/mhAWzSvLL/dFTdPm1UrWwanoFos= -github.com/grpc-ecosystem/grpc-gateway v1.3.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc/grpc-go v1.7.5 h1:AO1n6bZsX2sh0U8Y0fDwUKOv6Uw7XOeDuDf7jeVMKVM= -github.com/grpc/grpc-go v1.7.5/go.mod h1:OkrsaFQVyvU0P5XR5PQ2d19rg8dJ/sIJcthuZNcktKk= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= -github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.3/go.mod h1:UpNcs7fFbpKIyZaUuSW6EPiH+eZC7OuyFD+wc1oal+k= -github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c h1:kQWxfPIHVLbgLzphqk3QUflDy9QdksZR4ygR807bpy0= -github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= -github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/json-iterator/go v1.1.5 h1:gL2yXlmiIo4+t+y32d4WGwOjKGYcGOuyrg46vadswDE= -github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/karlseguin/ccache v2.0.3-0.20170217060820-3ba9789cfd2c+incompatible h1:Yvcw4N+1TaDTNkIuHn3gn8D1KP7Wxn4LP5GngDPWcPQ= -github.com/karlseguin/ccache v2.0.3-0.20170217060820-3ba9789cfd2c+incompatible/go.mod h1:CM9tNPzT6EdRh14+jiW8mEF9mkNZuuE51qmgGYUB93w= -github.com/karlseguin/expect v1.0.1 h1:z4wy4npwwHSWKjGWH85WNJO42VQhovxTCZDSzhjo8hY= -github.com/karlseguin/expect v1.0.1/go.mod h1:zNBxMY8P21owkeogJELCLeHIt+voOSduHYTFUbwRAV8= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kubernetes/api v0.0.0-20180601181742-8b7507fac302 h1:w9o/Ji0IH+0hUX6eV9NHgYHQ0QBOFhfbNctpZ3ZXFcs= -github.com/kubernetes/api v0.0.0-20180601181742-8b7507fac302/go.mod h1:o5K7QWn2BV3MxynyVmAM1hhJxCL/FTrSymRIVwXDw58= -github.com/kubernetes/apimachinery v0.0.0-20180601181227-17529ec7eadb h1:BuNmIG2pNJspCLPkruNcZCmR8RtHc8WDy6hRiCFV7M8= -github.com/kubernetes/apimachinery v0.0.0-20180601181227-17529ec7eadb/go.mod h1:Pe/YBTPc3vqoMkbuIWPH8CF9ehINdvNyS0dP3J6HC0s= -github.com/kubernetes/client-go v0.0.0-20180817174322-745ca8300397 h1:jx8QGtpqZkPXUz+DceA5DKIOXb0oTISb9th5GmJC4WE= -github.com/kubernetes/client-go v0.0.0-20180817174322-745ca8300397/go.mod h1:kszVi2i+FeqECZHhjpkV5h5zM0GnURfJv897YzgoAQ8= -github.com/labstack/echo v3.2.2-0.20180316170059-a5d81b8d4a62+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s= -github.com/labstack/gommon v0.2.1/go.mod h1:/tj9csK2iPSBvn+3NLM9e52usepMtrd5ilFYA+wQNJ4= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -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/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/natefinch/lumberjack v0.0.0-20170531160350-a96e63847dc3 h1:BDvcX7oM8ZWOS08LQXaW8ucGblfoSG4srpoW6pKhvqs= -github.com/natefinch/lumberjack v0.0.0-20170531160350-a96e63847dc3/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk= -github.com/olekukonko/tablewriter v0.0.0-20180506121414-d4647c9c7a84/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.4.1 h1:PZSj/UFNaVp3KxrzHOcS7oyuWA7LoOY/77yCTEFu21U= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492 h1:lM6RxxfUMrYL/f8bWEUqdXrANWtrL7Nndbm9iFN0DlU= -github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing/opentracing-go v1.0.2 h1:3jA2P6O1F9UOrWVpwrIo17pu01KWvNWg4X946/Y5Zwg= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/openzipkin/zipkin-go-opentracing v0.3.3-0.20180123190626-6bb822a7f15f h1:nn2nWXhr9DIrC4IxlTiwow9G6Zq6jVWdckXhIzYtJOM= -github.com/openzipkin/zipkin-go-opentracing v0.3.3-0.20180123190626-6bb822a7f15f/go.mod h1:js2AbwmHW0YD9DwIw2JhQWmbfFi/UnWyYwdVhqbCDOE= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus/client_golang v0.8.1-0.20170628125436-ab4214782d02 h1:Wud705ibHyyfQnllggTZva4YsYCECxhGVkcq58A1j6A= -github.com/prometheus/client_golang v0.8.1-0.20170628125436-ab4214782d02/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_model v0.0.0-20170216185247-6f3806018612 h1:13pIdM2tpaDi4OVe24fgoIS7ZTqMt0QI+bwQsX5hq+g= -github.com/prometheus/client_model v0.0.0-20170216185247-6f3806018612/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e h1:n/3MEhJQjQxrOUCzh1Y3Re6aJUUWRp2M9+Oc3eVn/54= -github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273 h1:agujYaXJSxSo18YNX3jzl+4G6Bstwt+kqv47GS12uL0= -github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/rcrowley/go-metrics v0.0.0-20180503174638-e2704e165165 h1:nkcn14uNmFEuGCb2mBZbBb24RdNRL08b/wb+xBOYpuk= -github.com/rcrowley/go-metrics v0.0.0-20180503174638-e2704e165165/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rs/cors v0.0.0-20170608165155-8dd4211afb5d h1:573lGU02rfWK16h656qmmul1zPul8WPPCDekyq+keVs= -github.com/rs/cors v0.0.0-20170608165155-8dd4211afb5d/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/satori/go.uuid v1.1.0 h1:B9KXyj+GzIpJbV7gmr873NsY6zpbxNy24CBtGrk7jHo= -github.com/satori/go.uuid v1.1.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sirupsen/logrus v1.3.0 h1:hI/7Q+DtNZ2kINb6qt/lS+IyXnHQe9e90POfeewL/ME= -github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spf13/cobra v0.0.0-20170624150100-4d647c8944eb/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/pflag v1.0.0 h1:oaPbdDe/x0UncahuwiPxW1GYJyilRAdsPnq3e1yaPcI= -github.com/spf13/pflag v1.0.0/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -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/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/uber-go/zap v1.9.0 h1:HSDaxzxZlbVzACpHSNfxOga0D/vTBAuE7vUarwRGeGg= -github.com/uber-go/zap v1.9.0/go.mod h1:GY+83l3yxBcBw2kmHu/sAWwItnTn+ynxHCRo+WiIQOY= -github.com/ugorji/go v1.1.1 h1:gmervu+jDMvXTbcHQ0pd2wee85nEoE0BsVyEuzkfK8w= -github.com/ugorji/go v1.1.1/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4/go.mod h1:50wTf68f99/Zt14pr046Tgt3Lp2vLyFZKzbFXTOabXw= -github.com/widuu/gojson v0.0.0-20170212122013-7da9d2cd949b/go.mod h1:9W1pyetRkwXqjR9tjOSrSuhGHBK0EqXoQSwWbhBHHwA= -github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0 h1:3UeQBvD0TFrlVjOeLOBz+CPAI8dnbqNSVwUwRrkp7vQ= -github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0/go.mod h1:IXCdmsXIht47RaVFLEdVnh1t+pgYtTAhQGj73kz+2DM= -github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18 h1:MPPkRncZLN9Kh4MEFmbnK4h3BD7AUmskWv2+EeZJCCs= -github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3 h1:KYQXGkl6vs02hK7pK4eIbw0NpNPedieTSTEiJ//bwGs= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc h1:a3CU5tJYVj92DY2LaA1kUkrsqD5/3mLDhx2NcNqyW+0= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5 h1:x6r4Jo0KNzOOzYd8lbcRsqjuqEASK6ob3auvWYM4/8U= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/karlseguin/expect.v1 v1.0.1 h1:9u0iUltnhFbJTHaSIH0EP+cuTU5rafIgmcsEsg2JQFw= -gopkg.in/karlseguin/expect.v1 v1.0.1/go.mod h1:uB7QIJBcclvYbwlUDkSCsGjAOMis3fP280LyhuDEf2I= -gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/mep/mepserver/kong-k8s.yaml b/mep/mepserver/kong-k8s.yaml deleted file mode 100644 index c61475f..0000000 --- a/mep/mepserver/kong-k8s.yaml +++ /dev/null @@ -1,124 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -# kong deployment ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: apigw-kong - name: apigw-kong - namespace: mep -spec: - replicas: 1 - selector: - matchLabels: - app: apigw-kong - template: - metadata: - labels: - app: apigw-kong - spec: - initContainers: - - name: check-db-ready - image: postgres:9.6 - command: ['sh', '-c', 'until pg_isready -h postgres-db -p 5432; - do echo waiting for database; sleep 2; done;'] - containers: - - name: kong-proxy - image: kong:1.5.1-alpine - env: - - name: KONG_DATABASE - value: "postgres" - - name: KONG_NGINX_WORKER_PROCESSES - value: "1" - - name: KONG_ADMIN_ACCESS_LOG - value: /dev/stdout - - name: KONG_ADMIN_ERROR_LOG - value: /dev/stderr - - name: KONG_ADMIN_ACCESS_LOG - value: /dev/stdout - - name: KONG_ADMIN_ERROR_LOG - value: /dev/stderr - - name: KONG_ADMIN_LISTEN - value: 127.0.0.1:8444 ssl - - name: KONG_PROXY_LISTEN - value: 0.0.0.0:8000, 0.0.0.0:8443 ssl http2 - - name: KONG_ADMIN_LISTEN - value: 0.0.0.0:8001 - - name: KONG_PG_DATABASE - value: kong - - name: KONG_PG_HOST - value: postgres-db - - name: KONG_PG_USER - value: kong - - name: KONG_PG_PASSWORD - value: kong - - name: KONG_PROXY_ACCESS_LOG - value: /dev/stdout - - name: KONG_PROXY_ERROR_LOG - value: /dev/stderr - #- name: KONG_SSL_CERT - #value: /run/kongssl/server.cer - #- name: KONG_SSL_CERT_KEY - #value: /run/kongssl/server_key.pem - ports: - - containerPort: 8000 - name: proxy - protocol: TCP - - containerPort: 8443 - name: proxy-ssl - protocol: TCP - - containerPort: 8001 - name: admin-api - protocol: TCP - - containerPort: 8444 - name: admin-api-ssl - protocol: TCP - #volumeMounts: - #- name: kongssl - #mountPath: "/run/kongssl" - #readOnly: true - #volumes: - #- name: kongssl - #secret: - #secretName: kongssl-secret - - -# kong service ---- -apiVersion: v1 -kind: Service -metadata: - name: kong-service - namespace: mep -spec: - selector: - app: apigw-kong - type: NodePort - ports: - - port: 8000 - name: proxy - nodePort: 30010 - - port: 8443 - name: proxy-ssl - nodePort: 30011 - - port: 8001 - name: admin-api - nodePort: 30012 - - port: 8444 - name: admin-api-ssl - nodePort: 30013 diff --git a/mep/mepserver/main.go b/mep/mepserver/main.go deleted file mode 100644 index b54b57f..0000000 --- a/mep/mepserver/main.go +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -import ( - "github.com/apache/servicecomb-service-center/server" - _ "github.com/apache/servicecomb-service-center/server/bootstrap" - _ "github.com/apache/servicecomb-service-center/server/init" - - _ "mepserver/mp1" - _ "mepserver/mp1/uuid" -) - -func main() { - server.Run() -} diff --git a/mep/mepserver/mep-basic.yaml b/mep/mepserver/mep-basic.yaml deleted file mode 100644 index d8f6cbe..0000000 --- a/mep/mepserver/mep-basic.yaml +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -# mep namespace ---- -apiVersion: v1 -kind: Namespace -metadata: - name: mep - -# persitent volume ---- -kind: PersistentVolume -apiVersion: v1 -metadata: - name: postgres-pv-volume - labels: - type: local - app: postgres -spec: - storageClassName: manual - capacity: - storage: 5Gi - accessModes: - - ReadWriteMany - hostPath: - path: "/mnt/data" - -# pvc ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: postgres-pv-claim - namespace: mep - labels: - app: postgres -spec: - storageClassName: manual - accessModes: - - ReadWriteMany - resources: - requests: - storage: 5Gi diff --git a/mep/mepserver/mep-k8s.yaml b/mep/mepserver/mep-k8s.yaml deleted file mode 100755 index b27b6bf..0000000 --- a/mep/mepserver/mep-k8s.yaml +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -# mep pod ---- -apiVersion: v1 -kind: Pod -metadata: - name: mep - namespace: mep - labels: - app: mep -spec: - containers: - - image: ealtedge/mep:latest - imagePullPolicy: IfNotPresent - name: mep-pod - ports: - - containerPort: 8088 - - containerPort: 8443 - env: - - name: SSL_ROOT - value: "/etc/mepssl" - - name: MEP_SSL_MODE - value: "0" - #volumeMounts: - #- name: mepssl - #mountPath: "/etc/mepssl" - #readOnly: true - #volumes: - #- name: mepssl - #secret: - #secretName: mepssl-secret - - -# mep service ---- -apiVersion: v1 -kind: Service -metadata: - name: mep-service - namespace: mep -spec: - selector: - app: mep - type: NodePort - ports: - - port: 8088 - name: mep-port - nodePort: 30088 - - port: 8443 - name: mep-https-port - nodePort: 30443 diff --git a/mep/mepserver/mp1/arch/bus/base.go b/mep/mepserver/mp1/arch/bus/base.go deleted file mode 100644 index f049c73..0000000 --- a/mep/mepserver/mp1/arch/bus/base.go +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package bus - -import ( - "fmt" - "reflect" - "strconv" - "strings" -) - -type JSONPathInfo struct { - ParentNode reflect.Value - CurNode reflect.Value - CurName string - e error -} - -type JpErr struct { - ErrDes string - JPath string -} - -func (e *JpErr) Error() string { - return fmt.Sprintf("jpath error info:%s, json path:%s", e.ErrDes, e.JPath) -} - -func ObjReflectPath(p reflect.Value, v reflect.Value, path string) JSONPathInfo { - fieldName, subPath := GetFirstName(path) - - switch v.Kind() { - case reflect.Invalid: - return JSONPathInfo{e: &JpErr{"reflect.Invalid", path}} - - case reflect.Slice, reflect.Array: - return ObjReflectPathArray(v, fieldName, subPath) - case reflect.Struct: - return ObjReflectPathStruct(v, fieldName, subPath) - - case reflect.Map: - return ObjReflectPathMap(v, fieldName, subPath) - - case reflect.Ptr: - if v.IsNil() { - return JSONPathInfo{e: &JpErr{"pointer is null", path}} - } - return ObjReflectPath(p, v.Elem(), path) - case reflect.Interface: - if v.IsNil() { - return JSONPathInfo{e: &JpErr{"kind is interface, nil", path}} - } - - if subPath == "" { - return ReflectSafeAddr(v, v.Elem()) - } - return ObjReflectPath(p, v.Elem(), path) - - default: - return GetFieldFromPath(p, v, path) - } -} - -func ObjReflectPathArray(v reflect.Value, fieldName string, subPath string) JSONPathInfo { - if fieldName == "-" { - mapInfo := ReflectSafeAddr(v, reflect.ValueOf(nil)) - mapInfo.CurName = "-" - return mapInfo - } - - idx, err := strconv.Atoi(fieldName) - if err != nil { - return JSONPathInfo{e: &JpErr{"Atoi error", fieldName}} - } - if idx >= v.Len() { - return JSONPathInfo{e: &JpErr{"Index out of range", fieldName}} - } - if subPath == "" { - return ReflectSafeAddr(v, v.Index(idx)) - } - return ObjReflectPath(v, v.Index(idx), subPath) -} - -func ObjReflectPathStruct(v reflect.Value, fieldName string, subPath string) JSONPathInfo { - - vType := v.Type() - for i := 0; i < v.NumField(); i++ { - if !MatchJSONFieldName(vType, i, fieldName) { - continue - } - if subPath == "" { - return ReflectSafeAddr(v, v.Field(i)) - } - return ObjReflectPath(v, v.Field(i), subPath) - } - return JSONPathInfo{e: &JpErr{"can not find field in struct", fieldName}} - -} - -func ObjReflectPathMap(v reflect.Value, fieldName string, subPath string) JSONPathInfo { - for _, key := range v.MapKeys() { - if ReflectValueToString(key) != fieldName { - continue - } - - if subPath == "" { - mapInfo := ReflectSafeAddr(v, reflect.ValueOf(nil)) - mapInfo.CurName = fieldName - return mapInfo - } - return ObjReflectPath(v, v.MapIndex(key), subPath) - - } - if subPath == "" { - mapInfo := ReflectSafeAddr(v, reflect.ValueOf(nil)) - mapInfo.CurName = fieldName - return mapInfo - } - - return JSONPathInfo{e: &JpErr{"path not in map:" + fieldName, subPath}} -} - -func GetFirstName(path string) (string, string) { - if len(path) == 0 { - return "", "" - } - newPath := path - if path[0] == '/' { - newPath = path[1:] - } - pos := strings.IndexByte(newPath, '/') - if pos < 0 { - pos = len(newPath) - } - subPath := newPath[pos:] - firstName := newPath[0:pos] - escape := strings.IndexByte(firstName, '~') - if escape >= 0 { - firstName = strings.Replace(firstName, "~1", "/", -1) - firstName = strings.Replace(firstName, "~0", "~", -1) - } - return firstName, subPath -} - -func MatchJSONFieldName(vType reflect.Type, i int, jsonName string) bool { - tag := vType.Field(i).Tag - if !strings.Contains(string(tag), jsonName) { - return false - } - name := tag.Get("json") - if name == "" { - name = strings.ToLower(vType.Field(i).Name) - } else { - pos := strings.IndexByte(name, ',') - if pos > 0 { - name = name[0:pos] - } - } - if name == jsonName { - return true - } - - return false -} - -func GetFieldFromPath(p reflect.Value, v reflect.Value, path string) JSONPathInfo { - var info JSONPathInfo - if !v.CanAddr() { - return JSONPathInfo{e: &JpErr{"CanAddr false", path}} - } - - switch v.Kind() { - case reflect.Invalid: - return JSONPathInfo{e: &JpErr{"Kind invalid", path}} - - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - info.ParentNode = p - info.CurNode = v - return info - - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - info.ParentNode = p - info.CurNode = v - return info - - case reflect.Bool: - info.ParentNode = p - info.CurNode = v - return info - case reflect.String: - info.ParentNode = p - info.CurNode = v - return info - case reflect.Slice, reflect.Map: - info.ParentNode = p - info.CurNode = v - return info - case reflect.Ptr: - info.ParentNode = p - info.CurNode = v - return info - case reflect.Chan, reflect.Func: - return JSONPathInfo{e: &JpErr{"Kind Chan or Func", path}} - default: - return JSONPathInfo{e: &JpErr{"upexpect Kint: reflect.Array, reflect.Struct, reflect.Interface", path}} - } -} - -func ReflectValueToString(v reflect.Value) string { - switch v.Kind() { - case reflect.Invalid: - return "invalid" - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return strconv.FormatInt(v.Int(), 10) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return strconv.FormatUint(v.Uint(), 10) - case reflect.Bool: - return strconv.FormatBool(v.Bool()) - case reflect.String: - return v.String() - case reflect.Chan, reflect.Func, reflect.Ptr, reflect.Slice, reflect.Map: - return "invalid" - default: - return "invalid" - } -} - -func ReflectSafeAddr(p reflect.Value, v reflect.Value) JSONPathInfo { - var info JSONPathInfo - - if p.CanAddr(){ - info.ParentNode = p - } - - if v.CanAddr(){ - info.CurNode = v - } - return info -} diff --git a/mep/mepserver/mp1/arch/bus/load.go b/mep/mepserver/mp1/arch/bus/load.go deleted file mode 100644 index e4aac47..0000000 --- a/mep/mepserver/mp1/arch/bus/load.go +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package bus - -import ( - "reflect" - "strings" -) - -func parseTags(tag reflect.StructTag) (string, string) { - fieldName := tag.Get("json") - if fieldName == "" { - return "", "" - } - fieldNames := strings.Split(fieldName, ",") - secTag := "in" - if len(fieldNames) > 1 { - secTag = fieldNames[1] - } - return fieldNames[0], secTag -} - -func LoadObjByInd(dst interface{}, src interface{}, direction string) bool { - rflDst := reflect.ValueOf(dst).Elem() - rflSrc := reflect.ValueOf(src).Elem() - vType := rflDst.Type() - for i := 0; i < rflDst.NumField(); i++ { - fieldName, secTag := parseTags(vType.Field(i).Tag) - if fieldName == "" { - continue - } - if secTag != direction { - continue - } - - valDst := rflDst.Field(i) - srcNode := ObjReflectPath(rflSrc, rflSrc, fieldName) - if srcNode.e != nil || srcNode.CurNode.Kind() == reflect.Invalid { - continue - } - - valSrc := srcNode.CurNode - if direction == "in" { - valDst.Set(valSrc) - } else { - valSrc.Set(valDst) - } - } - return true -} diff --git a/mep/mepserver/mp1/arch/workspace/runner.go b/mep/mepserver/mp1/arch/workspace/runner.go deleted file mode 100644 index 0670ebe..0000000 --- a/mep/mepserver/mp1/arch/workspace/runner.go +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package workspace - -import ( - "sync" - - "mepserver/mp1/arch/bus" -) - -type GoPolicy int - -const ( - _ GoPolicy = iota - GoParallel - GoBackground - GoSerial -) - -func WkRun(plan SpaceIf) ErrCode { - curPlan := plan.getPlan() - for { - if curPlan.CurGrpIdx >= len(curPlan.PlanGrp) { - break - } - curSub := &curPlan.PlanGrp[curPlan.CurGrpIdx] - retCode, stepIdx := GrpRun(curSub, plan, &curPlan.WtPlan) - if retCode <= TaskOK { - curPlan.CurGrpIdx++ - continue - } - RecordErrInfo(curPlan, stepIdx) - GotoErrorProc(curPlan) - } - // wait backgroud job finish - curPlan.WtPlan.Wait() - return TaskOK - -} - -func TaskRunner(wkSpace interface{}, stepIf TaskBaseIf) int { - for { - bus.LoadObjByInd(stepIf, wkSpace, "in") - retCode := stepIf.OnRequest("") - if retCode <= TaskFinish { - bus.LoadObjByInd(stepIf, wkSpace, "out") - break - } - } - return 0 -} - -func StepPolicy(wg *sync.WaitGroup, curSub *SubGrp, plan SpaceIf, wtPlan *sync.WaitGroup, stepIf TaskBaseIf) ErrCode { - taskRet := TaskOK - switch curSub.Policy { - case GoBackground: - wtPlan.Add(1) - go func() { - defer wtPlan.Done() - TaskRunner(plan, stepIf) - }() - - case GoParallel: - wg.Add(1) - go func() { - defer wg.Done() - TaskRunner(plan, stepIf) - }() - default: - TaskRunner(plan, stepIf) - taskRet, _ = stepIf.GetErrCode() - } - - return taskRet -} - -func GrpOneStep(wg *sync.WaitGroup, curSub *SubGrp, plan SpaceIf, wtPlan *sync.WaitGroup) bool { - if curSub.CurStepIdx >= len(curSub.StepObjs) { - return false - } - curStep := curSub.StepObjs[curSub.CurStepIdx] - if curStep == nil { - curSub.CurStepIdx++ - return true - } - stepIf, ok := curStep.(TaskBaseIf) - if !ok { - return false - } - taskRet := StepPolicy(wg, curSub, plan, wtPlan, stepIf) - curSub.CurStepIdx++ - - return taskRet <= TaskOK -} - -func GrpGetRetCode(curSub *SubGrp) (ErrCode, int) { - for idx, curStep := range curSub.StepObjs { - stepIf, ok := curStep.(TaskBaseIf) - if !ok { - continue - } - errCode, _ := stepIf.GetErrCode() - if errCode > TaskOK { - return errCode, idx - } - } - - return TaskOK, -1 -} - -func GrpRun(curSub *SubGrp, plan SpaceIf, wtPlan *sync.WaitGroup) (ErrCode, int) { - var wg sync.WaitGroup - for { - nextStep := GrpOneStep(&wg, curSub, plan, wtPlan) - if !nextStep { - break - } - } - if curSub.Policy == GoParallel { - wg.Wait() - } - return GrpGetRetCode(curSub) -} diff --git a/mep/mepserver/mp1/arch/workspace/task_base.go b/mep/mepserver/mp1/arch/workspace/task_base.go deleted file mode 100644 index 7176bd3..0000000 --- a/mep/mepserver/mp1/arch/workspace/task_base.go +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package workspace - -type TaskBaseIf interface { - OnRequest(data string) TaskCode - Parse(params string) - OnFork(wkSpace interface{}, param interface{}) int - GetErrCode() (ErrCode, string) - OnStop() int - WithName(name string) - SetSerErrInfo(serErr *SerErrInfo) -} - -type TaskBase struct { - serErr *SerErrInfo - errMsg string - Name string - Param []string - resultCode ErrCode -} - -func (t *TaskBase) WithName(name string) { - t.Name = name -} - -func (t *TaskBase) Parse(params string) { - t.Param = append(t.Param, params) -} - -func (t *TaskBase) OnFork(wkSpace interface{}, param interface{}) int { - return 0 -} - -func (t *TaskBase) OnStop() int { - return 0 -} - -type TaskCode int - -const ( - TaskFinish TaskCode = iota - TaskWaitMore - TaskError -) - -func (t *TaskBase) OnRequest(wkSpace interface{}) TaskCode { - return TaskFinish -} - -func (t *TaskBase) SetFirstErrorCode(code ErrCode, msg string) { - if t.resultCode > TaskOK { - return - } - t.resultCode = code - t.errMsg = msg -} - -func (t *TaskBase) GetErrCode() (ErrCode, string) { - return t.resultCode, t.errMsg -} - -func (t *TaskBase) SetSerErrInfo(serErr *SerErrInfo) { - t.serErr = serErr -} - -func (t *TaskBase) GetSerErrInfo() *SerErrInfo { - return t.serErr -} - -type StepMap map[string]interface{} - -var StepData StepMap = StepMap{} - -func NameMap(name string, obj interface{}, listenOn string) bool { - StepData[name] = obj - return true -} diff --git a/mep/mepserver/mp1/arch/workspace/workspace_base.go b/mep/mepserver/mp1/arch/workspace/workspace_base.go deleted file mode 100644 index e15002c..0000000 --- a/mep/mepserver/mp1/arch/workspace/workspace_base.go +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package workspace - -import ( - "sync" -) - -type PlanIf interface { - SetErrorStep(stepName string) - UsingSpace(spaceName string) - RunBackground(task ...interface{}) - RunParallel(task ...interface{}) - RunSerial(task ...interface{}) -} - -type SpaceIf interface { - PlanIf - getPlan() *PlanBase -} - -type ErrCode int - -const ( - TaskContinue ErrCode = -1 - TaskOK ErrCode = iota - TaskFail -) - -const FINALLY string = "finally" - - -type SubGrp struct { - Policy GoPolicy - CurStepIdx int - StepNames []string - StepObjs []interface{} -} - -func (s *SubGrp) Install(task []interface{}) bool { - for _, stepObj := range task { - if stepObj == nil { - return false - } - s.StepObjs = append(s.StepObjs, stepObj) - } - return true -} - -type SerErrInfo struct { - ErrCode int - Message string - GrpIdx int - TaskIdx int -} - -type PlanBase struct { - SerError *SerErrInfo - PlanName string - SpaceName string - ErrStep string - PlanGrp []SubGrp - CurGrpIdx int - WtPlan sync.WaitGroup -} - -func (b *PlanBase) SetErrorStep(stepName string) { - b.ErrStep = stepName -} - -func (b *PlanBase) UsingSpace(spaceName string) { - b.SpaceName = spaceName -} - -func (b *PlanBase) RunBackground(task ...interface{}) { - b.LoadTask(GoBackground, task) -} - -func (b *PlanBase) RunParallel(task ...interface{}) { - b.LoadTask(GoParallel, task) -} - -func (b *PlanBase) RunSerial(task ...interface{}) { - b.LoadTask(GoSerial, task) -} - -func (b *PlanBase) RunSerialName(task interface{}, name string) { - var subGrp SubGrp - subGrp.Policy = GoSerial - subGrp.Install([]interface{}{task}) - b.LoadData([]interface{}{task}) - subGrp.StepNames = []string{name} - b.PlanGrp = append(b.PlanGrp, subGrp) -} - -func (b *PlanBase) Try(task ...interface{}) { - b.SetErrorStep(FINALLY) - b.LoadTask(GoSerial, task) -} - -func (b *PlanBase) Finally(task interface{}) { - var subGrp SubGrp - subGrp.Policy = GoSerial - subGrp.Install([]interface{}{task}) - b.LoadData([]interface{}{task}) - subGrp.StepNames = []string{FINALLY} - b.PlanGrp = append(b.PlanGrp, subGrp) -} - -func (b *PlanBase) LoadTask(policy GoPolicy, task []interface{}) { - var subGrp SubGrp - subGrp.Policy = policy - subGrp.Install(task) - b.LoadData(task) - b.PlanGrp = append(b.PlanGrp, subGrp) -} - -func (b *PlanBase) LoadData(task []interface{}) bool { - for _, stepObj := range task { - if stepObj == nil { - return false - } - stepIf, ok := stepObj.(TaskBaseIf) - if !ok { - continue - } - stepIf.SetSerErrInfo(b.SerError) - } - return true -} - -type SpaceBase struct { - PlanBase -} - -func (s *SpaceBase) Init() { - s.SerError = &SerErrInfo{} -} - -func (s *SpaceBase) getPlan() *PlanBase { - return &s.PlanBase -} - -func GotoErrorStep(curPlan *PlanBase, grpNum int) bool { - for idx, stepName := range curPlan.PlanGrp[grpNum].StepNames { - if stepName == curPlan.ErrStep { - if curPlan.CurGrpIdx > grpNum { - return true - } - curPlan.CurGrpIdx = grpNum - if curPlan.PlanGrp[grpNum].CurStepIdx < idx { - curPlan.PlanGrp[grpNum].CurStepIdx = idx - } - return true - } - } - return false -} - -func RecordErrInfo(curPlan *PlanBase, stepIdx int) { - if curPlan.CurGrpIdx >= len(curPlan.PlanGrp) { - return - } - curGrp := curPlan.PlanGrp[curPlan.CurGrpIdx] - if stepIdx < 0 || stepIdx >= len(curGrp.StepObjs) { - return - } - - curPlan.SerError.GrpIdx = curPlan.CurGrpIdx - curPlan.SerError.TaskIdx = stepIdx - curStep := curGrp.StepObjs[stepIdx] - stepIf, ok := curStep.(TaskBaseIf) - if !ok { - return - } - errCode, msg := stepIf.GetErrCode() - curPlan.SerError.ErrCode = int(errCode) - curPlan.SerError.Message = msg -} - -func GotoErrorProc(curPlan *PlanBase) { - curPlan.CurGrpIdx++ - for grpNum := 0; grpNum < len(curPlan.PlanGrp); grpNum++ { - done := GotoErrorStep(curPlan, grpNum) - if done { - break - } - } -} diff --git a/mep/mepserver/mp1/controller.go b/mep/mepserver/mp1/controller.go deleted file mode 100644 index cf596ed..0000000 --- a/mep/mepserver/mp1/controller.go +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package mp1 - -import ( - "context" - "net/http" - - "github.com/apache/servicecomb-service-center/pkg/log" - "github.com/apache/servicecomb-service-center/pkg/rest" - "github.com/apache/servicecomb-service-center/pkg/util" - "github.com/apache/servicecomb-service-center/server/core/proto" - "github.com/apache/servicecomb-service-center/server/notify" - v4 "github.com/apache/servicecomb-service-center/server/rest/controller/v4" - svcutil "github.com/apache/servicecomb-service-center/server/service/util" - - "mepserver/mp1/arch/workspace" - "mepserver/mp1/models" -) - -const ( - basePath = "/mep/mec_service_mgmt/v1" - servicesPath = basePath + "/services" - appServicesPath = basePath + "/applications/:appInstanceId" + "/services" - appSubscribePath = basePath + "/applications/:appInstanceId/subscriptions" -) - -const ( - SerErrFailBase workspace.ErrCode = workspace.TaskFail - SerErrServiceNotFound = 2 - SerInstanceNotFound = 3 - ParseInfoErr = 4 - SubscriptionNotFound = 5 - OperateDataWithEtcdErr = 6 - SerErrServiceDelFailed = 7 - SerErrServiceUpdFailed = 8 -) - -type APIHookFunc func() models.EndPointInfo - -type APIGwHook struct { - APIHook APIHookFunc -} - -var apihook APIGwHook - -func SetAPIHook(hook APIGwHook) { - apihook = hook -} - -func GetApiHook() APIGwHook { - return apihook -} - -func init() { - initRouter() -} - -func initRouter() { - rest. - RegisterServant(&Mp1Service{}) -} - -type Mp1Service struct { - v4.MicroServiceService -} - -func (m *Mp1Service) URLPatterns() []rest.Route { - return []rest.Route{ - // appSubscriptions - {Method: rest.HTTP_METHOD_POST, Path: appSubscribePath, Func: doAppSubscribe}, - {Method: rest.HTTP_METHOD_GET, Path: appSubscribePath, Func: getAppSubscribes}, - {Method: rest.HTTP_METHOD_GET, Path: appSubscribePath + "/:subscriptionId", Func: getOneAppSubscribe}, - {Method: rest.HTTP_METHOD_DELETE, Path: appSubscribePath + "/:subscriptionId", Func: delOneAppSubscribe}, - // appServices - {Method: rest.HTTP_METHOD_POST, Path: appServicesPath, Func: serviceRegister}, - {Method: rest.HTTP_METHOD_GET, Path: appServicesPath, Func: serviceDiscover}, - {Method: rest.HTTP_METHOD_PUT, Path: appServicesPath + "/:serviceId", Func: serviceUpdate}, - {Method: rest.HTTP_METHOD_GET, Path: appServicesPath + "/:serviceId", Func: getOneService}, - {Method: rest.HTTP_METHOD_DELETE, Path: appServicesPath + "/:serviceId", Func: serviceDelete}, - // services - {Method: rest.HTTP_METHOD_GET, Path: servicesPath, Func: serviceDiscover}, - {Method: rest.HTTP_METHOD_GET, Path: servicesPath + "/:serviceId", Func: getOneService}, - } -} - -//application subscription -func doAppSubscribe(w http.ResponseWriter, r *http.Request) { - - workPlan := NewWorkSpace(w, r) - workPlan.Try( - (&DecodeRestReq{}).WithBody(&models.SerAvailabilityNotificationSubscription{}), - &SubscribeIst{}) - workPlan.Finally(&SendHttpRspCreated{}) - - workspace.WkRun(workPlan) -} - -func getAppSubscribes(w http.ResponseWriter, r *http.Request) { - - workPlan := NewWorkSpace(w, r) - workPlan.Try( - &DecodeRestReq{}, - &GetSubscribes{}) - workPlan.Finally(&SendHttpRsp{}) - - workspace.WkRun(workPlan) -} - -func getOneAppSubscribe(w http.ResponseWriter, r *http.Request) { - - workPlan := NewWorkSpace(w, r) - workPlan.Try( - &DecodeRestReq{}, - &GetOneSubscribe{}) - workPlan.Finally(&SendHttpRsp{}) - - workspace.WkRun(workPlan) -} - -func delOneAppSubscribe(w http.ResponseWriter, r *http.Request) { - - workPlan := NewWorkSpace(w, r) - workPlan.Try( - &DecodeRestReq{}, - &DelOneSubscribe{}) - workPlan.Finally(&SendHttpRsp{}) - - workspace.WkRun(workPlan) -} - -//service registery request -func serviceRegister(w http.ResponseWriter, r *http.Request) { - log.Info("Register service start...") - - workPlan := NewWorkSpace(w, r) - workPlan.Try( - (&DecodeRestReq{}).WithBody(&models.ServiceInfo{}), - &RegisterServiceId{}, - &RegisterServiceInst{}) - workPlan.Finally(&SendHttpRspCreated{}) - - workspace.WkRun(workPlan) -} - -func serviceDiscover(w http.ResponseWriter, r *http.Request) { - log.Info("Discover service service start...") - - workPlan := NewWorkSpace(w, r) - workPlan.Try( - &DiscoverDecode{}, - &DiscoverService{}, - &ToStrDiscover{}, - &RspHook{}) - workPlan.Finally(&SendHttpRsp{}) - - workspace.WkRun(workPlan) -} - -func serviceUpdate(w http.ResponseWriter, r *http.Request) { - log.Info("Update a service start...") - - workPlan := NewWorkSpace(w, r) - workPlan.Try( - (&DecodeRestReq{}).WithBody(&models.ServiceInfo{}), - &UpdateInstance{}) - workPlan.Finally(&SendHttpRsp{}) - - workspace.WkRun(workPlan) -} - -func getOneService(w http.ResponseWriter, r *http.Request) { - log.Info("Register service start...") - - workPlan := NewWorkSpace(w, r) - workPlan.Try( - &GetOneDecode{}, - &GetOneInstance{}) - workPlan.Finally(&SendHttpRsp{}) - - workspace.WkRun(workPlan) - -} - -func serviceDelete(w http.ResponseWriter, r *http.Request) { - log.Info("Delete a service start...") - - workPlan := NewWorkSpace(w, r) - workPlan.Try( - &DecodeRestReq{}, - &DeleteService{}) - workPlan.Finally(&SendHttpRsp{}) - - workspace.WkRun(workPlan) -} - -func WebsocketListAndWatch(ctx context.Context, req *proto.WatchInstanceRequest, consumerSvcId string) { - if req == nil || len(req.SelfServiceId) == 0 { - log.Warn("request fomat invalid!") - return - } - domainProject := util.ParseDomainProject(ctx) - if !svcutil.ServiceExist(ctx, domainProject, req.SelfServiceId) { - log.Warn("service does not exist!") - return - } - DoWebsocketListAndWatch(ctx, req.SelfServiceId, consumerSvcId, func() ([]*proto.WatchInstanceResponse, int64) { - return svcutil.QueryAllProvidersInstances(ctx, req.SelfServiceId) - }) -} - -func DoWebsocketListAndWatch(ctx context.Context, serviceId string, consumerSvcId string, f func() ([]*proto.WatchInstanceResponse, int64)) { - domainProject := util.ParseDomainProject(ctx) - socket := &Websocket{ - ctx: ctx, - watcher: notify.NewInstanceEventListWatcher(serviceId, domainProject, f), - serviceID: consumerSvcId, - } - ProcessSocket(socket) -} - -func ProcessSocket(socket *Websocket) { - if err := socket.Init(); err != nil { - return - } - socket.HandleWatchWebSocketControlMessage() -} diff --git a/mep/mepserver/mp1/instance_event_handler.go b/mep/mepserver/mp1/instance_event_handler.go deleted file mode 100644 index 34ab04c..0000000 --- a/mep/mepserver/mp1/instance_event_handler.go +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package mp1 - -import ( - "encoding/json" - "strings" - - "github.com/apache/servicecomb-service-center/pkg/log" - "github.com/apache/servicecomb-service-center/pkg/util" - apt "github.com/apache/servicecomb-service-center/server/core" - "github.com/apache/servicecomb-service-center/server/core/backend" - "github.com/apache/servicecomb-service-center/server/core/proto" - "github.com/apache/servicecomb-service-center/server/notify" - "github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery" - "github.com/apache/servicecomb-service-center/server/plugin/pkg/registry" - "github.com/apache/servicecomb-service-center/server/service/cache" - "github.com/apache/servicecomb-service-center/server/service/metrics" - svcutil "github.com/apache/servicecomb-service-center/server/service/util" - "golang.org/x/net/context" - - "mepserver/mp1/models" -) - -const indexStart, indexEnd = 33, 17 - -type InstanceEtsiEventHandler struct { -} - -func (h *InstanceEtsiEventHandler) Type() discovery.Type { - return backend.INSTANCE -} - -func (h *InstanceEtsiEventHandler) OnEvent(evt discovery.KvEvent) { - action := evt.Type - instance, ok := evt.KV.Value.(*proto.MicroServiceInstance) - if !ok { - log.Warn("cast to instance failed") - } - providerId, providerInstanceId, domainProject := apt.GetInfoFromInstKV(evt.KV.Key) - idx := strings.Index(domainProject, "/") - domainName := domainProject[:idx] - switch action { - case proto.EVT_INIT: - metrics.ReportInstances(domainName, 1) - return - case proto.EVT_CREATE: - metrics.ReportInstances(domainName, 1) - case proto.EVT_DELETE: - metrics.ReportInstances(domainName, -1) - if !apt.IsDefaultDomainProject(domainProject) { - projectName := domainProject[idx+1:] - svcutil.RemandInstanceQuota(util.SetDomainProject(context.Background(), domainName, projectName)) - } - } - - if notify.NotifyCenter().Closed() { - log.Warnf("caught [%s] instance [%s/%s] event, endpoints %v, but notify service is closed", - action, providerId, providerInstanceId, instance.Endpoints) - return - } - - ctx := context.WithValue(context.WithValue(context.Background(), - svcutil.CTX_CACHEONLY, "1"), - svcutil.CTX_GLOBAL, "1") - ms, err := svcutil.GetService(ctx, domainProject, providerId) - if ms == nil { - log.Errorf(err, "caught [%s] instance [%s/%s] event, endpoints %v, get cached provider's file failed", - action, providerId, providerInstanceId, instance.Endpoints) - return - } - - log.Infof("caught [%s] service[%s][%s/%s/%s/%s] isntance[%s] event, endpoints %v", - action, providerId, ms.Environment, ms.AppId, ms.ServiceName, ms.Version, providerInstanceId, instance.Endpoints) - - consumerIds := getCosumerIds() - - log.Infof("there are %d consuemrIDs, %s", len(consumerIds), consumerIds) - PublishInstanceEvent(evt, domainProject, proto.MicroServiceToKey(domainProject, ms), consumerIds) -} - -func getCosumerIds() []string { - var consumerIds []string - opts := []registry.PluginOp{ - registry.OpGet(registry.WithStrKey("/cse-sr/inst/files"), registry.WithPrefix()), - } - resp, err := backend.Registry().TxnWithCmp(context.Background(), opts, nil, nil) - if err != nil { - log.Errorf(err, "get subscription from etcd failed") - return consumerIds - } - - for _, kvs := range resp.Kvs { - key := kvs.Key - keystring := string(key) - value := kvs.Value - - var mp1Req models.ServiceInfo - err = json.Unmarshal(value, &mp1Req) - if err != nil { - log.Errorf(err, "parse serviceInfo failed") - } - length := len(keystring) - keystring = keystring[length-indexStart : length-indexEnd] - if StringContains(consumerIds, keystring) == -1 { - consumerIds = append(consumerIds, keystring) - } - } - return consumerIds -} - -func NewInstanceEtsiEventHandler() *InstanceEtsiEventHandler { - return &InstanceEtsiEventHandler{} -} - -func PublishInstanceEvent(evt discovery.KvEvent, domainProject string, serviceKey *proto.MicroServiceKey, subscribers []string) { - defer cache.FindInstances.Remove(serviceKey) - if len(subscribers) == 0 { - log.Warn("the subscribers size is 0") - return - } - - response := &proto.WatchInstanceResponse{ - Response: proto.CreateResponse(proto.Response_SUCCESS, "Watch instance successfully."), - Action: string(evt.Type), - Key: serviceKey, - Instance: evt.KV.Value.(*proto.MicroServiceInstance), - } - for _, consumerId := range subscribers { - job := notify.NewInstanceEventWithTime(consumerId, domainProject, evt.Revision, evt.CreateAt, response) - err := notify.NotifyCenter().Publish(job) - if err != nil { - log.Errorf(err, "publish failed") - } - } -} diff --git a/mep/mepserver/mp1/mepspace.go b/mep/mepserver/mp1/mepspace.go deleted file mode 100644 index 2d8a1d2..0000000 --- a/mep/mepserver/mp1/mepspace.go +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package mp1 - -import ( - "net/http" - "net/url" - - "github.com/apache/servicecomb-service-center/server/core/proto" - "golang.org/x/net/context" - - "mepserver/mp1/arch/workspace" -) - -type MepSpace struct { - workspace.SpaceBase - R *http.Request `json:"r"` - W http.ResponseWriter `json:"w"` - - Ctx context.Context `json:"ctx"` - ServiceId string `json:"serviceId"` - RestBody interface{} `json:"restBody"` - AppInstanceId string `json:"appInstanceId"` - InstanceId string `json:"instanceId"` - SubscribeId string `json:"subscribeId"` - QueryParam url.Values `json:"queryParam"` - - CoreRequest interface{} `json:"coreRequest"` - CoreRsp interface{} `json:"coreRsp"` - HttPErrInf *proto.Response `json:"httpErrInf"` - HttPRsp interface{} `json:"httpRsp"` -} - -func NewWorkSpace(w http.ResponseWriter, r *http.Request) *MepSpace { - var plan = MepSpace{ - W: w, - R: r, - } - - plan.Init() - return &plan -} diff --git a/mep/mepserver/mp1/models/categoryref.go b/mep/mepserver/mp1/models/categoryref.go deleted file mode 100644 index d570705..0000000 --- a/mep/mepserver/mp1/models/categoryref.go +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package models - -// This type represents the category reference -type CategoryRef struct { - Href string `json:"href,omitempty"` - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Version string `json:"version,omitempty"` -} diff --git a/mep/mepserver/mp1/models/endpointinfo.go b/mep/mepserver/mp1/models/endpointinfo.go deleted file mode 100644 index d8a12f1..0000000 --- a/mep/mepserver/mp1/models/endpointinfo.go +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package models - -type EndPointInfo struct { - Uris []string - Addresses []EndPointInfoAddress - Alternative interface{} -} - -type EndPointInfoAddress struct { - Host string `json:"host,omitempty"` - Port uint32 `json:"port,omitempty"` -} diff --git a/mep/mepserver/mp1/models/filtering_criteria.go b/mep/mepserver/mp1/models/filtering_criteria.go deleted file mode 100644 index d451002..0000000 --- a/mep/mepserver/mp1/models/filtering_criteria.go +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package models - -// Filtering criteria to match services for which events are requested to be reported. If absent, matches all services. All child attributes are combined with the logical \"AND\" operation. -type FilteringCriteria struct { - SerInstanceIds []string `json:"serInstanceIds,omitempty"` - SerNames []string `json:"serNames,omitempty"` - SerCategories []CategoryRef `json:"serCategories,omitempty"` - States []string `json:"states,omitempty"` - IsLocal bool `json:"isLocal,omitempty"` -} diff --git a/mep/mepserver/mp1/models/problemdetails.go b/mep/mepserver/mp1/models/problemdetails.go deleted file mode 100644 index 5102d97..0000000 --- a/mep/mepserver/mp1/models/problemdetails.go +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package models - -import ( - "encoding/json" - - "github.com/apache/servicecomb-service-center/pkg/log" -) - -type ProblemDetails struct { - ProbType string `json:"type,omitempty"` - Title string `json:"title,omitempty"` - Status uint32 `json:"status,omitempty"` - Detail string `json:"detail,omitempty"` - Instance string `json:"instance,omitempty"` -} - -func (pd ProblemDetails) String() string { - d, err := json.Marshal(pd) - if err != nil { - log.Errorf(err, "Marsh ProblemDetails error!") - return "" - } - return string(d) -} diff --git a/mep/mepserver/mp1/models/securityinfo.go b/mep/mepserver/mp1/models/securityinfo.go deleted file mode 100644 index 00af31e..0000000 --- a/mep/mepserver/mp1/models/securityinfo.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package models - -// This type represents security information related to a transport -type SecurityInfo struct { - OAuth2Info SecurityInfoOAuth2Info `json:"oAuth2Info,omitempty"` -} diff --git a/mep/mepserver/mp1/models/securityinfo_oauth2_info.go b/mep/mepserver/mp1/models/securityinfo_oauth2_info.go deleted file mode 100644 index 7b21662..0000000 --- a/mep/mepserver/mp1/models/securityinfo_oauth2_info.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package models - -// Parameters related to use of OAuth 2.0 -type SecurityInfoOAuth2Info struct { - GrantTypes []string `json:"grantTypes"` - TokenEndpoint string `json:"tokenEndpoint"` -} diff --git a/mep/mepserver/mp1/models/ser_avail_notify_subscribe.go b/mep/mepserver/mp1/models/ser_avail_notify_subscribe.go deleted file mode 100644 index 37d7056..0000000 --- a/mep/mepserver/mp1/models/ser_avail_notify_subscribe.go +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package models - -// This type represents a subscription to the notifications from the MEC platform regarding the availability of a MEC service or a list of MEC services. -type SerAvailabilityNotificationSubscription struct { - SubscriptionType string `json:"subscriptionType"` - CallbackReference string `json:"callbackReference"` - Links string `json:"_links"` - FilteringCriteria FilteringCriteria `json:"filteringCriteria,omitempty"` -} diff --git a/mep/mepserver/mp1/models/serviceinfo.go b/mep/mepserver/mp1/models/serviceinfo.go deleted file mode 100644 index ea57cd6..0000000 --- a/mep/mepserver/mp1/models/serviceinfo.go +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package models - -import ( - "encoding/json" - "fmt" - "math" - "strconv" - "strings" - "time" - - "github.com/apache/servicecomb-service-center/pkg/log" - "github.com/apache/servicecomb-service-center/pkg/util" - "github.com/apache/servicecomb-service-center/server/core/proto" - - meputil "mepserver/mp1/util" -) - -// This type represents the general information of a MEC service info for registry/discovery -type ServiceInfo struct { - SerInstanceId string `json:"serInstanceId,omitempty"` - SerName string `json:"serName"` - SerCategory CategoryRef `json:"serCategory,omitempty"` - Version string `json:"version"` - State string `json:"state"` - TransportID string `json:"transportId,omitempty"` - TransportInfo TransportInfo `json:"transportInfo"` - Serializer string `json:"serializer"` - ScopeOfLocality string `json:"scopeOfLocality,omitempty"` - ConsumedLocalOnly bool `json:"consumedLocalOnly,omitempty"` - IsLocal bool `json:"isLocal,omitempty"` -} - -func (s *ServiceInfo) ToServiceRequest(req *proto.CreateServiceRequest) { - if req == nil { - log.Warn("create service request nil") - } - if req.Service == nil { - req.Service = &proto.MicroService{} - } - req.Service.AppId = "" - req.Service.ServiceName = s.SerName - req.Service.Version = s.Version - req.Service.Status = "UP" - if s.State == "INACTIVE" { - req.Service.Status = "DOWN" - } -} - -func (s *ServiceInfo) ToRegisterInstance(req *proto.RegisterInstanceRequest) { - if req == nil { - log.Warn("register instance request nil") - } - if req.Instance == nil { - req.Instance = &proto.MicroServiceInstance{} - } - req.Instance.Properties = make(map[string]string, 5) - req.Instance.Properties["serName"] = s.SerName - s.serCategoryToProperties(req.Instance.Properties) - req.Instance.Version = s.Version - req.Instance.Timestamp = strconv.FormatInt(time.Now().Unix(), 10) - req.Instance.ModTimestamp = req.Instance.Timestamp - - req.Instance.Status = "UP" - if s.State == "INACTIVE" { - req.Instance.Status = "DOWN" - } - properties := req.Instance.Properties - meputil.InfoToProperties(properties, "transportId", s.TransportID) - meputil.InfoToProperties(properties, "serializer", s.Serializer) - meputil.InfoToProperties(properties, "ScopeOfLocality", s.ScopeOfLocality) - meputil.InfoToProperties(properties, "ConsumedLocalOnly", strconv.FormatBool(s.ConsumedLocalOnly)) - meputil.InfoToProperties(properties, "IsLocal", strconv.FormatBool(s.IsLocal)) - req.Instance.HostName = "default" - var epType string - req.Instance.Endpoints, epType = s.toEndpoints() - req.Instance.Properties["endPointType"] = epType - - healthCheck := &proto.HealthCheck{ - Mode: proto.CHECK_BY_HEARTBEAT, - Port: 0, - Interval: math.MaxInt32 - 1, - Times: 0, - Url: "", - } - req.Instance.HealthCheck = healthCheck - s.transportInfoToProperties(req.Instance.Properties) -} - -func (s *ServiceInfo) toEndpoints() ([]string, string) { - if len(s.TransportInfo.Endpoint.Addresses) != 0 { - return s.TransportInfo.Endpoint.Uris, "uris" - } - endPoints := make([]string, 0, 1) - if len(s.TransportInfo.Endpoint.Addresses) != 0 { - - for _, v := range s.TransportInfo.Endpoint.Addresses { - addrDes := fmt.Sprintf("%s:%d", v.Host, v.Port) - endPoints = append(endPoints, addrDes) - } - return endPoints, "addresses" - } - - if s.TransportInfo.Endpoint.Alternative != nil { - jsonBytes, err := json.Marshal(s.TransportInfo.Endpoint.Alternative) - if err != nil { - return nil, "" - } - jsonText := util.BytesToStringWithNoCopy(jsonBytes) - endPoints = append(endPoints, jsonText) - return endPoints, "alternative" - } - return nil, "" -} - -func (s *ServiceInfo) transportInfoToProperties(properties map[string]string) { - if properties == nil { - return - } - meputil.InfoToProperties(properties, "transportInfo/id", s.TransportInfo.ID) - meputil.InfoToProperties(properties, "transportInfo/name", s.TransportInfo.Name) - meputil.InfoToProperties(properties, "transportInfo/description", s.TransportInfo.Description) - meputil.InfoToProperties(properties, "transportInfo/type", string(s.TransportInfo.TransType)) - meputil.InfoToProperties(properties, "transportInfo/protocol", s.TransportInfo.Protocol) - meputil.InfoToProperties(properties, "transportInfo/version", s.TransportInfo.Version) - grantTypes := strings.Join(s.TransportInfo.Security.OAuth2Info.GrantTypes, ",") - meputil.InfoToProperties(properties, "transportInfo/security/oAuth2Info/grantTypes", grantTypes) - meputil.InfoToProperties(properties, "transportInfo/security/oAuth2Info/tokenEndpoint", s.TransportInfo.Security.OAuth2Info.TokenEndpoint) - -} - -func (s *ServiceInfo) serCategoryToProperties(properties map[string]string) { - if properties == nil { - return - } - meputil.InfoToProperties(properties, "serCategory/href", s.SerCategory.Href) - meputil.InfoToProperties(properties, "serCategory/id", s.SerCategory.ID) - meputil.InfoToProperties(properties, "serCategory/name", s.SerCategory.Name) - meputil.InfoToProperties(properties, "serCategory/version", s.SerCategory.Version) -} - -func (s *ServiceInfo) FromServiceInstance(inst *proto.MicroServiceInstance) { - s.SerInstanceId = inst.ServiceId + inst.InstanceId - s.serCategoryFromProperties(inst.Properties) - s.Version = inst.Version - s.State = "ACTIVE" - if inst.Status == "DOWN" { - s.State = "INACTIVE" - } - - epType := "uris" - if inst.Properties != nil { - s.SerName = inst.Properties["serName"] - s.TransportID = inst.Properties["transportId"] - s.Serializer = inst.Properties["serializer"] - epType = inst.Properties["endPointType"] - s.ScopeOfLocality = inst.Properties["ScopeOfLocality"] - var err error - s.ConsumedLocalOnly, err = strconv.ParseBool(inst.Properties["ConsumedLocalOnly"]) - if err != nil { - log.Warn("parse bool ConsumedLocalOnly fail") - } - s.IsLocal, err = strconv.ParseBool(inst.Properties["IsLocal"]) - if err != nil { - log.Warn("parse bool ConsumedLocalOnly fail") - } - } - s.fromEndpoints(inst.Endpoints, epType) - s.transportInfoFromProperties(inst.Properties) -} - -func (s *ServiceInfo) serCategoryFromProperties(properties map[string]string) { - if properties == nil { - return - } - s.SerCategory.Href = properties["serCategory/href"] - s.SerCategory.ID = properties["serCategory/id"] - s.SerCategory.Name = properties["serCategory/name"] - s.SerCategory.Version = properties["serCategory/version"] -} - -//Parse service endpoint info -func (s *ServiceInfo) fromEndpoints(uris []string, epType string) { - if epType == "uris" { - s.TransportInfo.Endpoint.Uris = uris - return - } - if epType == "address" { - - s.TransportInfo.Endpoint.Addresses = make([]EndPointInfoAddress, 0, 1) - for _, v := range uris { - host, port := meputil.GetHostPort(v) - tmp := EndPointInfoAddress{ - Host: host, - Port: uint32(port), - } - s.TransportInfo.Endpoint.Addresses = append(s.TransportInfo.Endpoint.Addresses, tmp) - } - } - if epType == "alternative" { - jsonObj, err := meputil.JsonTextToObj(uris[0]) - if err != nil { - s.TransportInfo.Endpoint.Alternative = jsonObj - } - return - } -} - -//Parse service transport info -func (s *ServiceInfo) transportInfoFromProperties(properties map[string]string) { - if properties == nil { - return - } - s.TransportInfo.ID = properties["transportInfo/id"] - s.TransportInfo.Name = properties["transportInfo/name"] - s.TransportInfo.Description = properties["transportInfo/description"] - s.TransportInfo.TransType = TransportTypes(properties["transportInfo/type"]) - s.TransportInfo.Protocol = properties["transportInfo/protocol"] - s.TransportInfo.Version = properties["transportInfo/version"] - grantTypes := properties["transportInfo/security/oAuth2Info/grantTypes"] - s.TransportInfo.Security.OAuth2Info.GrantTypes = strings.Split(grantTypes, ",") - s.TransportInfo.Security.OAuth2Info.TokenEndpoint = properties["transportInfo/security/oAuth2Info/tokenEndpoint"] -} diff --git a/mep/mepserver/mp1/models/transportinfo.go b/mep/mepserver/mp1/models/transportinfo.go deleted file mode 100644 index 3f5a515..0000000 --- a/mep/mepserver/mp1/models/transportinfo.go +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package models - -// This type represents the general information of a MEC service. -type TransportInfo struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Description string `json:"description,omitempty"` - TransType TransportTypes `json:"type,omitempty"` - Protocol string `json:"protocol,omitempty"` - Version string `json:"version,omitempty"` - // This type represents information about a transport endpoint - Endpoint EndPointInfo `json:"endpoint,omitempty"` - Security SecurityInfo `json:"security,omitempty"` - ImplSpecificInfo interface{} `json:"implSpecificInfo,omitempty"` -} - -type TransportTypes string diff --git a/mep/mepserver/mp1/mp1event.go b/mep/mepserver/mp1/mp1event.go deleted file mode 100644 index a6c08d5..0000000 --- a/mep/mepserver/mp1/mp1event.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package mp1 - -import ( - "github.com/apache/servicecomb-service-center/pkg/log" - mgr "github.com/apache/servicecomb-service-center/server/plugin" - "github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery" - "github.com/apache/servicecomb-service-center/server/plugin/pkg/quota" - "github.com/apache/servicecomb-service-center/server/plugin/pkg/quota/buildin" -) - -func init() { - mgr.RegisterPlugin(mgr.Plugin{PName: mgr.QUOTA, Name: "buildin", New: New}) - discovery.AddEventHandler(NewInstanceEtsiEventHandler()) -} - -func New() mgr.PluginInstance { - buildin.InitConfigs() - log.Infof("quota init, service: %d, instance: %d, schema: %d/service, tag: %d/service, rule: %d/service", - quota.DefaultServiceQuota, quota.DefaultInstanceQuota, quota.DefaultSchemaQuota, quota.DefaultTagQuota, quota.DefaultRuleQuota) - return &buildin.BuildInQuota{} -} diff --git a/mep/mepserver/mp1/plan_del_one_subscribe.go b/mep/mepserver/mp1/plan_del_one_subscribe.go deleted file mode 100644 index efea6f2..0000000 --- a/mep/mepserver/mp1/plan_del_one_subscribe.go +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package mp1 - -import ( - "context" - "net/http" - - "github.com/apache/servicecomb-service-center/pkg/log" - "github.com/apache/servicecomb-service-center/server/core/backend" - "github.com/apache/servicecomb-service-center/server/core/proto" - "github.com/apache/servicecomb-service-center/server/plugin/pkg/registry" - - "mepserver/mp1/arch/workspace" -) - -type DelOneSubscribe struct { - workspace.TaskBase - R *http.Request `json:"r,in"` - HttpErrInf *proto.Response `json:"httpErrInf,out"` - Ctx context.Context `json:"ctx,in"` - W http.ResponseWriter `json:"w,in"` - AppInstanceId string `json:"appInstanceId,in"` - SubscribeId string `json:"subscribeId,in"` - HttpRsp interface{} `json:"httpRsp,out"` -} - -func (t *DelOneSubscribe) OnRequest(data string) workspace.TaskCode { - - appInstanceId := t.AppInstanceId - subscribeId := t.SubscribeId - - opts := []registry.PluginOp{ - registry.OpGet(registry.WithStrKey("/cse-sr/etsi/subscribe/" + appInstanceId + "/" + subscribeId)), - } - resp, errGet := backend.Registry().TxnWithCmp(context.Background(), opts, nil, nil) - if errGet != nil { - log.Errorf(errGet, "get subscription from etcd failed") - t.SetFirstErrorCode(OperateDataWithEtcdErr, "get subscription from etch failed") - return workspace.TaskFinish - } - - if len(resp.Kvs) == 0 { - log.Errorf(errGet, "subscription not exist") - t.SetFirstErrorCode(SubscriptionNotFound, "subscription not exist") - return workspace.TaskFinish - } - - opts = []registry.PluginOp{ - registry.OpDel(registry.WithStrKey("/cse-sr/etsi/subscribe/" + appInstanceId + "/" + subscribeId)), - } - _, err := backend.Registry().TxnWithCmp(context.Background(), opts, nil, nil) - if err != nil { - log.Errorf(err, "delete subscription from etcd failed") - t.SetFirstErrorCode(OperateDataWithEtcdErr, "delete subscription from etch failed") - return workspace.TaskFinish - } - - t.HttpRsp = "" - return workspace.TaskFinish -} diff --git a/mep/mepserver/mp1/plan_delete_svc.go b/mep/mepserver/mp1/plan_delete_svc.go deleted file mode 100644 index f0f1ece..0000000 --- a/mep/mepserver/mp1/plan_delete_svc.go +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package mp1 - -import ( - "context" - - "github.com/apache/servicecomb-service-center/pkg/log" - "github.com/apache/servicecomb-service-center/server/core" - "github.com/apache/servicecomb-service-center/server/core/proto" - - "mepserver/mp1/arch/workspace" -) - -type DeleteService struct { - HttpErrInf *proto.Response `json:"httpErrInf,out"` - workspace.TaskBase - Ctx context.Context `json:"ctx,in"` - ServiceId string `json:"serviceId,in"` -} - -func (t *DeleteService) OnRequest(data string) workspace.TaskCode { - if t.ServiceId == "" { - t.SetFirstErrorCode(SerErrServiceDelFailed, "param is empty") - return workspace.TaskFinish - } - serviceID := t.ServiceId[:len(t.ServiceId)/2] - instanceID := t.ServiceId[len(t.ServiceId)/2:] - req := &proto.UnregisterInstanceRequest{ - ServiceId: serviceID, - InstanceId: instanceID, - } - resp, err := core.InstanceAPI.Unregister(t.Ctx, req) - if err != nil { - log.Errorf(err, "Service delete failed!") - } - t.HttpErrInf = resp.Response - - return workspace.TaskFinish -} diff --git a/mep/mepserver/mp1/plan_discover_svc.go b/mep/mepserver/mp1/plan_discover_svc.go deleted file mode 100644 index 6ba4a69..0000000 --- a/mep/mepserver/mp1/plan_discover_svc.go +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package mp1 - -import ( - "context" - "net/http" - "net/url" - - "github.com/apache/servicecomb-service-center/server/core" - "github.com/apache/servicecomb-service-center/server/core/proto" - - "mepserver/mp1/arch/workspace" - "mepserver/mp1/models" - meputil "mepserver/mp1/util" -) - -type DiscoverDecode struct { - workspace.TaskBase - R *http.Request `json:"r,in"` - Ctx context.Context `json:"ctx,out"` - QueryParam url.Values `json:"queryParam,out"` - CoreRequest interface{} `json:"coreRequest,out"` -} - -func (t *DiscoverDecode) OnRequest(data string) workspace.TaskCode { - t.Ctx, t.CoreRequest, t.QueryParam = meputil.GetFindParam(t.R) - return workspace.TaskFinish -} - -type DiscoverService struct { - workspace.TaskBase - Ctx context.Context `json:"ctx,in"` - QueryParam url.Values `json:"queryParam,in"` - CoreRequest interface{} `json:"coreRequest,in"` - CoreRsp interface{} `json:"coreRsp,out"` -} - -func (t *DiscoverService) checkInstanceId(req *proto.FindInstancesRequest) bool { - instanceId := req.AppId - if instanceId != "default" { - instances := t.CoreRsp.(*proto.FindInstancesResponse).Instances - for _, val := range instances { - if val.ServiceId+val.InstanceId == instanceId { - return true - } - } - return false - } - return true -} - -func (t *DiscoverService) OnRequest(data string) workspace.TaskCode { - req, ok := t.CoreRequest.(*proto.FindInstancesRequest) - if !ok { - t.SetFirstErrorCode(SerErrServiceNotFound, "cast to request fail") - return workspace.TaskFinish - } - if req.ServiceName == "" { - var errFindByKey error - t.CoreRsp, errFindByKey = meputil.FindInstanceByKey(t.QueryParam) - if errFindByKey != nil || t.CoreRsp == nil { - t.SetFirstErrorCode(SerErrServiceNotFound, errFindByKey.Error()) - return workspace.TaskFinish - } - if !t.checkInstanceId(req) { - t.SetFirstErrorCode(SerErrServiceNotFound, "instance id not found") - } - return workspace.TaskFinish - } - - findInstance, err := core.InstanceAPI.Find(t.Ctx, req) - if err != nil { - t.SetFirstErrorCode(SerErrServiceNotFound, err.Error()) - return workspace.TaskFinish - } - if findInstance == nil || len(findInstance.Instances) == 0 { - t.SetFirstErrorCode(SerErrServiceNotFound, "service not found") - return workspace.TaskFinish - } - - t.CoreRsp = findInstance - return workspace.TaskFinish -} - -type ToStrDiscover struct { - HttpErrInf *proto.Response `json:"httpErrInf,out"` - workspace.TaskBase - CoreRsp interface{} `json:"coreRsp,in"` - HttpRsp interface{} `json:"httpRsp,out"` -} - -func (t *ToStrDiscover) OnRequest(data string) workspace.TaskCode { - t.HttpErrInf, t.HttpRsp = mp1CvtSrvDiscover(t.CoreRsp.(*proto.FindInstancesResponse)) - return workspace.TaskFinish -} - -type RspHook struct { - R *http.Request `json:"r,in"` - workspace.TaskBase - Ctx context.Context `json:"ctx,in"` - HttpRsp interface{} `json:"httpRsp,in"` - HookRsp interface{} `json:"hookRsp,out"` -} - -func (t *RspHook) OnRequest(data string) workspace.TaskCode { - t.HookRsp = instanceHook(t.Ctx, t.R, t.HttpRsp) - return workspace.TaskFinish -} - -func instanceHook(ctx context.Context, r *http.Request, rspData interface{}) interface{} { - rspBody, ok := rspData.([]*models.ServiceInfo) - if !ok { - return rspData - } - - if len(rspBody) == 0 { - return rspBody - } - consumerName := r.Header.Get("X-ConsumerName") - if consumerName == "APIGW" { - return rspBody - } - - for _, v := range rspBody { - if apihook.APIHook != nil { - info := apihook.APIHook() - if len(info.Addresses) == 0 && len(info.Uris) == 0 { - return rspBody - } - v.TransportInfo.Endpoint = info - } - } - return rspBody -} - -type SendHttpRsp struct { - HttpErrInf *proto.Response `json:"httpErrInf,in"` - workspace.TaskBase - W http.ResponseWriter `json:"w,in"` - HttpRsp interface{} `json:"httpRsp,in"` -} - -func (t *SendHttpRsp) OnRequest(data string) workspace.TaskCode { - errInfo := t.GetSerErrInfo() - if errInfo.ErrCode >= int(workspace.TaskFail) { - statusCode, httpBody := t.cvtHttpErrInfo(errInfo) - meputil.HttpErrResponse(t.W, statusCode, httpBody) - - return workspace.TaskFinish - } - meputil.WriteResponse(t.W, t.HttpErrInf, t.HttpRsp) - return workspace.TaskFinish -} - -func (t *SendHttpRsp) cvtHttpErrInfo(errInfo *workspace.SerErrInfo) (int, interface{}) { - statusCode := http.StatusBadRequest - var httpBody interface{} - switch workspace.ErrCode(errInfo.ErrCode) { - case SerErrServiceNotFound: - { - //status should return bad request - body := &models.ProblemDetails{ - Title: "Can not found resource", - Status: uint32(errInfo.ErrCode), - Detail: errInfo.Message, - } - httpBody = body - } - case SerInstanceNotFound: - { - statusCode = http.StatusNotFound - body := &models.ProblemDetails{ - Title: "Can not found resource", - Status: uint32(errInfo.ErrCode), - Detail: errInfo.Message, - } - httpBody = body - } - } - - return statusCode, httpBody -} - -func mp1CvtSrvDiscover(findInsResp *proto.FindInstancesResponse) (*proto.Response, []*models.ServiceInfo) { - resp := findInsResp.Response - if resp != nil && resp.GetCode() != proto.Response_SUCCESS { - return resp, nil - } - serviceInfos := make([]*models.ServiceInfo, 0, len(findInsResp.Instances)) - for _, ins := range findInsResp.Instances { - serviceInfo := &models.ServiceInfo{} - serviceInfo.FromServiceInstance(ins) - serviceInfos = append(serviceInfos, serviceInfo) - } - return resp, serviceInfos - -} diff --git a/mep/mepserver/mp1/plan_get_one_subscribe.go b/mep/mepserver/mp1/plan_get_one_subscribe.go deleted file mode 100644 index 01e5d22..0000000 --- a/mep/mepserver/mp1/plan_get_one_subscribe.go +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package mp1 - -import ( - "context" - "encoding/json" - "net/http" - - "github.com/apache/servicecomb-service-center/pkg/log" - "github.com/apache/servicecomb-service-center/server/core/backend" - "github.com/apache/servicecomb-service-center/server/core/proto" - "github.com/apache/servicecomb-service-center/server/plugin/pkg/registry" - - "mepserver/mp1/arch/workspace" - "mepserver/mp1/models" -) - -type GetOneSubscribe struct { - workspace.TaskBase - R *http.Request `json:"r,in"` - HttpErrInf *proto.Response `json:"httpErrInf,out"` - Ctx context.Context `json:"ctx,in"` - W http.ResponseWriter `json:"w,in"` - AppInstanceId string `json:"appInstanceId,in"` - SubscribeId string `json:"subscribeId,in"` - HttpRsp interface{} `json:"httpRsp,out"` -} - -func (t *GetOneSubscribe) OnRequest(data string) workspace.TaskCode { - - appInstanceId := t.AppInstanceId - subscribeId := t.SubscribeId - - opts := []registry.PluginOp{ - registry.OpGet(registry.WithStrKey("/cse-sr/etsi/subscribe/" + appInstanceId + "/" + subscribeId)), - } - resp, err := backend.Registry().TxnWithCmp(context.Background(), opts, nil, nil) - if err != nil { - log.Errorf(err, "get subscription from etcd failed") - t.SetFirstErrorCode(OperateDataWithEtcdErr, "get subscription from etch failed") - return workspace.TaskFinish - } - - if len(resp.Kvs) == 0 { - log.Errorf(err, "subscription not exist") - t.SetFirstErrorCode(SubscriptionNotFound, "subscription not exist") - return workspace.TaskFinish - } - sub := &models.SerAvailabilityNotificationSubscription{} - jsonErr := json.Unmarshal([]byte(string(resp.Kvs[0].Value)), sub) - if jsonErr != nil { - log.Warn("subscribe can not be parsed to SerAvailabilityNotificationSubscription") - return workspace.TaskFinish - } - t.HttpRsp = sub - return workspace.TaskFinish -} diff --git a/mep/mepserver/mp1/plan_get_one_svc.go b/mep/mepserver/mp1/plan_get_one_svc.go deleted file mode 100644 index d2a7309..0000000 --- a/mep/mepserver/mp1/plan_get_one_svc.go +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package mp1 - -import ( - "context" - "net/http" - - "github.com/apache/servicecomb-service-center/pkg/util" - "github.com/apache/servicecomb-service-center/server/core" - "github.com/apache/servicecomb-service-center/server/core/proto" - - "mepserver/mp1/arch/workspace" - "mepserver/mp1/models" - meputil "mepserver/mp1/util" -) - -type GetOneDecode struct { - workspace.TaskBase - R *http.Request `json:"r,in"` - Ctx context.Context `json:"ctx,out"` - CoreRequest interface{} `json:"coreRequest,out"` -} - -func (t *GetOneDecode) OnRequest(data string) workspace.TaskCode { - t.Ctx, t.CoreRequest = t.getFindParam(t.R) - return workspace.TaskFinish - -} - -func (t *GetOneDecode) getFindParam(r *http.Request) (context.Context, *proto.GetOneInstanceRequest) { - query, ids := meputil.GetHTTPTags(r) - mp1SrvId := query.Get(":serviceId") - serviceId := mp1SrvId[:len(mp1SrvId)/2] - instanceId := mp1SrvId[len(mp1SrvId)/2:] - req := &proto.GetOneInstanceRequest{ - ConsumerServiceId: r.Header.Get("X-ConsumerId"), - ProviderServiceId: serviceId, - ProviderInstanceId: instanceId, - Tags: ids, - } - - ctx := util.SetTargetDomainProject(r.Context(), r.Header.Get("X-Domain-Name"), query.Get(":project")) - return ctx, req -} - -type GetOneInstance struct { - workspace.TaskBase - HttpErrInf *proto.Response `json:"httpErrInf,out"` - Ctx context.Context `json:"ctx,in"` - CoreRequest interface{} `json:"coreRequest,in"` - HttpRsp interface{} `json:"httpRsp,out"` -} - -func (t *GetOneInstance) OnRequest(data string) workspace.TaskCode { - resp, _ := core.InstanceAPI.GetOneInstance(t.Ctx, t.CoreRequest.(*proto.GetOneInstanceRequest)) - t.HttpErrInf = resp.Response - resp.Response = nil - mp1Rsp := &models.ServiceInfo{} - if resp.Instance != nil { - mp1Rsp.FromServiceInstance(resp.Instance) - } else { - t.SetFirstErrorCode(SerInstanceNotFound, "service instance id not found") - return workspace.TaskFinish - } - t.HttpRsp = mp1Rsp - - return workspace.TaskFinish -} diff --git a/mep/mepserver/mp1/plan_get_subsribes.go b/mep/mepserver/mp1/plan_get_subsribes.go deleted file mode 100644 index 06f04aa..0000000 --- a/mep/mepserver/mp1/plan_get_subsribes.go +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package mp1 - -import ( - "context" - "encoding/json" - "net/http" - - "github.com/apache/servicecomb-service-center/pkg/log" - "github.com/apache/servicecomb-service-center/server/core/backend" - "github.com/apache/servicecomb-service-center/server/core/proto" - "github.com/apache/servicecomb-service-center/server/plugin/pkg/registry" - - "mepserver/mp1/arch/workspace" - "mepserver/mp1/models" -) - -type GetSubscribes struct { - workspace.TaskBase - R *http.Request `json:"r,in"` - HttpErrInf *proto.Response `json:"httpErrInf,out"` - Ctx context.Context `json:"ctx,in"` - W http.ResponseWriter `json:"w,in"` - AppInstanceId string `json:"appInstanceId,in"` - HttpRsp interface{} `json:"httpRsp,out"` -} - -func (t *GetSubscribes) OnRequest(data string) workspace.TaskCode { - - appInstanceId := t.AppInstanceId - - opts := []registry.PluginOp{ - registry.OpGet(registry.WithStrKey("/cse-sr/etsi/subscribe/"+appInstanceId), registry.WithPrefix()), - } - - resp, err := backend.Registry().TxnWithCmp(context.Background(), opts, nil, nil) - if err != nil { - log.Errorf(err, "get subscription from etcd failed") - t.SetFirstErrorCode(OperateDataWithEtcdErr, "get subscription from etcd failed") - return workspace.TaskFinish - } - - var values []string - for _, value := range resp.Kvs { - values = append(values, string(value.Value)) - } - if len(values) == 0 { - log.Errorf(err, "get subscription failed, subscription not exist") - t.SetFirstErrorCode(SubscriptionNotFound, "get subscription failed, subscription not exist") - return workspace.TaskFinish - } - - subs := make([]*models.SerAvailabilityNotificationSubscription, 0, len(values)) - for _, val := range values { - sub := &models.SerAvailabilityNotificationSubscription{} - err := json.Unmarshal([]byte(val), sub) - if err != nil { - log.Warn("subscribe can not be parsed to SerAvailabilityNotificationSubscription") - continue - } - subs = append(subs, sub) - } - - t.HttpRsp = subs - return workspace.TaskFinish -} diff --git a/mep/mepserver/mp1/plan_register_svc.go b/mep/mepserver/mp1/plan_register_svc.go deleted file mode 100644 index ea5ebff..0000000 --- a/mep/mepserver/mp1/plan_register_svc.go +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package mp1 - -import ( - "context" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - - "github.com/apache/servicecomb-service-center/pkg/log" - "github.com/apache/servicecomb-service-center/pkg/util" - "github.com/apache/servicecomb-service-center/server/core" - "github.com/apache/servicecomb-service-center/server/core/proto" - svcerr "github.com/apache/servicecomb-service-center/server/error" - - "mepserver/mp1/arch/workspace" - "mepserver/mp1/models" - meputil "mepserver/mp1/util" -) - -type DecodeRestReq struct { - workspace.TaskBase - R *http.Request `json:"r,in"` - Ctx context.Context `json:"ctx,out"` - AppInstanceId string `json:"appInstanceId,out"` - SubscribeId string `json:"subscribeId,out"` - ServiceId string `json:"serviceId,out"` - RestBody interface{} `json:"restBody,out"` -} - -//service request handler -func (t *DecodeRestReq) OnRequest(data string) workspace.TaskCode { - t.GetParam(t.R) - err := t.ParseBody(t.R) - if err != nil { - log.Error("parse rest body failed", err) - } - return workspace.TaskFinish -} - -func (t *DecodeRestReq) ParseBody(r *http.Request) error { - if t.RestBody == nil { - return nil - } - msg, err := ioutil.ReadAll(r.Body) - if err != nil { - log.Error("read body failed", err) - t.SetFirstErrorCode(SerErrFailBase, err.Error()) - return err - } - - newMsg, err := t.checkParam(msg) - if err != nil { - log.Error("check Param failed", err) - t.SetFirstErrorCode(SerErrFailBase, err.Error()) - return err - } - - err = json.Unmarshal(newMsg, t.RestBody) - if err != nil { - log.Errorf(err, "invalid json: %s", util.BytesToStringWithNoCopy(newMsg)) - t.SetFirstErrorCode(SerErrFailBase, err.Error()) - return err - } - return nil - -} - -func (t *DecodeRestReq) checkParam(msg []byte) ([]byte, error) { - - var temp map[string]interface{} - err := json.Unmarshal(msg, &temp) - if err != nil { - log.Errorf(err, "invalid json to map: %s", util.BytesToStringWithNoCopy(msg)) - t.SetFirstErrorCode(SerErrFailBase, err.Error()) - return nil, err - } - - meputil.SetMapValue(temp, "consumedLocalOnly", true) - meputil.SetMapValue(temp, "isLocal", true) - meputil.SetMapValue(temp, "scopeOfLocality", "MEC_HOST") - - msg, err = json.Marshal(&temp) - if err != nil { - log.Errorf(err, "invalid map to json") - t.SetFirstErrorCode(SerErrFailBase, err.Error()) - return nil, err - } - - return msg, nil -} - -func (t *DecodeRestReq) WithBody(body interface{}) *DecodeRestReq { - t.RestBody = body - return t -} - -func (t *DecodeRestReq) GetParam(r *http.Request) { - query, _ := meputil.GetHTTPTags(r) - t.AppInstanceId = query.Get(":appInstanceId") - t.SubscribeId = query.Get(":subscriptionId") - t.ServiceId = query.Get(":serviceId") - t.Ctx = util.SetTargetDomainProject(r.Context(), r.Header.Get("X-Domain-Name"), query.Get(":project")) -} - -type RegisterServiceId struct { - HttpErrInf *proto.Response `json:"httpErrInf,out"` - workspace.TaskBase - Ctx context.Context `json:"ctx,in"` - ServiceId string `json:"serviceId,out"` - RestBody interface{} `json:"restBody,in"` -} - -func (t *RegisterServiceId) OnRequest(data string) workspace.TaskCode { - - serviceInfo, ok := t.RestBody.(*models.ServiceInfo) - if !ok { - t.SetFirstErrorCode(1, "restbody failed") - return workspace.TaskFinish - } - req := &proto.CreateServiceRequest{} - serviceInfo.ToServiceRequest(req) - resp, err := core.ServiceAPI.Create(t.Ctx, req) - if err != nil { - log.Errorf(err, "Service Center ServiceAPI.Create fail: %s!", err.Error()) - t.SetFirstErrorCode(1, err.Error()) - return workspace.TaskFinish - } - - if resp.ServiceId == "" { - t.HttpErrInf = resp.Response - log.Warn("Service id empty.") - } - t.ServiceId = resp.ServiceId - return workspace.TaskFinish -} - -type RegisterServiceInst struct { - HttpErrInf *proto.Response `json:"httpErrInf,out"` - workspace.TaskBase - W http.ResponseWriter `json:"w,in"` - Ctx context.Context `json:"ctx,in"` - AppInstanceId string `json:"appInstanceId,in"` - ServiceId string `json:"serviceId,in"` - InstanceId string `json:"instanceId,out"` - RestBody interface{} `json:"restBody,in"` - HttpRsp interface{} `json:"httpRsp,out"` -} - -//request service registry handling -func (t *RegisterServiceInst) OnRequest(data string) workspace.TaskCode { - serviceInfo, ok := t.RestBody.(*models.ServiceInfo) - if !ok { - t.SetFirstErrorCode(1, "restbody failed") - return workspace.TaskFinish - } - req := &proto.RegisterInstanceRequest{} - serviceInfo.ToRegisterInstance(req) - req.Instance.ServiceId = t.ServiceId - req.Instance.Properties["appInstanceId"] = t.AppInstanceId - - //Call service comb for instance register - resp, err := core.InstanceAPI.Register(t.Ctx, req) - if err != nil { - log.Errorf(err, "RegisterInstance fail: %s", t.ServiceId) - t.HttpErrInf = &proto.Response{} - t.HttpErrInf.Code = svcerr.ErrForbidden - t.HttpErrInf.Message = err.Error() - return workspace.TaskFinish - } - t.InstanceId = resp.InstanceId - - //build response serviceComb use serviceId + InstanceId to mark a service instance - mp1SerId := t.ServiceId + t.InstanceId - serviceInfo.SerInstanceId = mp1SerId - t.HttpRsp = serviceInfo - - location := fmt.Sprintf("/mep/mp1/v1/services/%s", mp1SerId) - t.W.Header().Set("Location", location) - return workspace.TaskFinish -} diff --git a/mep/mepserver/mp1/plan_send_httprsp_created.go b/mep/mepserver/mp1/plan_send_httprsp_created.go deleted file mode 100644 index dce8a4e..0000000 --- a/mep/mepserver/mp1/plan_send_httprsp_created.go +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package mp1 - -import ( - "net/http" - - "github.com/apache/servicecomb-service-center/server/core/proto" - - "mepserver/mp1/arch/workspace" - "mepserver/mp1/util" -) - -type SendHttpRspCreated struct { - HttpErrInf *proto.Response `json:"httpErrInf,in"` - workspace.TaskBase - W http.ResponseWriter `json:"w,in"` - HttpRsp interface{} `json:"httpRsp,in"` -} - -func (t *SendHttpRspCreated) OnRequest(data string) workspace.TaskCode { - util.WriteHTTPResponse(t.W, t.HttpErrInf, t.HttpRsp) - return workspace.TaskFinish -} diff --git a/mep/mepserver/mp1/plan_subscribe_app.go b/mep/mepserver/mp1/plan_subscribe_app.go deleted file mode 100644 index b2f4169..0000000 --- a/mep/mepserver/mp1/plan_subscribe_app.go +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package mp1 - -import ( - "context" - "encoding/json" - "fmt" - "net/http" - - "github.com/apache/servicecomb-service-center/pkg/log" - "github.com/apache/servicecomb-service-center/server/core/backend" - "github.com/apache/servicecomb-service-center/server/core/proto" - "github.com/apache/servicecomb-service-center/server/plugin/pkg/registry" - "github.com/satori/go.uuid" - - "mepserver/mp1/arch/workspace" - "mepserver/mp1/models" -) - -type SubscribeIst struct { - workspace.TaskBase - R *http.Request `json:"r,in"` - HttpErrInf *proto.Response `json:"httpErrInf,out"` - Ctx context.Context `json:"ctx,in"` - W http.ResponseWriter `json:"w,in"` - RestBody interface{} `json:"restBody,in"` - AppInstanceId string `json:"appInstanceId,in"` - SubscribeId string `json:"subscribeId,in"` - HttpRsp interface{} `json:"httpRsp,out"` -} - -//service subscription request -func (t *SubscribeIst) OnRequest(data string) workspace.TaskCode { - - mp1SubscribeInfo, ok := t.RestBody.(*models.SerAvailabilityNotificationSubscription) - if !ok { - t.SetFirstErrorCode(SerErrFailBase, "restBody failed") - return workspace.TaskFinish - } - - appInstanceId := t.AppInstanceId - subscribeId := uuid.NewV4().String() - t.SubscribeId = subscribeId - subscribeJSON, err := json.Marshal(mp1SubscribeInfo) - if err != nil { - log.Errorf(err, "can not Marshal subscribe info") - t.SetFirstErrorCode(ParseInfoErr, "can not marshal subscribe info") - return workspace.TaskFinish - } - opts := []registry.PluginOp{ - registry.OpPut(registry.WithStrKey("/cse-sr/etsi/subscribe/"+appInstanceId+"/"+subscribeId), - registry.WithValue(subscribeJSON)), - } - _, resultErr := backend.Registry().TxnWithCmp(context.Background(), opts, nil, nil) - if resultErr != nil { - log.Errorf(err, "subscription to etcd failed!") - t.SetFirstErrorCode(OperateDataWithEtcdErr, "put subscription to etcd failed") - return workspace.TaskFinish - } - - req := &proto.WatchInstanceRequest{SelfServiceId: appInstanceId[:len(appInstanceId)/2]} - t.R.Method = "WATCHLIST" - WebsocketListAndWatch(t.Ctx, req, appInstanceId) - t.buildResponse(mp1SubscribeInfo) - - return workspace.TaskFinish -} - -func (t *SubscribeIst) buildResponse(sub *models.SerAvailabilityNotificationSubscription) { - appInstanceID := t.AppInstanceId - subscribeID := t.SubscribeId - - t.HttpRsp = sub - location := fmt.Sprintf("/mec_service_mgmt/v1/applications/%s/subscriptions/%s/", appInstanceID, subscribeID) - t.W.Header().Set("Location", location) -} diff --git a/mep/mepserver/mp1/plan_update_svc.go b/mep/mepserver/mp1/plan_update_svc.go deleted file mode 100644 index 4e19194..0000000 --- a/mep/mepserver/mp1/plan_update_svc.go +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package mp1 - -import ( - "context" - - "github.com/apache/servicecomb-service-center/pkg/util" - "github.com/apache/servicecomb-service-center/server/core/proto" - svcutil "github.com/apache/servicecomb-service-center/server/service/util" - - "mepserver/mp1/arch/workspace" - "mepserver/mp1/models" - meputil "mepserver/mp1/util" -) - -type UpdateInstance struct { - workspace.TaskBase - HttpErrInf *proto.Response `json:"httpErrInf,out"` - Ctx context.Context `json:"ctx,in"` - ServiceId string `json:"serviceId,in"` - RestBody interface{} `json:"restBody,in"` - HttpRsp interface{} `json:"httpRsp,out"` -} - -func (t *UpdateInstance) OnRequest(data string) workspace.TaskCode { - if t.ServiceId == "" { - t.SetFirstErrorCode(SerErrFailBase, "param is empty") - return workspace.TaskFinish - } - mp1Ser, ok := t.RestBody.(*models.ServiceInfo) - if !ok { - t.SetFirstErrorCode(SerErrFailBase, "body invalid") - return workspace.TaskFinish - } - - instance, err := meputil.GetServiceInstance(t.Ctx, t.ServiceId) - if err != nil { - t.SetFirstErrorCode(SerInstanceNotFound, "find service failed") - return workspace.TaskFinish - } - - copyInstanceRef := *instance - req := proto.RegisterInstanceRequest{ - Instance: ©InstanceRef, - } - mp1Ser.ToRegisterInstance(&req) - - domainProject := util.ParseDomainProject(t.Ctx) - centerErr := svcutil.UpdateInstance(t.Ctx, domainProject, ©InstanceRef) - if centerErr != nil { - t.SetFirstErrorCode(SerErrServiceUpdFailed, "update service failed") - return workspace.TaskFinish - } - - err = meputil.Heartbeat(t.Ctx, mp1Ser.SerInstanceId) - if err != nil { - t.SetFirstErrorCode(SerErrServiceUpdFailed, "heartbeat failed") - return workspace.TaskFinish - } - mp1Ser.SerInstanceId = instance.ServiceId + instance.InstanceId - t.HttpRsp = mp1Ser - t.HttpErrInf = proto.CreateResponse(proto.Response_SUCCESS, "Update service instance success.") - return workspace.TaskFinish -} diff --git a/mep/mepserver/mp1/publisher.go b/mep/mepserver/mp1/publisher.go deleted file mode 100644 index bc2c09a..0000000 --- a/mep/mepserver/mp1/publisher.go +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package mp1 - -import ( - "sync" - "time" - - "github.com/apache/servicecomb-service-center/pkg/gopool" - "golang.org/x/net/context" -) - -type Publisher struct { - wss []*Websocket - goroutine *gopool.Pool - lock sync.Mutex -} - -func (p *Publisher) Run() { - gopool.Go(publisher.loop) -} - -func (p *Publisher) loop(ctx context.Context) { - defer p.Stop() - ticker := time.NewTicker(500 * time.Millisecond) - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - var removes []int - for i, ws := range p.wss { - payload := ws.Pick() - if payload == nil { - continue - } - _, ok := payload.(error) - if ok { - removes = append(removes, i) - } - p.dispatch(ws, payload) - } - if len(removes) == 0 { - continue - } - p.lock.Lock() - var ( - news []*Websocket - s int - ) - for _, e := range removes { - news = append(news, p.wss[s:e]...) - s = e + 1 - } - if s < len(p.wss) { - news = append(news, p.wss[s:]...) - } - p.wss = news - p.lock.Unlock() - } - } -} - -func (p *Publisher) Stop() { - p.goroutine.Close(true) -} - -func (p *Publisher) dispatch(ws *Websocket, payload interface{}) { - p.goroutine.Do(func(ctx context.Context) { - ws.HandleWatchWebSocketJob(payload) - }) -} - -func (p *Publisher) Accept(ws *Websocket) { - p.lock.Lock() - p.wss = append(p.wss, ws) - p.lock.Unlock() -} - -var publisher *Publisher - -func init() { - publisher = NewPublisher() - publisher.Run() -} - -func NewPublisher() *Publisher { - return &Publisher{ - goroutine: gopool.New(context.Background()), - } -} diff --git a/mep/mepserver/mp1/util/meputil.go b/mep/mepserver/mp1/util/meputil.go deleted file mode 100644 index f81e5bc..0000000 --- a/mep/mepserver/mp1/util/meputil.go +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package util - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "net/http" - "net/url" - "strconv" - "strings" - - "github.com/apache/servicecomb-service-center/pkg/log" - "github.com/apache/servicecomb-service-center/pkg/rest" - "github.com/apache/servicecomb-service-center/pkg/util" - "github.com/apache/servicecomb-service-center/server/core" - "github.com/apache/servicecomb-service-center/server/core/backend" - "github.com/apache/servicecomb-service-center/server/core/proto" - svcerror "github.com/apache/servicecomb-service-center/server/error" - "github.com/apache/servicecomb-service-center/server/plugin/pkg/registry" - "github.com/apache/servicecomb-service-center/server/rest/controller" - svcutil "github.com/apache/servicecomb-service-center/server/service/util" -) - -func InfoToProperties(properties map[string]string, key string, value string) { - if value != "" { - properties[key] = value - } -} - -func JsonTextToObj(jsonText string) (interface{}, error) { - data := []byte(jsonText) - var jsonMap interface{} - decoder := json.NewDecoder(bytes.NewReader(data)) - err := decoder.Decode(&jsonMap) - if err != nil { - return nil, err - } - return jsonMap, nil -} - -func GetHostPort(uri string) (string, int) { - idx := strings.LastIndex(uri, ":") - domain := uri - port := 0 - var err error - if idx > 0 { - port, err = strconv.Atoi(uri[idx+1:]) - if err != nil { - port = 0 - } - domain = uri[:idx] - } - return domain, port -} - -func GetHTTPTags(r *http.Request) (url.Values, []string) { - var ids []string - query := r.URL.Query() - keys := query.Get("tags") - if len(keys) > 0 { - ids = strings.Split(keys, ",") - } - - return query, ids -} - -func GetFindParam(r *http.Request) (context.Context, *proto.FindInstancesRequest, url.Values) { - - query, ids := GetHTTPTags(r) - - req := &proto.FindInstancesRequest{ - ConsumerServiceId: r.Header.Get("X-ConsumerId"), - AppId: query.Get("instance_id"), - ServiceName: query.Get("ser_name"), - VersionRule: query.Get("version"), - Environment: query.Get("env"), - Tags: ids, - } - - if req.AppId == "" { - req.AppId = "default" - } - if req.VersionRule == "" { - req.VersionRule = "latest" - } - ctx := util.SetTargetDomainProject(r.Context(), r.Header.Get("X-Domain-Name"), query.Get(":project")) - return ctx, req, query -} - -//send http response -func WriteHTTPResponse(w http.ResponseWriter, resp *proto.Response, obj interface{}) { - if resp != nil && resp.GetCode() != proto.Response_SUCCESS { - controller.WriteError(w, resp.GetCode(), resp.GetMessage()) - return - } - if obj == nil { - w.Header().Set(rest.HEADER_RESPONSE_STATUS, strconv.Itoa(http.StatusOK)) - w.Header().Set(rest.HEADER_CONTENT_TYPE, rest.CONTENT_TYPE_TEXT) - w.WriteHeader(http.StatusOK) - return - } - - objJSON, err := json.Marshal(obj) - if err != nil { - controller.WriteError(w, svcerror.ErrInternal, err.Error()) - return - } - w.Header().Set(rest.HEADER_RESPONSE_STATUS, strconv.Itoa(http.StatusOK)) - w.Header().Set(rest.HEADER_CONTENT_TYPE, rest.CONTENT_TYPE_JSON) - w.WriteHeader(http.StatusCreated) - _, err = fmt.Fprintln(w, util.BytesToStringWithNoCopy(objJSON)) - if err != nil { - return - } -} - -func WriteResponse(w http.ResponseWriter, resp *proto.Response, obj interface{}) { - if resp != nil && resp.GetCode() != proto.Response_SUCCESS { - controller.WriteError(w, resp.GetCode(), resp.GetMessage()) - return - } - if obj == nil { - w.Header().Set(rest.HEADER_RESPONSE_STATUS, strconv.Itoa(http.StatusOK)) - w.Header().Set(rest.HEADER_CONTENT_TYPE, rest.CONTENT_TYPE_TEXT) - w.WriteHeader(http.StatusOK) - return - } - - objJSON, err := json.Marshal(obj) - if err != nil { - controller.WriteError(w, svcerror.ErrInternal, err.Error()) - return - } - w.Header().Set(rest.HEADER_RESPONSE_STATUS, strconv.Itoa(http.StatusOK)) - w.Header().Set(rest.HEADER_CONTENT_TYPE, rest.CONTENT_TYPE_JSON) - w.WriteHeader(http.StatusOK) - _, err = fmt.Fprintln(w, util.BytesToStringWithNoCopy(objJSON)) - if err != nil { - return - } -} - -func HttpErrResponse(w http.ResponseWriter, statusCode int, obj interface{}) { - if obj == nil { - w.Header().Set(rest.HEADER_RESPONSE_STATUS, strconv.Itoa(statusCode)) - w.Header().Set(rest.HEADER_CONTENT_TYPE, rest.CONTENT_TYPE_TEXT) - w.WriteHeader(statusCode) - return - } - - objJSON, err := json.Marshal(obj) - if err != nil { - log.Errorf(err, "json marshal object fail") - return - } - w.Header().Set(rest.HEADER_RESPONSE_STATUS, strconv.Itoa(http.StatusOK)) - w.Header().Set(rest.HEADER_CONTENT_TYPE, rest.CONTENT_TYPE_JSON) - w.WriteHeader(statusCode) - _, err = fmt.Fprintln(w, util.BytesToStringWithNoCopy(objJSON)) - if err != nil { - log.Errorf(err, "send http response fail") - } -} - -// heartbeat use put to update a service register info -func Heartbeat(ctx context.Context, mp1SvcId string) error { - serviceID := mp1SvcId[:len(mp1SvcId)/2] - instanceID := mp1SvcId[len(mp1SvcId)/2:] - req := &proto.HeartbeatRequest{ - ServiceId: serviceID, - InstanceId: instanceID, - } - _, err := core.InstanceAPI.Heartbeat(ctx, req) - return err -} - -func GetServiceInstance(ctx context.Context, serviceId string) (*proto.MicroServiceInstance, error) { - domainProjet := util.ParseDomainProject(ctx) - serviceID := serviceId[:len(serviceId)/2] - instanceID := serviceId[len(serviceId)/2:] - instance, err := svcutil.GetInstance(ctx, domainProjet, serviceID, instanceID) - if err != nil { - return nil, err - } - if instance == nil { - err = fmt.Errorf("domainProjet %s sservice Id %s not exist", domainProjet, serviceID) - } - return instance, err -} - -func FindInstanceByKey(result url.Values) (*proto.FindInstancesResponse, error) { - serCategoryId := result.Get("ser_category_id") - scopeOfLocality := result.Get("scope_of_locality") - consumedLocalOnly := result.Get("consumed_local_only") - isLocal := result.Get("is_local") - isQueryAllSvc := serCategoryId == "" && scopeOfLocality == "" && consumedLocalOnly == "" && isLocal == "" - - opts := []registry.PluginOp{ - registry.OpGet(registry.WithStrKey("/cse-sr/inst/files///"), registry.WithPrefix()), - } - resp, err := backend.Registry().TxnWithCmp(context.Background(), opts, nil, nil) - if err != nil { - return nil, fmt.Errorf("query from etch error") - } - var findResp []*proto.MicroServiceInstance - for _, value := range resp.Kvs { - var instance map[string]interface{} - err = json.Unmarshal(value.Value, &instance) - if err != nil { - return nil, fmt.Errorf("string convert to instance failed") - } - dci := &proto.DataCenterInfo{Name: "", Region: "", AvailableZone: ""} - instance["datacenterinfo"] = dci - var message []byte - message, err = json.Marshal(&instance) - if err != nil { - log.Errorf(err, "Instance convert to string failed!") - } - var ins *proto.MicroServiceInstance - err = json.Unmarshal(message, &ins) - if err != nil { - log.Errorf(err, "String convert to MicroServiceInstance failed!") - } - property := ins.Properties - if isQueryAllSvc && property != nil { - findResp = append(findResp, ins) - } else if strings.EqualFold(property["serCategory/id"], serCategoryId) || - strings.EqualFold(property["ConsumedLocalOnly"], consumedLocalOnly) || - strings.EqualFold(property["ScopeOfLocality"], scopeOfLocality) || - strings.EqualFold(property["IsLocal"], isLocal) { - findResp = append(findResp, ins) - } - } - if len(findResp) == 0 { - return nil, fmt.Errorf("service not found") - } - response := &proto.Response{Code: 0, Message: ""} - ret := &proto.FindInstancesResponse{Response: response, Instances: findResp} - return ret, nil -} - -func SetMapValue(theMap map[string]interface{}, key string, val interface{}) { - mapValue, ok := theMap[key] - if !ok || mapValue == nil { - theMap[key] = val - } -} - diff --git a/mep/mepserver/mp1/uuid/mp1context.go b/mep/mepserver/mp1/uuid/mp1context.go deleted file mode 100644 index 46da3b1..0000000 --- a/mep/mepserver/mp1/uuid/mp1context.go +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package uuid - -import ( - "crypto/sha256" - "fmt" - - "github.com/apache/servicecomb-service-center/pkg/util" - mgr "github.com/apache/servicecomb-service-center/server/plugin" - "github.com/apache/servicecomb-service-center/server/plugin/pkg/uuid" - "github.com/apache/servicecomb-service-center/server/plugin/pkg/uuid/buildin" - "golang.org/x/net/context" -) - -func init() { - mgr.RegisterPlugin(mgr.Plugin{PName: mgr.UUID, Name: "mp1context", New: New}) - -} - -func New() mgr.PluginInstance { - return &Mp1ContextUUID{} -} - -type Mp1ContextUUID struct { - buildin.BuildinUUID -} - -func (cu *Mp1ContextUUID) fromContext(ctx context.Context) string { - key, ok := ctx.Value(uuid.ContextKey).(string) - if !ok { - return "" - } - return key -} - -func (cu *Mp1ContextUUID) GetServiceId(ctx context.Context) string { - content := cu.fromContext(ctx) - if len(content) == 0 { - return cu.BuildinUUID.GetServiceId(ctx) - } - - shaSum := sha256.Sum256(util.StringToBytesWithNoCopy(content)) - shaHalf := shaSum[0:8] - return fmt.Sprintf("%x", shaHalf) -} - -func (cu *Mp1ContextUUID) GetInstanceId(_ context.Context) string { - shaSum := sha256.Sum256(util.StringToBytesWithNoCopy(util.GenerateUuid())) - shaHalf := shaSum[0:8] - return fmt.Sprintf("%x", shaHalf) -} diff --git a/mep/mepserver/mp1/websocket.go b/mep/mepserver/mp1/websocket.go deleted file mode 100644 index f921fde..0000000 --- a/mep/mepserver/mp1/websocket.go +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright 2020 Huawei Technologies Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package mp1 - -import ( - "context" - "encoding/json" - "fmt" - "io" - "net/http" - "strings" - "time" - - "github.com/apache/servicecomb-service-center/pkg/log" - "github.com/apache/servicecomb-service-center/server/core/backend" - "github.com/apache/servicecomb-service-center/server/core/proto" - "github.com/apache/servicecomb-service-center/server/notify" - "github.com/apache/servicecomb-service-center/server/plugin/pkg/registry" - - "mepserver/mp1/models" -) - -type Websocket struct { - watcher *notify.InstanceEventListWatcher - ticker *time.Ticker - ctx context.Context - needPingWatcher bool - free chan struct{} - closed chan struct{} - serviceID string -} - -func (ws *Websocket) Init() error { - ws.ticker = time.NewTicker(notify.HeartbeatInterval) - ws.needPingWatcher = true - ws.free = make(chan struct{}, 1) - ws.closed = make(chan struct{}) - ws.SetReady() - if err := notify.NotifyCenter().AddSubscriber(ws.watcher); err != nil { - return err - } - publisher.Accept(ws) - return nil -} - -func (ws *Websocket) ReadTimeout() time.Duration { - return notify.ReadTimeout -} - -func (ws *Websocket) SendTimeout() time.Duration { - return notify.SendTimeout -} - -func (ws *Websocket) HandleWatchWebSocketControlMessage() { - -} - -func (ws *Websocket) HandleWatchWebSocketJob(payload interface{}) { - defer ws.SetReady() - var ( - job *notify.InstanceEvent - ) - switch v := payload.(type) { - case error: - err := payload.(error) - log.Errorf(err, "watcher catch an error, subject: %s, group: %s", ws.watcher.Subject(), ws.watcher.Group()) - case time.Time: - return - case *notify.InstanceEvent: - serviceID := ws.serviceID - job = payload.(*notify.InstanceEvent) - resp := job.Response - SendMsgToApp(resp, serviceID) - default: - log.Errorf(nil, "watcher unknown input type %T, subject: %s, group: %s", v, ws.watcher.Subject(), ws.watcher.Group()) - return - } - - select { - case _, ok := <-ws.closed: - if !ok { - log.Warn("websocket channel closed") - } - return - default: - } -} - -func (ws *Websocket) SetReady() { - select { - case ws.free <- struct{}{}: - default: - } - -} - -func (ws *Websocket) Pick() interface{} { - select { - case _, ok := <-ws.Ready(): - if !ok { - log.Warn("websocket ready channel closed") - } - if ws.watcher.Err() != nil { - return ws.watcher.Err() - } - - select { - case t, ok := <-ws.ticker.C: - if !ok { - log.Warn("websocket ticker C channel closed") - } - return t - case j, ok := <-ws.watcher.Job: - if !ok { - log.Warn("websocket watcher job channel closed") - } - if j == nil { - err := fmt.Errorf("server shutdown") - log.Error("server shutdown", err) - } - return j - default: - ws.SetReady() - } - default: - } - return nil -} - -func (ws *Websocket) Ready() chan struct{} { - return ws.free -} - -func (ws *Websocket) Stop() { - close(ws.closed) -} - -func getCallBackUris(serviceID string, instanceID string, serName string) []string { - var callbackUris []string - opts := []registry.PluginOp{ - registry.OpGet(registry.WithStrKey("/cse-sr/etsi/subscribe/"+serviceID), registry.WithPrefix()), - } - resp, err := backend.Registry().TxnWithCmp(context.Background(), opts, nil, nil) - if err != nil { - log.Errorf(err, "get subcription from etcd failed!") - return callbackUris - } - for _, v := range resp.Kvs { - var notifyInfo models.SerAvailabilityNotificationSubscription - if v.Value == nil { - log.Warn("the value is nil in etcd") - continue - } - err = json.Unmarshal(v.Value, ¬ifyInfo) - if err != nil { - log.Warn("notify json can not be parsed to notifyInfo") - continue - } - callbackURI := notifyInfo.CallbackReference - filter := notifyInfo.FilteringCriteria - - if (len(filter.SerInstanceIds) != 0 && StringContains(filter.SerInstanceIds, instanceID) != -1) || - (len(filter.SerNames) != 0 && StringContains(filter.SerNames, serviceID) != -1) { - callbackUris = append(callbackUris, callbackURI) - } - } - log.Infof("send to consumerIds: %s", callbackUris) - return callbackUris -} - -func StringContains(arr []string, val string) (index int) { - index = -1 - for i := 0; i < len(arr); i++ { - if arr[i] == val { - index = i - return - } - } - return -} - -func SendMsgToApp(data *proto.WatchInstanceResponse, serviceID string) { - // transfer data to instanceInfo, and get instaceid, serviceName - instanceID := data.Instance.ServiceId + data.Instance.InstanceId - serName := data.Instance.Properties["serName"] - action := data.Action - instanceInfo := data.Instance - instanceStr, err := json.Marshal(instanceInfo) - if err != nil { - log.Errorf(err, "parse instanceInfo failed!") - return - } - - callbackUris := getCallBackUris(serviceID, instanceID, serName) - body := strings.NewReader(string(instanceStr)) - doSend(action, body, callbackUris) -} - -func doSend(action string, body io.Reader, callbackUris []string) { - for _, callbackURI := range callbackUris { - log.Debugf("action: %s with callbackURI:%s", action, callbackURI) - if !strings.HasPrefix(callbackURI, "http") { - callbackURI = "http://" + callbackURI - } - client := http.Client{} - - if action == "CREATE" { - contentType := "application/x-www-form-urlencoded" - _, err := http.Post(callbackURI, contentType, body) - if err != nil { - log.Warn("the consumer handle post action failed!") - } - } else if action == "DELETE" { - req, err := http.NewRequest("delete", callbackURI, body) - if err != nil { - _, err := client.Do(req) - if err != nil { - log.Warn("the consumer handle delete action failed!") - } - - } else { - log.Errorf(err, "crate request failed!") - } - } else if action == "UPDATE" { - req, err := http.NewRequest("put", callbackURI, body) - if err != nil { - _, err := client.Do(req) - if err != nil { - log.Warn("the consumer handle update action failed!") - } - - } else { - log.Errorf(err, "crate request failed!") - } - } - } -} - -func DoWebSocketListAndWatchV2(ctx context.Context, id string, id2 string, f func() ([]*proto.WatchInstanceResponse, int64)) { - //TBD -} diff --git a/mep/mepserver/postgres-k8s.yaml b/mep/mepserver/postgres-k8s.yaml deleted file mode 100644 index 49c0007..0000000 --- a/mep/mepserver/postgres-k8s.yaml +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -# postgres database ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: postgres-db - namespace: mep - labels: - app: postgres-db -spec: - replicas: 1 - selector: - matchLabels: - app: postgres-db - template: - metadata: - labels: - app: postgres-db - spec: - volumes: - - name: postgres-data - persistentVolumeClaim: - claimName: postgres-pv-claim - containers: - - name: postgres-db - image: postgres:9.6 - imagePullPolicy: "IfNotPresent" - env: - - name: POSTGRES_DB - value: kong - - name: POSTGRES_USER - value: kong - - name: POSTGRES_PASSWORD - value: kong - volumeMounts: - - mountPath: /var/lib/postgresql/data - name: postgres-data - ports: - - containerPort: 5432 - -# prepare postgres-db ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: prepare-postgre-db - namespace: mep -spec: - template: - spec: - initContainers: - - name: check-db-ready - image: postgres:9.6 - command: ['sh', '-c', 'until pg_isready -h postgres-db -p 5432; - do echo waiting for database; sleep 2; done;'] - containers: - - name: prepare-postgres-db - image: kong:1.5.1-alpine - env: - - name: KONG_DATABASE - value: "postgres" - - name: KONG_PG_DATABASE - value: kong - - name: KONG_PG_HOST - value: postgres-db - - name: KONG_PG_USER - value: kong - - name: KONG_PG_PASSWORD - value: kong - command: ['kong'] - args: ['migrations', 'bootstrap'] - restartPolicy: Never - backoffLimit: 4 - - -# postgres servcie ---- -apiVersion: v1 -kind: Service -metadata: - name: postgres-db - namespace: mep -spec: - selector: - app: postgres-db - type: ClusterIP - ports: - - port: 5432 diff --git a/mep/mepserver/start.sh b/mep/mepserver/start.sh deleted file mode 100755 index 8365c15..0000000 --- a/mep/mepserver/start.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -cd / -set +e -sed -i "s/^httpaddr.*=.*$/httpaddr = $(hostname)/g" conf/app.conf -sed -i "s/^ssl_mode.*=.*$/ssl_mode = ${MEP_SSL_MODE:-0}/g" conf/app.conf -sed -i "s/^ssl_verify_client.*=.*$/ssl_verify_client = 0/g" conf/app.conf -set -e -./app diff --git a/mep/mepserver/undeploy.sh b/mep/mepserver/undeploy.sh deleted file mode 100755 index 7f28089..0000000 --- a/mep/mepserver/undeploy.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -# Copyright 2020 Huawei Technologies Co., Ltd. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - - kubectl delete -f mep-k8s.yaml - kubectl delete -f kong-k8s.yaml - kubectl delete -f postgres-k8s.yaml - kubectl delete -f mep-basic.yaml