dependence

This commit is contained in:
zhangwei 2024-03-01 15:46:42 +08:00
parent e6c36af34f
commit 27789653c1
106 changed files with 624 additions and 581 deletions

7
go.mod
View File

@ -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

29
go.sum
View File

@ -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=

View File

@ -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"

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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 {

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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

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