From bd3c8e71e55b6f4515b8db5df104495509f8405e Mon Sep 17 00:00:00 2001 From: devad Date: Sat, 2 Apr 2022 18:19:56 +0800 Subject: [PATCH 1/4] refactor Signed-off-by: devad --- common/tenanter/main_test.go | 3 +-- configs/{config.yaml => config_template.yaml} | 0 main.go | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) rename configs/{config.yaml => config_template.yaml} (100%) diff --git a/common/tenanter/main_test.go b/common/tenanter/main_test.go index 2a52f726..20889881 100644 --- a/common/tenanter/main_test.go +++ b/common/tenanter/main_test.go @@ -1,10 +1,9 @@ package tenanter import ( + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbtenant" "os" "testing" - - "PCM/lan_trans/go/idl/pbtenant" ) var ( diff --git a/configs/config.yaml b/configs/config_template.yaml similarity index 100% rename from configs/config.yaml rename to configs/config_template.yaml diff --git a/main.go b/main.go index 1a4bef8a..db7f3d78 100644 --- a/main.go +++ b/main.go @@ -43,7 +43,7 @@ func run() error { func main() { var configFile string - flag.StringVar(&configFile, "conf", "config.yaml", "configs/config.yaml") + flag.StringVar(&configFile, "conf", "configs/config.yaml", "config.yaml") flag.Parse() defer glog.Flush() From a8e7c3cb47c90d46a50492e8116ed5a27a4b11f1 Mon Sep 17 00:00:00 2001 From: devad Date: Mon, 4 Apr 2022 19:09:27 +0800 Subject: [PATCH 2/4] Add pod list Signed-off-by: devad --- adaptor/cm_adaptor/cm_adaptor | 0 adaptor/func_api_adaptor/func_api_adaptor | 0 adaptor/pod_adaptor/server/pod/list.go | 128 ++ adaptor/pod_adaptor/server/pod/list_test.go | 83 ++ adaptor/pod_adaptor/server/pod/main_test.go | 33 + adaptor/pod_adaptor/service/poder/ali.go | 95 ++ .../pod_adaptor/service/poder/main_test.go | 33 + adaptor/pod_adaptor/service/poder/poder.go | 46 + .../pod_adaptor/service/poder/poder_test.go | 70 ++ adaptor/vm_adaptor/server/ecs/list.go | 7 +- adaptor/vm_adaptor/vm_adaptor | 0 common/server/server.go | 4 + common/server/server_ecs.go | 4 + common/server/server_pod.go | 32 + go.mod | 3 + idl/pbecs/ecs.proto | 2 +- idl/pbpod/pod.proto | 163 +++ idl/pbtenant/tenant.proto | 4 +- lan_trans/idl/pbecs/ecs.pb.go | 2 +- lan_trans/idl/pbpod/pod.pb.go | 1102 +++++++++++++++++ lan_trans/idl/pbpod/pod.pb.gw.go | 329 +++++ lan_trans/idl/pbpod/pod_grpc.pb.go | 183 +++ lan_trans/idl/pbtenant/tenant.pb.go | 235 ++-- .../openapiv2/idl/demo/demo.swagger.json | 99 ++ .../idl/pbecs/ecs.swagger.json} | 286 ++--- .../openapiv2/idl/pbpod/pod.swagger.json | 436 +++++++ .../idl/pbtenant/tenant.swagger.json | 46 + main.go | 12 +- 28 files changed, 3145 insertions(+), 292 deletions(-) delete mode 100644 adaptor/cm_adaptor/cm_adaptor delete mode 100644 adaptor/func_api_adaptor/func_api_adaptor create mode 100644 adaptor/pod_adaptor/server/pod/list.go create mode 100644 adaptor/pod_adaptor/server/pod/list_test.go create mode 100644 adaptor/pod_adaptor/server/pod/main_test.go create mode 100644 adaptor/pod_adaptor/service/poder/ali.go create mode 100644 adaptor/pod_adaptor/service/poder/main_test.go create mode 100644 adaptor/pod_adaptor/service/poder/poder.go create mode 100644 adaptor/pod_adaptor/service/poder/poder_test.go delete mode 100644 adaptor/vm_adaptor/vm_adaptor create mode 100644 common/server/server_pod.go create mode 100644 idl/pbpod/pod.proto create mode 100644 lan_trans/idl/pbpod/pod.pb.go create mode 100644 lan_trans/idl/pbpod/pod.pb.gw.go create mode 100644 lan_trans/idl/pbpod/pod_grpc.pb.go create mode 100644 lan_trans/openapiv2/idl/demo/demo.swagger.json rename lan_trans/{swagger.json => openapiv2/idl/pbecs/ecs.swagger.json} (80%) create mode 100644 lan_trans/openapiv2/idl/pbpod/pod.swagger.json create mode 100644 lan_trans/openapiv2/idl/pbtenant/tenant.swagger.json diff --git a/adaptor/cm_adaptor/cm_adaptor b/adaptor/cm_adaptor/cm_adaptor deleted file mode 100644 index e69de29b..00000000 diff --git a/adaptor/func_api_adaptor/func_api_adaptor b/adaptor/func_api_adaptor/func_api_adaptor deleted file mode 100644 index e69de29b..00000000 diff --git a/adaptor/pod_adaptor/server/pod/list.go b/adaptor/pod_adaptor/server/pod/list.go new file mode 100644 index 00000000..1664d999 --- /dev/null +++ b/adaptor/pod_adaptor/server/pod/list.go @@ -0,0 +1,128 @@ +package pod + +import ( + "context" + "sync" + + "gitlink.org.cn/JCCE/PCM/adaptor/pod_adaptor/service/poder" + "gitlink.org.cn/JCCE/PCM/common/tenanter" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbpod" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbtenant" + + "github.com/golang/glog" + "github.com/pkg/errors" +) + +//ListDetail returns the detail of pod instances +func ListDetail(ctx context.Context, req *pbpod.ListDetailReq) (*pbpod.ListDetailResp, error) { + var ( + pod poder.Poder + ) + + tenanters, err := tenanter.GetTenanters(req.Provider) + if err != nil { + return nil, errors.WithMessage(err, "getTenanters error") + } + + region, err := tenanter.NewRegion(req.Provider, req.RegionId) + if err != nil { + return nil, errors.WithMessagef(err, "provider %v regionId %v", req.Provider, req.RegionId) + } + + for _, tenanter := range tenanters { + if req.AccountName == "" || tenanter.AccountName() == req.AccountName { + if pod, err = poder.NewPodClient(req.Provider, region, tenanter); err != nil { + return nil, errors.WithMessage(err, "NewPodClient error") + } + break + } + } + + return pod.ListDetail(ctx, req) +} + +//List returns the list of pod instances +func List(ctx context.Context, req *pbpod.ListReq) (*pbpod.ListResp, error) { + var ( + wg sync.WaitGroup + mutex sync.Mutex + podes []*pbpod.PodInstance + ) + + tenanters, err := tenanter.GetTenanters(req.Provider) + if err != nil { + return nil, errors.WithMessage(err, "getTenanters error") + } + + regions := tenanter.GetAllRegionIds(req.Provider) + + wg.Add(len(tenanters) * len(regions)) + for _, t := range tenanters { + for _, region := range regions { + go func(tenant tenanter.Tenanter, region tenanter.Region) { + defer wg.Done() + pod, err := poder.NewPodClient(req.Provider, region, tenant) + if err != nil { + glog.Errorf("New Pod Client error %v", err) + return + } + + request := &pbpod.ListDetailReq{ + Provider: req.Provider, + AccountName: tenant.AccountName(), + RegionId: region.GetId(), + PageNumber: 1, + PageSize: 20, + NextToken: "", + } + for { + resp, err := pod.ListDetail(ctx, request) + if err != nil { + glog.Errorf("ListDetail error %v", err) + return + } + mutex.Lock() + podes = append(podes, resp.Pods...) + mutex.Unlock() + if resp.Finished { + break + } + request.PageNumber, request.PageSize, request.NextToken = resp.PageNumber, resp.PageSize, resp.NextToken + } + }(t, region) + } + } + wg.Wait() + + return &pbpod.ListResp{Pods: podes}, nil +} + +// ListAll returns all pod instances +func ListAll(ctx context.Context) (*pbpod.ListResp, error) { + var ( + wg sync.WaitGroup + mutex sync.Mutex + podes []*pbpod.PodInstance + ) + + wg.Add(len(pbtenant.CloudProvider_name)) + for k := range pbtenant.CloudProvider_name { + go func(provider int32) { + defer wg.Done() + + resp, err := List(ctx, &pbpod.ListReq{Provider: pbtenant.CloudProvider(provider)}) + if err != nil { + glog.Errorf("List error %v", err) + return + } + + mutex.Lock() + podes = append(podes, resp.Pods...) + mutex.Unlock() + }(k) + } + + wg.Wait() + + return &pbpod.ListResp{Pods: podes}, nil +} diff --git a/adaptor/pod_adaptor/server/pod/list_test.go b/adaptor/pod_adaptor/server/pod/list_test.go new file mode 100644 index 00000000..9009dfd7 --- /dev/null +++ b/adaptor/pod_adaptor/server/pod/list_test.go @@ -0,0 +1,83 @@ +package pod + +import ( + "context" + "testing" + + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbpod" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbtenant" +) + +func TestListDetail(t *testing.T) { + type args struct { + req *pbpod.ListDetailReq + } + tests := []struct { + name string + args args + wantErr bool + }{ + {name: "ali", args: args{req: &pbpod.ListDetailReq{Provider: pbtenant.CloudProvider_ali, RegionId: int32(pbtenant.AliRegionId_ali_cn_hangzhou), PageNumber: 1, PageSize: 10}}, wantErr: false}, + {name: "tencent", args: args{req: &pbpod.ListDetailReq{Provider: pbtenant.CloudProvider_tencent, RegionId: int32(pbtenant.TencentRegionId_tc_ap_beijing), PageNumber: 1, PageSize: 10}}, wantErr: false}, + {name: "aws", args: args{req: &pbpod.ListDetailReq{Provider: pbtenant.CloudProvider_aws, RegionId: int32(pbtenant.AwsRegionId_aws_us_east_2), PageNumber: 1, PageSize: 10}}, wantErr: false}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := ListDetail(context.Background(), tt.args.req) + if (err != nil) != tt.wantErr { + t.Errorf("ListDetail() error = %+v, wantErr %v", err, tt.wantErr) + return + } + t.Log(got) + }) + } +} + +func TestList(t *testing.T) { + type args struct { + req *pbpod.ListReq + } + tests := []struct { + name string + args args + wantErr bool + }{ + {name: "ali", args: args{req: &pbpod.ListReq{Provider: pbtenant.CloudProvider_ali}}, wantErr: false}, + {name: "tencent", args: args{req: &pbpod.ListReq{Provider: pbtenant.CloudProvider_tencent}}, wantErr: false}, + {name: "huawei", args: args{req: &pbpod.ListReq{Provider: pbtenant.CloudProvider_huawei}}, wantErr: false}, + {name: "aws", args: args{req: &pbpod.ListReq{Provider: pbtenant.CloudProvider_aws}}, wantErr: false}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := List(context.Background(), tt.args.req) + if (err != nil) != tt.wantErr { + t.Errorf("List() error = %+v, wantErr %v", err, tt.wantErr) + return + } + t.Log(got) + }) + } +} + +func TestListAll(t *testing.T) { + type args struct { + req *pbpod.ListReq + } + tests := []struct { + name string + args args + wantErr bool + }{ + {name: "all", args: args{req: &pbpod.ListReq{}}, wantErr: false}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := ListAll(context.Background()) + if (err != nil) != tt.wantErr { + t.Errorf("ListAll() error = %+v, wantErr %v", err, tt.wantErr) + return + } + t.Log(got) + }) + } +} diff --git a/adaptor/pod_adaptor/server/pod/main_test.go b/adaptor/pod_adaptor/server/pod/main_test.go new file mode 100644 index 00000000..8b7a4d0f --- /dev/null +++ b/adaptor/pod_adaptor/server/pod/main_test.go @@ -0,0 +1,33 @@ +package pod + +import ( + "os" + "testing" + + "gitlink.org.cn/JCCE/PCM/common/tenanter" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbtenant" +) + +var ( + aliTenant, tcTenant, hwTenant, awsTenant []tenanter.Tenanter +) + +func TestMain(m *testing.M) { + err := tenanter.LoadCloudConfigs("../../../../configs/config.yaml") + if err != nil { + panic(err) + } + if aliTenant, err = tenanter.GetTenanters(pbtenant.CloudProvider_ali); err != nil { + panic("get aliTenant failed") + } + if tcTenant, err = tenanter.GetTenanters(pbtenant.CloudProvider_tencent); err != nil { + panic("get tcTenant failed") + } + if hwTenant, err = tenanter.GetTenanters(pbtenant.CloudProvider_huawei); err != nil { + panic("get hwTenant failed") + } + //if awsTenant, err = tenanter.GetTenanters(pbtenant.CloudProvider_aws); err != nil { + // panic("get awsTenant failed") + //} + os.Exit(m.Run()) +} diff --git a/adaptor/pod_adaptor/service/poder/ali.go b/adaptor/pod_adaptor/service/poder/ali.go new file mode 100644 index 00000000..90e2e687 --- /dev/null +++ b/adaptor/pod_adaptor/service/poder/ali.go @@ -0,0 +1,95 @@ +package poder + +import ( + "context" + "sync" + + "gitlink.org.cn/JCCE/PCM/common/tenanter" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbpod" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbtenant" + + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + alipod "github.com/aliyun/alibaba-cloud-sdk-go/services/eci" + "github.com/pkg/errors" +) + +var aliClientMutex sync.Mutex + +type AliPod struct { + cli *alipod.Client + region tenanter.Region + tenanter tenanter.Tenanter +} + +func newAliPodClient(region tenanter.Region, tenant tenanter.Tenanter) (Poder, error) { + var ( + client *alipod.Client + err error + ) + + switch t := tenant.(type) { + case *tenanter.AccessKeyTenant: + // 阿里云的sdk有一个 map 的并发问题,go test 加上-race 能检测出来,所以这里加一个锁 + aliClientMutex.Lock() + client, err = alipod.NewClientWithAccessKey(region.GetName(), t.GetId(), t.GetSecret()) + aliClientMutex.Unlock() + default: + } + + if err != nil { + return nil, errors.Wrap(err, "init ali pod client error") + } + + return &AliPod{ + cli: client, + region: region, + tenanter: tenant, + }, nil +} + +func (pod *AliPod) ListDetail(ctx context.Context, req *pbpod.ListDetailReq) (*pbpod.ListDetailResp, error) { + request := alipod.CreateDescribeContainerGroupsRequest() + request.Limit = requests.NewInteger(int(req.PageSize)) + request.RegionId = pod.region.GetName() + request.NextToken = req.NextToken + resp, err := pod.cli.DescribeContainerGroups(request) + if err != nil { + return nil, errors.Wrap(err, "Aliyun ListDetail error") + } + + var podes = make([]*pbpod.PodInstance, len(resp.ContainerGroups)) + for k, v := range resp.ContainerGroups { + podes[k] = &pbpod.PodInstance{ + Provider: pbtenant.CloudProvider_ali, + AccountName: pod.tenanter.AccountName(), + InstanceId: v.ContainerGroupId, + InstanceName: v.ContainerGroupName, + RegionName: pod.region.GetName(), + PublicIps: v.InternetIp, + InstanceType: v.InstanceType, + Cpu: int32(v.Cpu), + Memory: int32(v.Memory), + //Description: v.Description, + Status: v.Status, + CreationTime: v.CreationTime, + ExpireTime: v.ExpiredTime, + //InnerIps: v.IntranetIp, + VpcId: v.VpcId, + //SecurityGroupId: v.SecurityGroupId + } + } + + isFinished := false + if len(podes) < int(req.PageSize) { + isFinished = true + } + + return &pbpod.ListDetailResp{ + Pods: podes, + Finished: isFinished, + PageNumber: req.PageNumber + 1, + PageSize: req.PageSize, + NextToken: resp.NextToken, + RequestId: resp.RequestId, + }, nil +} diff --git a/adaptor/pod_adaptor/service/poder/main_test.go b/adaptor/pod_adaptor/service/poder/main_test.go new file mode 100644 index 00000000..49f63e78 --- /dev/null +++ b/adaptor/pod_adaptor/service/poder/main_test.go @@ -0,0 +1,33 @@ +package poder + +import ( + "os" + "testing" + + "gitlink.org.cn/JCCE/PCM/common/tenanter" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbtenant" +) + +var ( + aliTenant, tcTenant, hwTenant, awsTenant []tenanter.Tenanter +) + +func TestMain(m *testing.M) { + err := tenanter.LoadCloudConfigs("../../../config.yaml") + if err != nil { + panic(err) + } + if aliTenant, err = tenanter.GetTenanters(pbtenant.CloudProvider_ali); err != nil { + panic("get aliTenant failed") + } + if tcTenant, err = tenanter.GetTenanters(pbtenant.CloudProvider_tencent); err != nil { + panic("get tcTenant failed") + } + if hwTenant, err = tenanter.GetTenanters(pbtenant.CloudProvider_huawei); err != nil { + panic("get hwTenant failed") + } + if awsTenant, err = tenanter.GetTenanters(pbtenant.CloudProvider_aws); err != nil { + panic("get awsTenant failed") + } + os.Exit(m.Run()) +} diff --git a/adaptor/pod_adaptor/service/poder/poder.go b/adaptor/pod_adaptor/service/poder/poder.go new file mode 100644 index 00000000..a5a03ea2 --- /dev/null +++ b/adaptor/pod_adaptor/service/poder/poder.go @@ -0,0 +1,46 @@ +package poder + +import ( + "context" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbpod" + + "gitlink.org.cn/JCCE/PCM/common/tenanter" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbtenant" + + "github.com/golang/glog" + "github.com/pkg/errors" +) + +var ( + ErrPodListNotSupported = errors.New("cloud not supported pod list") + ErrPoderPanic = errors.New("pod init panic") +) + +type Poder interface { + ListDetail(ctx context.Context, req *pbpod.ListDetailReq) (resp *pbpod.ListDetailResp, err error) +} + +func NewPodClient(provider pbtenant.CloudProvider, region tenanter.Region, tenant tenanter.Tenanter) (poder Poder, err error) { + // 部分sdk会在内部panic + defer func() { + if err1 := recover(); err1 != nil { + glog.Errorf("NewPodClient panic %v", err1) + err = errors.WithMessagef(ErrPoderPanic, "%v", err1) + } + }() + + switch provider { + case pbtenant.CloudProvider_ali: + return newAliPodClient(region, tenant) + //case pbtenant.CloudProvider_tencent: + // return newTencentPodClient(region, tenant) + //case pbtenant.CloudProvider_huawei: + // return newHuaweiPodClient(region, tenant) + //TODO aws + //case pbtenant.CloudProvider_aws: + // return newAwsPodClient(region, tenant) + } + + err = errors.WithMessagef(ErrPodListNotSupported, "cloud provider %v region %v", provider, region) + return +} diff --git a/adaptor/pod_adaptor/service/poder/poder_test.go b/adaptor/pod_adaptor/service/poder/poder_test.go new file mode 100644 index 00000000..8ab40768 --- /dev/null +++ b/adaptor/pod_adaptor/service/poder/poder_test.go @@ -0,0 +1,70 @@ +package poder + +import ( + "context" + "testing" + + "gitlink.org.cn/JCCE/PCM/common/tenanter" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbecs" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbtenant" +) + +func TestEcser_ListDetail(t *testing.T) { + region, _ := tenanter.NewRegion(pbtenant.CloudProvider_ali, int32(pbtenant.AliRegionId_ali_cn_hangzhou)) + ali, _ := NewEcsClient(pbtenant.CloudProvider_ali, region, aliTenant[0]) + aliFailed, _ := NewEcsClient(pbtenant.CloudProvider_ali, region, tenanter.NewTenantWithAccessKey("empty", "", "")) + + region, _ = tenanter.NewRegion(pbtenant.CloudProvider_tencent, int32(pbtenant.TencentRegionId_tc_ap_beijing)) + tc, _ := NewEcsClient(pbtenant.CloudProvider_tencent, region, tcTenant[0]) + tcFailed, _ := NewEcsClient(pbtenant.CloudProvider_tencent, region, tenanter.NewTenantWithAccessKey("empty", "", "")) + + region, _ = tenanter.NewRegion(pbtenant.CloudProvider_huawei, int32(pbtenant.HuaweiRegionId_hw_cn_southwest_2)) + hw, _ := NewEcsClient(pbtenant.CloudProvider_huawei, region, hwTenant[0]) + // hwFailed, _ := newHuaweiEcsClient(int32(pbtenant.HuaweiRegionId_hw_cn_north_1), tenanter.NewTenantWithAccessKey("empty", "", "", "")) + + region, _ = tenanter.NewRegion(pbtenant.CloudProvider_aws, int32(pbtenant.AwsRegionId_aws_us_east_2)) + aws, _ := NewEcsClient(pbtenant.CloudProvider_aws, region, awsTenant[0]) + + // google, _ := NewGoogleEcsClient(tenanter.NewTenantWithAccessKey("", "")) + + type args struct { + req *pbecs.ListDetailReq + } + tests := []struct { + name string + fields Ecser + args args + wantErr bool + }{ + {name: "ali wrong cli", fields: aliFailed, args: args{&pbecs.ListDetailReq{PageNumber: 1, PageSize: 1}}, wantErr: true}, + {name: "ali wrong page number", fields: ali, args: args{&pbecs.ListDetailReq{PageNumber: 0, PageSize: 1}}, wantErr: true}, + {name: "ali wrong page size", fields: ali, args: args{&pbecs.ListDetailReq{PageNumber: 1, PageSize: 0}}, wantErr: true}, + {name: "ali right cli", fields: ali, args: args{&pbecs.ListDetailReq{PageNumber: 1, PageSize: 10}}, wantErr: false}, + + {name: "tc wrong cli", fields: tcFailed, args: args{&pbecs.ListDetailReq{PageNumber: 1, PageSize: 1}}, wantErr: true}, + {name: "tc wrong page number", fields: tc, args: args{&pbecs.ListDetailReq{PageNumber: 0, PageSize: 1}}, wantErr: true}, + {name: "tc wrong page size", fields: tc, args: args{&pbecs.ListDetailReq{PageNumber: 1, PageSize: 0}}, wantErr: true}, + {name: "tc right cli", fields: tc, args: args{&pbecs.ListDetailReq{PageNumber: 1, PageSize: 10}}, wantErr: false}, + + // {name: "hw wrong cli", fields: hwFailed, args: args{pageNumber: 1, pageSize: 1}, wantErr: true}, + {name: "hw right cli", fields: hw, args: args{&pbecs.ListDetailReq{PageNumber: 1, PageSize: 10}}, wantErr: false}, + + {name: "aws right cli", fields: aws, args: args{&pbecs.ListDetailReq{PageNumber: 1, PageSize: 10}}, wantErr: false}, + + // {name: "right cli", fields: google, args: args{pageNumber: 1, pageSize: 10}, wantErr: false}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + resp, err := tt.fields.ListDetail(context.Background(), tt.args.req) + if (err != nil) != tt.wantErr { + t.Errorf("ListDetail() error = %+v, wantErr %v", err, tt.wantErr) + return + } + t.Logf("%+v", err) + if err == nil { + t.Log(resp) + } + }) + } +} diff --git a/adaptor/vm_adaptor/server/ecs/list.go b/adaptor/vm_adaptor/server/ecs/list.go index e73fc492..4910faf7 100644 --- a/adaptor/vm_adaptor/server/ecs/list.go +++ b/adaptor/vm_adaptor/server/ecs/list.go @@ -2,16 +2,18 @@ package ecs import ( "context" + "sync" + "gitlink.org.cn/JCCE/PCM/adaptor/vm_adaptor/service/ecser" "gitlink.org.cn/JCCE/PCM/common/tenanter" "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbecs" "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbtenant" - "sync" "github.com/golang/glog" "github.com/pkg/errors" ) +//ListDetail returns the detail of ecs instances func ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (*pbecs.ListDetailResp, error) { var ( ecs ecser.Ecser @@ -39,6 +41,7 @@ func ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (*pbecs.ListDetai return ecs.ListDetail(ctx, req) } +//List returns the list of ecs instances func List(ctx context.Context, req *pbecs.ListReq) (*pbecs.ListResp, error) { var ( wg sync.WaitGroup @@ -87,7 +90,6 @@ func List(ctx context.Context, req *pbecs.ListReq) (*pbecs.ListResp, error) { request.PageNumber, request.PageSize, request.NextToken = resp.PageNumber, resp.PageSize, resp.NextToken } }(t, region) - } } wg.Wait() @@ -95,6 +97,7 @@ func List(ctx context.Context, req *pbecs.ListReq) (*pbecs.ListResp, error) { return &pbecs.ListResp{Ecses: ecses}, nil } +// ListAll returns all ecs instances func ListAll(ctx context.Context) (*pbecs.ListResp, error) { var ( wg sync.WaitGroup diff --git a/adaptor/vm_adaptor/vm_adaptor b/adaptor/vm_adaptor/vm_adaptor deleted file mode 100644 index e69de29b..00000000 diff --git a/common/server/server.go b/common/server/server.go index 5965160c..cb70570a 100644 --- a/common/server/server.go +++ b/common/server/server.go @@ -2,6 +2,9 @@ package server import ( "context" + + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbpod" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/demo" "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbecs" ) @@ -10,6 +13,7 @@ type Server struct { // 使用unsafe可以强制让编译器检查是否实现了相关方法 demo.UnsafeDemoServiceServer pbecs.UnsafeEcsServiceServer + pbpod.UnimplementedPodServiceServer } func (s *Server) Echo(ctx context.Context, req *demo.StringMessage) (*demo.StringMessage, error) { diff --git a/common/server/server_ecs.go b/common/server/server_ecs.go index 0cb931d0..9ea8b11e 100644 --- a/common/server/server_ecs.go +++ b/common/server/server_ecs.go @@ -2,6 +2,7 @@ package server import ( "context" + "gitlink.org.cn/JCCE/PCM/adaptor/vm_adaptor/server/ecs" "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbecs" @@ -10,6 +11,7 @@ import ( "google.golang.org/grpc/status" ) +// ListEcsDetail return ecs detail func (s *Server) ListEcsDetail(ctx context.Context, req *pbecs.ListDetailReq) (*pbecs.ListDetailResp, error) { resp, err := ecs.ListDetail(ctx, req) if err != nil { @@ -19,6 +21,7 @@ func (s *Server) ListEcsDetail(ctx context.Context, req *pbecs.ListDetailReq) (* return resp, nil } +//ListEcs return ecs list func (s *Server) ListEcs(ctx context.Context, req *pbecs.ListReq) (*pbecs.ListResp, error) { resp, err := ecs.List(ctx, req) if err != nil { @@ -28,6 +31,7 @@ func (s *Server) ListEcs(ctx context.Context, req *pbecs.ListReq) (*pbecs.ListRe return resp, nil } +// ListEcsAll return all ecs func (s *Server) ListEcsAll(ctx context.Context, req *pbecs.ListAllReq) (*pbecs.ListResp, error) { resp, err := ecs.ListAll(ctx) if err != nil { diff --git a/common/server/server_pod.go b/common/server/server_pod.go new file mode 100644 index 00000000..7833b676 --- /dev/null +++ b/common/server/server_pod.go @@ -0,0 +1,32 @@ +package server + +import ( + "context" + + "gitlink.org.cn/JCCE/PCM/adaptor/pod_adaptor/server/pod" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbpod" + + "github.com/golang/glog" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// ListPodDetail return pod detail +func (s *Server) ListPodDetail(ctx context.Context, req *pbpod.ListDetailReq) (*pbpod.ListDetailResp, error) { + resp, err := pod.ListDetail(ctx, req) + if err != nil { + glog.Errorf("ListPodDetail error %+v", err) + return nil, status.Errorf(codes.Internal, err.Error()) + } + return resp, nil +} + +//ListPod return pod list +func (s *Server) ListPod(ctx context.Context, req *pbpod.ListReq) (*pbpod.ListResp, error) { + resp, err := pod.List(ctx, req) + if err != nil { + glog.Errorf("ListPod error %+v", err) + return nil, status.Errorf(codes.Internal, err.Error()) + } + return resp, nil +} diff --git a/go.mod b/go.mod index f1e37ae8..f363c452 100644 --- a/go.mod +++ b/go.mod @@ -28,11 +28,13 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/google/gofuzz v1.0.0 // indirect github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d // indirect + github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect github.com/imdario/mergo v0.3.5 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/json-iterator/go v1.1.10 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/smartystreets/goconvey v1.7.2 // indirect github.com/spf13/pflag v1.0.1 // indirect golang.org/x/crypto v0.0.0-20210920023735-84f357641f63 // indirect @@ -43,6 +45,7 @@ require ( golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect google.golang.org/appengine v1.6.6 // indirect + gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect gopkg.in/inf.v0 v0.9.0 // indirect gopkg.in/ini.v1 v1.66.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/idl/pbecs/ecs.proto b/idl/pbecs/ecs.proto index 0ee855d6..56833847 100644 --- a/idl/pbecs/ecs.proto +++ b/idl/pbecs/ecs.proto @@ -35,7 +35,7 @@ message EcsInstance { string expire_time = 13; // 内网ip repeated string inner_ips = 14; - // vcp id + // vpc id string vpc_id = 15; // 资源组id string resource_group_id = 16; diff --git a/idl/pbpod/pod.proto b/idl/pbpod/pod.proto new file mode 100644 index 00000000..55325ecf --- /dev/null +++ b/idl/pbpod/pod.proto @@ -0,0 +1,163 @@ +syntax = "proto3"; +package pbpod; + +option go_package = "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbpod"; + +import "idl/pbtenant/tenant.proto"; +import "google/api/annotations.proto"; + +message PodInstance { + // 云类型 + pbtenant.CloudProvider provider = 1; + // 账号名称 + string account_name = 2; + // 实例id + string instance_id = 3; + // 实例名称 + string instance_name = 4; + // 地域,数据中心 + string region_name = 5; + // 公网ip + string public_ips = 6; + // 实例类型 + string instance_type = 7; + // vcpu数 + int32 cpu = 8; + // 内存MB + int32 memory = 9; + // 实例描述 + string description = 10; + // 状态 + string status = 11; + // 创建时间,ISO8601 + string creation_time = 12; + // 过期时间 + string expire_time = 13; + // 内网ip + repeated string inner_ips = 14; + // vpc id + string vpc_id = 15; + // 安全组id + string security_group_id = 16; + // 子网Id + string SubnetId = 17; + // 容器实例 + Container Container = 18; +} + +message Container { + // 容器镜像 + string image = 1; + // 容器名称 + string name = 2; + // vcpu数 + int32 cpu = 3; + // 内存MB + int32 memory = 4; + // 重启次数 + int32 restart_count = 5; +} + +message ListDetailReq { + // 云名称 + pbtenant.CloudProvider provider = 1; + // 账户名称,根据config.yaml中的配置,默认为第一个配置的账户 + string account_name = 2; + // 区域Id,参考 tenant.proto 中的各个云的区域 + int32 region_id = 3; + // 分页相关参数,页码 + int32 page_number = 4; + // 分页相关参数,每页数量 + int32 page_size = 5; + // 分页相关参数,下一页的token + string next_token = 6; +} + +message ListDetailResp { + // pod 容器组集合 + repeated PodInstance pods = 1; + // 查询是否完成,如果为否-false,则可以将下面三个分页参数填入到请求中,继续查询 + bool finished = 2; + // 分页相关参数,页码 + int32 page_number = 3; + // 分页相关参数,每页数量 + int32 page_size = 4; + // 分页相关参数,下一页的token + string next_token = 5; + // 请求id,出现问题后提供给云厂商,排查问题 + string request_id = 6; +} + +message ListReq { + // 云名称 + pbtenant.CloudProvider provider = 1; +} + +message ListResp { + // Pod 容器组集合 + repeated PodInstance pods = 1; +} + +message CreateReq { + // 云名称 + pbtenant.CloudProvider provider = 1; + // 账户名称,根据config.yaml中的配置,默认为第一个配置的账户 + string account_name = 2; + // 区域Id,参考 tenant.proto 中的各个云的区域 + int32 region_id = 3; + // 镜像地址 + string container_image = 4; + // 容器名称 + string container_name = 5; + // 容器实例名称 + string container_group_name = 6; + // vcpu数 + int32 cpu = 7; + // 内存MB + int32 memory = 8; + // namespace (华为云cci必需) + string namespace = 9; + // 安全组id(腾讯云eks必需) + repeated string security_group_id = 10; + //subnet_id 子网id (腾讯云eks必需) + repeated string subnet_id = 11; + // vpc id (腾讯云eks必需) + string vpc_id = 12; +} + +message CreateRep { + repeated string id = 1; + string request_id = 2; + +} + +// 容器组类产品接口 +// 阿里云 - ECI +// 腾讯云 - EKS +// 华为云 - CCI +service PodService { + + // 创建pod - 支持云类型、区域 + rpc CreatePod(CreateReq) returns (CreateRep) { + option (google.api.http) = { + post : "/apis/pod/create" + body : "*" + }; + } + + // 查询Pod明细 - 支持云类型、区域、账户、分页等过滤条件 + rpc ListPodDetail(ListDetailReq) returns (ListDetailResp) { + option (google.api.http) = { + post : "/apis/pod/detail" + body : "*" + }; + } + + // 查询pod全量 - 根据云类型 + rpc ListPod(ListReq) returns (ListResp) { + option (google.api.http) = { + post : "/apis/pod" + body : "*" + }; + } +} \ No newline at end of file diff --git a/idl/pbtenant/tenant.proto b/idl/pbtenant/tenant.proto index 801b611e..f54f5b28 100644 --- a/idl/pbtenant/tenant.proto +++ b/idl/pbtenant/tenant.proto @@ -30,6 +30,8 @@ enum CloudProduct { product_domain = 3; // 4 - OSS类产品:阿里云OSS product_oss = 4; + // 5 - POD类产品:阿里云ECI,华为云CCI,腾讯云EKS + product_pod = 5; } // 云配置信息 @@ -148,7 +150,7 @@ service TenantService { description : "所有云租户的认证服务" external_docs : { url : "https://gitlink.org.cn/JCCE/PCM" - description: "Find out more about CloudFitter" + description: "Find out more about PCM" } }; diff --git a/lan_trans/idl/pbecs/ecs.pb.go b/lan_trans/idl/pbecs/ecs.pb.go index 49d8db85..07175d4b 100644 --- a/lan_trans/idl/pbecs/ecs.pb.go +++ b/lan_trans/idl/pbecs/ecs.pb.go @@ -55,7 +55,7 @@ type EcsInstance struct { ExpireTime string `protobuf:"bytes,13,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"` // 内网ip InnerIps []string `protobuf:"bytes,14,rep,name=inner_ips,json=innerIps,proto3" json:"inner_ips,omitempty"` - // vcp id + // vpc id VpcId string `protobuf:"bytes,15,opt,name=vpc_id,json=vpcId,proto3" json:"vpc_id,omitempty"` // 资源组id ResourceGroupId string `protobuf:"bytes,16,opt,name=resource_group_id,json=resourceGroupId,proto3" json:"resource_group_id,omitempty"` diff --git a/lan_trans/idl/pbpod/pod.pb.go b/lan_trans/idl/pbpod/pod.pb.go new file mode 100644 index 00000000..b500cb31 --- /dev/null +++ b/lan_trans/idl/pbpod/pod.pb.go @@ -0,0 +1,1102 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc (unknown) +// source: idl/pbpod/pod.proto + +package pbpod + +import ( + pbtenant "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbtenant" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PodInstance struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 云类型 + Provider pbtenant.CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=pbtenant.CloudProvider" json:"provider,omitempty"` + // 账号名称 + AccountName string `protobuf:"bytes,2,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` + // 实例id + InstanceId string `protobuf:"bytes,3,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` + // 实例名称 + InstanceName string `protobuf:"bytes,4,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"` + // 地域,数据中心 + RegionName string `protobuf:"bytes,5,opt,name=region_name,json=regionName,proto3" json:"region_name,omitempty"` + // 公网ip + PublicIps string `protobuf:"bytes,6,opt,name=public_ips,json=publicIps,proto3" json:"public_ips,omitempty"` + // 实例类型 + InstanceType string `protobuf:"bytes,7,opt,name=instance_type,json=instanceType,proto3" json:"instance_type,omitempty"` + // vcpu数 + Cpu int32 `protobuf:"varint,8,opt,name=cpu,proto3" json:"cpu,omitempty"` + // 内存MB + Memory int32 `protobuf:"varint,9,opt,name=memory,proto3" json:"memory,omitempty"` + // 实例描述 + Description string `protobuf:"bytes,10,opt,name=description,proto3" json:"description,omitempty"` + // 状态 + Status string `protobuf:"bytes,11,opt,name=status,proto3" json:"status,omitempty"` + // 创建时间,ISO8601 + CreationTime string `protobuf:"bytes,12,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"` + // 过期时间 + ExpireTime string `protobuf:"bytes,13,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"` + // 内网ip + InnerIps []string `protobuf:"bytes,14,rep,name=inner_ips,json=innerIps,proto3" json:"inner_ips,omitempty"` + // vpc id + VpcId string `protobuf:"bytes,15,opt,name=vpc_id,json=vpcId,proto3" json:"vpc_id,omitempty"` + // 安全组id + SecurityGroupId string `protobuf:"bytes,16,opt,name=security_group_id,json=securityGroupId,proto3" json:"security_group_id,omitempty"` + // 子网Id + SubnetId string `protobuf:"bytes,17,opt,name=SubnetId,proto3" json:"SubnetId,omitempty"` + // 容器实例 + Container *Container `protobuf:"bytes,18,opt,name=Container,proto3" json:"Container,omitempty"` +} + +func (x *PodInstance) Reset() { + *x = PodInstance{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_pbpod_pod_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PodInstance) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PodInstance) ProtoMessage() {} + +func (x *PodInstance) ProtoReflect() protoreflect.Message { + mi := &file_idl_pbpod_pod_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PodInstance.ProtoReflect.Descriptor instead. +func (*PodInstance) Descriptor() ([]byte, []int) { + return file_idl_pbpod_pod_proto_rawDescGZIP(), []int{0} +} + +func (x *PodInstance) GetProvider() pbtenant.CloudProvider { + if x != nil { + return x.Provider + } + return pbtenant.CloudProvider(0) +} + +func (x *PodInstance) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +func (x *PodInstance) GetInstanceId() string { + if x != nil { + return x.InstanceId + } + return "" +} + +func (x *PodInstance) GetInstanceName() string { + if x != nil { + return x.InstanceName + } + return "" +} + +func (x *PodInstance) GetRegionName() string { + if x != nil { + return x.RegionName + } + return "" +} + +func (x *PodInstance) GetPublicIps() string { + if x != nil { + return x.PublicIps + } + return "" +} + +func (x *PodInstance) GetInstanceType() string { + if x != nil { + return x.InstanceType + } + return "" +} + +func (x *PodInstance) GetCpu() int32 { + if x != nil { + return x.Cpu + } + return 0 +} + +func (x *PodInstance) GetMemory() int32 { + if x != nil { + return x.Memory + } + return 0 +} + +func (x *PodInstance) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *PodInstance) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *PodInstance) GetCreationTime() string { + if x != nil { + return x.CreationTime + } + return "" +} + +func (x *PodInstance) GetExpireTime() string { + if x != nil { + return x.ExpireTime + } + return "" +} + +func (x *PodInstance) GetInnerIps() []string { + if x != nil { + return x.InnerIps + } + return nil +} + +func (x *PodInstance) GetVpcId() string { + if x != nil { + return x.VpcId + } + return "" +} + +func (x *PodInstance) GetSecurityGroupId() string { + if x != nil { + return x.SecurityGroupId + } + return "" +} + +func (x *PodInstance) GetSubnetId() string { + if x != nil { + return x.SubnetId + } + return "" +} + +func (x *PodInstance) GetContainer() *Container { + if x != nil { + return x.Container + } + return nil +} + +type Container struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 容器镜像 + Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` + // 容器名称 + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // vcpu数 + Cpu int32 `protobuf:"varint,3,opt,name=cpu,proto3" json:"cpu,omitempty"` + // 内存MB + Memory int32 `protobuf:"varint,4,opt,name=memory,proto3" json:"memory,omitempty"` + // 重启次数 + RestartCount int32 `protobuf:"varint,5,opt,name=restart_count,json=restartCount,proto3" json:"restart_count,omitempty"` +} + +func (x *Container) Reset() { + *x = Container{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_pbpod_pod_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Container) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Container) ProtoMessage() {} + +func (x *Container) ProtoReflect() protoreflect.Message { + mi := &file_idl_pbpod_pod_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Container.ProtoReflect.Descriptor instead. +func (*Container) Descriptor() ([]byte, []int) { + return file_idl_pbpod_pod_proto_rawDescGZIP(), []int{1} +} + +func (x *Container) GetImage() string { + if x != nil { + return x.Image + } + return "" +} + +func (x *Container) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Container) GetCpu() int32 { + if x != nil { + return x.Cpu + } + return 0 +} + +func (x *Container) GetMemory() int32 { + if x != nil { + return x.Memory + } + return 0 +} + +func (x *Container) GetRestartCount() int32 { + if x != nil { + return x.RestartCount + } + return 0 +} + +type ListDetailReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 云名称 + Provider pbtenant.CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=pbtenant.CloudProvider" json:"provider,omitempty"` + // 账户名称,根据config.yaml中的配置,默认为第一个配置的账户 + AccountName string `protobuf:"bytes,2,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` + // 区域Id,参考 tenant.proto 中的各个云的区域 + RegionId int32 `protobuf:"varint,3,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` + // 分页相关参数,页码 + PageNumber int32 `protobuf:"varint,4,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"` + // 分页相关参数,每页数量 + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // 分页相关参数,下一页的token + NextToken string `protobuf:"bytes,6,opt,name=next_token,json=nextToken,proto3" json:"next_token,omitempty"` +} + +func (x *ListDetailReq) Reset() { + *x = ListDetailReq{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_pbpod_pod_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDetailReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDetailReq) ProtoMessage() {} + +func (x *ListDetailReq) ProtoReflect() protoreflect.Message { + mi := &file_idl_pbpod_pod_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListDetailReq.ProtoReflect.Descriptor instead. +func (*ListDetailReq) Descriptor() ([]byte, []int) { + return file_idl_pbpod_pod_proto_rawDescGZIP(), []int{2} +} + +func (x *ListDetailReq) GetProvider() pbtenant.CloudProvider { + if x != nil { + return x.Provider + } + return pbtenant.CloudProvider(0) +} + +func (x *ListDetailReq) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +func (x *ListDetailReq) GetRegionId() int32 { + if x != nil { + return x.RegionId + } + return 0 +} + +func (x *ListDetailReq) GetPageNumber() int32 { + if x != nil { + return x.PageNumber + } + return 0 +} + +func (x *ListDetailReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListDetailReq) GetNextToken() string { + if x != nil { + return x.NextToken + } + return "" +} + +type ListDetailResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // pod 容器组集合 + Pods []*PodInstance `protobuf:"bytes,1,rep,name=pods,proto3" json:"pods,omitempty"` + // 查询是否完成,如果为否-false,则可以将下面三个分页参数填入到请求中,继续查询 + Finished bool `protobuf:"varint,2,opt,name=finished,proto3" json:"finished,omitempty"` + // 分页相关参数,页码 + PageNumber int32 `protobuf:"varint,3,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"` + // 分页相关参数,每页数量 + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // 分页相关参数,下一页的token + NextToken string `protobuf:"bytes,5,opt,name=next_token,json=nextToken,proto3" json:"next_token,omitempty"` + // 请求id,出现问题后提供给云厂商,排查问题 + RequestId string `protobuf:"bytes,6,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` +} + +func (x *ListDetailResp) Reset() { + *x = ListDetailResp{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_pbpod_pod_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListDetailResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDetailResp) ProtoMessage() {} + +func (x *ListDetailResp) ProtoReflect() protoreflect.Message { + mi := &file_idl_pbpod_pod_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListDetailResp.ProtoReflect.Descriptor instead. +func (*ListDetailResp) Descriptor() ([]byte, []int) { + return file_idl_pbpod_pod_proto_rawDescGZIP(), []int{3} +} + +func (x *ListDetailResp) GetPods() []*PodInstance { + if x != nil { + return x.Pods + } + return nil +} + +func (x *ListDetailResp) GetFinished() bool { + if x != nil { + return x.Finished + } + return false +} + +func (x *ListDetailResp) GetPageNumber() int32 { + if x != nil { + return x.PageNumber + } + return 0 +} + +func (x *ListDetailResp) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ListDetailResp) GetNextToken() string { + if x != nil { + return x.NextToken + } + return "" +} + +func (x *ListDetailResp) GetRequestId() string { + if x != nil { + return x.RequestId + } + return "" +} + +type ListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 云名称 + Provider pbtenant.CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=pbtenant.CloudProvider" json:"provider,omitempty"` +} + +func (x *ListReq) Reset() { + *x = ListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_pbpod_pod_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListReq) ProtoMessage() {} + +func (x *ListReq) ProtoReflect() protoreflect.Message { + mi := &file_idl_pbpod_pod_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListReq.ProtoReflect.Descriptor instead. +func (*ListReq) Descriptor() ([]byte, []int) { + return file_idl_pbpod_pod_proto_rawDescGZIP(), []int{4} +} + +func (x *ListReq) GetProvider() pbtenant.CloudProvider { + if x != nil { + return x.Provider + } + return pbtenant.CloudProvider(0) +} + +type ListResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Pod 容器组集合 + Pods []*PodInstance `protobuf:"bytes,1,rep,name=pods,proto3" json:"pods,omitempty"` +} + +func (x *ListResp) Reset() { + *x = ListResp{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_pbpod_pod_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListResp) ProtoMessage() {} + +func (x *ListResp) ProtoReflect() protoreflect.Message { + mi := &file_idl_pbpod_pod_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListResp.ProtoReflect.Descriptor instead. +func (*ListResp) Descriptor() ([]byte, []int) { + return file_idl_pbpod_pod_proto_rawDescGZIP(), []int{5} +} + +func (x *ListResp) GetPods() []*PodInstance { + if x != nil { + return x.Pods + } + return nil +} + +type CreateReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 云名称 + Provider pbtenant.CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=pbtenant.CloudProvider" json:"provider,omitempty"` + // 账户名称,根据config.yaml中的配置,默认为第一个配置的账户 + AccountName string `protobuf:"bytes,2,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` + // 区域Id,参考 tenant.proto 中的各个云的区域 + RegionId int32 `protobuf:"varint,3,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"` + // 镜像地址 + ContainerImage string `protobuf:"bytes,4,opt,name=container_image,json=containerImage,proto3" json:"container_image,omitempty"` + // 容器名称 + ContainerName string `protobuf:"bytes,5,opt,name=container_name,json=containerName,proto3" json:"container_name,omitempty"` + // 容器实例名称 + ContainerGroupName string `protobuf:"bytes,6,opt,name=container_group_name,json=containerGroupName,proto3" json:"container_group_name,omitempty"` + // vcpu数 + Cpu int32 `protobuf:"varint,7,opt,name=cpu,proto3" json:"cpu,omitempty"` + // 内存MB + Memory int32 `protobuf:"varint,8,opt,name=memory,proto3" json:"memory,omitempty"` + // namespace (华为云cci必需) + Namespace string `protobuf:"bytes,9,opt,name=namespace,proto3" json:"namespace,omitempty"` + // 安全组id(腾讯云eks必需) + SecurityGroupId []string `protobuf:"bytes,10,rep,name=security_group_id,json=securityGroupId,proto3" json:"security_group_id,omitempty"` + //subnet_id 子网id (腾讯云eks必需) + SubnetId []string `protobuf:"bytes,11,rep,name=subnet_id,json=subnetId,proto3" json:"subnet_id,omitempty"` + // vpc id (腾讯云eks必需) + VpcId string `protobuf:"bytes,12,opt,name=vpc_id,json=vpcId,proto3" json:"vpc_id,omitempty"` +} + +func (x *CreateReq) Reset() { + *x = CreateReq{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_pbpod_pod_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateReq) ProtoMessage() {} + +func (x *CreateReq) ProtoReflect() protoreflect.Message { + mi := &file_idl_pbpod_pod_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateReq.ProtoReflect.Descriptor instead. +func (*CreateReq) Descriptor() ([]byte, []int) { + return file_idl_pbpod_pod_proto_rawDescGZIP(), []int{6} +} + +func (x *CreateReq) GetProvider() pbtenant.CloudProvider { + if x != nil { + return x.Provider + } + return pbtenant.CloudProvider(0) +} + +func (x *CreateReq) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +func (x *CreateReq) GetRegionId() int32 { + if x != nil { + return x.RegionId + } + return 0 +} + +func (x *CreateReq) GetContainerImage() string { + if x != nil { + return x.ContainerImage + } + return "" +} + +func (x *CreateReq) GetContainerName() string { + if x != nil { + return x.ContainerName + } + return "" +} + +func (x *CreateReq) GetContainerGroupName() string { + if x != nil { + return x.ContainerGroupName + } + return "" +} + +func (x *CreateReq) GetCpu() int32 { + if x != nil { + return x.Cpu + } + return 0 +} + +func (x *CreateReq) GetMemory() int32 { + if x != nil { + return x.Memory + } + return 0 +} + +func (x *CreateReq) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *CreateReq) GetSecurityGroupId() []string { + if x != nil { + return x.SecurityGroupId + } + return nil +} + +func (x *CreateReq) GetSubnetId() []string { + if x != nil { + return x.SubnetId + } + return nil +} + +func (x *CreateReq) GetVpcId() string { + if x != nil { + return x.VpcId + } + return "" +} + +type CreateRep struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id []string `protobuf:"bytes,1,rep,name=id,proto3" json:"id,omitempty"` + RequestId string `protobuf:"bytes,2,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` +} + +func (x *CreateRep) Reset() { + *x = CreateRep{} + if protoimpl.UnsafeEnabled { + mi := &file_idl_pbpod_pod_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateRep) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateRep) ProtoMessage() {} + +func (x *CreateRep) ProtoReflect() protoreflect.Message { + mi := &file_idl_pbpod_pod_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateRep.ProtoReflect.Descriptor instead. +func (*CreateRep) Descriptor() ([]byte, []int) { + return file_idl_pbpod_pod_proto_rawDescGZIP(), []int{7} +} + +func (x *CreateRep) GetId() []string { + if x != nil { + return x.Id + } + return nil +} + +func (x *CreateRep) GetRequestId() string { + if x != nil { + return x.RequestId + } + return "" +} + +var File_idl_pbpod_pod_proto protoreflect.FileDescriptor + +var file_idl_pbpod_pod_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x69, 0x64, 0x6c, 0x2f, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2f, 0x70, 0x6f, 0x64, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x1a, 0x19, 0x69, 0x64, + 0x6c, 0x2f, 0x70, 0x62, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x2f, 0x74, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe6, 0x04, 0x0a, 0x0b, 0x50, 0x6f, 0x64, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, + 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x23, + 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x69, + 0x70, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x49, 0x70, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, + 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, + 0x72, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, 0x0d, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x70, 0x73, 0x18, + 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x49, 0x70, 0x73, 0x12, + 0x15, 0x0a, 0x06, 0x76, 0x70, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x70, 0x63, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, + 0x74, 0x79, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x49, 0x64, 0x18, 0x11, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x53, 0x75, 0x62, 0x6e, 0x65, 0x74, 0x49, 0x64, 0x12, 0x2e, + 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x12, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x52, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22, 0x84, + 0x01, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, + 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, + 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, + 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xe1, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x33, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x74, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, + 0x70, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, + 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, + 0x78, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x6e, 0x65, 0x78, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xd0, 0x01, 0x0a, 0x0e, 0x4c, 0x69, + 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x04, + 0x70, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x70, + 0x6f, 0x64, 0x2e, 0x50, 0x6f, 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x04, + 0x70, 0x6f, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, + 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, + 0x0a, 0x0a, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, + 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x3e, 0x0a, 0x07, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x33, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x74, 0x65, + 0x6e, 0x61, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x32, 0x0a, 0x08, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x04, 0x70, 0x6f, 0x64, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x50, + 0x6f, 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x04, 0x70, 0x6f, 0x64, 0x73, + 0x22, 0xaa, 0x03, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x33, + 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x17, 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, + 0x64, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x67, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x25, 0x0a, 0x0e, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, + 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, + 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x2a, 0x0a, + 0x11, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, + 0x69, 0x64, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, + 0x74, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x75, 0x62, + 0x6e, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x73, 0x75, + 0x62, 0x6e, 0x65, 0x74, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x76, 0x70, 0x63, 0x5f, 0x69, 0x64, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x70, 0x63, 0x49, 0x64, 0x22, 0x3a, 0x0a, + 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x32, 0xf7, 0x01, 0x0a, 0x0a, 0x50, 0x6f, + 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x50, 0x6f, 0x64, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x15, 0x22, 0x10, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x59, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, + 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, + 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x10, 0x2f, 0x61, + 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x3a, 0x01, + 0x2a, 0x12, 0x40, 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x12, 0x0e, 0x2e, 0x70, + 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, + 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x14, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x22, 0x09, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, + 0x3a, 0x01, 0x2a, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x6f, + 0x72, 0x67, 0x2e, 0x63, 0x6e, 0x2f, 0x4a, 0x43, 0x43, 0x45, 0x2f, 0x50, 0x43, 0x4d, 0x2f, 0x6c, + 0x61, 0x6e, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x2f, 0x69, 0x64, 0x6c, 0x2f, 0x70, 0x62, 0x70, + 0x6f, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_idl_pbpod_pod_proto_rawDescOnce sync.Once + file_idl_pbpod_pod_proto_rawDescData = file_idl_pbpod_pod_proto_rawDesc +) + +func file_idl_pbpod_pod_proto_rawDescGZIP() []byte { + file_idl_pbpod_pod_proto_rawDescOnce.Do(func() { + file_idl_pbpod_pod_proto_rawDescData = protoimpl.X.CompressGZIP(file_idl_pbpod_pod_proto_rawDescData) + }) + return file_idl_pbpod_pod_proto_rawDescData +} + +var file_idl_pbpod_pod_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_idl_pbpod_pod_proto_goTypes = []interface{}{ + (*PodInstance)(nil), // 0: pbpod.PodInstance + (*Container)(nil), // 1: pbpod.Container + (*ListDetailReq)(nil), // 2: pbpod.ListDetailReq + (*ListDetailResp)(nil), // 3: pbpod.ListDetailResp + (*ListReq)(nil), // 4: pbpod.ListReq + (*ListResp)(nil), // 5: pbpod.ListResp + (*CreateReq)(nil), // 6: pbpod.CreateReq + (*CreateRep)(nil), // 7: pbpod.CreateRep + (pbtenant.CloudProvider)(0), // 8: pbtenant.CloudProvider +} +var file_idl_pbpod_pod_proto_depIdxs = []int32{ + 8, // 0: pbpod.PodInstance.provider:type_name -> pbtenant.CloudProvider + 1, // 1: pbpod.PodInstance.Container:type_name -> pbpod.Container + 8, // 2: pbpod.ListDetailReq.provider:type_name -> pbtenant.CloudProvider + 0, // 3: pbpod.ListDetailResp.pods:type_name -> pbpod.PodInstance + 8, // 4: pbpod.ListReq.provider:type_name -> pbtenant.CloudProvider + 0, // 5: pbpod.ListResp.pods:type_name -> pbpod.PodInstance + 8, // 6: pbpod.CreateReq.provider:type_name -> pbtenant.CloudProvider + 6, // 7: pbpod.PodService.CreatePod:input_type -> pbpod.CreateReq + 2, // 8: pbpod.PodService.ListPodDetail:input_type -> pbpod.ListDetailReq + 4, // 9: pbpod.PodService.ListPod:input_type -> pbpod.ListReq + 7, // 10: pbpod.PodService.CreatePod:output_type -> pbpod.CreateRep + 3, // 11: pbpod.PodService.ListPodDetail:output_type -> pbpod.ListDetailResp + 5, // 12: pbpod.PodService.ListPod:output_type -> pbpod.ListResp + 10, // [10:13] is the sub-list for method output_type + 7, // [7:10] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_idl_pbpod_pod_proto_init() } +func file_idl_pbpod_pod_proto_init() { + if File_idl_pbpod_pod_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_idl_pbpod_pod_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PodInstance); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_pbpod_pod_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Container); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_pbpod_pod_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDetailReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_pbpod_pod_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDetailResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_pbpod_pod_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_pbpod_pod_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_pbpod_pod_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_idl_pbpod_pod_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateRep); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_idl_pbpod_pod_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_idl_pbpod_pod_proto_goTypes, + DependencyIndexes: file_idl_pbpod_pod_proto_depIdxs, + MessageInfos: file_idl_pbpod_pod_proto_msgTypes, + }.Build() + File_idl_pbpod_pod_proto = out.File + file_idl_pbpod_pod_proto_rawDesc = nil + file_idl_pbpod_pod_proto_goTypes = nil + file_idl_pbpod_pod_proto_depIdxs = nil +} diff --git a/lan_trans/idl/pbpod/pod.pb.gw.go b/lan_trans/idl/pbpod/pod.pb.gw.go new file mode 100644 index 00000000..60395a5e --- /dev/null +++ b/lan_trans/idl/pbpod/pod.pb.gw.go @@ -0,0 +1,329 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: idl/pbpod/pod.proto + +/* +Package pbpod is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package pbpod + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_PodService_CreatePod_0(ctx context.Context, marshaler runtime.Marshaler, client PodServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreatePod(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_PodService_CreatePod_0(ctx context.Context, marshaler runtime.Marshaler, server PodServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreatePod(ctx, &protoReq) + return msg, metadata, err + +} + +func request_PodService_ListPodDetail_0(ctx context.Context, marshaler runtime.Marshaler, client PodServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListDetailReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListPodDetail(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_PodService_ListPodDetail_0(ctx context.Context, marshaler runtime.Marshaler, server PodServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListDetailReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListPodDetail(ctx, &protoReq) + return msg, metadata, err + +} + +func request_PodService_ListPod_0(ctx context.Context, marshaler runtime.Marshaler, client PodServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListPod(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_PodService_ListPod_0(ctx context.Context, marshaler runtime.Marshaler, server PodServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListPod(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterPodServiceHandlerServer registers the http handlers for service PodService to "mux". +// UnaryRPC :call PodServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPodServiceHandlerFromEndpoint instead. +func RegisterPodServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PodServiceServer) error { + + mux.Handle("POST", pattern_PodService_CreatePod_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pbpod.PodService/CreatePod") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_PodService_CreatePod_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_PodService_CreatePod_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_PodService_ListPodDetail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pbpod.PodService/ListPodDetail") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_PodService_ListPodDetail_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_PodService_ListPodDetail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_PodService_ListPod_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pbpod.PodService/ListPod") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_PodService_ListPod_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_PodService_ListPod_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterPodServiceHandlerFromEndpoint is same as RegisterPodServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterPodServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterPodServiceHandler(ctx, mux, conn) +} + +// RegisterPodServiceHandler registers the http handlers for service PodService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterPodServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterPodServiceHandlerClient(ctx, mux, NewPodServiceClient(conn)) +} + +// RegisterPodServiceHandlerClient registers the http handlers for service PodService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PodServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PodServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "PodServiceClient" to call the correct interceptors. +func RegisterPodServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PodServiceClient) error { + + mux.Handle("POST", pattern_PodService_CreatePod_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/pbpod.PodService/CreatePod") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_PodService_CreatePod_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_PodService_CreatePod_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_PodService_ListPodDetail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/pbpod.PodService/ListPodDetail") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_PodService_ListPodDetail_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_PodService_ListPodDetail_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_PodService_ListPod_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/pbpod.PodService/ListPod") + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_PodService_ListPod_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_PodService_ListPod_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_PodService_CreatePod_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "pod", "create"}, "")) + + pattern_PodService_ListPodDetail_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "pod", "detail"}, "")) + + pattern_PodService_ListPod_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"apis", "pod"}, "")) +) + +var ( + forward_PodService_CreatePod_0 = runtime.ForwardResponseMessage + + forward_PodService_ListPodDetail_0 = runtime.ForwardResponseMessage + + forward_PodService_ListPod_0 = runtime.ForwardResponseMessage +) diff --git a/lan_trans/idl/pbpod/pod_grpc.pb.go b/lan_trans/idl/pbpod/pod_grpc.pb.go new file mode 100644 index 00000000..d4aeb23a --- /dev/null +++ b/lan_trans/idl/pbpod/pod_grpc.pb.go @@ -0,0 +1,183 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: idl/pbpod/pod.proto + +package pbpod + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// PodServiceClient is the client API for PodService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PodServiceClient interface { + // 创建pod - 支持云类型、区域 + CreatePod(ctx context.Context, in *CreateReq, opts ...grpc.CallOption) (*CreateRep, error) + // 查询Pod明细 - 支持云类型、区域、账户、分页等过滤条件 + ListPodDetail(ctx context.Context, in *ListDetailReq, opts ...grpc.CallOption) (*ListDetailResp, error) + // 查询pod全量 - 根据云类型 + ListPod(ctx context.Context, in *ListReq, opts ...grpc.CallOption) (*ListResp, error) +} + +type podServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewPodServiceClient(cc grpc.ClientConnInterface) PodServiceClient { + return &podServiceClient{cc} +} + +func (c *podServiceClient) CreatePod(ctx context.Context, in *CreateReq, opts ...grpc.CallOption) (*CreateRep, error) { + out := new(CreateRep) + err := c.cc.Invoke(ctx, "/pbpod.PodService/CreatePod", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *podServiceClient) ListPodDetail(ctx context.Context, in *ListDetailReq, opts ...grpc.CallOption) (*ListDetailResp, error) { + out := new(ListDetailResp) + err := c.cc.Invoke(ctx, "/pbpod.PodService/ListPodDetail", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *podServiceClient) ListPod(ctx context.Context, in *ListReq, opts ...grpc.CallOption) (*ListResp, error) { + out := new(ListResp) + err := c.cc.Invoke(ctx, "/pbpod.PodService/ListPod", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PodServiceServer is the server API for PodService service. +// All implementations must embed UnimplementedPodServiceServer +// for forward compatibility +type PodServiceServer interface { + // 创建pod - 支持云类型、区域 + CreatePod(context.Context, *CreateReq) (*CreateRep, error) + // 查询Pod明细 - 支持云类型、区域、账户、分页等过滤条件 + ListPodDetail(context.Context, *ListDetailReq) (*ListDetailResp, error) + // 查询pod全量 - 根据云类型 + ListPod(context.Context, *ListReq) (*ListResp, error) + mustEmbedUnimplementedPodServiceServer() +} + +// UnimplementedPodServiceServer must be embedded to have forward compatible implementations. +type UnimplementedPodServiceServer struct { +} + +func (UnimplementedPodServiceServer) CreatePod(context.Context, *CreateReq) (*CreateRep, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreatePod not implemented") +} +func (UnimplementedPodServiceServer) ListPodDetail(context.Context, *ListDetailReq) (*ListDetailResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListPodDetail not implemented") +} +func (UnimplementedPodServiceServer) ListPod(context.Context, *ListReq) (*ListResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListPod not implemented") +} +func (UnimplementedPodServiceServer) mustEmbedUnimplementedPodServiceServer() {} + +// UnsafePodServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PodServiceServer will +// result in compilation errors. +type UnsafePodServiceServer interface { + mustEmbedUnimplementedPodServiceServer() +} + +func RegisterPodServiceServer(s grpc.ServiceRegistrar, srv PodServiceServer) { + s.RegisterService(&PodService_ServiceDesc, srv) +} + +func _PodService_CreatePod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PodServiceServer).CreatePod(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pbpod.PodService/CreatePod", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PodServiceServer).CreatePod(ctx, req.(*CreateReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PodService_ListPodDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListDetailReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PodServiceServer).ListPodDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pbpod.PodService/ListPodDetail", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PodServiceServer).ListPodDetail(ctx, req.(*ListDetailReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PodService_ListPod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PodServiceServer).ListPod(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pbpod.PodService/ListPod", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PodServiceServer).ListPod(ctx, req.(*ListReq)) + } + return interceptor(ctx, in, info, handler) +} + +// PodService_ServiceDesc is the grpc.ServiceDesc for PodService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PodService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pbpod.PodService", + HandlerType: (*PodServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreatePod", + Handler: _PodService_CreatePod_Handler, + }, + { + MethodName: "ListPodDetail", + Handler: _PodService_ListPodDetail_Handler, + }, + { + MethodName: "ListPod", + Handler: _PodService_ListPod_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "idl/pbpod/pod.proto", +} diff --git a/lan_trans/idl/pbtenant/tenant.pb.go b/lan_trans/idl/pbtenant/tenant.pb.go index 23b4c6a3..1afcfd41 100644 --- a/lan_trans/idl/pbtenant/tenant.pb.go +++ b/lan_trans/idl/pbtenant/tenant.pb.go @@ -93,6 +93,8 @@ const ( CloudProduct_product_domain CloudProduct = 3 // 4 - OSS类产品:阿里云OSS CloudProduct_product_oss CloudProduct = 4 + // 5 - POD类产品:阿里云ECI,华为云CCI,腾讯云EKS + CloudProduct_product_pod CloudProduct = 5 ) // Enum value maps for CloudProduct. @@ -103,6 +105,7 @@ var ( 2: "product_rds", 3: "product_domain", 4: "product_oss", + 5: "product_pod", } CloudProduct_value = map[string]int32{ "product_all": 0, @@ -110,6 +113,7 @@ var ( "product_rds": 2, "product_domain": 3, "product_oss": 4, + "product_pod": 5, } ) @@ -686,127 +690,128 @@ var file_idl_pbtenant_tenant_proto_rawDesc = []byte{ 0x3a, 0x0a, 0x0d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x07, 0x0a, 0x03, 0x61, 0x6c, 0x69, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x68, 0x75, 0x61, 0x77, 0x65, 0x69, - 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x61, 0x77, 0x73, 0x10, 0x03, 0x2a, 0x66, 0x0a, 0x0c, 0x43, + 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x61, 0x77, 0x73, 0x10, 0x03, 0x2a, 0x77, 0x0a, 0x0c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, 0x0f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x65, 0x63, 0x73, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x72, 0x64, 0x73, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x6f, 0x73, - 0x73, 0x10, 0x04, 0x2a, 0x86, 0x04, 0x0a, 0x0b, 0x41, 0x6c, 0x69, 0x52, 0x65, 0x67, 0x69, 0x6f, - 0x6e, 0x49, 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00, - 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x71, 0x69, 0x6e, 0x67, 0x64, - 0x61, 0x6f, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x62, - 0x65, 0x69, 0x6a, 0x69, 0x6e, 0x67, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, - 0x63, 0x6e, 0x5f, 0x7a, 0x68, 0x61, 0x6e, 0x67, 0x6a, 0x69, 0x61, 0x6b, 0x6f, 0x75, 0x10, 0x03, - 0x12, 0x14, 0x0a, 0x10, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x68, 0x75, 0x68, 0x65, 0x68, - 0x61, 0x6f, 0x74, 0x65, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, - 0x5f, 0x77, 0x75, 0x6c, 0x61, 0x6e, 0x63, 0x68, 0x61, 0x62, 0x75, 0x10, 0x05, 0x12, 0x13, 0x0a, - 0x0f, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x68, 0x61, 0x6e, 0x67, 0x7a, 0x68, 0x6f, 0x75, - 0x10, 0x06, 0x12, 0x13, 0x0a, 0x0f, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x73, 0x68, 0x61, - 0x6e, 0x67, 0x68, 0x61, 0x69, 0x10, 0x07, 0x12, 0x13, 0x0a, 0x0f, 0x61, 0x6c, 0x69, 0x5f, 0x63, - 0x6e, 0x5f, 0x73, 0x68, 0x65, 0x6e, 0x7a, 0x68, 0x65, 0x6e, 0x10, 0x08, 0x12, 0x11, 0x0a, 0x0d, - 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x68, 0x65, 0x79, 0x75, 0x61, 0x6e, 0x10, 0x09, 0x12, - 0x14, 0x0a, 0x10, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x7a, - 0x68, 0x6f, 0x75, 0x10, 0x0a, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, - 0x63, 0x68, 0x65, 0x6e, 0x67, 0x64, 0x75, 0x10, 0x0b, 0x12, 0x13, 0x0a, 0x0f, 0x61, 0x6c, 0x69, - 0x5f, 0x63, 0x6e, 0x5f, 0x68, 0x6f, 0x6e, 0x67, 0x6b, 0x6f, 0x6e, 0x67, 0x10, 0x0c, 0x12, 0x16, - 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, - 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0d, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, - 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x0e, 0x12, 0x16, - 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, - 0x73, 0x74, 0x5f, 0x33, 0x10, 0x0f, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, - 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x35, 0x10, 0x10, 0x12, 0x12, - 0x0a, 0x0e, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, - 0x10, 0x11, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, 0x5f, 0x6e, 0x6f, 0x72, - 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x12, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x6c, - 0x69, 0x5f, 0x75, 0x73, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x13, 0x12, 0x11, 0x0a, - 0x0d, 0x61, 0x6c, 0x69, 0x5f, 0x75, 0x73, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x14, - 0x12, 0x14, 0x0a, 0x10, 0x61, 0x6c, 0x69, 0x5f, 0x65, 0x75, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x72, - 0x61, 0x6c, 0x5f, 0x31, 0x10, 0x15, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x6c, 0x69, 0x5f, 0x65, 0x75, - 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x16, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x6c, 0x69, - 0x5f, 0x6d, 0x65, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x17, 0x2a, 0xa1, 0x03, 0x0a, - 0x0f, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49, 0x64, - 0x12, 0x0a, 0x0a, 0x06, 0x74, 0x63, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, - 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x62, 0x61, 0x6e, 0x67, 0x6b, 0x6f, 0x6b, 0x10, 0x01, 0x12, - 0x11, 0x0a, 0x0d, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x62, 0x65, 0x69, 0x6a, 0x69, 0x6e, 0x67, - 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x63, 0x68, 0x65, 0x6e, - 0x67, 0x64, 0x75, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x63, - 0x68, 0x6f, 0x6e, 0x67, 0x71, 0x69, 0x6e, 0x67, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x74, 0x63, - 0x5f, 0x61, 0x70, 0x5f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x7a, 0x68, 0x6f, 0x75, 0x10, 0x05, 0x12, - 0x18, 0x0a, 0x14, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x7a, 0x68, - 0x6f, 0x75, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x10, 0x06, 0x12, 0x12, 0x0a, 0x0e, 0x74, 0x63, 0x5f, - 0x61, 0x70, 0x5f, 0x68, 0x6f, 0x6e, 0x67, 0x6b, 0x6f, 0x6e, 0x67, 0x10, 0x07, 0x12, 0x10, 0x0a, - 0x0c, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x6d, 0x75, 0x6d, 0x62, 0x61, 0x69, 0x10, 0x08, 0x12, - 0x0f, 0x0a, 0x0b, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x65, 0x6f, 0x75, 0x6c, 0x10, 0x09, - 0x12, 0x12, 0x0a, 0x0e, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x68, - 0x61, 0x69, 0x10, 0x0a, 0x12, 0x16, 0x0a, 0x12, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x68, - 0x61, 0x6e, 0x67, 0x68, 0x61, 0x69, 0x5f, 0x66, 0x73, 0x69, 0x10, 0x0b, 0x12, 0x16, 0x0a, 0x12, - 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x68, 0x65, 0x6e, 0x7a, 0x68, 0x65, 0x6e, 0x5f, 0x66, - 0x73, 0x69, 0x10, 0x0c, 0x12, 0x13, 0x0a, 0x0f, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x69, - 0x6e, 0x67, 0x61, 0x70, 0x6f, 0x72, 0x65, 0x10, 0x0d, 0x12, 0x0f, 0x0a, 0x0b, 0x74, 0x63, 0x5f, - 0x61, 0x70, 0x5f, 0x74, 0x6f, 0x6b, 0x79, 0x6f, 0x10, 0x0e, 0x12, 0x13, 0x0a, 0x0f, 0x74, 0x63, - 0x5f, 0x65, 0x75, 0x5f, 0x66, 0x72, 0x61, 0x6e, 0x6b, 0x66, 0x75, 0x72, 0x74, 0x10, 0x0f, 0x12, - 0x10, 0x0a, 0x0c, 0x74, 0x63, 0x5f, 0x65, 0x75, 0x5f, 0x6d, 0x6f, 0x73, 0x63, 0x6f, 0x77, 0x10, - 0x10, 0x12, 0x11, 0x0a, 0x0d, 0x74, 0x63, 0x5f, 0x6e, 0x61, 0x5f, 0x61, 0x73, 0x68, 0x62, 0x75, - 0x72, 0x6e, 0x10, 0x11, 0x12, 0x17, 0x0a, 0x13, 0x74, 0x63, 0x5f, 0x6e, 0x61, 0x5f, 0x73, 0x69, - 0x6c, 0x69, 0x63, 0x6f, 0x6e, 0x76, 0x61, 0x6c, 0x6c, 0x65, 0x79, 0x10, 0x12, 0x12, 0x11, 0x0a, - 0x0d, 0x74, 0x63, 0x5f, 0x6e, 0x61, 0x5f, 0x74, 0x6f, 0x72, 0x6f, 0x6e, 0x74, 0x6f, 0x10, 0x13, - 0x2a, 0xe8, 0x01, 0x0a, 0x0e, 0x48, 0x75, 0x61, 0x77, 0x65, 0x69, 0x52, 0x65, 0x67, 0x69, 0x6f, - 0x6e, 0x49, 0x64, 0x12, 0x0a, 0x0a, 0x06, 0x68, 0x77, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00, 0x12, - 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, 0x5f, 0x31, - 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x6e, 0x6f, 0x72, 0x74, - 0x68, 0x5f, 0x34, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x73, - 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x68, 0x77, 0x5f, 0x63, - 0x6e, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x68, 0x77, - 0x5f, 0x63, 0x6e, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x05, 0x12, 0x15, 0x0a, 0x11, - 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x77, 0x65, 0x73, 0x74, 0x5f, - 0x32, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x68, 0x77, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, - 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x68, 0x77, - 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, - 0x08, 0x12, 0x15, 0x0a, 0x11, 0x68, 0x77, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, - 0x65, 0x61, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x09, 0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, 0x61, - 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x0a, 0x2a, 0xcd, 0x03, 0x0a, 0x0b, - 0x41, 0x77, 0x73, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x61, - 0x77, 0x73, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, - 0x75, 0x73, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x61, - 0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x02, 0x12, 0x11, - 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x31, 0x10, - 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, 0x77, 0x65, 0x73, 0x74, - 0x5f, 0x32, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x66, 0x5f, 0x73, - 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x05, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, - 0x61, 0x70, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x06, 0x12, 0x12, 0x0a, 0x0e, 0x61, - 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x07, 0x12, - 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, 0x65, - 0x61, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, - 0x70, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x09, 0x12, - 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, 0x65, - 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0a, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, - 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x0b, 0x12, - 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, - 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0c, 0x12, 0x14, 0x0a, 0x10, 0x61, 0x77, 0x73, 0x5f, 0x63, - 0x61, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x5f, 0x31, 0x10, 0x0d, 0x12, 0x14, 0x0a, - 0x10, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x5f, - 0x31, 0x10, 0x0e, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x77, 0x65, - 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0f, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, - 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x10, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, - 0x5f, 0x65, 0x75, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x11, 0x12, 0x11, 0x0a, - 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x12, - 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, - 0x5f, 0x31, 0x10, 0x13, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x6d, 0x65, 0x5f, 0x73, - 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x14, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, - 0x73, 0x61, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x15, 0x32, 0x78, 0x0a, 0x0d, 0x54, - 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x67, 0x92, 0x41, - 0x64, 0x12, 0x1e, 0xe6, 0x89, 0x80, 0xe6, 0x9c, 0x89, 0xe4, 0xba, 0x91, 0xe7, 0xa7, 0x9f, 0xe6, - 0x88, 0xb7, 0xe7, 0x9a, 0x84, 0xe8, 0xae, 0xa4, 0xe8, 0xaf, 0x81, 0xe6, 0x9c, 0x8d, 0xe5, 0x8a, - 0xa1, 0x1a, 0x42, 0x0a, 0x1f, 0x46, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x6d, 0x6f, - 0x72, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x46, 0x69, - 0x74, 0x74, 0x65, 0x72, 0x12, 0x1f, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, - 0x74, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x63, 0x6e, 0x2f, 0x4a, 0x43, 0x43, - 0x45, 0x2f, 0x50, 0x43, 0x4d, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x6c, 0x69, 0x6e, 0x6b, - 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x63, 0x6e, 0x2f, 0x4a, 0x43, 0x43, 0x45, 0x2f, 0x50, 0x43, 0x4d, - 0x2f, 0x6c, 0x61, 0x6e, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x2f, 0x69, 0x64, 0x6c, 0x2f, 0x70, - 0x62, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x70, + 0x6f, 0x64, 0x10, 0x05, 0x2a, 0x86, 0x04, 0x0a, 0x0b, 0x41, 0x6c, 0x69, 0x52, 0x65, 0x67, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x6c, 0x6c, 0x10, + 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x71, 0x69, 0x6e, 0x67, + 0x64, 0x61, 0x6f, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, + 0x62, 0x65, 0x69, 0x6a, 0x69, 0x6e, 0x67, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, + 0x5f, 0x63, 0x6e, 0x5f, 0x7a, 0x68, 0x61, 0x6e, 0x67, 0x6a, 0x69, 0x61, 0x6b, 0x6f, 0x75, 0x10, + 0x03, 0x12, 0x14, 0x0a, 0x10, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x68, 0x75, 0x68, 0x65, + 0x68, 0x61, 0x6f, 0x74, 0x65, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x61, 0x6c, 0x69, 0x5f, 0x63, + 0x6e, 0x5f, 0x77, 0x75, 0x6c, 0x61, 0x6e, 0x63, 0x68, 0x61, 0x62, 0x75, 0x10, 0x05, 0x12, 0x13, + 0x0a, 0x0f, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x68, 0x61, 0x6e, 0x67, 0x7a, 0x68, 0x6f, + 0x75, 0x10, 0x06, 0x12, 0x13, 0x0a, 0x0f, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x73, 0x68, + 0x61, 0x6e, 0x67, 0x68, 0x61, 0x69, 0x10, 0x07, 0x12, 0x13, 0x0a, 0x0f, 0x61, 0x6c, 0x69, 0x5f, + 0x63, 0x6e, 0x5f, 0x73, 0x68, 0x65, 0x6e, 0x7a, 0x68, 0x65, 0x6e, 0x10, 0x08, 0x12, 0x11, 0x0a, + 0x0d, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x68, 0x65, 0x79, 0x75, 0x61, 0x6e, 0x10, 0x09, + 0x12, 0x14, 0x0a, 0x10, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x67, 0x75, 0x61, 0x6e, 0x67, + 0x7a, 0x68, 0x6f, 0x75, 0x10, 0x0a, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, + 0x5f, 0x63, 0x68, 0x65, 0x6e, 0x67, 0x64, 0x75, 0x10, 0x0b, 0x12, 0x13, 0x0a, 0x0f, 0x61, 0x6c, + 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x68, 0x6f, 0x6e, 0x67, 0x6b, 0x6f, 0x6e, 0x67, 0x10, 0x0c, 0x12, + 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, + 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0d, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61, + 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x0e, 0x12, + 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, + 0x61, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x0f, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61, + 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x35, 0x10, 0x10, 0x12, + 0x12, 0x0a, 0x0e, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, + 0x31, 0x10, 0x11, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, 0x5f, 0x6e, 0x6f, + 0x72, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x12, 0x12, 0x11, 0x0a, 0x0d, 0x61, + 0x6c, 0x69, 0x5f, 0x75, 0x73, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x13, 0x12, 0x11, + 0x0a, 0x0d, 0x61, 0x6c, 0x69, 0x5f, 0x75, 0x73, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, + 0x14, 0x12, 0x14, 0x0a, 0x10, 0x61, 0x6c, 0x69, 0x5f, 0x65, 0x75, 0x5f, 0x63, 0x65, 0x6e, 0x74, + 0x72, 0x61, 0x6c, 0x5f, 0x31, 0x10, 0x15, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x6c, 0x69, 0x5f, 0x65, + 0x75, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x16, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x6c, + 0x69, 0x5f, 0x6d, 0x65, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x17, 0x2a, 0xa1, 0x03, + 0x0a, 0x0f, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x12, 0x0a, 0x0a, 0x06, 0x74, 0x63, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x11, 0x0a, + 0x0d, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x62, 0x61, 0x6e, 0x67, 0x6b, 0x6f, 0x6b, 0x10, 0x01, + 0x12, 0x11, 0x0a, 0x0d, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x62, 0x65, 0x69, 0x6a, 0x69, 0x6e, + 0x67, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x63, 0x68, 0x65, + 0x6e, 0x67, 0x64, 0x75, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, + 0x63, 0x68, 0x6f, 0x6e, 0x67, 0x71, 0x69, 0x6e, 0x67, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x74, + 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x7a, 0x68, 0x6f, 0x75, 0x10, 0x05, + 0x12, 0x18, 0x0a, 0x14, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x7a, + 0x68, 0x6f, 0x75, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x10, 0x06, 0x12, 0x12, 0x0a, 0x0e, 0x74, 0x63, + 0x5f, 0x61, 0x70, 0x5f, 0x68, 0x6f, 0x6e, 0x67, 0x6b, 0x6f, 0x6e, 0x67, 0x10, 0x07, 0x12, 0x10, + 0x0a, 0x0c, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x6d, 0x75, 0x6d, 0x62, 0x61, 0x69, 0x10, 0x08, + 0x12, 0x0f, 0x0a, 0x0b, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x65, 0x6f, 0x75, 0x6c, 0x10, + 0x09, 0x12, 0x12, 0x0a, 0x0e, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x68, 0x61, 0x6e, 0x67, + 0x68, 0x61, 0x69, 0x10, 0x0a, 0x12, 0x16, 0x0a, 0x12, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, + 0x68, 0x61, 0x6e, 0x67, 0x68, 0x61, 0x69, 0x5f, 0x66, 0x73, 0x69, 0x10, 0x0b, 0x12, 0x16, 0x0a, + 0x12, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x68, 0x65, 0x6e, 0x7a, 0x68, 0x65, 0x6e, 0x5f, + 0x66, 0x73, 0x69, 0x10, 0x0c, 0x12, 0x13, 0x0a, 0x0f, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, + 0x69, 0x6e, 0x67, 0x61, 0x70, 0x6f, 0x72, 0x65, 0x10, 0x0d, 0x12, 0x0f, 0x0a, 0x0b, 0x74, 0x63, + 0x5f, 0x61, 0x70, 0x5f, 0x74, 0x6f, 0x6b, 0x79, 0x6f, 0x10, 0x0e, 0x12, 0x13, 0x0a, 0x0f, 0x74, + 0x63, 0x5f, 0x65, 0x75, 0x5f, 0x66, 0x72, 0x61, 0x6e, 0x6b, 0x66, 0x75, 0x72, 0x74, 0x10, 0x0f, + 0x12, 0x10, 0x0a, 0x0c, 0x74, 0x63, 0x5f, 0x65, 0x75, 0x5f, 0x6d, 0x6f, 0x73, 0x63, 0x6f, 0x77, + 0x10, 0x10, 0x12, 0x11, 0x0a, 0x0d, 0x74, 0x63, 0x5f, 0x6e, 0x61, 0x5f, 0x61, 0x73, 0x68, 0x62, + 0x75, 0x72, 0x6e, 0x10, 0x11, 0x12, 0x17, 0x0a, 0x13, 0x74, 0x63, 0x5f, 0x6e, 0x61, 0x5f, 0x73, + 0x69, 0x6c, 0x69, 0x63, 0x6f, 0x6e, 0x76, 0x61, 0x6c, 0x6c, 0x65, 0x79, 0x10, 0x12, 0x12, 0x11, + 0x0a, 0x0d, 0x74, 0x63, 0x5f, 0x6e, 0x61, 0x5f, 0x74, 0x6f, 0x72, 0x6f, 0x6e, 0x74, 0x6f, 0x10, + 0x13, 0x2a, 0xe8, 0x01, 0x0a, 0x0e, 0x48, 0x75, 0x61, 0x77, 0x65, 0x69, 0x52, 0x65, 0x67, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x0a, 0x0a, 0x06, 0x68, 0x77, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00, + 0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, 0x5f, + 0x31, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x6e, 0x6f, 0x72, + 0x74, 0x68, 0x5f, 0x34, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, + 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x68, 0x77, 0x5f, + 0x63, 0x6e, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x68, + 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x05, 0x12, 0x15, 0x0a, + 0x11, 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x77, 0x65, 0x73, 0x74, + 0x5f, 0x32, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x68, 0x77, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, + 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x68, + 0x77, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, + 0x10, 0x08, 0x12, 0x15, 0x0a, 0x11, 0x68, 0x77, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, + 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x09, 0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, + 0x61, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x0a, 0x2a, 0xcd, 0x03, 0x0a, + 0x0b, 0x41, 0x77, 0x73, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x0b, 0x0a, 0x07, + 0x61, 0x77, 0x73, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, + 0x5f, 0x75, 0x73, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, + 0x61, 0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x02, 0x12, + 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x31, + 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, 0x77, 0x65, 0x73, + 0x74, 0x5f, 0x32, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x66, 0x5f, + 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x05, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, + 0x5f, 0x61, 0x70, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x06, 0x12, 0x12, 0x0a, 0x0e, + 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x07, + 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, + 0x65, 0x61, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, + 0x61, 0x70, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x09, + 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, + 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0a, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, + 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x0b, + 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, + 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0c, 0x12, 0x14, 0x0a, 0x10, 0x61, 0x77, 0x73, 0x5f, + 0x63, 0x61, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x5f, 0x31, 0x10, 0x0d, 0x12, 0x14, + 0x0a, 0x10, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, + 0x5f, 0x31, 0x10, 0x0e, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x77, + 0x65, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0f, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x65, + 0x75, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x10, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, + 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x11, 0x12, 0x11, + 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x33, 0x10, + 0x12, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x6e, 0x6f, 0x72, 0x74, + 0x68, 0x5f, 0x31, 0x10, 0x13, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x6d, 0x65, 0x5f, + 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x14, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, + 0x5f, 0x73, 0x61, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x15, 0x32, 0x70, 0x0a, 0x0d, + 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x5f, 0x92, + 0x41, 0x5c, 0x12, 0x1e, 0xe6, 0x89, 0x80, 0xe6, 0x9c, 0x89, 0xe4, 0xba, 0x91, 0xe7, 0xa7, 0x9f, + 0xe6, 0x88, 0xb7, 0xe7, 0x9a, 0x84, 0xe8, 0xae, 0xa4, 0xe8, 0xaf, 0x81, 0xe6, 0x9c, 0x8d, 0xe5, + 0x8a, 0xa1, 0x1a, 0x3a, 0x0a, 0x17, 0x46, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x6d, + 0x6f, 0x72, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x50, 0x43, 0x4d, 0x12, 0x1f, 0x68, + 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x6f, + 0x72, 0x67, 0x2e, 0x63, 0x6e, 0x2f, 0x4a, 0x43, 0x43, 0x45, 0x2f, 0x50, 0x43, 0x4d, 0x42, 0x30, + 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x63, 0x6e, + 0x2f, 0x4a, 0x43, 0x43, 0x45, 0x2f, 0x50, 0x43, 0x4d, 0x2f, 0x6c, 0x61, 0x6e, 0x5f, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x2f, 0x69, 0x64, 0x6c, 0x2f, 0x70, 0x62, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/lan_trans/openapiv2/idl/demo/demo.swagger.json b/lan_trans/openapiv2/idl/demo/demo.swagger.json new file mode 100644 index 00000000..a969e31b --- /dev/null +++ b/lan_trans/openapiv2/idl/demo/demo.swagger.json @@ -0,0 +1,99 @@ +{ + "swagger": "2.0", + "info": { + "title": "idl/demo/demo.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "DemoService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/apis/demo": { + "post": { + "summary": "Echo 样例接口", + "operationId": "DemoService_Echo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/demoStringMessage" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/demoStringMessage" + } + } + ], + "tags": [ + "DemoService" + ], + "deprecated": true, + "security": [], + "externalDocs": { + "description": "Find out more about the interface", + "url": "https://github.com/grpc-ecosystem/grpc-gateway" + } + } + } + }, + "definitions": { + "demoStringMessage": { + "type": "object", + "properties": { + "value": { + "type": "string" + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "typeUrl": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/lan_trans/swagger.json b/lan_trans/openapiv2/idl/pbecs/ecs.swagger.json similarity index 80% rename from lan_trans/swagger.json rename to lan_trans/openapiv2/idl/pbecs/ecs.swagger.json index 8d6af87c..6e80824e 100644 --- a/lan_trans/swagger.json +++ b/lan_trans/openapiv2/idl/pbecs/ecs.swagger.json @@ -1,44 +1,30 @@ { + "swagger": "2.0", + "info": { + "title": "idl/pbecs/ecs.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "EcsService" + } + ], "consumes": [ "application/json" ], "produces": [ "application/json" ], - "swagger": "2.0", - "info": { - "title": "idl/demo/demo.proto", - "version": "version not set" - }, "paths": { - "/apis/demo": { + "/apis/ecs": { "post": { - "security": [], - "tags": [ - "DemoService" - ], - "summary": "Echo 样例接口", - "externalDocs": { - "description": "Find out more about the interface", - "url": "https://github.com/grpc-ecosystem/grpc-gateway" - }, - "operationId": "DemoService_Echo", - "deprecated": true, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/demoStringMessage" - } - } - ], + "summary": "查询ECS全量 - 根据云类型", + "operationId": "EcsService_ListEcs", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/demoStringMessage" + "$ref": "#/definitions/pbecsListResp" } }, "default": { @@ -47,16 +33,7 @@ "$ref": "#/definitions/rpcStatus" } } - } - } - }, - "/apis/ecs": { - "post": { - "tags": [ - "EcsService" - ], - "summary": "查询ECS全量 - 根据云类型", - "operationId": "EcsService_ListEcs", + }, "parameters": [ { "name": "body", @@ -67,6 +44,15 @@ } } ], + "tags": [ + "EcsService" + ] + } + }, + "/apis/ecs/all": { + "post": { + "summary": "查询所有云的ECS", + "operationId": "EcsService_ListEcsAll", "responses": { "200": { "description": "A successful response.", @@ -80,16 +66,7 @@ "$ref": "#/definitions/rpcStatus" } } - } - } - }, - "/apis/ecs/all": { - "post": { - "tags": [ - "EcsService" - ], - "summary": "查询所有云的ECS", - "operationId": "EcsService_ListEcsAll", + }, "parameters": [ { "name": "body", @@ -100,39 +77,15 @@ } } ], - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/pbecsListResp" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - } + "tags": [ + "EcsService" + ] } }, "/apis/ecs/detail": { "post": { - "tags": [ - "EcsService" - ], "summary": "查询ECS明细 - 支持云类型、区域、账户、分页等过滤条件", "operationId": "EcsService_ListEcsDetail", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/pbecsListDetailReq" - } - } - ], "responses": { "200": { "description": "A successful response.", @@ -146,54 +99,35 @@ "$ref": "#/definitions/rpcStatus" } } - } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbecsListDetailReq" + } + } + ], + "tags": [ + "EcsService" + ] } } }, "definitions": { - "demoStringMessage": { - "type": "object", - "properties": { - "value": { - "type": "string" - } - } - }, "pbecsEcsInstance": { "type": "object", "properties": { + "provider": { + "$ref": "#/definitions/pbtenantCloudProvider", + "title": "云类型" + }, "accountName": { "type": "string", "title": "账号名称" }, - "chargeType": { - "type": "string", - "title": "收费类型" - }, - "cpu": { - "type": "integer", - "format": "int32", - "title": "vcpu数" - }, - "creationTime": { - "type": "string", - "title": "创建时间,ISO8601" - }, - "description": { - "type": "string", - "title": "实例描述" - }, - "expireTime": { - "type": "string", - "title": "过期时间" - }, - "innerIps": { - "type": "array", - "title": "内网ip", - "items": { - "type": "string" - } - }, "instanceId": { "type": "string", "title": "实例id" @@ -202,41 +136,65 @@ "type": "string", "title": "实例名称" }, + "regionName": { + "type": "string", + "title": "地域,数据中心" + }, + "publicIps": { + "type": "array", + "items": { + "type": "string" + }, + "title": "公网ip" + }, "instanceType": { "type": "string", "title": "实例类型" }, + "cpu": { + "type": "integer", + "format": "int32", + "title": "vcpu数" + }, "memory": { "type": "integer", "format": "int32", "title": "内存MB" }, - "provider": { - "title": "云类型", - "$ref": "#/definitions/pbtenantCloudProvider" - }, - "publicIps": { - "type": "array", - "title": "公网ip", - "items": { - "type": "string" - } - }, - "regionName": { + "description": { "type": "string", - "title": "地域,数据中心" - }, - "resourceGroupId": { - "type": "string", - "title": "资源组id" + "title": "实例描述" }, "status": { "type": "string", "title": "状态" }, + "creationTime": { + "type": "string", + "title": "创建时间,ISO8601" + }, + "expireTime": { + "type": "string", + "title": "过期时间" + }, + "innerIps": { + "type": "array", + "items": { + "type": "string" + }, + "title": "内网ip" + }, "vpcId": { "type": "string", - "title": "vcp id" + "title": "vpc id" + }, + "resourceGroupId": { + "type": "string", + "title": "资源组id" + }, + "chargeType": { + "type": "string", + "title": "收费类型" } } }, @@ -246,13 +204,18 @@ "pbecsListDetailReq": { "type": "object", "properties": { + "provider": { + "$ref": "#/definitions/pbtenantCloudProvider", + "title": "云名称" + }, "accountName": { "type": "string", "title": "账户名称,根据config.yaml中的配置,默认为第一个配置的账户" }, - "nextToken": { - "type": "string", - "title": "分页相关参数,下一页的token" + "regionId": { + "type": "integer", + "format": "int32", + "title": "区域Id,参考 tenant.proto 中的各个云的区域" }, "pageNumber": { "type": "integer", @@ -264,14 +227,9 @@ "format": "int32", "title": "分页相关参数,每页数量" }, - "provider": { - "title": "云名称", - "$ref": "#/definitions/pbtenantCloudProvider" - }, - "regionId": { - "type": "integer", - "format": "int32", - "title": "区域Id,参考 tenant.proto 中的各个云的区域" + "nextToken": { + "type": "string", + "title": "分页相关参数,下一页的token" } } }, @@ -280,19 +238,15 @@ "properties": { "ecses": { "type": "array", - "title": "Ecs 机器集合", "items": { "$ref": "#/definitions/pbecsEcsInstance" - } + }, + "title": "Ecs 机器集合" }, "finished": { "type": "boolean", "title": "查询是否完成,如果为否-false,则可以将下面三个分页参数填入到请求中,继续查询" }, - "nextToken": { - "type": "string", - "title": "分页相关参数,下一页的token" - }, "pageNumber": { "type": "integer", "format": "int32", @@ -303,6 +257,10 @@ "format": "int32", "title": "分页相关参数,每页数量" }, + "nextToken": { + "type": "string", + "title": "分页相关参数,下一页的token" + }, "requestId": { "type": "string", "title": "请求id,出现问题后提供给云厂商,排查问题" @@ -313,8 +271,8 @@ "type": "object", "properties": { "provider": { - "title": "云名称", - "$ref": "#/definitions/pbtenantCloudProvider" + "$ref": "#/definitions/pbtenantCloudProvider", + "title": "云名称" } } }, @@ -323,24 +281,24 @@ "properties": { "ecses": { "type": "array", - "title": "Ecs 机器集合", "items": { "$ref": "#/definitions/pbecsEcsInstance" - } + }, + "title": "Ecs 机器集合" } } }, "pbtenantCloudProvider": { - "description": "- ali: 0 - 阿里云\n - tencent: 1 - 腾讯云\n - huawei: 2 - 华为云\n - aws: 3 - 亚马逊云", "type": "string", - "title": "云提供商", - "default": "ali", "enum": [ "ali", "tencent", "huawei", "aws" - ] + ], + "default": "ali", + "description": "- ali: 0 - 阿里云\n - tencent: 1 - 腾讯云\n - huawei: 2 - 华为云\n - aws: 3 - 亚马逊云", + "title": "云提供商" }, "protobufAny": { "type": "object", @@ -361,24 +319,16 @@ "type": "integer", "format": "int32" }, + "message": { + "type": "string" + }, "details": { "type": "array", "items": { "$ref": "#/definitions/protobufAny" } - }, - "message": { - "type": "string" } } } - }, - "tags": [ - { - "name": "DemoService" - }, - { - "name": "EcsService" - } - ] -} \ No newline at end of file + } +} diff --git a/lan_trans/openapiv2/idl/pbpod/pod.swagger.json b/lan_trans/openapiv2/idl/pbpod/pod.swagger.json new file mode 100644 index 00000000..a234fb3a --- /dev/null +++ b/lan_trans/openapiv2/idl/pbpod/pod.swagger.json @@ -0,0 +1,436 @@ +{ + "swagger": "2.0", + "info": { + "title": "idl/pbpod/pod.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "PodService" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/apis/pod": { + "post": { + "summary": "查询pod全量 - 根据云类型", + "operationId": "PodService_ListPod", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbpodListResp" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbpodListReq" + } + } + ], + "tags": [ + "PodService" + ] + } + }, + "/apis/pod/create": { + "post": { + "summary": "创建pod - 支持云类型、区域", + "operationId": "PodService_CreatePod", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbpodCreateRep" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbpodCreateReq" + } + } + ], + "tags": [ + "PodService" + ] + } + }, + "/apis/pod/detail": { + "post": { + "summary": "查询Pod明细 - 支持云类型、区域、账户、分页等过滤条件", + "operationId": "PodService_ListPodDetail", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pbpodListDetailResp" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/pbpodListDetailReq" + } + } + ], + "tags": [ + "PodService" + ] + } + } + }, + "definitions": { + "pbpodContainer": { + "type": "object", + "properties": { + "image": { + "type": "string", + "title": "容器镜像" + }, + "name": { + "type": "string", + "title": "容器名称" + }, + "cpu": { + "type": "integer", + "format": "int32", + "title": "vcpu数" + }, + "memory": { + "type": "integer", + "format": "int32", + "title": "内存MB" + }, + "restartCount": { + "type": "integer", + "format": "int32", + "title": "重启次数" + } + } + }, + "pbpodCreateRep": { + "type": "object", + "properties": { + "id": { + "type": "array", + "items": { + "type": "string" + } + }, + "requestId": { + "type": "string" + } + } + }, + "pbpodCreateReq": { + "type": "object", + "properties": { + "provider": { + "$ref": "#/definitions/pbtenantCloudProvider", + "title": "云名称" + }, + "accountName": { + "type": "string", + "title": "账户名称,根据config.yaml中的配置,默认为第一个配置的账户" + }, + "regionId": { + "type": "integer", + "format": "int32", + "title": "区域Id,参考 tenant.proto 中的各个云的区域" + }, + "containerImage": { + "type": "string", + "title": "镜像地址" + }, + "containerName": { + "type": "string", + "title": "容器名称" + }, + "containerGroupName": { + "type": "string", + "title": "容器实例名称" + }, + "cpu": { + "type": "integer", + "format": "int32", + "title": "vcpu数" + }, + "memory": { + "type": "integer", + "format": "int32", + "title": "内存MB" + }, + "namespace": { + "type": "string", + "title": "namespace (华为云cci必需)" + }, + "securityGroupId": { + "type": "array", + "items": { + "type": "string" + }, + "title": "安全组id(腾讯云eks必需)" + }, + "subnetId": { + "type": "array", + "items": { + "type": "string" + }, + "title": "subnet_id 子网id (腾讯云eks必需)" + }, + "vpcId": { + "type": "string", + "title": "vpc id (腾讯云eks必需)" + } + } + }, + "pbpodListDetailReq": { + "type": "object", + "properties": { + "provider": { + "$ref": "#/definitions/pbtenantCloudProvider", + "title": "云名称" + }, + "accountName": { + "type": "string", + "title": "账户名称,根据config.yaml中的配置,默认为第一个配置的账户" + }, + "regionId": { + "type": "integer", + "format": "int32", + "title": "区域Id,参考 tenant.proto 中的各个云的区域" + }, + "pageNumber": { + "type": "integer", + "format": "int32", + "title": "分页相关参数,页码" + }, + "pageSize": { + "type": "integer", + "format": "int32", + "title": "分页相关参数,每页数量" + }, + "nextToken": { + "type": "string", + "title": "分页相关参数,下一页的token" + } + } + }, + "pbpodListDetailResp": { + "type": "object", + "properties": { + "pods": { + "type": "array", + "items": { + "$ref": "#/definitions/pbpodPodInstance" + }, + "title": "pod 容器组集合" + }, + "finished": { + "type": "boolean", + "title": "查询是否完成,如果为否-false,则可以将下面三个分页参数填入到请求中,继续查询" + }, + "pageNumber": { + "type": "integer", + "format": "int32", + "title": "分页相关参数,页码" + }, + "pageSize": { + "type": "integer", + "format": "int32", + "title": "分页相关参数,每页数量" + }, + "nextToken": { + "type": "string", + "title": "分页相关参数,下一页的token" + }, + "requestId": { + "type": "string", + "title": "请求id,出现问题后提供给云厂商,排查问题" + } + } + }, + "pbpodListReq": { + "type": "object", + "properties": { + "provider": { + "$ref": "#/definitions/pbtenantCloudProvider", + "title": "云名称" + } + } + }, + "pbpodListResp": { + "type": "object", + "properties": { + "pods": { + "type": "array", + "items": { + "$ref": "#/definitions/pbpodPodInstance" + }, + "title": "Pod 容器组集合" + } + } + }, + "pbpodPodInstance": { + "type": "object", + "properties": { + "provider": { + "$ref": "#/definitions/pbtenantCloudProvider", + "title": "云类型" + }, + "accountName": { + "type": "string", + "title": "账号名称" + }, + "instanceId": { + "type": "string", + "title": "实例id" + }, + "instanceName": { + "type": "string", + "title": "实例名称" + }, + "regionName": { + "type": "string", + "title": "地域,数据中心" + }, + "publicIps": { + "type": "string", + "title": "公网ip" + }, + "instanceType": { + "type": "string", + "title": "实例类型" + }, + "cpu": { + "type": "integer", + "format": "int32", + "title": "vcpu数" + }, + "memory": { + "type": "integer", + "format": "int32", + "title": "内存MB" + }, + "description": { + "type": "string", + "title": "实例描述" + }, + "status": { + "type": "string", + "title": "状态" + }, + "creationTime": { + "type": "string", + "title": "创建时间,ISO8601" + }, + "expireTime": { + "type": "string", + "title": "过期时间" + }, + "innerIps": { + "type": "array", + "items": { + "type": "string" + }, + "title": "内网ip" + }, + "vpcId": { + "type": "string", + "title": "vpc id" + }, + "securityGroupId": { + "type": "string", + "title": "安全组id" + }, + "SubnetId": { + "type": "string", + "title": "子网Id" + }, + "Container": { + "$ref": "#/definitions/pbpodContainer", + "title": "容器实例" + } + } + }, + "pbtenantCloudProvider": { + "type": "string", + "enum": [ + "ali", + "tencent", + "huawei", + "aws" + ], + "default": "ali", + "description": "- ali: 0 - 阿里云\n - tencent: 1 - 腾讯云\n - huawei: 2 - 华为云\n - aws: 3 - 亚马逊云", + "title": "云提供商" + }, + "protobufAny": { + "type": "object", + "properties": { + "typeUrl": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/lan_trans/openapiv2/idl/pbtenant/tenant.swagger.json b/lan_trans/openapiv2/idl/pbtenant/tenant.swagger.json new file mode 100644 index 00000000..636ce737 --- /dev/null +++ b/lan_trans/openapiv2/idl/pbtenant/tenant.swagger.json @@ -0,0 +1,46 @@ +{ + "swagger": "2.0", + "info": { + "title": "idl/pbtenant/tenant.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "typeUrl": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/main.go b/main.go index db7f3d78..efb3eae6 100644 --- a/main.go +++ b/main.go @@ -3,16 +3,17 @@ package main import ( "context" "flag" - "gitlink.org.cn/JCCE/PCM/common/server" - "gitlink.org.cn/JCCE/PCM/common/tenanter" - "gitlink.org.cn/JCCE/PCM/lan_trans/idl/demo" - "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbecs" "net" "net/http" "github.com/golang/glog" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/pkg/errors" + "gitlink.org.cn/JCCE/PCM/common/server" + "gitlink.org.cn/JCCE/PCM/common/tenanter" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/demo" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbecs" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbpod" "google.golang.org/grpc" ) @@ -35,6 +36,8 @@ func run() error { return errors.Wrap(err, "RegisterDemoServiceHandlerFromEndpoint error") } else if err = pbecs.RegisterEcsServiceHandlerFromEndpoint(ctx, mux, *grpcServerEndpoint, opts); err != nil { return errors.Wrap(err, "RegisterEcsServiceHandlerFromEndpoint error") + } else if err = pbpod.RegisterPodServiceHandlerFromEndpoint(ctx, mux, *grpcServerEndpoint, opts); err != nil { + return errors.Wrap(err, "RegisterPoderviceHandlerFromEndpoint error") } // Start HTTP server (and proxy calls to gRPC server endpoint) @@ -65,6 +68,7 @@ func main() { s := grpc.NewServer() demo.RegisterDemoServiceServer(s, &server.Server{}) pbecs.RegisterEcsServiceServer(s, &server.Server{}) + pbpod.RegisterPodServiceServer(s, &server.Server{}) if err = s.Serve(lis); err != nil { glog.Fatalf("failed to serve: %v", err) From 7c6c84108a9c7b65b8d147eb16c3dc71a08b62a8 Mon Sep 17 00:00:00 2001 From: devad Date: Tue, 5 Apr 2022 15:11:44 +0800 Subject: [PATCH 3/4] add huawei pod Signed-off-by: devad --- adaptor/container_api_adaptor/common/main.go | 4 +- .../huawei/pkg/auth/aksk/aksk.go | 1 + adaptor/pod_adaptor/service/poder/huawei.go | 163 ++++++++++++++++++ adaptor/pod_adaptor/service/poder/poder.go | 9 +- idl/pbpod/pod.proto | 2 + idl/pbtenant/tenant.proto | 1 + lan_trans/idl/pbpod/pod.pb.go | 155 +++++++++-------- lan_trans/idl/pbtenant/tenant.pb.go | 88 +++++----- .../openapiv2/idl/pbpod/pod.swagger.json | 4 + 9 files changed, 308 insertions(+), 119 deletions(-) create mode 100644 adaptor/pod_adaptor/service/poder/huawei.go diff --git a/adaptor/container_api_adaptor/common/main.go b/adaptor/container_api_adaptor/common/main.go index 075f5bc3..f97e5856 100644 --- a/adaptor/container_api_adaptor/common/main.go +++ b/adaptor/container_api_adaptor/common/main.go @@ -1,5 +1,7 @@ package main +import "gitlink.org.cn/JCCE/PCM/adaptor/container_api_adaptor/common/api" + func main() { aliConfigPath := "adaptor/container_api_adaptor/alibaba/eci/config_eci.conf" @@ -17,7 +19,7 @@ func main() { //api.DeletePod("alibaba", akskPath, aliConfigPath) //api.CreatePod("huawei", akskPath, huaweiConfigPath) - //api.ListPod("huawei", akskPath, huaweiConfigPath) + api.ListPod("huawei", akskPath, huaweiConfigPath) //api.UpdatePod("huawei", akskPath, huaweiConfigPath) //api.DeletePod("huawei", akskPath, huaweiConfigPath) diff --git a/adaptor/container_api_adaptor/huawei/pkg/auth/aksk/aksk.go b/adaptor/container_api_adaptor/huawei/pkg/auth/aksk/aksk.go index 06eeae3b..0810021a 100644 --- a/adaptor/container_api_adaptor/huawei/pkg/auth/aksk/aksk.go +++ b/adaptor/container_api_adaptor/huawei/pkg/auth/aksk/aksk.go @@ -2,6 +2,7 @@ package aksk import ( "fmt" + "gitlink.org.cn/JCCE/PCM/adaptor/container_api_adaptor/common/auth/aksk" "gitlink.org.cn/JCCE/PCM/adaptor/container_api_adaptor/common/config" clientset "gitlink.org.cn/JCCE/PCM/adaptor/container_api_adaptor/huawei/pkg/client/networking.cci.io/v1beta1" diff --git a/adaptor/pod_adaptor/service/poder/huawei.go b/adaptor/pod_adaptor/service/poder/huawei.go new file mode 100644 index 00000000..69750874 --- /dev/null +++ b/adaptor/pod_adaptor/service/poder/huawei.go @@ -0,0 +1,163 @@ +package poder + +import ( + "context" + "fmt" + "sync" + + "github.com/golang/glog" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbpod" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbtenant" + + "k8s.io/client-go/tools/clientcmd" + "k8s.io/client-go/tools/clientcmd/api" + + huaweipod "k8s.io/client-go/kubernetes" + + "github.com/pkg/errors" + "gitlink.org.cn/JCCE/PCM/common/tenanter" +) + +var huaweiClientMutex sync.Mutex + +type HuaweiPod struct { + cli *huaweipod.Clientset + region tenanter.Region + tenanter tenanter.Tenanter +} + +const ( + apiVersion = "client.authentication.k8s.io/v1beta1" + iamEndpoint = "https://iam.myhuaweicloud.com" +) + +func newHuaweiPodClient(region tenanter.Region, tenant tenanter.Tenanter) (Poder, error) { + var ( + client *huaweipod.Clientset + err error + ) + cciEndpoint := "https://cci." + region.GetName() + ".myhuaweicloud.com" + cciConfig, err := clientcmd.BuildConfigFromFlags(cciEndpoint, "") + if err != nil { + return nil, err + } + + switch t := tenant.(type) { + case *tenanter.AccessKeyTenant: + // 阿里云的sdk有一个 map 的并发问题,go test 加上-race 能检测出来,所以这里加一个锁 + huaweiClientMutex.Lock() + var optionArgs []string + optionArgs = append(optionArgs, fmt.Sprintf("--iam-endpoint=%s", iamEndpoint)) + optionArgs = append(optionArgs, fmt.Sprintf("--project-name=%s", region.GetName())) + optionArgs = append(optionArgs, fmt.Sprintf("--ak=%s", t.GetId())) + optionArgs = append(optionArgs, fmt.Sprintf("--sk=%s", t.GetSecret())) + cciConfig.ExecProvider = &api.ExecConfig{ + Command: "cci-iam-authenticator", + APIVersion: apiVersion, + Args: append([]string{"token"}, optionArgs...), + Env: make([]api.ExecEnvVar, 0), + } + client, err = huaweipod.NewForConfig(cciConfig) + huaweiClientMutex.Unlock() + default: + } + + if err != nil { + return nil, errors.Wrap(err, "init huawei pod client error") + } + + return &HuaweiPod{ + cli: client, + region: region, + tenanter: tenant, + }, nil +} + +func (pod *HuaweiPod) ListDetail(ctx context.Context, req *pbpod.ListDetailReq) (*pbpod.ListDetailResp, error) { + resp, err := pod.cli.CoreV1().Pods(req.GetNamespace()).List(metav1.ListOptions{}) + if err != nil { + return nil, errors.Wrap(err, "Huaweiyun ListDetail pod error") + } + glog.Info("Huaweiyun ListDetail pod success", resp.Items) + var podes = make([]*pbpod.PodInstance, len(resp.Items)) + for k, v := range resp.Items { + podes[k] = &pbpod.PodInstance{ + Provider: pbtenant.CloudProvider_huawei, + AccountName: pod.tenanter.AccountName(), + InstanceId: string(v.GetUID()), + InstanceName: v.Name, + RegionName: pod.region.GetName(), + PublicIps: v.Status.PodIP, + //InstanceType: v.InstanceType, + //Cpu: v.Spec.Containers[0].Resources.Requests.Cpu(), + //Memory: v.Spec.Containers[0].Resources.Requests.Memory(), + //Description: v.Description, + Status: string(v.Status.Phase), + CreationTime: v.CreationTimestamp.String(), + //ExpireTime: v.ExpiredTime, + //InnerIps: v.IntranetIp, + //VpcId: v.VpcId, + //SecurityGroupId: v.SecurityGroupId + } + } + + isFinished := false + if len(podes) < int(req.PageSize) { + isFinished = true + } + + return &pbpod.ListDetailResp{ + Pods: podes, + Finished: isFinished, + PageNumber: req.PageNumber + 1, + PageSize: req.PageSize, + //NextToken: resp.NextToken, + //RequestId: resp.RequestId, + }, nil +} + +func (pod *HuaweiPod) create(ctx context.Context, req *pbpod.ListDetailReq) (*pbpod.ListDetailResp, error) { + resp, err := pod.cli.CoreV1().Pods(req.GetNamespace()).List(metav1.ListOptions{}) + if err != nil { + return nil, errors.Wrap(err, "Huaweiyun ListDetail pod error") + } + glog.Info("Huaweiyun ListDetail pod success", resp.Items) + var podes = make([]*pbpod.PodInstance, len(resp.Items)) + for k, v := range resp.Items { + podes[k] = &pbpod.PodInstance{ + Provider: pbtenant.CloudProvider_huawei, + AccountName: pod.tenanter.AccountName(), + InstanceId: string(v.GetUID()), + InstanceName: v.Name, + RegionName: pod.region.GetName(), + PublicIps: v.Status.PodIP, + //InstanceType: v.InstanceType, + //Cpu: v.Spec.Containers[0].Resources.Requests.Cpu(), + //Memory: v.Spec.Containers[0].Resources.Requests.Memory(), + //Description: v.Description, + Status: string(v.Status.Phase), + CreationTime: v.CreationTimestamp.String(), + //ExpireTime: v.ExpiredTime, + //InnerIps: v.IntranetIp, + //VpcId: v.VpcId, + //SecurityGroupId: v.SecurityGroupId + } + } + + isFinished := false + if len(podes) < int(req.PageSize) { + isFinished = true + } + + return &pbpod.ListDetailResp{ + Pods: podes, + Finished: isFinished, + PageNumber: req.PageNumber + 1, + PageSize: req.PageSize, + //NextToken: resp.NextToken, + //RequestId: resp.RequestId, + }, nil +} diff --git a/adaptor/pod_adaptor/service/poder/poder.go b/adaptor/pod_adaptor/service/poder/poder.go index a5a03ea2..6b184051 100644 --- a/adaptor/pod_adaptor/service/poder/poder.go +++ b/adaptor/pod_adaptor/service/poder/poder.go @@ -2,6 +2,7 @@ package poder import ( "context" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbpod" "gitlink.org.cn/JCCE/PCM/common/tenanter" @@ -32,10 +33,10 @@ func NewPodClient(provider pbtenant.CloudProvider, region tenanter.Region, tenan switch provider { case pbtenant.CloudProvider_ali: return newAliPodClient(region, tenant) - //case pbtenant.CloudProvider_tencent: - // return newTencentPodClient(region, tenant) - //case pbtenant.CloudProvider_huawei: - // return newHuaweiPodClient(region, tenant) + //case pbtenant.CloudProvider_tencent: + // return newTencentPodClient(region, tenant) + case pbtenant.CloudProvider_huawei: + return newHuaweiPodClient(region, tenant) //TODO aws //case pbtenant.CloudProvider_aws: // return newAwsPodClient(region, tenant) diff --git a/idl/pbpod/pod.proto b/idl/pbpod/pod.proto index 55325ecf..33879de6 100644 --- a/idl/pbpod/pod.proto +++ b/idl/pbpod/pod.proto @@ -71,6 +71,8 @@ message ListDetailReq { int32 page_size = 5; // 分页相关参数,下一页的token string next_token = 6; + // namespace + string namespace = 7; } message ListDetailResp { diff --git a/idl/pbtenant/tenant.proto b/idl/pbtenant/tenant.proto index f54f5b28..2087cef8 100644 --- a/idl/pbtenant/tenant.proto +++ b/idl/pbtenant/tenant.proto @@ -116,6 +116,7 @@ enum HuaweiRegionId { hw_ap_southeast_2 = 8; hw_ap_southeast_3 = 9; hw_af_south_1 = 10; + hw_cn_south_2 = 11; } // 亚马逊云区域,需要将对应的 _ 转化为 - diff --git a/lan_trans/idl/pbpod/pod.pb.go b/lan_trans/idl/pbpod/pod.pb.go index b500cb31..99a55b57 100644 --- a/lan_trans/idl/pbpod/pod.pb.go +++ b/lan_trans/idl/pbpod/pod.pb.go @@ -324,6 +324,8 @@ type ListDetailReq struct { PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // 分页相关参数,下一页的token NextToken string `protobuf:"bytes,6,opt,name=next_token,json=nextToken,proto3" json:"next_token,omitempty"` + // namespace + Namespace string `protobuf:"bytes,7,opt,name=namespace,proto3" json:"namespace,omitempty"` } func (x *ListDetailReq) Reset() { @@ -400,6 +402,13 @@ func (x *ListDetailReq) GetNextToken() string { return "" } +func (x *ListDetailReq) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + type ListDetailResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -846,7 +855,7 @@ var file_idl_pbpod_pod_proto_rawDesc = []byte{ 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xe1, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xff, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x33, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, @@ -860,77 +869,79 @@ var file_idl_pbpod_pod_proto_rawDesc = []byte{ 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x6e, 0x65, 0x78, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xd0, 0x01, 0x0a, 0x0e, 0x4c, 0x69, - 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x04, - 0x70, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x70, - 0x6f, 0x64, 0x2e, 0x50, 0x6f, 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x04, - 0x70, 0x6f, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, - 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, - 0x0a, 0x0a, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, - 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x3e, 0x0a, 0x07, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x33, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x74, 0x65, - 0x6e, 0x61, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x32, 0x0a, 0x08, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x04, 0x70, 0x6f, 0x64, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x50, - 0x6f, 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x04, 0x70, 0x6f, 0x64, 0x73, - 0x22, 0xaa, 0x03, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x33, - 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x17, 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, - 0x64, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x67, 0x69, 0x6f, - 0x6e, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x25, 0x0a, 0x0e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, - 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, - 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x2a, 0x0a, - 0x11, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, - 0x69, 0x64, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, - 0x74, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x75, 0x62, - 0x6e, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x73, 0x75, - 0x62, 0x6e, 0x65, 0x74, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x76, 0x70, 0x63, 0x5f, 0x69, 0x64, - 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x70, 0x63, 0x49, 0x64, 0x22, 0x3a, 0x0a, - 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x32, 0xf7, 0x01, 0x0a, 0x0a, 0x50, 0x6f, - 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x50, 0x6f, 0x64, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x15, 0x22, 0x10, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x59, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, - 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, - 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x52, 0x65, 0x73, 0x70, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x10, 0x2f, 0x61, - 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x3a, 0x01, - 0x2a, 0x12, 0x40, 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x12, 0x0e, 0x2e, 0x70, - 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, - 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x14, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x22, 0x09, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, - 0x3a, 0x01, 0x2a, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x6f, - 0x72, 0x67, 0x2e, 0x63, 0x6e, 0x2f, 0x4a, 0x43, 0x43, 0x45, 0x2f, 0x50, 0x43, 0x4d, 0x2f, 0x6c, - 0x61, 0x6e, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x2f, 0x69, 0x64, 0x6c, 0x2f, 0x70, 0x62, 0x70, - 0x6f, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x65, 0x78, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0xd0, 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, + 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x04, 0x70, 0x6f, + 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, + 0x2e, 0x50, 0x6f, 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x04, 0x70, 0x6f, + 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x1f, + 0x0a, 0x0b, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x3e, 0x0a, 0x07, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x33, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6e, 0x61, + 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x32, 0x0a, 0x08, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x04, 0x70, 0x6f, 0x64, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x50, 0x6f, 0x64, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x04, 0x70, 0x6f, 0x64, 0x73, 0x22, 0xaa, + 0x03, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x33, 0x0a, 0x08, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, + 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, + 0x6d, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x30, 0x0a, 0x14, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x0a, + 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x73, + 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, + 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x75, 0x62, 0x6e, 0x65, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x73, 0x75, 0x62, 0x6e, + 0x65, 0x74, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x76, 0x70, 0x63, 0x5f, 0x69, 0x64, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x70, 0x63, 0x49, 0x64, 0x22, 0x3a, 0x0a, 0x09, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x32, 0xf7, 0x01, 0x0a, 0x0a, 0x50, 0x6f, 0x64, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x50, 0x6f, 0x64, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, + 0x10, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x59, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x62, + 0x70, 0x6f, 0x64, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, + 0x73, 0x70, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x22, 0x10, 0x2f, 0x61, 0x70, 0x69, + 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x3a, 0x01, 0x2a, 0x12, + 0x40, 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x12, 0x0e, 0x2e, 0x70, 0x62, 0x70, + 0x6f, 0x64, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x62, 0x70, + 0x6f, 0x64, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x14, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x0e, 0x22, 0x09, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x3a, 0x01, + 0x2a, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x6f, 0x72, 0x67, + 0x2e, 0x63, 0x6e, 0x2f, 0x4a, 0x43, 0x43, 0x45, 0x2f, 0x50, 0x43, 0x4d, 0x2f, 0x6c, 0x61, 0x6e, + 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x2f, 0x69, 0x64, 0x6c, 0x2f, 0x70, 0x62, 0x70, 0x6f, 0x64, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/lan_trans/idl/pbtenant/tenant.pb.go b/lan_trans/idl/pbtenant/tenant.pb.go index 1afcfd41..93a05d1e 100644 --- a/lan_trans/idl/pbtenant/tenant.pb.go +++ b/lan_trans/idl/pbtenant/tenant.pb.go @@ -373,6 +373,7 @@ const ( HuaweiRegionId_hw_ap_southeast_2 HuaweiRegionId = 8 HuaweiRegionId_hw_ap_southeast_3 HuaweiRegionId = 9 HuaweiRegionId_hw_af_south_1 HuaweiRegionId = 10 + HuaweiRegionId_hw_cn_south_2 HuaweiRegionId = 11 ) // Enum value maps for HuaweiRegionId. @@ -389,6 +390,7 @@ var ( 8: "hw_ap_southeast_2", 9: "hw_ap_southeast_3", 10: "hw_af_south_1", + 11: "hw_cn_south_2", } HuaweiRegionId_value = map[string]int32{ "hw_all": 0, @@ -402,6 +404,7 @@ var ( "hw_ap_southeast_2": 8, "hw_ap_southeast_3": 9, "hw_af_south_1": 10, + "hw_cn_south_2": 11, } ) @@ -757,7 +760,7 @@ var file_idl_pbtenant_tenant_proto_rawDesc = []byte{ 0x75, 0x72, 0x6e, 0x10, 0x11, 0x12, 0x17, 0x0a, 0x13, 0x74, 0x63, 0x5f, 0x6e, 0x61, 0x5f, 0x73, 0x69, 0x6c, 0x69, 0x63, 0x6f, 0x6e, 0x76, 0x61, 0x6c, 0x6c, 0x65, 0x79, 0x10, 0x12, 0x12, 0x11, 0x0a, 0x0d, 0x74, 0x63, 0x5f, 0x6e, 0x61, 0x5f, 0x74, 0x6f, 0x72, 0x6f, 0x6e, 0x74, 0x6f, 0x10, - 0x13, 0x2a, 0xe8, 0x01, 0x0a, 0x0e, 0x48, 0x75, 0x61, 0x77, 0x65, 0x69, 0x52, 0x65, 0x67, 0x69, + 0x13, 0x2a, 0xfb, 0x01, 0x0a, 0x0e, 0x48, 0x75, 0x61, 0x77, 0x65, 0x69, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x0a, 0x0a, 0x06, 0x68, 0x77, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x6e, 0x6f, 0x72, @@ -771,47 +774,48 @@ var file_idl_pbtenant_tenant_proto_rawDesc = []byte{ 0x77, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x08, 0x12, 0x15, 0x0a, 0x11, 0x68, 0x77, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x09, 0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, - 0x61, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x0a, 0x2a, 0xcd, 0x03, 0x0a, - 0x0b, 0x41, 0x77, 0x73, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x0b, 0x0a, 0x07, - 0x61, 0x77, 0x73, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, - 0x5f, 0x75, 0x73, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, - 0x61, 0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x02, 0x12, - 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x31, - 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, 0x77, 0x65, 0x73, - 0x74, 0x5f, 0x32, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x66, 0x5f, - 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x05, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, - 0x5f, 0x61, 0x70, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x06, 0x12, 0x12, 0x0a, 0x0e, - 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x07, - 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, - 0x65, 0x61, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, - 0x61, 0x70, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x09, - 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, - 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0a, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, - 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x0b, - 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, - 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0c, 0x12, 0x14, 0x0a, 0x10, 0x61, 0x77, 0x73, 0x5f, - 0x63, 0x61, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x5f, 0x31, 0x10, 0x0d, 0x12, 0x14, - 0x0a, 0x10, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, - 0x5f, 0x31, 0x10, 0x0e, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x77, - 0x65, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0f, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x65, - 0x75, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x10, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, - 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x11, 0x12, 0x11, - 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x33, 0x10, - 0x12, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x6e, 0x6f, 0x72, 0x74, - 0x68, 0x5f, 0x31, 0x10, 0x13, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x6d, 0x65, 0x5f, - 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x14, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, - 0x5f, 0x73, 0x61, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x15, 0x32, 0x70, 0x0a, 0x0d, - 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x5f, 0x92, - 0x41, 0x5c, 0x12, 0x1e, 0xe6, 0x89, 0x80, 0xe6, 0x9c, 0x89, 0xe4, 0xba, 0x91, 0xe7, 0xa7, 0x9f, - 0xe6, 0x88, 0xb7, 0xe7, 0x9a, 0x84, 0xe8, 0xae, 0xa4, 0xe8, 0xaf, 0x81, 0xe6, 0x9c, 0x8d, 0xe5, - 0x8a, 0xa1, 0x1a, 0x3a, 0x0a, 0x17, 0x46, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x6d, - 0x6f, 0x72, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x50, 0x43, 0x4d, 0x12, 0x1f, 0x68, - 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x6f, - 0x72, 0x67, 0x2e, 0x63, 0x6e, 0x2f, 0x4a, 0x43, 0x43, 0x45, 0x2f, 0x50, 0x43, 0x4d, 0x42, 0x30, - 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x63, 0x6e, - 0x2f, 0x4a, 0x43, 0x43, 0x45, 0x2f, 0x50, 0x43, 0x4d, 0x2f, 0x6c, 0x61, 0x6e, 0x5f, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x2f, 0x69, 0x64, 0x6c, 0x2f, 0x70, 0x62, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x0a, 0x12, 0x11, 0x0a, 0x0d, + 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x32, 0x10, 0x0b, 0x2a, + 0xcd, 0x03, 0x0a, 0x0b, 0x41, 0x77, 0x73, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, + 0x0b, 0x0a, 0x07, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, + 0x61, 0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x01, 0x12, + 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, + 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, 0x77, 0x65, 0x73, + 0x74, 0x5f, 0x31, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, + 0x77, 0x65, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, + 0x61, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x05, 0x12, 0x11, 0x0a, 0x0d, + 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x06, 0x12, + 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, + 0x31, 0x10, 0x07, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x6e, 0x6f, + 0x72, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x61, + 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, + 0x32, 0x10, 0x09, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x6e, 0x6f, + 0x72, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0a, 0x12, 0x16, 0x0a, 0x12, 0x61, + 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, + 0x32, 0x10, 0x0b, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, + 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0c, 0x12, 0x14, 0x0a, 0x10, 0x61, + 0x77, 0x73, 0x5f, 0x63, 0x61, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x5f, 0x31, 0x10, + 0x0d, 0x12, 0x14, 0x0a, 0x10, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x63, 0x65, 0x6e, 0x74, + 0x72, 0x61, 0x6c, 0x5f, 0x31, 0x10, 0x0e, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x65, + 0x75, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0f, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, + 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x10, 0x12, 0x12, 0x0a, + 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, + 0x11, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x77, 0x65, 0x73, 0x74, + 0x5f, 0x33, 0x10, 0x12, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x6e, + 0x6f, 0x72, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x13, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, + 0x6d, 0x65, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x14, 0x12, 0x11, 0x0a, 0x0d, + 0x61, 0x77, 0x73, 0x5f, 0x73, 0x61, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x15, 0x32, + 0x70, 0x0a, 0x0d, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x1a, 0x5f, 0x92, 0x41, 0x5c, 0x12, 0x1e, 0xe6, 0x89, 0x80, 0xe6, 0x9c, 0x89, 0xe4, 0xba, 0x91, + 0xe7, 0xa7, 0x9f, 0xe6, 0x88, 0xb7, 0xe7, 0x9a, 0x84, 0xe8, 0xae, 0xa4, 0xe8, 0xaf, 0x81, 0xe6, + 0x9c, 0x8d, 0xe5, 0x8a, 0xa1, 0x1a, 0x3a, 0x0a, 0x17, 0x46, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x75, + 0x74, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x50, 0x43, 0x4d, + 0x12, 0x1f, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x69, 0x6e, + 0x6b, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x63, 0x6e, 0x2f, 0x4a, 0x43, 0x43, 0x45, 0x2f, 0x50, 0x43, + 0x4d, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x6f, 0x72, 0x67, + 0x2e, 0x63, 0x6e, 0x2f, 0x4a, 0x43, 0x43, 0x45, 0x2f, 0x50, 0x43, 0x4d, 0x2f, 0x6c, 0x61, 0x6e, + 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x2f, 0x69, 0x64, 0x6c, 0x2f, 0x70, 0x62, 0x74, 0x65, 0x6e, + 0x61, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/lan_trans/openapiv2/idl/pbpod/pod.swagger.json b/lan_trans/openapiv2/idl/pbpod/pod.swagger.json index a234fb3a..0aec6131 100644 --- a/lan_trans/openapiv2/idl/pbpod/pod.swagger.json +++ b/lan_trans/openapiv2/idl/pbpod/pod.swagger.json @@ -250,6 +250,10 @@ "nextToken": { "type": "string", "title": "分页相关参数,下一页的token" + }, + "namespace": { + "type": "string", + "title": "namespace" } } }, From eecb8f6a2345086f20b9d37c3e4d8baf77607cb4 Mon Sep 17 00:00:00 2001 From: devad Date: Tue, 5 Apr 2022 16:15:24 +0800 Subject: [PATCH 4/4] add huawei pod Signed-off-by: devad --- adaptor/pod_adaptor/service/poder/ali.go | 95 ------ adaptor/pod_adaptor/service/poder/huawei.go | 163 ---------- .../pod_adaptor/service/poder/huawei_cci.go | 286 ++++++++++-------- adaptor/pod_adaptor/service/poder/poder.go | 3 +- gen.sh | 2 +- go.mod | 10 +- idl/pbpod/pod.proto | 7 +- lan_trans/idl/demo/demo.pb.gw.go | 10 +- lan_trans/idl/pbecs/ecs.pb.gw.go | 30 +- lan_trans/idl/pbpod/pod.pb.go | 121 ++++---- lan_trans/idl/pbpod/pod.pb.gw.go | 40 +-- .../openapiv2/idl/demo/demo.swagger.json | 9 +- .../openapiv2/idl/pbecs/ecs.swagger.json | 11 +- .../openapiv2/idl/pbpod/pod.swagger.json | 19 +- .../idl/pbtenant/tenant.swagger.json | 9 +- 15 files changed, 291 insertions(+), 524 deletions(-) delete mode 100644 adaptor/pod_adaptor/service/poder/ali.go delete mode 100644 adaptor/pod_adaptor/service/poder/huawei.go diff --git a/adaptor/pod_adaptor/service/poder/ali.go b/adaptor/pod_adaptor/service/poder/ali.go deleted file mode 100644 index 90e2e687..00000000 --- a/adaptor/pod_adaptor/service/poder/ali.go +++ /dev/null @@ -1,95 +0,0 @@ -package poder - -import ( - "context" - "sync" - - "gitlink.org.cn/JCCE/PCM/common/tenanter" - "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbpod" - "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbtenant" - - "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" - alipod "github.com/aliyun/alibaba-cloud-sdk-go/services/eci" - "github.com/pkg/errors" -) - -var aliClientMutex sync.Mutex - -type AliPod struct { - cli *alipod.Client - region tenanter.Region - tenanter tenanter.Tenanter -} - -func newAliPodClient(region tenanter.Region, tenant tenanter.Tenanter) (Poder, error) { - var ( - client *alipod.Client - err error - ) - - switch t := tenant.(type) { - case *tenanter.AccessKeyTenant: - // 阿里云的sdk有一个 map 的并发问题,go test 加上-race 能检测出来,所以这里加一个锁 - aliClientMutex.Lock() - client, err = alipod.NewClientWithAccessKey(region.GetName(), t.GetId(), t.GetSecret()) - aliClientMutex.Unlock() - default: - } - - if err != nil { - return nil, errors.Wrap(err, "init ali pod client error") - } - - return &AliPod{ - cli: client, - region: region, - tenanter: tenant, - }, nil -} - -func (pod *AliPod) ListDetail(ctx context.Context, req *pbpod.ListDetailReq) (*pbpod.ListDetailResp, error) { - request := alipod.CreateDescribeContainerGroupsRequest() - request.Limit = requests.NewInteger(int(req.PageSize)) - request.RegionId = pod.region.GetName() - request.NextToken = req.NextToken - resp, err := pod.cli.DescribeContainerGroups(request) - if err != nil { - return nil, errors.Wrap(err, "Aliyun ListDetail error") - } - - var podes = make([]*pbpod.PodInstance, len(resp.ContainerGroups)) - for k, v := range resp.ContainerGroups { - podes[k] = &pbpod.PodInstance{ - Provider: pbtenant.CloudProvider_ali, - AccountName: pod.tenanter.AccountName(), - InstanceId: v.ContainerGroupId, - InstanceName: v.ContainerGroupName, - RegionName: pod.region.GetName(), - PublicIps: v.InternetIp, - InstanceType: v.InstanceType, - Cpu: int32(v.Cpu), - Memory: int32(v.Memory), - //Description: v.Description, - Status: v.Status, - CreationTime: v.CreationTime, - ExpireTime: v.ExpiredTime, - //InnerIps: v.IntranetIp, - VpcId: v.VpcId, - //SecurityGroupId: v.SecurityGroupId - } - } - - isFinished := false - if len(podes) < int(req.PageSize) { - isFinished = true - } - - return &pbpod.ListDetailResp{ - Pods: podes, - Finished: isFinished, - PageNumber: req.PageNumber + 1, - PageSize: req.PageSize, - NextToken: resp.NextToken, - RequestId: resp.RequestId, - }, nil -} diff --git a/adaptor/pod_adaptor/service/poder/huawei.go b/adaptor/pod_adaptor/service/poder/huawei.go deleted file mode 100644 index 69750874..00000000 --- a/adaptor/pod_adaptor/service/poder/huawei.go +++ /dev/null @@ -1,163 +0,0 @@ -package poder - -import ( - "context" - "fmt" - "sync" - - "github.com/golang/glog" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbpod" - "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbtenant" - - "k8s.io/client-go/tools/clientcmd" - "k8s.io/client-go/tools/clientcmd/api" - - huaweipod "k8s.io/client-go/kubernetes" - - "github.com/pkg/errors" - "gitlink.org.cn/JCCE/PCM/common/tenanter" -) - -var huaweiClientMutex sync.Mutex - -type HuaweiPod struct { - cli *huaweipod.Clientset - region tenanter.Region - tenanter tenanter.Tenanter -} - -const ( - apiVersion = "client.authentication.k8s.io/v1beta1" - iamEndpoint = "https://iam.myhuaweicloud.com" -) - -func newHuaweiPodClient(region tenanter.Region, tenant tenanter.Tenanter) (Poder, error) { - var ( - client *huaweipod.Clientset - err error - ) - cciEndpoint := "https://cci." + region.GetName() + ".myhuaweicloud.com" - cciConfig, err := clientcmd.BuildConfigFromFlags(cciEndpoint, "") - if err != nil { - return nil, err - } - - switch t := tenant.(type) { - case *tenanter.AccessKeyTenant: - // 阿里云的sdk有一个 map 的并发问题,go test 加上-race 能检测出来,所以这里加一个锁 - huaweiClientMutex.Lock() - var optionArgs []string - optionArgs = append(optionArgs, fmt.Sprintf("--iam-endpoint=%s", iamEndpoint)) - optionArgs = append(optionArgs, fmt.Sprintf("--project-name=%s", region.GetName())) - optionArgs = append(optionArgs, fmt.Sprintf("--ak=%s", t.GetId())) - optionArgs = append(optionArgs, fmt.Sprintf("--sk=%s", t.GetSecret())) - cciConfig.ExecProvider = &api.ExecConfig{ - Command: "cci-iam-authenticator", - APIVersion: apiVersion, - Args: append([]string{"token"}, optionArgs...), - Env: make([]api.ExecEnvVar, 0), - } - client, err = huaweipod.NewForConfig(cciConfig) - huaweiClientMutex.Unlock() - default: - } - - if err != nil { - return nil, errors.Wrap(err, "init huawei pod client error") - } - - return &HuaweiPod{ - cli: client, - region: region, - tenanter: tenant, - }, nil -} - -func (pod *HuaweiPod) ListDetail(ctx context.Context, req *pbpod.ListDetailReq) (*pbpod.ListDetailResp, error) { - resp, err := pod.cli.CoreV1().Pods(req.GetNamespace()).List(metav1.ListOptions{}) - if err != nil { - return nil, errors.Wrap(err, "Huaweiyun ListDetail pod error") - } - glog.Info("Huaweiyun ListDetail pod success", resp.Items) - var podes = make([]*pbpod.PodInstance, len(resp.Items)) - for k, v := range resp.Items { - podes[k] = &pbpod.PodInstance{ - Provider: pbtenant.CloudProvider_huawei, - AccountName: pod.tenanter.AccountName(), - InstanceId: string(v.GetUID()), - InstanceName: v.Name, - RegionName: pod.region.GetName(), - PublicIps: v.Status.PodIP, - //InstanceType: v.InstanceType, - //Cpu: v.Spec.Containers[0].Resources.Requests.Cpu(), - //Memory: v.Spec.Containers[0].Resources.Requests.Memory(), - //Description: v.Description, - Status: string(v.Status.Phase), - CreationTime: v.CreationTimestamp.String(), - //ExpireTime: v.ExpiredTime, - //InnerIps: v.IntranetIp, - //VpcId: v.VpcId, - //SecurityGroupId: v.SecurityGroupId - } - } - - isFinished := false - if len(podes) < int(req.PageSize) { - isFinished = true - } - - return &pbpod.ListDetailResp{ - Pods: podes, - Finished: isFinished, - PageNumber: req.PageNumber + 1, - PageSize: req.PageSize, - //NextToken: resp.NextToken, - //RequestId: resp.RequestId, - }, nil -} - -func (pod *HuaweiPod) create(ctx context.Context, req *pbpod.ListDetailReq) (*pbpod.ListDetailResp, error) { - resp, err := pod.cli.CoreV1().Pods(req.GetNamespace()).List(metav1.ListOptions{}) - if err != nil { - return nil, errors.Wrap(err, "Huaweiyun ListDetail pod error") - } - glog.Info("Huaweiyun ListDetail pod success", resp.Items) - var podes = make([]*pbpod.PodInstance, len(resp.Items)) - for k, v := range resp.Items { - podes[k] = &pbpod.PodInstance{ - Provider: pbtenant.CloudProvider_huawei, - AccountName: pod.tenanter.AccountName(), - InstanceId: string(v.GetUID()), - InstanceName: v.Name, - RegionName: pod.region.GetName(), - PublicIps: v.Status.PodIP, - //InstanceType: v.InstanceType, - //Cpu: v.Spec.Containers[0].Resources.Requests.Cpu(), - //Memory: v.Spec.Containers[0].Resources.Requests.Memory(), - //Description: v.Description, - Status: string(v.Status.Phase), - CreationTime: v.CreationTimestamp.String(), - //ExpireTime: v.ExpiredTime, - //InnerIps: v.IntranetIp, - //VpcId: v.VpcId, - //SecurityGroupId: v.SecurityGroupId - } - } - - isFinished := false - if len(podes) < int(req.PageSize) { - isFinished = true - } - - return &pbpod.ListDetailResp{ - Pods: podes, - Finished: isFinished, - PageNumber: req.PageNumber + 1, - PageSize: req.PageSize, - //NextToken: resp.NextToken, - //RequestId: resp.RequestId, - }, nil -} diff --git a/adaptor/pod_adaptor/service/poder/huawei_cci.go b/adaptor/pod_adaptor/service/poder/huawei_cci.go index 733ed27b..56859e95 100644 --- a/adaptor/pod_adaptor/service/poder/huawei_cci.go +++ b/adaptor/pod_adaptor/service/poder/huawei_cci.go @@ -1,135 +1,155 @@ package poder -// -//import ( -// "fmt" -// "gitlink.org.cn/JCCE/PCM/adaptor/pod_adaptor/common/config" -// corev1 "k8s.io/api/core/v1" -// "k8s.io/apimachinery/pkg/api/resource" -// metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -// "k8s.io/client-go/kubernetes" -//) -// -//// CreatePod 创建Pod -//func CreatePod(client *kubernetes.Clientset, configPath string) (*corev1.Pod, error) { -// -// var configCommon config.PCMContainerConfig -// configCommon, _ = config.PCMconfig(configPath) -// -// nameSpace := configCommon.NameSpace -// podName := configCommon.ContainerGroupName -// containerImage := configCommon.ContainerImage -// containerName := configCommon.ContainerName -// cpuPod := configCommon.CpuPod -// memoryPod := configCommon.MemoryPod -// pod := corev1.Pod{ -// TypeMeta: metav1.TypeMeta{ -// APIVersion: "core/V1", -// Kind: "Pod", -// }, -// ObjectMeta: metav1.ObjectMeta{ -// Name: podName, -// Namespace: nameSpace, -// Labels: map[string]string{"name": "testapi"}, -// }, -// Spec: corev1.PodSpec{ -// RestartPolicy: corev1.RestartPolicyAlways, -// Containers: []corev1.Container{ -// { -// Name: containerName, -// Image: containerImage, -// Resources: corev1.ResourceRequirements{ -// Limits: map[corev1.ResourceName]resource.Quantity{ -// corev1.ResourceCPU: resource.MustParse(cpuPod), -// corev1.ResourceMemory: resource.MustParse(memoryPod), -// }, -// }, -// }, -// }, -// }, -// Status: corev1.PodStatus{}, -// } -// -// fmt.Println("Huawei ContainerGroup created") -// return client.CoreV1().Pods(nameSpace).Create(&pod) -//} -// -//// ListPod 查询Namespace下Pod列表 -//func ListPod(client *kubernetes.Clientset, configPath string) (*corev1.PodList, error) { -// -// var configCommon config.PCMContainerConfig -// configCommon, _ = config.PCMconfig(configPath) -// -// nameSpace := configCommon.NameSpace -// -// podList, _ := client.CoreV1().Pods(nameSpace).List(metav1.ListOptions{}) -// fmt.Println("Huawei ContainerGroup list", podList) -// -// return podList, nil -//} -// -//// UpdatePod 更新指定Pod -///* -//// 跨namespace目前有点问题 -//*/ -//func UpdatePod(client *kubernetes.Clientset, configPath string) (*corev1.Pod, error) { -// -// var configCommon config.PCMContainerConfig -// configCommon, _ = config.PCMconfig(configPath) -// -// nameSpace := configCommon.NamespaceUpdate -// podName := configCommon.ContainerGroupNameUpdate -// containerImage := configCommon.ContainerImageUpdate -// containerName := configCommon.ContainerNameUpdate -// -// pod := corev1.Pod{ -// TypeMeta: metav1.TypeMeta{ -// APIVersion: "core/V1", -// Kind: "Pod", -// }, -// ObjectMeta: metav1.ObjectMeta{ -// Name: podName, -// Namespace: nameSpace, -// Labels: map[string]string{"name": "pod-test2"}, -// }, -// Spec: corev1.PodSpec{ -// RestartPolicy: corev1.RestartPolicyAlways, -// Containers: []corev1.Container{ -// { -// Name: containerName, -// Image: containerImage, -// Resources: corev1.ResourceRequirements{ -// Limits: map[corev1.ResourceName]resource.Quantity{ -// corev1.ResourceLimitsCPU: resource.MustParse("500m"), -// corev1.ResourceLimitsMemory: resource.MustParse("1Gi"), -// }, -// Requests: map[corev1.ResourceName]resource.Quantity{ -// corev1.ResourceRequestsCPU: resource.MustParse("500m"), -// corev1.ResourceRequestsMemory: resource.MustParse("1Gi"), -// }, -// }, -// }, -// }, -// }, -// Status: corev1.PodStatus{}, -// } -// -// podNew, _ := client.CoreV1().Pods(nameSpace).Update(&pod) -// fmt.Println("Huawei ContainerGroup updated", podNew) -// -// return podNew, nil -//} -// -//// DeletePod 删除指定Pod -//func DeletePod(client *kubernetes.Clientset, configPath string) error { -// -// var configCommon config.PCMContainerConfig -// configCommon, _ = config.PCMconfig(configPath) -// -// nameSpace := configCommon.NameSpace -// podName := configCommon.ContainerGroupName -// -// fmt.Println("Huawei ContainerGroup:", podName, " Deleted") -// -// return client.CoreV1().Pods(nameSpace).Delete(podName, &metav1.DeleteOptions{}) -//} +import ( + "context" + "fmt" + "sync" + + "github.com/golang/glog" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbpod" + "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbtenant" + + "k8s.io/client-go/tools/clientcmd" + "k8s.io/client-go/tools/clientcmd/api" + + huaweicci "k8s.io/client-go/kubernetes" + + "github.com/pkg/errors" + "gitlink.org.cn/JCCE/PCM/common/tenanter" +) + +var huaweiClientMutex sync.Mutex + +type HuaweiCci struct { + cli *huaweicci.Clientset + region tenanter.Region + tenanter tenanter.Tenanter +} + +const ( + apiVersion = "client.authentication.k8s.io/v1beta1" + iamEndpoint = "https://iam.myhuaweicloud.com" +) + +func newHuaweiCciClient(region tenanter.Region, tenant tenanter.Tenanter) (Poder, error) { + var ( + client *huaweicci.Clientset + err error + ) + cciEndpoint := "https://cci." + region.GetName() + ".myhuaweicloud.com" + cciConfig, err := clientcmd.BuildConfigFromFlags(cciEndpoint, "") + if err != nil { + return nil, err + } + + switch t := tenant.(type) { + case *tenanter.AccessKeyTenant: + // 阿里云的sdk有一个 map 的并发问题,go test 加上-race 能检测出来,所以这里加一个锁 + huaweiClientMutex.Lock() + var optionArgs []string + optionArgs = append(optionArgs, fmt.Sprintf("--iam-endpoint=%s", iamEndpoint)) + optionArgs = append(optionArgs, fmt.Sprintf("--project-name=%s", region.GetName())) + optionArgs = append(optionArgs, fmt.Sprintf("--ak=%s", t.GetId())) + optionArgs = append(optionArgs, fmt.Sprintf("--sk=%s", t.GetSecret())) + cciConfig.ExecProvider = &api.ExecConfig{ + Command: "cci-iam-authenticator", + APIVersion: apiVersion, + Args: append([]string{"token"}, optionArgs...), + Env: make([]api.ExecEnvVar, 0), + } + client, err = huaweicci.NewForConfig(cciConfig) + huaweiClientMutex.Unlock() + default: + } + + if err != nil { + return nil, errors.Wrap(err, "init huawei pod client error") + } + + return &HuaweiCci{ + cli: client, + region: region, + tenanter: tenant, + }, nil +} + +func (pod *HuaweiCci) ListPodDetail(ctx context.Context, req *pbpod.ListPodDetailReq) (*pbpod.ListPodDetailResp, error) { + resp, err := pod.cli.CoreV1().Pods(req.GetNamespace()).List(metav1.ListOptions{}) + if err != nil { + return nil, errors.Wrap(err, "Huaweiyun ListDetail pod error") + } + glog.Info("Huaweiyun ListDetail pod success", resp.Items) + var podes = make([]*pbpod.PodInstance, len(resp.Items)) + for k, v := range resp.Items { + podes[k] = &pbpod.PodInstance{ + Provider: pbtenant.CloudProvider_huawei, + AccountName: pod.tenanter.AccountName(), + PodId: string(v.GetUID()), + PodName: v.Name, + RegionId: pod.region.GetId(), + ContainerImage: v.Spec.Containers[0].Image, + ContainerName: v.Spec.Containers[0].Name, + CpuPod: v.Spec.Containers[0].Resources.Requests.Cpu().String(), + MemoryPod: v.Spec.Containers[0].Resources.Requests.Memory().String(), + Namespace: v.Namespace, + } + } + + isFinished := false + if len(podes) < int(req.PageSize) { + isFinished = true + } + + return &pbpod.ListPodDetailResp{ + Pods: podes, + Finished: isFinished, + PageNumber: req.PageNumber + 1, + PageSize: req.PageSize, + //NextToken: resp.NextToken, + //RequestId: resp.RequestId, + }, nil +} + +func (pod *HuaweiCci) CreatePod(ctx context.Context, req *pbpod.CreatePodReq) (*pbpod.CreatePodResp, error) { + //resp, err := pod.cli.CoreV1().Pods(req.GetNamespace()).List(metav1.ListOptions{}) + //if err != nil { + // return nil, errors.Wrap(err, "Huaweiyun ListDetail pod error") + //} + //glog.Info("Huaweiyun ListDetail pod success", resp.Items) + //var podes = make([]*pbpod.PodInstance, len(resp.Items)) + //for k, v := range resp.Items { + // podes[k] = &pbpod.PodInstance{ + // Provider: pbtenant.CloudProvider_huawei, + // AccountName: pod.tenanter.AccountName(), + // InstanceId: string(v.GetUID()), + // InstanceName: v.Name, + // RegionName: pod.region.GetName(), + // PublicIps: v.Status.PodIP, + // //InstanceType: v.InstanceType, + // //Cpu: v.Spec.Containers[0].Resources.Requests.Cpu(), + // //Memory: v.Spec.Containers[0].Resources.Requests.Memory(), + // //Description: v.Description, + // Status: string(v.Status.Phase), + // CreationTime: v.CreationTimestamp.String(), + // //ExpireTime: v.ExpiredTime, + // //InnerIps: v.IntranetIp, + // //VpcId: v.VpcId, + // //SecurityGroupId: v.SecurityGroupId + // } + //} + // + //isFinished := false + //if len(podes) < int(req.PageSize) { + // isFinished = true + //} + // + return &pbpod.CreatePodResp{ + Pods: nil, + //Finished: isFinished, + //RequestId: resp.RequestId, + }, nil + +} diff --git a/adaptor/pod_adaptor/service/poder/poder.go b/adaptor/pod_adaptor/service/poder/poder.go index 9f03f5e4..48f5e113 100644 --- a/adaptor/pod_adaptor/service/poder/poder.go +++ b/adaptor/pod_adaptor/service/poder/poder.go @@ -2,6 +2,7 @@ package poder import ( "context" + "gitlink.org.cn/JCCE/PCM/common/tenanter" "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbpod" "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbtenant" @@ -35,7 +36,7 @@ func NewPodClient(provider pbtenant.CloudProvider, region tenanter.Region, tenan case pbtenant.CloudProvider_tencent: return nil, nil case pbtenant.CloudProvider_huawei: - return nil, nil + return newHuaweiCciClient(region, tenant) //TODO aws //case pbtenant.CloudProvider_aws: // return newAwsPodClient(region, tenant) diff --git a/gen.sh b/gen.sh index 112801df..b50b4d1d 100755 --- a/gen.sh +++ b/gen.sh @@ -1,5 +1,5 @@ #!/bin/bash -rm -rf lan_trans/gen/* +rm -rf lan_trans/idl/* buf mod update buf generate \ No newline at end of file diff --git a/go.mod b/go.mod index f363c452..7c55f05c 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module gitlink.org.cn/JCCE/PCM go 1.17 require ( - github.com/Unknwon/goconfig v1.0.0 github.com/aliyun/alibaba-cloud-sdk-go v1.61.1530 github.com/go-yaml/yaml v2.1.0+incompatible github.com/golang/glog v1.0.0 @@ -12,30 +11,24 @@ require ( github.com/pkg/errors v0.9.1 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.377 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.377 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.371 google.golang.org/genproto v0.0.0-20220317150908-0efb43f6373e google.golang.org/grpc v1.45.0 google.golang.org/protobuf v1.28.0 - k8s.io/api v0.0.0-20190620084959-7cf5895f2711 - k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719 k8s.io/client-go v0.0.0-20190620085101-78d2af792bab ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550 // indirect github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/gofuzz v1.0.0 // indirect github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d // indirect - github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect github.com/imdario/mergo v0.3.5 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/json-iterator/go v1.1.10 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.1 // indirect github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect - github.com/smartystreets/goconvey v1.7.2 // indirect github.com/spf13/pflag v1.0.1 // indirect golang.org/x/crypto v0.0.0-20210920023735-84f357641f63 // indirect golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect @@ -49,8 +42,9 @@ require ( gopkg.in/inf.v0 v0.9.0 // indirect gopkg.in/ini.v1 v1.66.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect + k8s.io/api v0.0.0-20190620084959-7cf5895f2711 // indirect + k8s.io/apimachinery v0.0.0-20190612205821-1799e75a0719 // indirect k8s.io/klog v0.3.1 // indirect - k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 // indirect k8s.io/utils v0.0.0-20190221042446-c2654d5206da // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/idl/pbpod/pod.proto b/idl/pbpod/pod.proto index da73f608..4ad142bb 100644 --- a/idl/pbpod/pod.proto +++ b/idl/pbpod/pod.proto @@ -22,9 +22,9 @@ message PodInstance { // 容器名称 string container_name = 7; // vcpu数 - float cpu_pod = 8; + string cpu_pod = 8; // 内存MB - float memory_pod = 9; + string memory_pod = 9; //安全组ID 对应腾讯 SecurityGroupIds(腾讯必需) string security_group_id = 10; @@ -34,7 +34,6 @@ message PodInstance { string vpc_id = 12; //名空间 string namespace = 13; - } @@ -92,6 +91,8 @@ message ListPodDetailReq { int32 page_size = 6; // 分页相关参数,下一页的token string next_token = 7; + // namespace + string namespace = 8; } message ListPodDetailResp { diff --git a/lan_trans/idl/demo/demo.pb.gw.go b/lan_trans/idl/demo/demo.pb.gw.go index 5fedd6b4..66ed1dcd 100644 --- a/lan_trans/idl/demo/demo.pb.gw.go +++ b/lan_trans/idl/demo/demo.pb.gw.go @@ -77,13 +77,12 @@ func RegisterDemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/demo.DemoService/Echo", runtime.WithHTTPPathPattern("/apis/demo")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/demo.DemoService/Echo") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_DemoService_Echo_0(ctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_DemoService_Echo_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -140,13 +139,12 @@ func RegisterDemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - ctx, err = runtime.AnnotateContext(ctx, mux, req, "/demo.DemoService/Echo", runtime.WithHTTPPathPattern("/apis/demo")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/demo.DemoService/Echo") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_DemoService_Echo_0(ctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_DemoService_Echo_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) diff --git a/lan_trans/idl/pbecs/ecs.pb.gw.go b/lan_trans/idl/pbecs/ecs.pb.gw.go index 425292e0..95d63554 100644 --- a/lan_trans/idl/pbecs/ecs.pb.gw.go +++ b/lan_trans/idl/pbecs/ecs.pb.gw.go @@ -145,13 +145,12 @@ func RegisterEcsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbecs.EcsService/ListEcsDetail", runtime.WithHTTPPathPattern("/apis/ecs/detail")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pbecs.EcsService/ListEcsDetail") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_EcsService_ListEcsDetail_0(ctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_EcsService_ListEcsDetail_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -169,13 +168,12 @@ func RegisterEcsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbecs.EcsService/ListEcs", runtime.WithHTTPPathPattern("/apis/ecs")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pbecs.EcsService/ListEcs") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_EcsService_ListEcs_0(ctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_EcsService_ListEcs_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -193,13 +191,12 @@ func RegisterEcsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbecs.EcsService/ListEcsAll", runtime.WithHTTPPathPattern("/apis/ecs/all")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pbecs.EcsService/ListEcsAll") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_EcsService_ListEcsAll_0(ctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_EcsService_ListEcsAll_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -256,13 +253,12 @@ func RegisterEcsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - ctx, err = runtime.AnnotateContext(ctx, mux, req, "/pbecs.EcsService/ListEcsDetail", runtime.WithHTTPPathPattern("/apis/ecs/detail")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/pbecs.EcsService/ListEcsDetail") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_EcsService_ListEcsDetail_0(ctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_EcsService_ListEcsDetail_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -277,13 +273,12 @@ func RegisterEcsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - ctx, err = runtime.AnnotateContext(ctx, mux, req, "/pbecs.EcsService/ListEcs", runtime.WithHTTPPathPattern("/apis/ecs")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/pbecs.EcsService/ListEcs") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_EcsService_ListEcs_0(ctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_EcsService_ListEcs_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -298,13 +293,12 @@ func RegisterEcsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - ctx, err = runtime.AnnotateContext(ctx, mux, req, "/pbecs.EcsService/ListEcsAll", runtime.WithHTTPPathPattern("/apis/ecs/all")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/pbecs.EcsService/ListEcsAll") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_EcsService_ListEcsAll_0(ctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_EcsService_ListEcsAll_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) diff --git a/lan_trans/idl/pbpod/pod.pb.go b/lan_trans/idl/pbpod/pod.pb.go index 3209d876..e26519cf 100644 --- a/lan_trans/idl/pbpod/pod.pb.go +++ b/lan_trans/idl/pbpod/pod.pb.go @@ -42,9 +42,9 @@ type PodInstance struct { // 容器名称 ContainerName string `protobuf:"bytes,7,opt,name=container_name,json=containerName,proto3" json:"container_name,omitempty"` // vcpu数 - CpuPod float32 `protobuf:"fixed32,8,opt,name=cpu_pod,json=cpuPod,proto3" json:"cpu_pod,omitempty"` + CpuPod string `protobuf:"bytes,8,opt,name=cpu_pod,json=cpuPod,proto3" json:"cpu_pod,omitempty"` // 内存MB - MemoryPod float32 `protobuf:"fixed32,9,opt,name=memory_pod,json=memoryPod,proto3" json:"memory_pod,omitempty"` + MemoryPod string `protobuf:"bytes,9,opt,name=memory_pod,json=memoryPod,proto3" json:"memory_pod,omitempty"` //安全组ID 对应腾讯 SecurityGroupIds(腾讯必需) SecurityGroupId string `protobuf:"bytes,10,opt,name=security_group_id,json=securityGroupId,proto3" json:"security_group_id,omitempty"` //子网ID 对应腾讯 SubnetId(腾讯必需) @@ -136,18 +136,18 @@ func (x *PodInstance) GetContainerName() string { return "" } -func (x *PodInstance) GetCpuPod() float32 { +func (x *PodInstance) GetCpuPod() string { if x != nil { return x.CpuPod } - return 0 + return "" } -func (x *PodInstance) GetMemoryPod() float32 { +func (x *PodInstance) GetMemoryPod() string { if x != nil { return x.MemoryPod } - return 0 + return "" } func (x *PodInstance) GetSecurityGroupId() string { @@ -419,6 +419,8 @@ type ListPodDetailReq struct { PageSize int32 `protobuf:"varint,6,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // 分页相关参数,下一页的token NextToken string `protobuf:"bytes,7,opt,name=next_token,json=nextToken,proto3" json:"next_token,omitempty"` + // namespace + Namespace string `protobuf:"bytes,8,opt,name=namespace,proto3" json:"namespace,omitempty"` } func (x *ListPodDetailReq) Reset() { @@ -502,6 +504,13 @@ func (x *ListPodDetailReq) GetNextToken() string { return "" } +func (x *ListPodDetailReq) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + type ListPodDetailResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -754,9 +763,9 @@ var file_idl_pbpod_pod_proto_rawDesc = []byte{ 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, - 0x63, 0x70, 0x75, 0x5f, 0x70, 0x6f, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x63, + 0x63, 0x70, 0x75, 0x5f, 0x70, 0x6f, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x70, 0x75, 0x50, 0x6f, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, - 0x70, 0x6f, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x02, 0x52, 0x09, 0x6d, 0x65, 0x6d, 0x6f, 0x72, + 0x70, 0x6f, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x50, 0x6f, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, @@ -800,7 +809,7 @@ var file_idl_pbpod_pod_proto_rawDesc = []byte{ 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x49, 0x64, 0x22, 0xfb, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, + 0x73, 0x74, 0x49, 0x64, 0x22, 0x99, 0x02, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x33, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x76, @@ -816,54 +825,56 @@ var file_idl_pbpod_pod_proto_rawDesc = []byte{ 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x22, 0xd3, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x44, 0x65, - 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x04, 0x70, 0x6f, 0x64, 0x73, + 0x65, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x22, 0xd3, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x04, 0x70, 0x6f, 0x64, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x50, 0x6f, 0x64, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x04, 0x70, 0x6f, 0x64, 0x73, 0x12, 0x1a, + 0x0a, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, + 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, + 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, 0x78, 0x74, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x65, + 0x78, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x41, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, + 0x64, 0x52, 0x65, 0x71, 0x12, 0x33, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, + 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x35, 0x0a, 0x0b, 0x4c, 0x69, 0x73, + 0x74, 0x50, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x04, 0x70, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x50, 0x6f, 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x04, 0x70, 0x6f, 0x64, 0x73, - 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, - 0x70, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, - 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x65, - 0x78, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x6e, 0x65, 0x78, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x41, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, - 0x50, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x12, 0x33, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6e, - 0x61, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x35, 0x0a, 0x0b, 0x4c, - 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x04, 0x70, 0x6f, - 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, - 0x2e, 0x50, 0x6f, 0x64, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x04, 0x70, 0x6f, - 0x64, 0x73, 0x22, 0x0f, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x41, 0x6c, 0x6c, - 0x52, 0x65, 0x71, 0x32, 0xdc, 0x02, 0x0a, 0x0a, 0x50, 0x6f, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x53, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x12, - 0x13, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, - 0x64, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x15, 0x22, 0x10, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x5f, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x50, - 0x6f, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, - 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, - 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x22, 0x1b, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x15, 0x22, 0x10, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x64, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x3a, 0x01, 0x2a, 0x12, 0x46, 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, - 0x50, 0x6f, 0x64, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x50, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x0e, 0x22, 0x09, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x3a, 0x01, 0x2a, - 0x12, 0x50, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x41, 0x6c, 0x6c, 0x12, 0x14, - 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x41, 0x6c, - 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x50, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, - 0x22, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x61, 0x6c, 0x6c, 0x3a, - 0x01, 0x2a, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x6f, 0x72, - 0x67, 0x2e, 0x63, 0x6e, 0x2f, 0x4a, 0x43, 0x43, 0x45, 0x2f, 0x50, 0x43, 0x4d, 0x2f, 0x6c, 0x61, - 0x6e, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x2f, 0x69, 0x64, 0x6c, 0x2f, 0x70, 0x62, 0x70, 0x6f, - 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0x0f, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x41, 0x6c, 0x6c, 0x52, 0x65, + 0x71, 0x32, 0xdc, 0x02, 0x0a, 0x0a, 0x50, 0x6f, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x53, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x12, 0x13, 0x2e, + 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x52, + 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x50, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, + 0x22, 0x10, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x5f, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, + 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x1a, + 0x18, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x15, 0x22, 0x10, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x64, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x3a, 0x01, 0x2a, 0x12, 0x46, 0x0a, 0x07, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, + 0x64, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, + 0x64, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x50, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, + 0x22, 0x09, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x3a, 0x01, 0x2a, 0x12, 0x50, + 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x41, 0x6c, 0x6c, 0x12, 0x14, 0x2e, 0x70, + 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x41, 0x6c, 0x6c, 0x52, + 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, + 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x22, 0x0d, + 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x61, 0x6c, 0x6c, 0x3a, 0x01, 0x2a, + 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x6f, 0x72, 0x67, 0x2e, + 0x63, 0x6e, 0x2f, 0x4a, 0x43, 0x43, 0x45, 0x2f, 0x50, 0x43, 0x4d, 0x2f, 0x6c, 0x61, 0x6e, 0x5f, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x2f, 0x69, 0x64, 0x6c, 0x2f, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/lan_trans/idl/pbpod/pod.pb.gw.go b/lan_trans/idl/pbpod/pod.pb.gw.go index 2fbe381a..7cb8d249 100644 --- a/lan_trans/idl/pbpod/pod.pb.gw.go +++ b/lan_trans/idl/pbpod/pod.pb.gw.go @@ -179,13 +179,12 @@ func RegisterPodServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbpod.PodService/CreatePod", runtime.WithHTTPPathPattern("/apis/pod/create")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pbpod.PodService/CreatePod") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_PodService_CreatePod_0(ctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_PodService_CreatePod_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -203,13 +202,12 @@ func RegisterPodServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbpod.PodService/ListPodDetail", runtime.WithHTTPPathPattern("/apis/pod/detail")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pbpod.PodService/ListPodDetail") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_PodService_ListPodDetail_0(ctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_PodService_ListPodDetail_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -227,13 +225,12 @@ func RegisterPodServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbpod.PodService/ListPod", runtime.WithHTTPPathPattern("/apis/pod")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pbpod.PodService/ListPod") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_PodService_ListPod_0(ctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_PodService_ListPod_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -251,13 +248,12 @@ func RegisterPodServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - ctx, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbpod.PodService/ListPodAll", runtime.WithHTTPPathPattern("/apis/pod/all")) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pbpod.PodService/ListPodAll") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_PodService_ListPodAll_0(ctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_PodService_ListPodAll_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -314,13 +310,12 @@ func RegisterPodServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - ctx, err = runtime.AnnotateContext(ctx, mux, req, "/pbpod.PodService/CreatePod", runtime.WithHTTPPathPattern("/apis/pod/create")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/pbpod.PodService/CreatePod") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_PodService_CreatePod_0(ctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_PodService_CreatePod_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -335,13 +330,12 @@ func RegisterPodServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - ctx, err = runtime.AnnotateContext(ctx, mux, req, "/pbpod.PodService/ListPodDetail", runtime.WithHTTPPathPattern("/apis/pod/detail")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/pbpod.PodService/ListPodDetail") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_PodService_ListPodDetail_0(ctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_PodService_ListPodDetail_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -356,13 +350,12 @@ func RegisterPodServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - ctx, err = runtime.AnnotateContext(ctx, mux, req, "/pbpod.PodService/ListPod", runtime.WithHTTPPathPattern("/apis/pod")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/pbpod.PodService/ListPod") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_PodService_ListPod_0(ctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_PodService_ListPod_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -377,13 +370,12 @@ func RegisterPodServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - ctx, err = runtime.AnnotateContext(ctx, mux, req, "/pbpod.PodService/ListPodAll", runtime.WithHTTPPathPattern("/apis/pod/all")) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/pbpod.PodService/ListPodAll") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_PodService_ListPodAll_0(ctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_PodService_ListPodAll_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) diff --git a/lan_trans/openapiv2/idl/demo/demo.swagger.json b/lan_trans/openapiv2/idl/demo/demo.swagger.json index d7db3be6..a969e31b 100644 --- a/lan_trans/openapiv2/idl/demo/demo.swagger.json +++ b/lan_trans/openapiv2/idl/demo/demo.swagger.json @@ -68,11 +68,14 @@ "protobufAny": { "type": "object", "properties": { - "@type": { + "typeUrl": { "type": "string" + }, + "value": { + "type": "string", + "format": "byte" } - }, - "additionalProperties": {} + } }, "rpcStatus": { "type": "object", diff --git a/lan_trans/openapiv2/idl/pbecs/ecs.swagger.json b/lan_trans/openapiv2/idl/pbecs/ecs.swagger.json index 84a423e2..6e80824e 100644 --- a/lan_trans/openapiv2/idl/pbecs/ecs.swagger.json +++ b/lan_trans/openapiv2/idl/pbecs/ecs.swagger.json @@ -186,7 +186,7 @@ }, "vpcId": { "type": "string", - "title": "vcp id" + "title": "vpc id" }, "resourceGroupId": { "type": "string", @@ -303,11 +303,14 @@ "protobufAny": { "type": "object", "properties": { - "@type": { + "typeUrl": { "type": "string" + }, + "value": { + "type": "string", + "format": "byte" } - }, - "additionalProperties": {} + } }, "rpcStatus": { "type": "object", diff --git a/lan_trans/openapiv2/idl/pbpod/pod.swagger.json b/lan_trans/openapiv2/idl/pbpod/pod.swagger.json index 22339bfe..69b0f56a 100644 --- a/lan_trans/openapiv2/idl/pbpod/pod.swagger.json +++ b/lan_trans/openapiv2/idl/pbpod/pod.swagger.json @@ -267,6 +267,10 @@ "nextToken": { "type": "string", "title": "分页相关参数,下一页的token" + }, + "namespace": { + "type": "string", + "title": "namespace" } } }, @@ -358,13 +362,11 @@ "title": "容器名称" }, "cpuPod": { - "type": "number", - "format": "float", + "type": "string", "title": "vcpu数" }, "memoryPod": { - "type": "number", - "format": "float", + "type": "string", "title": "内存MB" }, "securityGroupId": { @@ -400,11 +402,14 @@ "protobufAny": { "type": "object", "properties": { - "@type": { + "typeUrl": { "type": "string" + }, + "value": { + "type": "string", + "format": "byte" } - }, - "additionalProperties": {} + } }, "rpcStatus": { "type": "object", diff --git a/lan_trans/openapiv2/idl/pbtenant/tenant.swagger.json b/lan_trans/openapiv2/idl/pbtenant/tenant.swagger.json index 0a73b355..636ce737 100644 --- a/lan_trans/openapiv2/idl/pbtenant/tenant.swagger.json +++ b/lan_trans/openapiv2/idl/pbtenant/tenant.swagger.json @@ -15,11 +15,14 @@ "protobufAny": { "type": "object", "properties": { - "@type": { + "typeUrl": { "type": "string" + }, + "value": { + "type": "string", + "format": "byte" } - }, - "additionalProperties": {} + } }, "rpcStatus": { "type": "object",