Add pod list

Signed-off-by: devad <cossjie@foxmail.com>
This commit is contained in:
devad 2022-04-04 19:09:27 +08:00
parent bd3c8e71e5
commit a8e7c3cb47
28 changed files with 3145 additions and 292 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,16 +2,18 @@ package ecs
import ( import (
"context" "context"
"sync"
"gitlink.org.cn/JCCE/PCM/adaptor/vm_adaptor/service/ecser" "gitlink.org.cn/JCCE/PCM/adaptor/vm_adaptor/service/ecser"
"gitlink.org.cn/JCCE/PCM/common/tenanter" "gitlink.org.cn/JCCE/PCM/common/tenanter"
"gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbecs" "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbecs"
"gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbtenant" "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbtenant"
"sync"
"github.com/golang/glog" "github.com/golang/glog"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
//ListDetail returns the detail of ecs instances
func ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (*pbecs.ListDetailResp, error) { func ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (*pbecs.ListDetailResp, error) {
var ( var (
ecs ecser.Ecser ecs ecser.Ecser
@ -39,6 +41,7 @@ func ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (*pbecs.ListDetai
return ecs.ListDetail(ctx, req) return ecs.ListDetail(ctx, req)
} }
//List returns the list of ecs instances
func List(ctx context.Context, req *pbecs.ListReq) (*pbecs.ListResp, error) { func List(ctx context.Context, req *pbecs.ListReq) (*pbecs.ListResp, error) {
var ( var (
wg sync.WaitGroup 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 request.PageNumber, request.PageSize, request.NextToken = resp.PageNumber, resp.PageSize, resp.NextToken
} }
}(t, region) }(t, region)
} }
} }
wg.Wait() wg.Wait()
@ -95,6 +97,7 @@ func List(ctx context.Context, req *pbecs.ListReq) (*pbecs.ListResp, error) {
return &pbecs.ListResp{Ecses: ecses}, nil return &pbecs.ListResp{Ecses: ecses}, nil
} }
// ListAll returns all ecs instances
func ListAll(ctx context.Context) (*pbecs.ListResp, error) { func ListAll(ctx context.Context) (*pbecs.ListResp, error) {
var ( var (
wg sync.WaitGroup wg sync.WaitGroup

View File

@ -2,6 +2,9 @@ package server
import ( import (
"context" "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/demo"
"gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbecs" "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbecs"
) )
@ -10,6 +13,7 @@ type Server struct {
// 使用unsafe可以强制让编译器检查是否实现了相关方法 // 使用unsafe可以强制让编译器检查是否实现了相关方法
demo.UnsafeDemoServiceServer demo.UnsafeDemoServiceServer
pbecs.UnsafeEcsServiceServer pbecs.UnsafeEcsServiceServer
pbpod.UnimplementedPodServiceServer
} }
func (s *Server) Echo(ctx context.Context, req *demo.StringMessage) (*demo.StringMessage, error) { func (s *Server) Echo(ctx context.Context, req *demo.StringMessage) (*demo.StringMessage, error) {

View File

@ -2,6 +2,7 @@ package server
import ( import (
"context" "context"
"gitlink.org.cn/JCCE/PCM/adaptor/vm_adaptor/server/ecs" "gitlink.org.cn/JCCE/PCM/adaptor/vm_adaptor/server/ecs"
"gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbecs" "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbecs"
@ -10,6 +11,7 @@ import (
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
) )
// ListEcsDetail return ecs detail
func (s *Server) ListEcsDetail(ctx context.Context, req *pbecs.ListDetailReq) (*pbecs.ListDetailResp, error) { func (s *Server) ListEcsDetail(ctx context.Context, req *pbecs.ListDetailReq) (*pbecs.ListDetailResp, error) {
resp, err := ecs.ListDetail(ctx, req) resp, err := ecs.ListDetail(ctx, req)
if err != nil { if err != nil {
@ -19,6 +21,7 @@ func (s *Server) ListEcsDetail(ctx context.Context, req *pbecs.ListDetailReq) (*
return resp, nil return resp, nil
} }
//ListEcs return ecs list
func (s *Server) ListEcs(ctx context.Context, req *pbecs.ListReq) (*pbecs.ListResp, error) { func (s *Server) ListEcs(ctx context.Context, req *pbecs.ListReq) (*pbecs.ListResp, error) {
resp, err := ecs.List(ctx, req) resp, err := ecs.List(ctx, req)
if err != nil { if err != nil {
@ -28,6 +31,7 @@ func (s *Server) ListEcs(ctx context.Context, req *pbecs.ListReq) (*pbecs.ListRe
return resp, nil return resp, nil
} }
// ListEcsAll return all ecs
func (s *Server) ListEcsAll(ctx context.Context, req *pbecs.ListAllReq) (*pbecs.ListResp, error) { func (s *Server) ListEcsAll(ctx context.Context, req *pbecs.ListAllReq) (*pbecs.ListResp, error) {
resp, err := ecs.ListAll(ctx) resp, err := ecs.ListAll(ctx)
if err != nil { if err != nil {

View File

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

3
go.mod
View File

@ -28,11 +28,13 @@ require (
github.com/golang/protobuf v1.5.2 // indirect github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gofuzz v1.0.0 // indirect github.com/google/gofuzz v1.0.0 // indirect
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d // 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/imdario/mergo v0.3.5 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.10 // 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/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // 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/smartystreets/goconvey v1.7.2 // indirect
github.com/spf13/pflag v1.0.1 // indirect github.com/spf13/pflag v1.0.1 // indirect
golang.org/x/crypto v0.0.0-20210920023735-84f357641f63 // 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/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
google.golang.org/appengine v1.6.6 // 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/inf.v0 v0.9.0 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect

View File

@ -35,7 +35,7 @@ message EcsInstance {
string expire_time = 13; string expire_time = 13;
// ip // ip
repeated string inner_ips = 14; repeated string inner_ips = 14;
// vcp id // vpc id
string vpc_id = 15; string vpc_id = 15;
// id // id
string resource_group_id = 16; string resource_group_id = 16;

163
idl/pbpod/pod.proto Normal file
View File

@ -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 : "*"
};
}
}

View File

@ -30,6 +30,8 @@ enum CloudProduct {
product_domain = 3; product_domain = 3;
// 4 - OSS类产品OSS // 4 - OSS类产品OSS
product_oss = 4; product_oss = 4;
// 5 - POD类产品ECICCIEKS
product_pod = 5;
} }
// //
@ -148,7 +150,7 @@ service TenantService {
description : "所有云租户的认证服务" description : "所有云租户的认证服务"
external_docs : { external_docs : {
url : "https://gitlink.org.cn/JCCE/PCM" url : "https://gitlink.org.cn/JCCE/PCM"
description: "Find out more about CloudFitter" description: "Find out more about PCM"
} }
}; };

View File

@ -55,7 +55,7 @@ type EcsInstance struct {
ExpireTime string `protobuf:"bytes,13,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"` ExpireTime string `protobuf:"bytes,13,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"`
// 内网ip // 内网ip
InnerIps []string `protobuf:"bytes,14,rep,name=inner_ips,json=innerIps,proto3" json:"inner_ips,omitempty"` 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"` VpcId string `protobuf:"bytes,15,opt,name=vpc_id,json=vpcId,proto3" json:"vpc_id,omitempty"`
// 资源组id // 资源组id
ResourceGroupId string `protobuf:"bytes,16,opt,name=resource_group_id,json=resourceGroupId,proto3" json:"resource_group_id,omitempty"` ResourceGroupId string `protobuf:"bytes,16,opt,name=resource_group_id,json=resourceGroupId,proto3" json:"resource_group_id,omitempty"`

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

@ -93,6 +93,8 @@ const (
CloudProduct_product_domain CloudProduct = 3 CloudProduct_product_domain CloudProduct = 3
// 4 - OSS类产品阿里云OSS // 4 - OSS类产品阿里云OSS
CloudProduct_product_oss CloudProduct = 4 CloudProduct_product_oss CloudProduct = 4
// 5 - POD类产品阿里云ECI华为云CCI腾讯云EKS
CloudProduct_product_pod CloudProduct = 5
) )
// Enum value maps for CloudProduct. // Enum value maps for CloudProduct.
@ -103,6 +105,7 @@ var (
2: "product_rds", 2: "product_rds",
3: "product_domain", 3: "product_domain",
4: "product_oss", 4: "product_oss",
5: "product_pod",
} }
CloudProduct_value = map[string]int32{ CloudProduct_value = map[string]int32{
"product_all": 0, "product_all": 0,
@ -110,6 +113,7 @@ var (
"product_rds": 2, "product_rds": 2,
"product_domain": 3, "product_domain": 3,
"product_oss": 4, "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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 0x73, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x70,
0x6e, 0x49, 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00, 0x6f, 0x64, 0x10, 0x05, 0x2a, 0x86, 0x04, 0x0a, 0x0b, 0x41, 0x6c, 0x69, 0x52, 0x65, 0x67, 0x69,
0x12, 0x12, 0x0a, 0x0e, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x71, 0x69, 0x6e, 0x67, 0x64, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x6c, 0x6c, 0x10,
0x61, 0x6f, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x62, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x71, 0x69, 0x6e, 0x67,
0x65, 0x69, 0x6a, 0x69, 0x6e, 0x67, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x64, 0x61, 0x6f, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f,
0x63, 0x6e, 0x5f, 0x7a, 0x68, 0x61, 0x6e, 0x67, 0x6a, 0x69, 0x61, 0x6b, 0x6f, 0x75, 0x10, 0x03, 0x62, 0x65, 0x69, 0x6a, 0x69, 0x6e, 0x67, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69,
0x12, 0x14, 0x0a, 0x10, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x68, 0x75, 0x68, 0x65, 0x68, 0x5f, 0x63, 0x6e, 0x5f, 0x7a, 0x68, 0x61, 0x6e, 0x67, 0x6a, 0x69, 0x61, 0x6b, 0x6f, 0x75, 0x10,
0x61, 0x6f, 0x74, 0x65, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x68, 0x75, 0x68, 0x65,
0x5f, 0x77, 0x75, 0x6c, 0x61, 0x6e, 0x63, 0x68, 0x61, 0x62, 0x75, 0x10, 0x05, 0x12, 0x13, 0x0a, 0x68, 0x61, 0x6f, 0x74, 0x65, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x61, 0x6c, 0x69, 0x5f, 0x63,
0x0f, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x68, 0x61, 0x6e, 0x67, 0x7a, 0x68, 0x6f, 0x75, 0x6e, 0x5f, 0x77, 0x75, 0x6c, 0x61, 0x6e, 0x63, 0x68, 0x61, 0x62, 0x75, 0x10, 0x05, 0x12, 0x13,
0x10, 0x06, 0x12, 0x13, 0x0a, 0x0f, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x73, 0x68, 0x61, 0x0a, 0x0f, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x68, 0x61, 0x6e, 0x67, 0x7a, 0x68, 0x6f,
0x6e, 0x67, 0x68, 0x61, 0x69, 0x10, 0x07, 0x12, 0x13, 0x0a, 0x0f, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x75, 0x10, 0x06, 0x12, 0x13, 0x0a, 0x0f, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x73, 0x68,
0x6e, 0x5f, 0x73, 0x68, 0x65, 0x6e, 0x7a, 0x68, 0x65, 0x6e, 0x10, 0x08, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x6e, 0x67, 0x68, 0x61, 0x69, 0x10, 0x07, 0x12, 0x13, 0x0a, 0x0f, 0x61, 0x6c, 0x69, 0x5f,
0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x68, 0x65, 0x79, 0x75, 0x61, 0x6e, 0x10, 0x09, 0x12, 0x63, 0x6e, 0x5f, 0x73, 0x68, 0x65, 0x6e, 0x7a, 0x68, 0x65, 0x6e, 0x10, 0x08, 0x12, 0x11, 0x0a,
0x14, 0x0a, 0x10, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x7a, 0x0d, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x68, 0x65, 0x79, 0x75, 0x61, 0x6e, 0x10, 0x09,
0x68, 0x6f, 0x75, 0x10, 0x0a, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x12, 0x14, 0x0a, 0x10, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x67, 0x75, 0x61, 0x6e, 0x67,
0x63, 0x68, 0x65, 0x6e, 0x67, 0x64, 0x75, 0x10, 0x0b, 0x12, 0x13, 0x0a, 0x0f, 0x61, 0x6c, 0x69, 0x7a, 0x68, 0x6f, 0x75, 0x10, 0x0a, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x6c, 0x69, 0x5f, 0x63, 0x6e,
0x5f, 0x63, 0x6e, 0x5f, 0x68, 0x6f, 0x6e, 0x67, 0x6b, 0x6f, 0x6e, 0x67, 0x10, 0x0c, 0x12, 0x16, 0x5f, 0x63, 0x68, 0x65, 0x6e, 0x67, 0x64, 0x75, 0x10, 0x0b, 0x12, 0x13, 0x0a, 0x0f, 0x61, 0x6c,
0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x69, 0x5f, 0x63, 0x6e, 0x5f, 0x68, 0x6f, 0x6e, 0x67, 0x6b, 0x6f, 0x6e, 0x67, 0x10, 0x0c, 0x12,
0x73, 0x74, 0x5f, 0x31, 0x10, 0x0d, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65,
0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x0e, 0x12, 0x16, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0d, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61,
0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x0e, 0x12,
0x73, 0x74, 0x5f, 0x33, 0x10, 0x0f, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65,
0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x35, 0x10, 0x10, 0x12, 0x12, 0x61, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x0f, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61,
0x0a, 0x0e, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x35, 0x10, 0x10, 0x12,
0x10, 0x11, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, 0x5f, 0x6e, 0x6f, 0x72, 0x12, 0x0a, 0x0e, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f,
0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x12, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x6c, 0x31, 0x10, 0x11, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x6c, 0x69, 0x5f, 0x61, 0x70, 0x5f, 0x6e, 0x6f,
0x69, 0x5f, 0x75, 0x73, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x13, 0x12, 0x11, 0x0a, 0x72, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x12, 0x12, 0x11, 0x0a, 0x0d, 0x61,
0x0d, 0x61, 0x6c, 0x69, 0x5f, 0x75, 0x73, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x14, 0x6c, 0x69, 0x5f, 0x75, 0x73, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x13, 0x12, 0x11,
0x12, 0x14, 0x0a, 0x10, 0x61, 0x6c, 0x69, 0x5f, 0x65, 0x75, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x0a, 0x0d, 0x61, 0x6c, 0x69, 0x5f, 0x75, 0x73, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10,
0x61, 0x6c, 0x5f, 0x31, 0x10, 0x15, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x6c, 0x69, 0x5f, 0x65, 0x75, 0x14, 0x12, 0x14, 0x0a, 0x10, 0x61, 0x6c, 0x69, 0x5f, 0x65, 0x75, 0x5f, 0x63, 0x65, 0x6e, 0x74,
0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x16, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x6c, 0x69, 0x72, 0x61, 0x6c, 0x5f, 0x31, 0x10, 0x15, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x6c, 0x69, 0x5f, 0x65,
0x5f, 0x6d, 0x65, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x17, 0x2a, 0xa1, 0x03, 0x0a, 0x75, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x16, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x6c,
0x0f, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x69, 0x5f, 0x6d, 0x65, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x17, 0x2a, 0xa1, 0x03,
0x12, 0x0a, 0x0a, 0x06, 0x74, 0x63, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x0a, 0x0f, 0x54, 0x65, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49,
0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x62, 0x61, 0x6e, 0x67, 0x6b, 0x6f, 0x6b, 0x10, 0x01, 0x12, 0x64, 0x12, 0x0a, 0x0a, 0x06, 0x74, 0x63, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x11, 0x0a,
0x11, 0x0a, 0x0d, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x62, 0x65, 0x69, 0x6a, 0x69, 0x6e, 0x67, 0x0d, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x62, 0x61, 0x6e, 0x67, 0x6b, 0x6f, 0x6b, 0x10, 0x01,
0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x63, 0x68, 0x65, 0x6e, 0x12, 0x11, 0x0a, 0x0d, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x62, 0x65, 0x69, 0x6a, 0x69, 0x6e,
0x67, 0x64, 0x75, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x63, 0x67, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x63, 0x68, 0x65,
0x68, 0x6f, 0x6e, 0x67, 0x71, 0x69, 0x6e, 0x67, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x74, 0x63, 0x6e, 0x67, 0x64, 0x75, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f,
0x5f, 0x61, 0x70, 0x5f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x7a, 0x68, 0x6f, 0x75, 0x10, 0x05, 0x12, 0x63, 0x68, 0x6f, 0x6e, 0x67, 0x71, 0x69, 0x6e, 0x67, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x74,
0x18, 0x0a, 0x14, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x7a, 0x68, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x7a, 0x68, 0x6f, 0x75, 0x10, 0x05,
0x6f, 0x75, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x10, 0x06, 0x12, 0x12, 0x0a, 0x0e, 0x74, 0x63, 0x5f, 0x12, 0x18, 0x0a, 0x14, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x67, 0x75, 0x61, 0x6e, 0x67, 0x7a,
0x61, 0x70, 0x5f, 0x68, 0x6f, 0x6e, 0x67, 0x6b, 0x6f, 0x6e, 0x67, 0x10, 0x07, 0x12, 0x10, 0x0a, 0x68, 0x6f, 0x75, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x10, 0x06, 0x12, 0x12, 0x0a, 0x0e, 0x74, 0x63,
0x0c, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x6d, 0x75, 0x6d, 0x62, 0x61, 0x69, 0x10, 0x08, 0x12, 0x5f, 0x61, 0x70, 0x5f, 0x68, 0x6f, 0x6e, 0x67, 0x6b, 0x6f, 0x6e, 0x67, 0x10, 0x07, 0x12, 0x10,
0x0f, 0x0a, 0x0b, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x65, 0x6f, 0x75, 0x6c, 0x10, 0x09, 0x0a, 0x0c, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x6d, 0x75, 0x6d, 0x62, 0x61, 0x69, 0x10, 0x08,
0x12, 0x12, 0x0a, 0x0e, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x68, 0x12, 0x0f, 0x0a, 0x0b, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x65, 0x6f, 0x75, 0x6c, 0x10,
0x61, 0x69, 0x10, 0x0a, 0x12, 0x16, 0x0a, 0x12, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x68, 0x09, 0x12, 0x12, 0x0a, 0x0e, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x68, 0x61, 0x6e, 0x67,
0x61, 0x6e, 0x67, 0x68, 0x61, 0x69, 0x5f, 0x66, 0x73, 0x69, 0x10, 0x0b, 0x12, 0x16, 0x0a, 0x12, 0x68, 0x61, 0x69, 0x10, 0x0a, 0x12, 0x16, 0x0a, 0x12, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73,
0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x68, 0x65, 0x6e, 0x7a, 0x68, 0x65, 0x6e, 0x5f, 0x66, 0x68, 0x61, 0x6e, 0x67, 0x68, 0x61, 0x69, 0x5f, 0x66, 0x73, 0x69, 0x10, 0x0b, 0x12, 0x16, 0x0a,
0x73, 0x69, 0x10, 0x0c, 0x12, 0x13, 0x0a, 0x0f, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x69, 0x12, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x68, 0x65, 0x6e, 0x7a, 0x68, 0x65, 0x6e, 0x5f,
0x6e, 0x67, 0x61, 0x70, 0x6f, 0x72, 0x65, 0x10, 0x0d, 0x12, 0x0f, 0x0a, 0x0b, 0x74, 0x63, 0x5f, 0x66, 0x73, 0x69, 0x10, 0x0c, 0x12, 0x13, 0x0a, 0x0f, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73,
0x61, 0x70, 0x5f, 0x74, 0x6f, 0x6b, 0x79, 0x6f, 0x10, 0x0e, 0x12, 0x13, 0x0a, 0x0f, 0x74, 0x63, 0x69, 0x6e, 0x67, 0x61, 0x70, 0x6f, 0x72, 0x65, 0x10, 0x0d, 0x12, 0x0f, 0x0a, 0x0b, 0x74, 0x63,
0x5f, 0x65, 0x75, 0x5f, 0x66, 0x72, 0x61, 0x6e, 0x6b, 0x66, 0x75, 0x72, 0x74, 0x10, 0x0f, 0x12, 0x5f, 0x61, 0x70, 0x5f, 0x74, 0x6f, 0x6b, 0x79, 0x6f, 0x10, 0x0e, 0x12, 0x13, 0x0a, 0x0f, 0x74,
0x10, 0x0a, 0x0c, 0x74, 0x63, 0x5f, 0x65, 0x75, 0x5f, 0x6d, 0x6f, 0x73, 0x63, 0x6f, 0x77, 0x10, 0x63, 0x5f, 0x65, 0x75, 0x5f, 0x66, 0x72, 0x61, 0x6e, 0x6b, 0x66, 0x75, 0x72, 0x74, 0x10, 0x0f,
0x10, 0x12, 0x11, 0x0a, 0x0d, 0x74, 0x63, 0x5f, 0x6e, 0x61, 0x5f, 0x61, 0x73, 0x68, 0x62, 0x75, 0x12, 0x10, 0x0a, 0x0c, 0x74, 0x63, 0x5f, 0x65, 0x75, 0x5f, 0x6d, 0x6f, 0x73, 0x63, 0x6f, 0x77,
0x72, 0x6e, 0x10, 0x11, 0x12, 0x17, 0x0a, 0x13, 0x74, 0x63, 0x5f, 0x6e, 0x61, 0x5f, 0x73, 0x69, 0x10, 0x10, 0x12, 0x11, 0x0a, 0x0d, 0x74, 0x63, 0x5f, 0x6e, 0x61, 0x5f, 0x61, 0x73, 0x68, 0x62,
0x6c, 0x69, 0x63, 0x6f, 0x6e, 0x76, 0x61, 0x6c, 0x6c, 0x65, 0x79, 0x10, 0x12, 0x12, 0x11, 0x0a, 0x75, 0x72, 0x6e, 0x10, 0x11, 0x12, 0x17, 0x0a, 0x13, 0x74, 0x63, 0x5f, 0x6e, 0x61, 0x5f, 0x73,
0x0d, 0x74, 0x63, 0x5f, 0x6e, 0x61, 0x5f, 0x74, 0x6f, 0x72, 0x6f, 0x6e, 0x74, 0x6f, 0x10, 0x13, 0x69, 0x6c, 0x69, 0x63, 0x6f, 0x6e, 0x76, 0x61, 0x6c, 0x6c, 0x65, 0x79, 0x10, 0x12, 0x12, 0x11,
0x2a, 0xe8, 0x01, 0x0a, 0x0e, 0x48, 0x75, 0x61, 0x77, 0x65, 0x69, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x0a, 0x0d, 0x74, 0x63, 0x5f, 0x6e, 0x61, 0x5f, 0x74, 0x6f, 0x72, 0x6f, 0x6e, 0x74, 0x6f, 0x10,
0x6e, 0x49, 0x64, 0x12, 0x0a, 0x0a, 0x06, 0x68, 0x77, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x13, 0x2a, 0xe8, 0x01, 0x0a, 0x0e, 0x48, 0x75, 0x61, 0x77, 0x65, 0x69, 0x52, 0x65, 0x67, 0x69,
0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, 0x5f, 0x31, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x0a, 0x0a, 0x06, 0x68, 0x77, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00,
0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, 0x5f,
0x68, 0x5f, 0x34, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x73, 0x31, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x6e, 0x6f, 0x72,
0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x68, 0x77, 0x5f, 0x63, 0x74, 0x68, 0x5f, 0x34, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f,
0x6e, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x68, 0x77, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x68, 0x77, 0x5f,
0x5f, 0x63, 0x6e, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x05, 0x12, 0x15, 0x0a, 0x11, 0x63, 0x6e, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x68,
0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x05, 0x12, 0x15, 0x0a,
0x32, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x68, 0x77, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x11, 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x77, 0x65, 0x73, 0x74,
0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x68, 0x77, 0x5f, 0x32, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x68, 0x77, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f,
0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x68,
0x08, 0x12, 0x15, 0x0a, 0x11, 0x68, 0x77, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x77, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32,
0x65, 0x61, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x09, 0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, 0x61, 0x10, 0x08, 0x12, 0x15, 0x0a, 0x11, 0x68, 0x77, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74,
0x66, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x0a, 0x2a, 0xcd, 0x03, 0x0a, 0x0b, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x09, 0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f,
0x41, 0x77, 0x73, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x61, 0x61, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x0a, 0x2a, 0xcd, 0x03, 0x0a,
0x77, 0x73, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x0b, 0x41, 0x77, 0x73, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x0b, 0x0a, 0x07,
0x75, 0x73, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73,
0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x02, 0x12, 0x11, 0x5f, 0x75, 0x73, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d,
0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x61, 0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x02, 0x12,
0x03, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x31,
0x5f, 0x32, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x66, 0x5f, 0x73, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x75, 0x73, 0x5f, 0x77, 0x65, 0x73,
0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x05, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x74, 0x5f, 0x32, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x66, 0x5f,
0x61, 0x70, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x06, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x05, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73,
0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x07, 0x12, 0x5f, 0x61, 0x70, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x06, 0x12, 0x12, 0x0a, 0x0e,
0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, 0x65, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x07,
0x61, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68,
0x70, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x09, 0x12, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f,
0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, 0x65, 0x61, 0x70, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x09,
0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0a, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68,
0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x0b, 0x12, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0a, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f,
0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x0b,
0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0c, 0x12, 0x14, 0x0a, 0x10, 0x61, 0x77, 0x73, 0x5f, 0x63, 0x12, 0x16, 0x0a, 0x12, 0x61, 0x77, 0x73, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68,
0x61, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x5f, 0x31, 0x10, 0x0d, 0x12, 0x14, 0x0a, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0c, 0x12, 0x14, 0x0a, 0x10, 0x61, 0x77, 0x73, 0x5f,
0x10, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x5f, 0x63, 0x61, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x5f, 0x31, 0x10, 0x0d, 0x12, 0x14,
0x31, 0x10, 0x0e, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x77, 0x65, 0x0a, 0x10, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c,
0x73, 0x74, 0x5f, 0x31, 0x10, 0x0f, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x31, 0x10, 0x0e, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x77,
0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x10, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x65, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x0f, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x65,
0x5f, 0x65, 0x75, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x11, 0x12, 0x11, 0x0a, 0x75, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x32, 0x10, 0x10, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77,
0x0d, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x33, 0x10, 0x12, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x11, 0x12, 0x11,
0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x6e, 0x6f, 0x72, 0x74, 0x68, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x33, 0x10,
0x5f, 0x31, 0x10, 0x13, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x6d, 0x65, 0x5f, 0x73, 0x12, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x75, 0x5f, 0x6e, 0x6f, 0x72, 0x74,
0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x14, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73, 0x5f, 0x68, 0x5f, 0x31, 0x10, 0x13, 0x12, 0x12, 0x0a, 0x0e, 0x61, 0x77, 0x73, 0x5f, 0x6d, 0x65, 0x5f,
0x73, 0x61, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x15, 0x32, 0x78, 0x0a, 0x0d, 0x54, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x31, 0x10, 0x14, 0x12, 0x11, 0x0a, 0x0d, 0x61, 0x77, 0x73,
0x65, 0x6e, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x67, 0x92, 0x41, 0x5f, 0x73, 0x61, 0x5f, 0x65, 0x61, 0x73, 0x74, 0x5f, 0x31, 0x10, 0x15, 0x32, 0x70, 0x0a, 0x0d,
0x64, 0x12, 0x1e, 0xe6, 0x89, 0x80, 0xe6, 0x9c, 0x89, 0xe4, 0xba, 0x91, 0xe7, 0xa7, 0x9f, 0xe6, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x5f, 0x92,
0x88, 0xb7, 0xe7, 0x9a, 0x84, 0xe8, 0xae, 0xa4, 0xe8, 0xaf, 0x81, 0xe6, 0x9c, 0x8d, 0xe5, 0x8a, 0x41, 0x5c, 0x12, 0x1e, 0xe6, 0x89, 0x80, 0xe6, 0x9c, 0x89, 0xe4, 0xba, 0x91, 0xe7, 0xa7, 0x9f,
0xa1, 0x1a, 0x42, 0x0a, 0x1f, 0x46, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x6d, 0x6f, 0xe6, 0x88, 0xb7, 0xe7, 0x9a, 0x84, 0xe8, 0xae, 0xa4, 0xe8, 0xaf, 0x81, 0xe6, 0x9c, 0x8d, 0xe5,
0x72, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x46, 0x69, 0x8a, 0xa1, 0x1a, 0x3a, 0x0a, 0x17, 0x46, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x6d,
0x74, 0x74, 0x65, 0x72, 0x12, 0x1f, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x6f, 0x72, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x50, 0x43, 0x4d, 0x12, 0x1f, 0x68,
0x74, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x63, 0x6e, 0x2f, 0x4a, 0x43, 0x43, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x6f,
0x45, 0x2f, 0x50, 0x43, 0x4d, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x6c, 0x69, 0x6e, 0x6b, 0x72, 0x67, 0x2e, 0x63, 0x6e, 0x2f, 0x4a, 0x43, 0x43, 0x45, 0x2f, 0x50, 0x43, 0x4d, 0x42, 0x30,
0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x63, 0x6e, 0x2f, 0x4a, 0x43, 0x43, 0x45, 0x2f, 0x50, 0x43, 0x4d, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x63, 0x6e,
0x2f, 0x6c, 0x61, 0x6e, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x2f, 0x69, 0x64, 0x6c, 0x2f, 0x70, 0x2f, 0x4a, 0x43, 0x43, 0x45, 0x2f, 0x50, 0x43, 0x4d, 0x2f, 0x6c, 0x61, 0x6e, 0x5f, 0x74, 0x72,
0x62, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 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 ( var (

View File

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

View File

@ -1,44 +1,30 @@
{ {
"swagger": "2.0",
"info": {
"title": "idl/pbecs/ecs.proto",
"version": "version not set"
},
"tags": [
{
"name": "EcsService"
}
],
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
"produces": [ "produces": [
"application/json" "application/json"
], ],
"swagger": "2.0",
"info": {
"title": "idl/demo/demo.proto",
"version": "version not set"
},
"paths": { "paths": {
"/apis/demo": { "/apis/ecs": {
"post": { "post": {
"security": [], "summary": "查询ECS全量 - 根据云类型",
"tags": [ "operationId": "EcsService_ListEcs",
"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"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "A successful response.", "description": "A successful response.",
"schema": { "schema": {
"$ref": "#/definitions/demoStringMessage" "$ref": "#/definitions/pbecsListResp"
} }
}, },
"default": { "default": {
@ -47,16 +33,7 @@
"$ref": "#/definitions/rpcStatus" "$ref": "#/definitions/rpcStatus"
} }
} }
} },
}
},
"/apis/ecs": {
"post": {
"tags": [
"EcsService"
],
"summary": "查询ECS全量 - 根据云类型",
"operationId": "EcsService_ListEcs",
"parameters": [ "parameters": [
{ {
"name": "body", "name": "body",
@ -67,6 +44,15 @@
} }
} }
], ],
"tags": [
"EcsService"
]
}
},
"/apis/ecs/all": {
"post": {
"summary": "查询所有云的ECS",
"operationId": "EcsService_ListEcsAll",
"responses": { "responses": {
"200": { "200": {
"description": "A successful response.", "description": "A successful response.",
@ -80,16 +66,7 @@
"$ref": "#/definitions/rpcStatus" "$ref": "#/definitions/rpcStatus"
} }
} }
} },
}
},
"/apis/ecs/all": {
"post": {
"tags": [
"EcsService"
],
"summary": "查询所有云的ECS",
"operationId": "EcsService_ListEcsAll",
"parameters": [ "parameters": [
{ {
"name": "body", "name": "body",
@ -100,39 +77,15 @@
} }
} }
], ],
"responses": { "tags": [
"200": { "EcsService"
"description": "A successful response.", ]
"schema": {
"$ref": "#/definitions/pbecsListResp"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
}
} }
}, },
"/apis/ecs/detail": { "/apis/ecs/detail": {
"post": { "post": {
"tags": [
"EcsService"
],
"summary": "查询ECS明细 - 支持云类型、区域、账户、分页等过滤条件", "summary": "查询ECS明细 - 支持云类型、区域、账户、分页等过滤条件",
"operationId": "EcsService_ListEcsDetail", "operationId": "EcsService_ListEcsDetail",
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/pbecsListDetailReq"
}
}
],
"responses": { "responses": {
"200": { "200": {
"description": "A successful response.", "description": "A successful response.",
@ -146,54 +99,35 @@
"$ref": "#/definitions/rpcStatus" "$ref": "#/definitions/rpcStatus"
} }
} }
} },
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/pbecsListDetailReq"
}
}
],
"tags": [
"EcsService"
]
} }
} }
}, },
"definitions": { "definitions": {
"demoStringMessage": {
"type": "object",
"properties": {
"value": {
"type": "string"
}
}
},
"pbecsEcsInstance": { "pbecsEcsInstance": {
"type": "object", "type": "object",
"properties": { "properties": {
"provider": {
"$ref": "#/definitions/pbtenantCloudProvider",
"title": "云类型"
},
"accountName": { "accountName": {
"type": "string", "type": "string",
"title": "账号名称" "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": { "instanceId": {
"type": "string", "type": "string",
"title": "实例id" "title": "实例id"
@ -202,41 +136,65 @@
"type": "string", "type": "string",
"title": "实例名称" "title": "实例名称"
}, },
"regionName": {
"type": "string",
"title": "地域,数据中心"
},
"publicIps": {
"type": "array",
"items": {
"type": "string"
},
"title": "公网ip"
},
"instanceType": { "instanceType": {
"type": "string", "type": "string",
"title": "实例类型" "title": "实例类型"
}, },
"cpu": {
"type": "integer",
"format": "int32",
"title": "vcpu数"
},
"memory": { "memory": {
"type": "integer", "type": "integer",
"format": "int32", "format": "int32",
"title": "内存MB" "title": "内存MB"
}, },
"provider": { "description": {
"title": "云类型",
"$ref": "#/definitions/pbtenantCloudProvider"
},
"publicIps": {
"type": "array",
"title": "公网ip",
"items": {
"type": "string"
}
},
"regionName": {
"type": "string", "type": "string",
"title": "地域,数据中心" "title": "实例描述"
},
"resourceGroupId": {
"type": "string",
"title": "资源组id"
}, },
"status": { "status": {
"type": "string", "type": "string",
"title": "状态" "title": "状态"
}, },
"creationTime": {
"type": "string",
"title": "创建时间ISO8601"
},
"expireTime": {
"type": "string",
"title": "过期时间"
},
"innerIps": {
"type": "array",
"items": {
"type": "string"
},
"title": "内网ip"
},
"vpcId": { "vpcId": {
"type": "string", "type": "string",
"title": "vcp id" "title": "vpc id"
},
"resourceGroupId": {
"type": "string",
"title": "资源组id"
},
"chargeType": {
"type": "string",
"title": "收费类型"
} }
} }
}, },
@ -246,13 +204,18 @@
"pbecsListDetailReq": { "pbecsListDetailReq": {
"type": "object", "type": "object",
"properties": { "properties": {
"provider": {
"$ref": "#/definitions/pbtenantCloudProvider",
"title": "云名称"
},
"accountName": { "accountName": {
"type": "string", "type": "string",
"title": "账户名称根据config.yaml中的配置默认为第一个配置的账户" "title": "账户名称根据config.yaml中的配置默认为第一个配置的账户"
}, },
"nextToken": { "regionId": {
"type": "string", "type": "integer",
"title": "分页相关参数下一页的token" "format": "int32",
"title": "区域Id参考 tenant.proto 中的各个云的区域"
}, },
"pageNumber": { "pageNumber": {
"type": "integer", "type": "integer",
@ -264,14 +227,9 @@
"format": "int32", "format": "int32",
"title": "分页相关参数,每页数量" "title": "分页相关参数,每页数量"
}, },
"provider": { "nextToken": {
"title": "云名称", "type": "string",
"$ref": "#/definitions/pbtenantCloudProvider" "title": "分页相关参数下一页的token"
},
"regionId": {
"type": "integer",
"format": "int32",
"title": "区域Id参考 tenant.proto 中的各个云的区域"
} }
} }
}, },
@ -280,19 +238,15 @@
"properties": { "properties": {
"ecses": { "ecses": {
"type": "array", "type": "array",
"title": "Ecs 机器集合",
"items": { "items": {
"$ref": "#/definitions/pbecsEcsInstance" "$ref": "#/definitions/pbecsEcsInstance"
} },
"title": "Ecs 机器集合"
}, },
"finished": { "finished": {
"type": "boolean", "type": "boolean",
"title": "查询是否完成,如果为否-false则可以将下面三个分页参数填入到请求中继续查询" "title": "查询是否完成,如果为否-false则可以将下面三个分页参数填入到请求中继续查询"
}, },
"nextToken": {
"type": "string",
"title": "分页相关参数下一页的token"
},
"pageNumber": { "pageNumber": {
"type": "integer", "type": "integer",
"format": "int32", "format": "int32",
@ -303,6 +257,10 @@
"format": "int32", "format": "int32",
"title": "分页相关参数,每页数量" "title": "分页相关参数,每页数量"
}, },
"nextToken": {
"type": "string",
"title": "分页相关参数下一页的token"
},
"requestId": { "requestId": {
"type": "string", "type": "string",
"title": "请求id出现问题后提供给云厂商排查问题" "title": "请求id出现问题后提供给云厂商排查问题"
@ -313,8 +271,8 @@
"type": "object", "type": "object",
"properties": { "properties": {
"provider": { "provider": {
"title": "云名称", "$ref": "#/definitions/pbtenantCloudProvider",
"$ref": "#/definitions/pbtenantCloudProvider" "title": "云名称"
} }
} }
}, },
@ -323,24 +281,24 @@
"properties": { "properties": {
"ecses": { "ecses": {
"type": "array", "type": "array",
"title": "Ecs 机器集合",
"items": { "items": {
"$ref": "#/definitions/pbecsEcsInstance" "$ref": "#/definitions/pbecsEcsInstance"
} },
"title": "Ecs 机器集合"
} }
} }
}, },
"pbtenantCloudProvider": { "pbtenantCloudProvider": {
"description": "- ali: 0 - 阿里云\n - tencent: 1 - 腾讯云\n - huawei: 2 - 华为云\n - aws: 3 - 亚马逊云",
"type": "string", "type": "string",
"title": "云提供商",
"default": "ali",
"enum": [ "enum": [
"ali", "ali",
"tencent", "tencent",
"huawei", "huawei",
"aws" "aws"
] ],
"default": "ali",
"description": "- ali: 0 - 阿里云\n - tencent: 1 - 腾讯云\n - huawei: 2 - 华为云\n - aws: 3 - 亚马逊云",
"title": "云提供商"
}, },
"protobufAny": { "protobufAny": {
"type": "object", "type": "object",
@ -361,24 +319,16 @@
"type": "integer", "type": "integer",
"format": "int32" "format": "int32"
}, },
"message": {
"type": "string"
},
"details": { "details": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/definitions/protobufAny" "$ref": "#/definitions/protobufAny"
} }
},
"message": {
"type": "string"
} }
} }
} }
}, }
"tags": [
{
"name": "DemoService"
},
{
"name": "EcsService"
}
]
} }

View File

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

View File

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

12
main.go
View File

@ -3,16 +3,17 @@ package main
import ( import (
"context" "context"
"flag" "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"
"net/http" "net/http"
"github.com/golang/glog" "github.com/golang/glog"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/pkg/errors" "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" "google.golang.org/grpc"
) )
@ -35,6 +36,8 @@ func run() error {
return errors.Wrap(err, "RegisterDemoServiceHandlerFromEndpoint error") return errors.Wrap(err, "RegisterDemoServiceHandlerFromEndpoint error")
} else if err = pbecs.RegisterEcsServiceHandlerFromEndpoint(ctx, mux, *grpcServerEndpoint, opts); err != nil { } else if err = pbecs.RegisterEcsServiceHandlerFromEndpoint(ctx, mux, *grpcServerEndpoint, opts); err != nil {
return errors.Wrap(err, "RegisterEcsServiceHandlerFromEndpoint error") 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) // Start HTTP server (and proxy calls to gRPC server endpoint)
@ -65,6 +68,7 @@ func main() {
s := grpc.NewServer() s := grpc.NewServer()
demo.RegisterDemoServiceServer(s, &server.Server{}) demo.RegisterDemoServiceServer(s, &server.Server{})
pbecs.RegisterEcsServiceServer(s, &server.Server{}) pbecs.RegisterEcsServiceServer(s, &server.Server{})
pbpod.RegisterPodServiceServer(s, &server.Server{})
if err = s.Serve(lis); err != nil { if err = s.Serve(lis); err != nil {
glog.Fatalf("failed to serve: %v", err) glog.Fatalf("failed to serve: %v", err)