diff --git a/go.mod b/go.mod index 0c098ef..08f3fea 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module gitlink.org.cn/jcce-pcm/pcm-participant-openstack +module gitlink.org.cn/JointCloud/pcm-openstack go 1.21 @@ -7,8 +7,7 @@ require ( github.com/prometheus/common v0.45.0 github.com/robfig/cron/v3 v3.0.1 github.com/zeromicro/go-zero v1.6.0 - gitlink.org.cn/jcce-pcm/pcm-coordinator v0.1.19 - gitlink.org.cn/jcce-pcm/utils v0.0.2 + gitlink.org.cn/JointCloud/pcm-coordinator v0.0.0-20240301032931-d8d63c116dda google.golang.org/grpc v1.60.0 google.golang.org/protobuf v1.31.0 k8s.io/apimachinery v0.29.0 @@ -52,7 +51,6 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/nacos-group/nacos-sdk-go/v2 v2.2.4 // indirect github.com/openzipkin/zipkin-go v0.4.2 // indirect github.com/pelletier/go-toml/v2 v2.1.1 // indirect github.com/pkg/errors v0.9.1 // indirect @@ -87,7 +85,6 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/api v0.29.0 // indirect diff --git a/go.sum b/go.sum index c1e9444..f029b73 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 h1:uvdUDbHQHO85qeSydJtItA4T55Pw6BtAejd0APRJOCE= +github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.31.0 h1:ObEFUNlJwoIiyjxdrYF0QIDE7qXcLc7D3WpSH4c22PU= +github.com/alicebob/miniredis/v2 v2.31.0/go.mod h1:UB/T2Uztp7MlFSDakaX1sTXUv5CASoprx0wulRT6HBg= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0= @@ -46,6 +48,7 @@ github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq github.com/go-resty/resty/v2 v2.10.0 h1:Qla4W/+TMmv0fOeeRqzEpXPLfTUnR5HZ1+lGs+CkiCo= github.com/go-resty/resty/v2 v2.10.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -71,18 +74,21 @@ github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= +github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8= github.com/jinzhu/copier v0.4.0/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -104,12 +110,15 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= -github.com/nacos-group/nacos-sdk-go/v2 v2.2.4 h1:t3Eoz3ySvKrm7p2WMfWYciCF87UEdLac64CZKFlC0BA= -github.com/nacos-group/nacos-sdk-go/v2 v2.2.4/go.mod h1:Q9qY/WK+kxTKK7cNoxMkdkKcD7BLBgTmwQ1jmThgGK8= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= +github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= +github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/openzipkin/zipkin-go v0.4.2 h1:zjqfqHjUpPmB3c1GlCvvgsM1G4LkvqQbBDueDOCg/jA= github.com/openzipkin/zipkin-go v0.4.2/go.mod h1:ZeVkFjuuBiSy13y8vpSDCjMi9GoI3hPpCJSBx/EYFhY= github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= @@ -119,6 +128,7 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE 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/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= +github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= @@ -130,9 +140,11 @@ github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3c github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= @@ -148,12 +160,11 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE= +github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= github.com/zeromicro/go-zero v1.6.0 h1:UwSOR1lGZ2g7L0S07PM8RoneAcubtd5x//EfbuNucQ0= github.com/zeromicro/go-zero v1.6.0/go.mod h1:E9GCFPb0SwsTKFBcFr9UynGvXiDMmfc6fI5F15vqvAQ= -gitlink.org.cn/jcce-pcm/pcm-coordinator v0.1.19 h1:qeBcLo7NTGPsowxxgc7dD+fdWHEOZBrt1vY26+3wv+k= -gitlink.org.cn/jcce-pcm/pcm-coordinator v0.1.19/go.mod h1:0dHxKCTjH3ud1qRQZjE6EqXSs3NTOpiHWTpaip4mrWE= -gitlink.org.cn/jcce-pcm/utils v0.0.2 h1:Stif8W9C9TOCS2hw4g+OlOywDrsVYNrkiyKfBrWkT0w= -gitlink.org.cn/jcce-pcm/utils v0.0.2/go.mod h1:u8PTlBpzUyOlbQJgfSiutq91q/JtrJIQiPNDe4S/pGs= +gitlink.org.cn/JointCloud/pcm-coordinator v0.0.0-20240301032931-d8d63c116dda h1:tOZzCcUlZWGaFsElGBNl7rPZu+Dbdz9u4KCx18aDeZg= +gitlink.org.cn/JointCloud/pcm-coordinator v0.0.0-20240301032931-d8d63c116dda/go.mod h1:8qfTmGXRUiR836elnls5SA4xtQ1iIg3fJHXDjwDUsvo= go.etcd.io/etcd/api/v3 v3.5.11 h1:B54KwXbWDHyD3XYAwprxNzTe7vlhR69LuBgZnMVvS7E= go.etcd.io/etcd/api/v3 v3.5.11/go.mod h1:Ot+o0SWSyT6uHhA56al1oCED0JImsRiU9Dc26+C2a+4= go.etcd.io/etcd/client/pkg/v3 v3.5.11 h1:bT2xVspdiCj2910T0V+/KHcVKjkUrCZVtk8J2JF2z1A= @@ -185,6 +196,7 @@ go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v8 go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= @@ -264,6 +276,7 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= +golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -286,11 +299,11 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= +gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= 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.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= -gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= 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.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/internal/common/tokenService.go b/internal/common/tokenService.go index 3770f35..5202662 100644 --- a/internal/common/tokenService.go +++ b/internal/common/tokenService.go @@ -3,7 +3,7 @@ package common import ( "bytes" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/config" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/config" "io" "k8s.io/apimachinery/pkg/util/json" "log" diff --git a/internal/logic/addsecuritygrouptoserverlogic.go b/internal/logic/addsecuritygrouptoserverlogic.go index b847944..35391ec 100644 --- a/internal/logic/addsecuritygrouptoserverlogic.go +++ b/internal/logic/addsecuritygrouptoserverlogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *AddSecurityGroupToServerLogic) AddSecurityGroupToServer(in *openstack.A } payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackComputeUrl - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/servers"+in.ServerId+"/action", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/servers"+in.ServerId+"/action", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/bulkcreatenetworkslogic.go b/internal/logic/bulkcreatenetworkslogic.go index 5ffefaf..c1fdafb 100644 --- a/internal/logic/bulkcreatenetworkslogic.go +++ b/internal/logic/bulkcreatenetworkslogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -39,7 +40,7 @@ func (l *BulkCreateNetworksLogic) BulkCreateNetworks(in *openstack.BulkCreateNet payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/networks", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/networks", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/changeadministrativepasswordlogic.go b/internal/logic/changeadministrativepasswordlogic.go index e863530..67e9e93 100644 --- a/internal/logic/changeadministrativepasswordlogic.go +++ b/internal/logic/changeadministrativepasswordlogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *ChangeAdministrativePasswordLogic) ChangeAdministrativePassword(in *ope } payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackComputeUrl - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/servers"+in.ServerId+"/action", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/servers"+in.ServerId+"/action", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/createfirewallgrouplogic.go b/internal/logic/createfirewallgrouplogic.go index 5aa8202..03d64b0 100644 --- a/internal/logic/createfirewallgrouplogic.go +++ b/internal/logic/createfirewallgrouplogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *CreateFirewallGroupLogic) CreateFirewallGroup(in *openstack.CreateFirew } payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackNetworkUrl - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/v2.0/fwaas/firewall_groups", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/v2.0/fwaas/firewall_groups", payload, token) if statusCode == 202 { err := json.Unmarshal(body, &resp) if err != nil { diff --git a/internal/logic/createfirewallpolicylogic.go b/internal/logic/createfirewallpolicylogic.go index e1963cf..85bb79e 100644 --- a/internal/logic/createfirewallpolicylogic.go +++ b/internal/logic/createfirewallpolicylogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *CreateFirewallPolicyLogic) CreateFirewallPolicy(in *openstack.CreateFir } payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackNetworkUrl - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/v2.0/fwaas/firewall_policies", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/v2.0/fwaas/firewall_policies", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/createfirewallrulelogic.go b/internal/logic/createfirewallrulelogic.go index f8edf17..50b464a 100644 --- a/internal/logic/createfirewallrulelogic.go +++ b/internal/logic/createfirewallrulelogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *CreateFirewallRuleLogic) CreateFirewallRule(in *openstack.CreateFirewal } payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackNetworkUrl - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/v2.0/fwaas/firewall_rules", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/v2.0/fwaas/firewall_rules", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/createflavorlogic.go b/internal/logic/createflavorlogic.go index dc7ef27..cc9933d 100644 --- a/internal/logic/createflavorlogic.go +++ b/internal/logic/createflavorlogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *CreateFlavorLogic) CreateFlavor(in *openstack.CreateFlavorReq) (*openst } payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackComputeUrl - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/flavors", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/flavors", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/createfloatingiplogic.go b/internal/logic/createfloatingiplogic.go index 811fdad..4a353fd 100644 --- a/internal/logic/createfloatingiplogic.go +++ b/internal/logic/createfloatingiplogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *CreateFloatingIPLogic) CreateFloatingIP(in *openstack.CreateFloatingIPR } payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackNetworkUrl - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/v2.0/floatingips", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/v2.0/floatingips", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/createimagelogic.go b/internal/logic/createimagelogic.go index 1c56bd9..4b93869 100644 --- a/internal/logic/createimagelogic.go +++ b/internal/logic/createimagelogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -39,7 +40,7 @@ func (l *CreateImageLogic) CreateImage(in *openstack.CreateImageReq) (*openstack payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackImageUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/v2/images", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/v2/images", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/createnetworklogic.go b/internal/logic/createnetworklogic.go index 1507ac2..193c7a7 100644 --- a/internal/logic/createnetworklogic.go +++ b/internal/logic/createnetworklogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -38,7 +39,7 @@ func (l *CreateNetworkLogic) CreateNetwork(in *openstack.CreateNetworkReq) (*ope } payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackNetworkUrl - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/v2.0/networks", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/v2.0/networks", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/createnetworksegmentrangelogic.go b/internal/logic/createnetworksegmentrangelogic.go index 4b9ece8..aa65b43 100644 --- a/internal/logic/createnetworksegmentrangelogic.go +++ b/internal/logic/createnetworksegmentrangelogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -40,7 +40,7 @@ func (l *CreateNetworkSegmentRangeLogic) CreateNetworkSegmentRange(in *openstack } payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackNetworkUrl - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/v2.0/network_segment_ranges", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/v2.0/network_segment_ranges", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/createnodelogic.go b/internal/logic/createnodelogic.go index cc64760..3b8e6a4 100644 --- a/internal/logic/createnodelogic.go +++ b/internal/logic/createnodelogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -38,7 +39,7 @@ func (l *CreateNodeLogic) CreateNode(in *openstack.CreateNodeReq) (*openstack.Cr } payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackComputeUrl - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/v1/nodes", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/v1/nodes", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/createportlogic.go b/internal/logic/createportlogic.go index cdc45ca..8227bcc 100644 --- a/internal/logic/createportlogic.go +++ b/internal/logic/createportlogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -41,7 +41,7 @@ func (l *CreatePortLogic) CreatePort(in *openstack.CreatePortReq) (*openstack.Cr payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackNetworkUrl - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/v2.0/ports", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/v2.0/ports", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/createrouterlogic.go b/internal/logic/createrouterlogic.go index d3f29c7..9a92b7c 100644 --- a/internal/logic/createrouterlogic.go +++ b/internal/logic/createrouterlogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -40,7 +40,7 @@ func (l *CreateRouterLogic) CreateRouter(in *openstack.CreateRouterReq) (*openst } payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackNetworkUrl - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/v2.0/routers", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/v2.0/routers", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/createsecuritygrouplogic.go b/internal/logic/createsecuritygrouplogic.go index 877bb53..4f84359 100644 --- a/internal/logic/createsecuritygrouplogic.go +++ b/internal/logic/createsecuritygrouplogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *CreateSecurityGroupLogic) CreateSecurityGroup(in *openstack.CreateSecur } payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackNetworkUrl - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/v2.0/security-groups", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/v2.0/security-groups", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/createsecuritygrouprulelogic.go b/internal/logic/createsecuritygrouprulelogic.go index 22558ee..08eeaee 100644 --- a/internal/logic/createsecuritygrouprulelogic.go +++ b/internal/logic/createsecuritygrouprulelogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *CreateSecurityGroupRuleLogic) CreateSecurityGroupRule(in *openstack.Cre } payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackNetworkUrl - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/v2.0/security-group-rules", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/v2.0/security-group-rules", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/createserverlogic.go b/internal/logic/createserverlogic.go index 7334a6f..b49f1c4 100644 --- a/internal/logic/createserverlogic.go +++ b/internal/logic/createserverlogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "strings" "github.com/zeromicro/go-zero/core/logx" @@ -38,7 +39,7 @@ func (l *CreateServerLogic) CreateServer(in *openstack.CreateServerReq) (*openst } payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackComputeUrl - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/servers", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/servers", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/createsubnetlogic.go b/internal/logic/createsubnetlogic.go index bc4333d..6117d5c 100644 --- a/internal/logic/createsubnetlogic.go +++ b/internal/logic/createsubnetlogic.go @@ -4,12 +4,12 @@ import ( "context" "encoding/json" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "strings" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "strings" "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *CreateSubnetLogic) CreateSubnet(in *openstack.CreateSubnetReq) (*openst } payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackNetworkUrl - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/v2.0/subnets", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/v2.0/subnets", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/createvolumelogic.go b/internal/logic/createvolumelogic.go index e180998..d06b81b 100644 --- a/internal/logic/createvolumelogic.go +++ b/internal/logic/createvolumelogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -38,7 +39,7 @@ func (l *CreateVolumeLogic) CreateVolume(in *openstack.CreateVolumeReq) (*openst token := common.GetToken(in.Platform) payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackVolumev2Url - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/volumes", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/volumes", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/createvolumetypeslogic.go b/internal/logic/createvolumetypeslogic.go index 179cd8b..1a07c67 100644 --- a/internal/logic/createvolumetypeslogic.go +++ b/internal/logic/createvolumetypeslogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -38,7 +39,7 @@ func (l *CreateVolumeTypesLogic) CreateVolumeTypes(in *openstack.CreateVolumeTyp payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackVolumev2Url token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/types", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/types", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/deletefirewallgrouplogic.go b/internal/logic/deletefirewallgrouplogic.go index d07c11f..61780bd 100644 --- a/internal/logic/deletefirewallgrouplogic.go +++ b/internal/logic/deletefirewallgrouplogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -36,7 +37,7 @@ func (l *DeleteFirewallGroupLogic) DeleteFirewallGroup(in *openstack.DeleteFirew } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.DELETE, openstackUrl+"/v2.0/fwaas/firewall_groups/"+in.FirewallGroupId, strings.NewReader(``), token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.DELETE, openstackUrl+"/v2.0/fwaas/firewall_groups/"+in.FirewallGroupId, strings.NewReader(``), token) if err != nil { return nil, err } diff --git a/internal/logic/deletefirewallpolicylogic.go b/internal/logic/deletefirewallpolicylogic.go index 7705757..2438019 100644 --- a/internal/logic/deletefirewallpolicylogic.go +++ b/internal/logic/deletefirewallpolicylogic.go @@ -4,10 +4,11 @@ import ( "context" "fmt" "github.com/zeromicro/go-zero/core/logx" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" ) @@ -35,7 +36,7 @@ func (l *DeleteFirewallPolicyLogic) DeleteFirewallPolicy(in *openstack.DeleteFir } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.DELETE, openstackUrl+"/v2.0/fwaas/firewall_policies/"+in.FirewallPolicyId, strings.NewReader(``), token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.DELETE, openstackUrl+"/v2.0/fwaas/firewall_policies/"+in.FirewallPolicyId, strings.NewReader(``), token) if err != nil { return nil, err } diff --git a/internal/logic/deletefirewallrulelogic.go b/internal/logic/deletefirewallrulelogic.go index 369b71d..17a6943 100644 --- a/internal/logic/deletefirewallrulelogic.go +++ b/internal/logic/deletefirewallrulelogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -36,7 +37,7 @@ func (l *DeleteFirewallRuleLogic) DeleteFirewallRule(in *openstack.DeleteFirewal } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.DELETE, openstackUrl+"/v2.0/fwaas/firewall_rules/"+in.FirewallRuleId, strings.NewReader(``), token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.DELETE, openstackUrl+"/v2.0/fwaas/firewall_rules/"+in.FirewallRuleId, strings.NewReader(``), token) if err != nil { return nil, err } diff --git a/internal/logic/deleteflavorlogic.go b/internal/logic/deleteflavorlogic.go index 26387d9..cf11032 100644 --- a/internal/logic/deleteflavorlogic.go +++ b/internal/logic/deleteflavorlogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -36,7 +37,7 @@ func (l *DeleteFlavorLogic) DeleteFlavor(in *openstack.DeleteFlavorReq) (*openst } openstackUrl := platform.OpenstackImageUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.DELETE, openstackUrl+"/flavors/"+in.FlavorId, strings.NewReader(``), token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.DELETE, openstackUrl+"/flavors/"+in.FlavorId, strings.NewReader(``), token) if err != nil { return nil, err } diff --git a/internal/logic/deletefloatingiplogic.go b/internal/logic/deletefloatingiplogic.go index e6a9f15..5797e2d 100644 --- a/internal/logic/deletefloatingiplogic.go +++ b/internal/logic/deletefloatingiplogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -36,7 +37,7 @@ func (l *DeleteFloatingIPLogic) DeleteFloatingIP(in *openstack.DeleteFloatingIPR } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.DELETE, openstackUrl+"/v2.0/floatingips/"+in.FloatingipId, strings.NewReader(``), token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.DELETE, openstackUrl+"/v2.0/floatingips/"+in.FloatingipId, strings.NewReader(``), token) if err != nil { return nil, err } diff --git a/internal/logic/deleteimagelogic.go b/internal/logic/deleteimagelogic.go index 431285d..f93e9a3 100644 --- a/internal/logic/deleteimagelogic.go +++ b/internal/logic/deleteimagelogic.go @@ -4,10 +4,11 @@ import ( "context" "fmt" "github.com/zeromicro/go-zero/core/logx" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" ) @@ -35,7 +36,7 @@ func (l *DeleteImageLogic) DeleteImage(in *openstack.DeleteImageReq) (*openstack } openstackUrl := platform.OpenstackImageUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.DELETE, openstackUrl+"/v2/images/"+in.ImageId, strings.NewReader(``), token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.DELETE, openstackUrl+"/v2/images/"+in.ImageId, strings.NewReader(``), token) if err != nil { return nil, err } diff --git a/internal/logic/deletenetworklogic.go b/internal/logic/deletenetworklogic.go index b31e2ff..c4009d4 100644 --- a/internal/logic/deletenetworklogic.go +++ b/internal/logic/deletenetworklogic.go @@ -4,10 +4,11 @@ import ( "context" "fmt" "github.com/zeromicro/go-zero/core/logx" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" ) @@ -35,7 +36,7 @@ func (l *DeleteNetworkLogic) DeleteNetwork(in *openstack.DeleteNetworkReq) (*ope } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.DELETE, openstackUrl+"/v2.0/networks/"+in.NetworkId, strings.NewReader(``), token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.DELETE, openstackUrl+"/v2.0/networks/"+in.NetworkId, strings.NewReader(``), token) if err != nil { return nil, err } diff --git a/internal/logic/deletenetworksegmentrangeslogic.go b/internal/logic/deletenetworksegmentrangeslogic.go index 778b1d0..b92d1e8 100644 --- a/internal/logic/deletenetworksegmentrangeslogic.go +++ b/internal/logic/deletenetworksegmentrangeslogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -36,7 +37,7 @@ func (l *DeleteNetworkSegmentRangesLogic) DeleteNetworkSegmentRanges(in *opensta } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.DELETE, openstackUrl+"/v2.0/network_segment_ranges/"+in.NetworkSegmentRangeId, strings.NewReader(``), token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.DELETE, openstackUrl+"/v2.0/network_segment_ranges/"+in.NetworkSegmentRangeId, strings.NewReader(``), token) if err != nil { return nil, err } diff --git a/internal/logic/deletenodelogic.go b/internal/logic/deletenodelogic.go index a617f57..1f31ae1 100644 --- a/internal/logic/deletenodelogic.go +++ b/internal/logic/deletenodelogic.go @@ -4,10 +4,11 @@ import ( "context" "fmt" "github.com/zeromicro/go-zero/core/logx" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" ) @@ -35,7 +36,7 @@ func (l *DeleteNodeLogic) DeleteNode(in *openstack.DeleteNodeReq) (*openstack.De } openstackUrl := platform.OpenstackBareMetalUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.DELETE, openstackUrl+"/v1/nodes/"+in.NodeIdent, strings.NewReader(``), token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.DELETE, openstackUrl+"/v1/nodes/"+in.NodeIdent, strings.NewReader(``), token) if err != nil { return nil, err } diff --git a/internal/logic/deleteportlogic.go b/internal/logic/deleteportlogic.go index 204b377..795a5d0 100644 --- a/internal/logic/deleteportlogic.go +++ b/internal/logic/deleteportlogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -36,7 +37,7 @@ func (l *DeletePortLogic) DeletePort(in *openstack.DeletePortReq) (*openstack.De } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.DELETE, openstackUrl+"/v2.0/ports/"+in.PortId, strings.NewReader(``), token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.DELETE, openstackUrl+"/v2.0/ports/"+in.PortId, strings.NewReader(``), token) if err != nil { return nil, err } diff --git a/internal/logic/deleterouterlogic.go b/internal/logic/deleterouterlogic.go index 19bd86c..3996f6b 100644 --- a/internal/logic/deleterouterlogic.go +++ b/internal/logic/deleterouterlogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -36,7 +37,7 @@ func (l *DeleteRouterLogic) DeleteRouter(in *openstack.DeleteRouterReq) (*openst } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.DELETE, openstackUrl+"/v2.0/routers/"+in.RouterId, strings.NewReader(``), token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.DELETE, openstackUrl+"/v2.0/routers/"+in.RouterId, strings.NewReader(``), token) if err != nil { return nil, err } diff --git a/internal/logic/deletesecuritygrouplogic.go b/internal/logic/deletesecuritygrouplogic.go index 1c289f7..0394c97 100644 --- a/internal/logic/deletesecuritygrouplogic.go +++ b/internal/logic/deletesecuritygrouplogic.go @@ -4,10 +4,11 @@ import ( "context" "fmt" "github.com/zeromicro/go-zero/core/logx" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" ) @@ -35,7 +36,7 @@ func (l *DeleteSecurityGroupLogic) DeleteSecurityGroup(in *openstack.DeleteSecur } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.DELETE, openstackUrl+"/v2.0/security-groups/"+in.SecurityGroupId, strings.NewReader(``), token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.DELETE, openstackUrl+"/v2.0/security-groups/"+in.SecurityGroupId, strings.NewReader(``), token) if err != nil { return nil, err } diff --git a/internal/logic/deletesecuritygrouprulelogic.go b/internal/logic/deletesecuritygrouprulelogic.go index 0553a40..3ea2338 100644 --- a/internal/logic/deletesecuritygrouprulelogic.go +++ b/internal/logic/deletesecuritygrouprulelogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -36,7 +37,7 @@ func (l *DeleteSecurityGroupRuleLogic) DeleteSecurityGroupRule(in *openstack.Del } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.DELETE, openstackUrl+"/v2.0/security-groups/"+in.SecurityGroupRuleId, strings.NewReader(``), token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.DELETE, openstackUrl+"/v2.0/security-groups/"+in.SecurityGroupRuleId, strings.NewReader(``), token) if err != nil { return nil, err } diff --git a/internal/logic/deleteserverlogic.go b/internal/logic/deleteserverlogic.go index 75caf94..b704cd2 100644 --- a/internal/logic/deleteserverlogic.go +++ b/internal/logic/deleteserverlogic.go @@ -4,10 +4,11 @@ import ( "context" "fmt" "github.com/zeromicro/go-zero/core/logx" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" ) @@ -35,7 +36,7 @@ func (l *DeleteServerLogic) DeleteServer(in *openstack.DeleteServerReq) (*openst } openstackUrl := platform.OpenstackComputeUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.DELETE, openstackUrl+"/servers/"+in.ServerId, strings.NewReader(``), token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.DELETE, openstackUrl+"/servers/"+in.ServerId, strings.NewReader(``), token) if err != nil { return nil, err } diff --git a/internal/logic/deletesubnetlogic.go b/internal/logic/deletesubnetlogic.go index 8dcd460..8a90041 100644 --- a/internal/logic/deletesubnetlogic.go +++ b/internal/logic/deletesubnetlogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -37,7 +38,7 @@ func (l *DeleteSubnetLogic) DeleteSubnet(in *openstack.DeleteSubnetReq) (*openst } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.DELETE, openstackUrl+"/v2.0/subnets/"+in.SubnetId, strings.NewReader(``), token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.DELETE, openstackUrl+"/v2.0/subnets/"+in.SubnetId, strings.NewReader(``), token) if err != nil { return nil, err } diff --git a/internal/logic/deletevolumelogic.go b/internal/logic/deletevolumelogic.go index d668b18..c035cee 100644 --- a/internal/logic/deletevolumelogic.go +++ b/internal/logic/deletevolumelogic.go @@ -4,10 +4,11 @@ import ( "context" "fmt" "github.com/zeromicro/go-zero/core/logx" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" ) @@ -35,7 +36,7 @@ func (l *DeleteVolumeLogic) DeleteVolume(in *openstack.DeleteVolumeReq) (*openst return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.DELETE, openstackUrl+"/v2.0/subnets/"+in.VolumeId, strings.NewReader(``), token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.DELETE, openstackUrl+"/v2.0/subnets/"+in.VolumeId, strings.NewReader(``), token) if err != nil { return nil, err } diff --git a/internal/logic/deletevolumetypeslogic.go b/internal/logic/deletevolumetypeslogic.go index 896e56d..1ffe2ef 100644 --- a/internal/logic/deletevolumetypeslogic.go +++ b/internal/logic/deletevolumetypeslogic.go @@ -4,10 +4,11 @@ import ( "context" "fmt" "github.com/zeromicro/go-zero/core/logx" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" ) @@ -35,7 +36,7 @@ func (l *DeleteVolumeTypesLogic) DeleteVolumeTypes(in *openstack.DeleteVolumeTyp return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.DELETE, openstackUrl+"/types/"+in.VolumeTypeId, strings.NewReader(``), token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.DELETE, openstackUrl+"/types/"+in.VolumeTypeId, strings.NewReader(``), token) if err != nil { return nil, err } diff --git a/internal/logic/getcomputelimitslogic.go b/internal/logic/getcomputelimitslogic.go index bd14f94..9099c2d 100644 --- a/internal/logic/getcomputelimitslogic.go +++ b/internal/logic/getcomputelimitslogic.go @@ -4,12 +4,11 @@ import ( "context" "encoding/json" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" - "github.com/zeromicro/go-zero/core/logx" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" ) type GetComputeLimitsLogic struct { @@ -34,7 +33,7 @@ func (l *GetComputeLimitsLogic) GetComputeLimits(in *openstack.GetComputeLimitsR return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2/limits", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2/limits", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/getserversdetailedbyidlogic.go b/internal/logic/getserversdetailedbyidlogic.go index 8b074ce..22a5551 100644 --- a/internal/logic/getserversdetailedbyidlogic.go +++ b/internal/logic/getserversdetailedbyidlogic.go @@ -3,12 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "k8s.io/apimachinery/pkg/util/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -36,7 +36,7 @@ func (l *GetServersDetailedByIdLogic) GetServersDetailedById(in *openstack.GetSe return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/servers/"+in.ServerId, nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/servers/"+in.ServerId, nil, token) if err != nil { return nil, err } diff --git a/internal/logic/getvolumedetailedbyidlogic.go b/internal/logic/getvolumedetailedbyidlogic.go index 589f66e..d7632a2 100644 --- a/internal/logic/getvolumedetailedbyidlogic.go +++ b/internal/logic/getvolumedetailedbyidlogic.go @@ -3,12 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "k8s.io/apimachinery/pkg/util/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -36,7 +36,7 @@ func (l *GetVolumeDetailedByIdLogic) GetVolumeDetailedById(in *openstack.GetVolu if err != nil { return nil, err } - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/volumes/"+in.VolumeId, nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/volumes/"+in.VolumeId, nil, token) if err != nil { return nil, err } diff --git a/internal/logic/getvolumelimitslogic.go b/internal/logic/getvolumelimitslogic.go index d9274e8..1645bd5 100644 --- a/internal/logic/getvolumelimitslogic.go +++ b/internal/logic/getvolumelimitslogic.go @@ -3,13 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" "k8s.io/apimachinery/pkg/util/json" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -35,7 +34,7 @@ func (l *GetVolumeLimitsLogic) GetVolumeLimits(in *openstack.GetVolumeLimitsReq) return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/limits", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/limits", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listfirewallgroupslogic.go b/internal/logic/listfirewallgroupslogic.go index baf1455..98d3de4 100644 --- a/internal/logic/listfirewallgroupslogic.go +++ b/internal/logic/listfirewallgroupslogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" @@ -36,7 +37,7 @@ func (l *ListFirewallGroupsLogic) ListFirewallGroups(in *openstack.ListFirewallG return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/fwaas/firewall_groups", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/fwaas/firewall_groups", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listfirewallpolicieslogic.go b/internal/logic/listfirewallpolicieslogic.go index a9fb8ae..6fc7c5a 100644 --- a/internal/logic/listfirewallpolicieslogic.go +++ b/internal/logic/listfirewallpolicieslogic.go @@ -3,12 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "k8s.io/apimachinery/pkg/util/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -36,7 +36,7 @@ func (l *ListFirewallPoliciesLogic) ListFirewallPolicies(in *openstack.ListFirew return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/fwaas/firewall_policies", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/fwaas/firewall_policies", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listfirewallruleslogic.go b/internal/logic/listfirewallruleslogic.go index 2997716..73a187b 100644 --- a/internal/logic/listfirewallruleslogic.go +++ b/internal/logic/listfirewallruleslogic.go @@ -3,12 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "k8s.io/apimachinery/pkg/util/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -36,7 +36,7 @@ func (l *ListFirewallRulesLogic) ListFirewallRules(in *openstack.ListFirewallRul return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/fwaas/firewall_rules", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/fwaas/firewall_rules", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listflavorsdetaillogic.go b/internal/logic/listflavorsdetaillogic.go index 6000784..64a43e6 100644 --- a/internal/logic/listflavorsdetaillogic.go +++ b/internal/logic/listflavorsdetaillogic.go @@ -4,12 +4,11 @@ import ( "context" "encoding/json" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" - "github.com/zeromicro/go-zero/core/logx" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" ) type ListFlavorsDetailLogic struct { @@ -35,7 +34,7 @@ func (l *ListFlavorsDetailLogic) ListFlavorsDetail(in *openstack.ListFlavorsDeta return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/flavors/detail", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/flavors/detail", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listfloatingipslogic.go b/internal/logic/listfloatingipslogic.go index a9b0104..db99cd9 100644 --- a/internal/logic/listfloatingipslogic.go +++ b/internal/logic/listfloatingipslogic.go @@ -3,12 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "k8s.io/apimachinery/pkg/util/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -37,7 +37,7 @@ func (l *ListFloatingIPsLogic) ListFloatingIPs(in *openstack.ListFloatingIPsReq) } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/floatingips", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/floatingips", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listimageslogic.go b/internal/logic/listimageslogic.go index 9e60031..c289108 100644 --- a/internal/logic/listimageslogic.go +++ b/internal/logic/listimageslogic.go @@ -3,12 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "k8s.io/apimachinery/pkg/util/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -36,7 +36,7 @@ func (l *ListImagesLogic) ListImages(in *openstack.ListImagesReq) (*openstack.Li } openstackUrl := platform.OpenstackImageUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2/images", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2/images", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listnetworksegmentrangeslogic.go b/internal/logic/listnetworksegmentrangeslogic.go index 3e7b088..48b2d20 100644 --- a/internal/logic/listnetworksegmentrangeslogic.go +++ b/internal/logic/listnetworksegmentrangeslogic.go @@ -3,12 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "k8s.io/apimachinery/pkg/util/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -36,7 +36,7 @@ func (l *ListNetworkSegmentRangesLogic) ListNetworkSegmentRanges(in *openstack.L } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/network_segment_ranges", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/network_segment_ranges", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listnetworkslogic.go b/internal/logic/listnetworkslogic.go index 1658069..4439d52 100644 --- a/internal/logic/listnetworkslogic.go +++ b/internal/logic/listnetworkslogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" @@ -35,7 +36,7 @@ func (l *ListNetworksLogic) ListNetworks(in *openstack.ListNetworksReq) (*openst return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/networks", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/networks", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listnodeslogic.go b/internal/logic/listnodeslogic.go index f06a4ca..aebf666 100644 --- a/internal/logic/listnodeslogic.go +++ b/internal/logic/listnodeslogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" @@ -36,7 +37,7 @@ func (l *ListNodesLogic) ListNodes(in *openstack.ListNodesReq) (*openstack.ListN return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v1/nodes/", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v1/nodes/", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listportslogic.go b/internal/logic/listportslogic.go index daf80b7..453d1e2 100644 --- a/internal/logic/listportslogic.go +++ b/internal/logic/listportslogic.go @@ -3,12 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "k8s.io/apimachinery/pkg/util/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -36,7 +36,7 @@ func (l *ListPortsLogic) ListPorts(in *openstack.ListPortsReq) (*openstack.ListP return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/ports", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/ports", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listrouterslogic.go b/internal/logic/listrouterslogic.go index 5f2d9fe..17adc15 100644 --- a/internal/logic/listrouterslogic.go +++ b/internal/logic/listrouterslogic.go @@ -3,12 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "k8s.io/apimachinery/pkg/util/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -36,7 +36,7 @@ func (l *ListRoutersLogic) ListRouters(in *openstack.ListRoutersReq) (*openstack return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/routers", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/routers", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listsecuritygroupruleslogic.go b/internal/logic/listsecuritygroupruleslogic.go index 48509a0..c478843 100644 --- a/internal/logic/listsecuritygroupruleslogic.go +++ b/internal/logic/listsecuritygroupruleslogic.go @@ -3,12 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "k8s.io/apimachinery/pkg/util/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -37,7 +37,7 @@ func (l *ListSecurityGroupRulesLogic) ListSecurityGroupRules(in *openstack.ListS return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/security-group-rules", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/security-group-rules", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listsecuritygroupslogic.go b/internal/logic/listsecuritygroupslogic.go index 56e119d..2c1e75a 100644 --- a/internal/logic/listsecuritygroupslogic.go +++ b/internal/logic/listsecuritygroupslogic.go @@ -3,12 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "k8s.io/apimachinery/pkg/util/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -37,7 +37,7 @@ func (l *ListSecurityGroupsLogic) ListSecurityGroups(in *openstack.ListSecurityG return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/security-groups", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/security-groups", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listserversdetailedlogic.go b/internal/logic/listserversdetailedlogic.go index a5ff90d..ed6a399 100644 --- a/internal/logic/listserversdetailedlogic.go +++ b/internal/logic/listserversdetailedlogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" @@ -35,7 +36,7 @@ func (l *ListServersDetailedLogic) ListServersDetailed(in *openstack.ListServers return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/servers/detail", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/servers/detail", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listserverslogic.go b/internal/logic/listserverslogic.go index 640005f..320de07 100644 --- a/internal/logic/listserverslogic.go +++ b/internal/logic/listserverslogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" @@ -35,7 +36,7 @@ func (l *ListServersLogic) ListServers(in *openstack.ListServersReq) (*openstack return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/servers", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/servers", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listsubnetslogic.go b/internal/logic/listsubnetslogic.go index 231a819..92d44b2 100644 --- a/internal/logic/listsubnetslogic.go +++ b/internal/logic/listsubnetslogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" @@ -35,7 +36,7 @@ func (l *ListSubnetsLogic) ListSubnets(in *openstack.ListSubnetsReq) (*openstack } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/subnets", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/subnets", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listvolumesdetaillogic.go b/internal/logic/listvolumesdetaillogic.go index 337fb2f..a9739dd 100644 --- a/internal/logic/listvolumesdetaillogic.go +++ b/internal/logic/listvolumesdetaillogic.go @@ -4,12 +4,11 @@ import ( "context" "encoding/json" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" - "github.com/zeromicro/go-zero/core/logx" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" ) type ListVolumesDetailLogic struct { @@ -36,7 +35,7 @@ func (l *ListVolumesDetailLogic) ListVolumesDetail(in *openstack.ListVolumesDeta return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/volumes/detail", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/volumes/detail", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listvolumeslogic.go b/internal/logic/listvolumeslogic.go index e3b3ce1..db1b8fe 100644 --- a/internal/logic/listvolumeslogic.go +++ b/internal/logic/listvolumeslogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" @@ -37,7 +38,7 @@ func (l *ListVolumesLogic) ListVolumes(in *openstack.ListVolumesReq) (*openstack return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/volumes", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/volumes", nil, token) if err != nil { return nil, err } diff --git a/internal/logic/listvolumetypeslogic.go b/internal/logic/listvolumetypeslogic.go index 5409520..38aab49 100644 --- a/internal/logic/listvolumetypeslogic.go +++ b/internal/logic/listvolumetypeslogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" @@ -36,7 +37,7 @@ func (l *ListVolumeTypesLogic) ListVolumeTypes(in *openstack.ListVolumeTypesReq) return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/types", nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/types", nil, token) if err != nil { return nil, err diff --git a/internal/logic/migrateserverlogic.go b/internal/logic/migrateserverlogic.go index 5cb5545..f26ad1b 100644 --- a/internal/logic/migrateserverlogic.go +++ b/internal/logic/migrateserverlogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -42,7 +42,7 @@ func (l *MigrateServerLogic) MigrateServer(in *openstack.MigrateServerReq) (*ope return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/pauseserverlogic.go b/internal/logic/pauseserverlogic.go index 60d8dbe..271c5e5 100644 --- a/internal/logic/pauseserverlogic.go +++ b/internal/logic/pauseserverlogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -41,7 +42,7 @@ func (l *PauseServerLogic) PauseServer(in *openstack.PauseServerReq) (*openstack return nil, err } token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/rebootserverlogic.go b/internal/logic/rebootserverlogic.go index f4afd0d..c3edb01 100644 --- a/internal/logic/rebootserverlogic.go +++ b/internal/logic/rebootserverlogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -38,7 +39,7 @@ func (l *RebootServerLogic) RebootServer(in *openstack.RebootServerReq) (*openst } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/rebuildserverlogic.go b/internal/logic/rebuildserverlogic.go index 5516b56..eee8e35 100644 --- a/internal/logic/rebuildserverlogic.go +++ b/internal/logic/rebuildserverlogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *RebuildServerLogic) RebuildServer(in *openstack.RebuildServerReq) (*ope token := common.GetToken(in.Platform) payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackVolumev2Url - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/servers"+in.ServerId+"/action", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/servers"+in.ServerId+"/action", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/removesecuritygrouplogic.go b/internal/logic/removesecuritygrouplogic.go index 697b37e..9840be3 100644 --- a/internal/logic/removesecuritygrouplogic.go +++ b/internal/logic/removesecuritygrouplogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *RemoveSecurityGroupLogic) RemoveSecurityGroup(in *openstack.RemoveSecur token := common.GetToken(in.Platform) payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackVolumev2Url - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/servers"+in.ServerId+"/action", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/servers"+in.ServerId+"/action", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/rescueserverlogic.go b/internal/logic/rescueserverlogic.go index f7c9d13..f022e45 100644 --- a/internal/logic/rescueserverlogic.go +++ b/internal/logic/rescueserverlogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *RescueServerLogic) RescueServer(in *openstack.RescueServerReq) (*openst token := common.GetToken(in.Platform) payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackVolumev2Url - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/servers"+in.ServerId+"/action", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/servers"+in.ServerId+"/action", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/resizeserverlogic.go b/internal/logic/resizeserverlogic.go index dbb6d58..53b0769 100644 --- a/internal/logic/resizeserverlogic.go +++ b/internal/logic/resizeserverlogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *ResizeServerLogic) ResizeServer(in *openstack.ResizeServerReq) (*openst token := common.GetToken(in.Platform) payload := strings.NewReader(string(reqByte)) openstackUrl := platform.OpenstackVolumev2Url - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/servers"+in.ServerId+"/action", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/servers"+in.ServerId+"/action", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/shelveserverlogic.go b/internal/logic/shelveserverlogic.go index daa3e8f..c79a906 100644 --- a/internal/logic/shelveserverlogic.go +++ b/internal/logic/shelveserverlogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -42,7 +42,7 @@ func (l *ShelveServerLogic) ShelveServer(in *openstack.ShelveServerReq) (*openst } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/showfirewallgroupdetailslogic.go b/internal/logic/showfirewallgroupdetailslogic.go index 687bc61..9922245 100644 --- a/internal/logic/showfirewallgroupdetailslogic.go +++ b/internal/logic/showfirewallgroupdetailslogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" @@ -35,7 +36,7 @@ func (l *ShowFirewallGroupDetailsLogic) ShowFirewallGroupDetails(in *openstack.S } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/fwaas/firewall_groups/"+in.FirewallGroupId, nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/fwaas/firewall_groups/"+in.FirewallGroupId, nil, token) if err != nil { return nil, err } diff --git a/internal/logic/showfirewallpolicydetailslogic.go b/internal/logic/showfirewallpolicydetailslogic.go index 49c13a2..39ef94f 100644 --- a/internal/logic/showfirewallpolicydetailslogic.go +++ b/internal/logic/showfirewallpolicydetailslogic.go @@ -3,12 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "k8s.io/apimachinery/pkg/util/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -36,7 +36,7 @@ func (l *ShowFirewallPolicyDetailsLogic) ShowFirewallPolicyDetails(in *openstack } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/fwaas/firewall_policies/"+in.FirewallPolicyId, nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/fwaas/firewall_policies/"+in.FirewallPolicyId, nil, token) if err != nil { return nil, err } diff --git a/internal/logic/showfirewallruledetailslogic.go b/internal/logic/showfirewallruledetailslogic.go index 722ff66..316ca19 100644 --- a/internal/logic/showfirewallruledetailslogic.go +++ b/internal/logic/showfirewallruledetailslogic.go @@ -3,12 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "k8s.io/apimachinery/pkg/util/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -36,7 +36,7 @@ func (l *ShowFirewallRuleDetailsLogic) ShowFirewallRuleDetails(in *openstack.Sho } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/fwaas/firewall_rules/"+in.FirewallRuleId, nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/fwaas/firewall_rules/"+in.FirewallRuleId, nil, token) if err != nil { return nil, err } diff --git a/internal/logic/showfloatingipdetailslogic.go b/internal/logic/showfloatingipdetailslogic.go index 81d70bd..ff38156 100644 --- a/internal/logic/showfloatingipdetailslogic.go +++ b/internal/logic/showfloatingipdetailslogic.go @@ -3,12 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "k8s.io/apimachinery/pkg/util/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -36,7 +36,7 @@ func (l *ShowFloatingIPDetailsLogic) ShowFloatingIPDetails(in *openstack.ShowFlo } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/floatingips/"+in.FloatingipId, nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/floatingips/"+in.FloatingipId, nil, token) if err != nil { return nil, err } diff --git a/internal/logic/shownetworkdetailslogic.go b/internal/logic/shownetworkdetailslogic.go index 785c144..0a08f7a 100644 --- a/internal/logic/shownetworkdetailslogic.go +++ b/internal/logic/shownetworkdetailslogic.go @@ -4,10 +4,11 @@ import ( "context" "fmt" "github.com/zeromicro/go-zero/core/logx" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" ) @@ -35,7 +36,7 @@ func (l *ShowNetworkDetailsLogic) ShowNetworkDetails(in *openstack.ShowNetworkDe } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/networks/"+in.NetworkId, nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/networks/"+in.NetworkId, nil, token) if err != nil { return nil, err } diff --git a/internal/logic/shownetworksegmentrangedetailslogic.go b/internal/logic/shownetworksegmentrangedetailslogic.go index 505a1bc..818d1c8 100644 --- a/internal/logic/shownetworksegmentrangedetailslogic.go +++ b/internal/logic/shownetworksegmentrangedetailslogic.go @@ -3,13 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" "k8s.io/apimachinery/pkg/util/json" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -36,7 +35,7 @@ func (l *ShowNetworkSegmentRangeDetailsLogic) ShowNetworkSegmentRangeDetails(in } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/network_segment_ranges/"+in.NetworkSegmentRangeId, nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/network_segment_ranges/"+in.NetworkSegmentRangeId, nil, token) if err != nil { return nil, err } diff --git a/internal/logic/shownodedetailslogic.go b/internal/logic/shownodedetailslogic.go index e8c4446..48a0fce 100644 --- a/internal/logic/shownodedetailslogic.go +++ b/internal/logic/shownodedetailslogic.go @@ -4,10 +4,11 @@ import ( "context" "fmt" "github.com/zeromicro/go-zero/core/logx" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" ) @@ -34,7 +35,7 @@ func (l *ShowNodeDetailsLogic) ShowNodeDetails(in *openstack.ShowNodeDetailsReq) } openstackUrl := platform.OpenstackBareMetalUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v1/nodes/"+in.NodeIdent, nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v1/nodes/"+in.NodeIdent, nil, token) if err != nil { return nil, err } diff --git a/internal/logic/showportdetailslogic.go b/internal/logic/showportdetailslogic.go index c1e42d9..5a7a5ee 100644 --- a/internal/logic/showportdetailslogic.go +++ b/internal/logic/showportdetailslogic.go @@ -3,12 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "k8s.io/apimachinery/pkg/util/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -36,7 +36,7 @@ func (l *ShowPortDetailsLogic) ShowPortDetails(in *openstack.ShowPortDetailsReq) } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/ports/"+in.PortId, nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/ports/"+in.PortId, nil, token) if err != nil { return nil, err } diff --git a/internal/logic/showrouterdetailslogic.go b/internal/logic/showrouterdetailslogic.go index bc09182..33c70ef 100644 --- a/internal/logic/showrouterdetailslogic.go +++ b/internal/logic/showrouterdetailslogic.go @@ -3,12 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "k8s.io/apimachinery/pkg/util/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -36,7 +36,7 @@ func (l *ShowRouterDetailsLogic) ShowRouterDetails(in *openstack.ShowRouterDetai } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/routers"+in.RouterId, nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/routers"+in.RouterId, nil, token) if err != nil { return nil, err } diff --git a/internal/logic/showsecuritygrouplogic.go b/internal/logic/showsecuritygrouplogic.go index b5f8d7d..0cce7d5 100644 --- a/internal/logic/showsecuritygrouplogic.go +++ b/internal/logic/showsecuritygrouplogic.go @@ -3,12 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "k8s.io/apimachinery/pkg/util/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -36,7 +36,7 @@ func (l *ShowSecurityGroupLogic) ShowSecurityGroup(in *openstack.ShowSecurityGro } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/security-groups/"+in.SecurityGroupId, nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/security-groups/"+in.SecurityGroupId, nil, token) if err != nil { return nil, err } diff --git a/internal/logic/showsecuritygrouprulelogic.go b/internal/logic/showsecuritygrouprulelogic.go index 3e5535b..c98317c 100644 --- a/internal/logic/showsecuritygrouprulelogic.go +++ b/internal/logic/showsecuritygrouprulelogic.go @@ -3,12 +3,12 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" - "k8s.io/apimachinery/pkg/util/json" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -36,7 +36,7 @@ func (l *ShowSecurityGroupRuleLogic) ShowSecurityGroupRule(in *openstack.ShowSec } openstackUrl := platform.OpenstackNetworkUrl token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.GET, openstackUrl+"/v2.0/security-group-rules/"+in.SecurityGroupRuleId, nil, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.GET, openstackUrl+"/v2.0/security-group-rules/"+in.SecurityGroupRuleId, nil, token) if err != nil { return nil, err } diff --git a/internal/logic/startserverlogic.go b/internal/logic/startserverlogic.go index 2fc2db4..e845870 100644 --- a/internal/logic/startserverlogic.go +++ b/internal/logic/startserverlogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -41,7 +42,7 @@ func (l *StartServerLogic) StartServer(in *openstack.StartServerReq) (*openstack } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/stopserverlogic.go b/internal/logic/stopserverlogic.go index 25e76d3..fe6b8ca 100644 --- a/internal/logic/stopserverlogic.go +++ b/internal/logic/stopserverlogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -41,7 +42,7 @@ func (l *StopServerLogic) StopServer(in *openstack.StopServerReq) (*openstack.St } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/suspendserverlogic.go b/internal/logic/suspendserverlogic.go index 5a9fdd8..b7dc531 100644 --- a/internal/logic/suspendserverlogic.go +++ b/internal/logic/suspendserverlogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -42,7 +42,7 @@ func (l *SuspendServerLogic) SuspendServer(in *openstack.SuspendServerReq) (*ope } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/unpauseserverlogic.go b/internal/logic/unpauseserverlogic.go index 7993da4..6169a7d 100644 --- a/internal/logic/unpauseserverlogic.go +++ b/internal/logic/unpauseserverlogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -42,7 +42,7 @@ func (l *UnpauseServerLogic) UnpauseServer(in *openstack.UnpauseServerReq) (*ope } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/unrescuelogic.go b/internal/logic/unrescuelogic.go index 0a7cb1a..1e5e050 100644 --- a/internal/logic/unrescuelogic.go +++ b/internal/logic/unrescuelogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -42,7 +42,7 @@ func (l *UnRescueLogic) UnRescue(in *openstack.UnRescueServerReq) (*openstack.Un } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/unshelveserverlogic.go b/internal/logic/unshelveserverlogic.go index 7168c0a..a491020 100644 --- a/internal/logic/unshelveserverlogic.go +++ b/internal/logic/unshelveserverlogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -42,7 +42,7 @@ func (l *UnshelveServerLogic) UnshelveServer(in *openstack.UnshelveServerReq) (* } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/servers/"+in.ServerId+"/action", payload, token) if err != nil { return nil, err } diff --git a/internal/logic/updatefirewallgrouplogic.go b/internal/logic/updatefirewallgrouplogic.go index a97d4ea..a4cb6fc 100644 --- a/internal/logic/updatefirewallgrouplogic.go +++ b/internal/logic/updatefirewallgrouplogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *UpdateFirewallGroupLogic) UpdateFirewallGroup(in *openstack.UpdateFirew } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.PUT, openstackUrl+"/v2.0/fwaas/firewall_groups/"+in.FirewallGroupId, payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.PUT, openstackUrl+"/v2.0/fwaas/firewall_groups/"+in.FirewallGroupId, payload, token) if err != nil { return nil, err } diff --git a/internal/logic/updatefloatingiplogic.go b/internal/logic/updatefloatingiplogic.go index 104b99f..8ff8cb8 100644 --- a/internal/logic/updatefloatingiplogic.go +++ b/internal/logic/updatefloatingiplogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *UpdateFloatingIPLogic) UpdateFloatingIP(in *openstack.UpdateFloatingIPR } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.PUT, openstackUrl+"/v2.0/floatingips/"+in.FloatingipId, payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.PUT, openstackUrl+"/v2.0/floatingips/"+in.FloatingipId, payload, token) if err != nil { return nil, err } diff --git a/internal/logic/updatenetworklogic.go b/internal/logic/updatenetworklogic.go index 74f6f60..5076c9b 100644 --- a/internal/logic/updatenetworklogic.go +++ b/internal/logic/updatenetworklogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -38,7 +39,7 @@ func (l *UpdateNetworkLogic) UpdateNetwork(in *openstack.UpdateNetworkReq) (*ope } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.PUT, openstackUrl+"/v2.0/networks/"+in.NetworkId, payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.PUT, openstackUrl+"/v2.0/networks/"+in.NetworkId, payload, token) if err != nil { return nil, err } diff --git a/internal/logic/updatenetworksegmentrangeslogic.go b/internal/logic/updatenetworksegmentrangeslogic.go index 93d0d99..71cfff8 100644 --- a/internal/logic/updatenetworksegmentrangeslogic.go +++ b/internal/logic/updatenetworksegmentrangeslogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *UpdateNetworkSegmentRangesLogic) UpdateNetworkSegmentRanges(in *opensta } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.PUT, openstackUrl+"/v2.0/network_segment_ranges/"+in.NetworkSegmentRangeId, payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.PUT, openstackUrl+"/v2.0/network_segment_ranges/"+in.NetworkSegmentRangeId, payload, token) if err != nil { return nil, err } diff --git a/internal/logic/updateportlogic.go b/internal/logic/updateportlogic.go index 7d3ac45..f72d9a4 100644 --- a/internal/logic/updateportlogic.go +++ b/internal/logic/updateportlogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *UpdatePortLogic) UpdatePort(in *openstack.UpdatePortReq) (*openstack.Up } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.PUT, openstackUrl+"/v2.0/ports/"+in.PortId, payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.PUT, openstackUrl+"/v2.0/ports/"+in.PortId, payload, token) if err != nil { return nil, err } diff --git a/internal/logic/updaterouterlogic.go b/internal/logic/updaterouterlogic.go index 6c703ac..4ca4c80 100644 --- a/internal/logic/updaterouterlogic.go +++ b/internal/logic/updaterouterlogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *UpdateRouterLogic) UpdateRouter(in *openstack.UpdateRouterReq) (*openst } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.PUT, openstackUrl+"/v2.0/routers/"+in.RouterId, payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.PUT, openstackUrl+"/v2.0/routers/"+in.RouterId, payload, token) if err != nil { return nil, err } diff --git a/internal/logic/updatesecuritygrouplogic.go b/internal/logic/updatesecuritygrouplogic.go index 4c5a0cb..5872428 100644 --- a/internal/logic/updatesecuritygrouplogic.go +++ b/internal/logic/updatesecuritygrouplogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *UpdateSecurityGroupLogic) UpdateSecurityGroup(in *openstack.UpdateSecur } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.PUT, openstackUrl+"/v2.0/security-groups/"+in.SecurityGroupId, payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.PUT, openstackUrl+"/v2.0/security-groups/"+in.SecurityGroupId, payload, token) if err != nil { return nil, err } diff --git a/internal/logic/updateserverlogic.go b/internal/logic/updateserverlogic.go index a6587dc..1c82f12 100644 --- a/internal/logic/updateserverlogic.go +++ b/internal/logic/updateserverlogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -39,7 +40,7 @@ func (l *UpdateServerLogic) UpdateServer(in *openstack.UpdateServerReq) (*openst } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.PUT, openstackUrl+"/servers/"+in.ServerId, payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.PUT, openstackUrl+"/servers/"+in.ServerId, payload, token) if err != nil { return nil, err } diff --git a/internal/logic/updatesubnetlogic.go b/internal/logic/updatesubnetlogic.go index 795b255..a034295 100644 --- a/internal/logic/updatesubnetlogic.go +++ b/internal/logic/updatesubnetlogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *UpdateSubnetLogic) UpdateSubnet(in *openstack.UpdateSubnetReq) (*openst } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.PUT, openstackUrl+"/v2.0/subnets/"+in.SubnetId, payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.PUT, openstackUrl+"/v2.0/subnets/"+in.SubnetId, payload, token) if err != nil { return nil, err } diff --git a/internal/logic/updatevolumelogic.go b/internal/logic/updatevolumelogic.go index 70979b4..17afe48 100644 --- a/internal/logic/updatevolumelogic.go +++ b/internal/logic/updatevolumelogic.go @@ -3,10 +3,11 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" @@ -38,7 +39,7 @@ func (l *UpdateVolumeLogic) UpdateVolume(in *openstack.UpdateVolumeReq) (*openst } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.PUT, openstackUrl+"/types"+in.VolumeId, payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.PUT, openstackUrl+"/types"+in.VolumeId, payload, token) if err != nil { return nil, err } diff --git a/internal/logic/uploadimagelogic.go b/internal/logic/uploadimagelogic.go index 94452b0..ae0942f 100644 --- a/internal/logic/uploadimagelogic.go +++ b/internal/logic/uploadimagelogic.go @@ -3,14 +3,14 @@ package logic import ( "context" "fmt" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "strings" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/core/logx" ) @@ -39,7 +39,7 @@ func (l *UploadImageLogic) UploadImage(in *openstack.UploadOsImageReq) (*opensta } payload := strings.NewReader(string(reqByte)) token := common.GetToken(in.Platform) - statusCode, body, err := tool.HttpClientWithBodyAndCode(tool.POST, openstackUrl+"/servers", payload, token) + statusCode, body, err := httputils.HttpClientWithBodyAndCode(httputils.POST, openstackUrl+"/servers", payload, token) if err != nil { return nil, err } diff --git a/internal/pkg/cron/checkhealthcron.go b/internal/pkg/cron/checkhealthcron.go index 2975c45..255e601 100644 --- a/internal/pkg/cron/checkhealthcron.go +++ b/internal/pkg/cron/checkhealthcron.go @@ -3,12 +3,12 @@ package cron import ( "context" "github.com/zeromicro/go-zero/core/logx" - "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/client/participantservice" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-coordinator/rpc/client/participantservice" ) func ReportHeartbeat(address string, participantRpc participantservice.ParticipantService) { - participantId, err := tool.GetParticipantId("etc/pcmopenstack.yaml") + participantId, err := utils.GetParticipantId("etc/pcmopenstack.yaml") if err != nil { logx.Errorf("获取participant id失败! err:", err) return diff --git a/internal/pkg/cron/cron.go b/internal/pkg/cron/cron.go index bfb25f5..70aa6a5 100644 --- a/internal/pkg/cron/cron.go +++ b/internal/pkg/cron/cron.go @@ -1,8 +1,6 @@ package cron -import ( - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" -) +import "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" func AddCronGroup(svc *svc.ServiceContext) { // 同步任务信息到core端 diff --git a/internal/pkg/cron/taskcron.go b/internal/pkg/cron/taskcron.go index 4ea6400..4cac319 100644 --- a/internal/pkg/cron/taskcron.go +++ b/internal/pkg/cron/taskcron.go @@ -3,15 +3,15 @@ package cron import ( "context" "github.com/zeromicro/go-zero/core/logx" - "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/client/pcmcore" - "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/pcmCore" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-coordinator/rpc/client/pcmcore" + "gitlink.org.cn/JointCloud/pcm-coordinator/rpc/pcmCore" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" ) func SyncTask(svc *svc.ServiceContext) { var vmList []*pcmcore.VmInfo - participantId, err := tool.GetParticipantId("etc/pcmopenstack.yaml") + participantId, err := utils.GetParticipantId("etc/pcmopenstack.yaml") if err != nil { logx.Errorf("获取participant id失败! err:", err) return @@ -27,7 +27,7 @@ func SyncTask(svc *svc.ServiceContext) { } if infoList != nil && len(infoList.VmInfoList) != 0 { - tool.Convert(&infoList.VmInfoList, &vmList) + utils.Convert(&infoList.VmInfoList, &vmList) if err != nil { logx.Error(err) return diff --git a/internal/server/openstackserver.go b/internal/server/openstackserver.go index e4187cf..f67c2ba 100644 --- a/internal/server/openstackserver.go +++ b/internal/server/openstackserver.go @@ -5,10 +5,9 @@ package server import ( "context" - - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/logic" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/logic" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" ) type OpenstackServer struct { diff --git a/internal/svc/servicecontext.go b/internal/svc/servicecontext.go index 5c3094e..7e25ce7 100644 --- a/internal/svc/servicecontext.go +++ b/internal/svc/servicecontext.go @@ -3,9 +3,9 @@ package svc import ( "github.com/robfig/cron/v3" "github.com/zeromicro/go-zero/zrpc" - "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/client/participantservice" - "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/client/pcmcore" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/config" + "gitlink.org.cn/JointCloud/pcm-coordinator/rpc/client/participantservice" + "gitlink.org.cn/JointCloud/pcm-coordinator/rpc/client/pcmcore" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/config" ) type ServiceContext struct { diff --git a/openstackclient/openstack.go b/openstackclient/openstack.go index 3bfdb18..5aefea5 100644 --- a/openstackclient/openstack.go +++ b/openstackclient/openstack.go @@ -6,8 +6,6 @@ package openstackclient import ( "context" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "github.com/zeromicro/go-zero/zrpc" "google.golang.org/grpc" ) diff --git a/pcmopenstack.go b/pcmopenstack.go index d088998..2e3b894 100644 --- a/pcmopenstack.go +++ b/pcmopenstack.go @@ -7,15 +7,16 @@ import ( "github.com/zeromicro/go-zero/core/logx" "github.com/zeromicro/go-zero/core/service" "github.com/zeromicro/go-zero/zrpc" - "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/client/participantservice" - "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/pcmCore" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/common" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/config" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/pkg/cron" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/server" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/internal/svc" - "gitlink.org.cn/jcce-pcm/pcm-participant-openstack/openstack" - "gitlink.org.cn/jcce-pcm/utils/tool" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-coordinator/rpc/client/participantservice" + "gitlink.org.cn/JointCloud/pcm-coordinator/rpc/pcmCore" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/common" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/config" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/pkg/cron" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/server" + "gitlink.org.cn/JointCloud/pcm-openstack/internal/svc" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "google.golang.org/grpc" "google.golang.org/grpc/reflection" "strconv" @@ -70,7 +71,7 @@ func main() { // PushParticipantInfo 推送p端静态信息 func PushParticipantInfo(config config.Config, participantService participantservice.ParticipantService) { - participantId, err := tool.GetParticipantId(*&common.FileName) + participantId, err := utils.GetParticipantId(*&common.FileName) if err != nil { return } @@ -84,7 +85,7 @@ func PushParticipantInfo(config config.Config, participantService participantser }) } req := participantservice.ParticipantPhyReq{} - tool.Convert(config.Participant, &req) + utils.Convert(config.Participant, &req) req.ParticipantId = participantId req.LabelInfo = labels // @@ -94,5 +95,5 @@ func PushParticipantInfo(config config.Config, participantService participantser } // 更新本地配置文件ParticipantId - tool.UpdateParticipantId(*&common.FileName, strconv.FormatInt(resp.ParticipantId, 10)) + utils.UpdateParticipantId(*&common.FileName, strconv.FormatInt(resp.ParticipantId, 10)) }