Conflicts:
	adaptor/pod_adaptor/server/pod/pod.go
	lan_trans/idl/pbpod/pod.pb.go
	lan_trans/idl/pbpod/pod.pb.gw.go
	lan_trans/openapiv2/idl/pbpod/pod.swagger.json
This commit is contained in:
zhouqunjie 2022-04-15 17:36:06 +08:00
commit ad01fd74e5
31 changed files with 3984 additions and 670 deletions

View File

@ -2,6 +2,7 @@ package pod
import (
"context"
"fmt"
"sync"
"gitlink.org.cn/JCCE/PCM/adaptor/pod_adaptor/service/poder"
@ -15,21 +16,37 @@ import (
func CreatePods(ctx context.Context, req *pbpod.CreatePodsReq) (*pbpod.CreatePodsResp, error) {
var (
pods []*pbpod.PodInstance
requestIds = make([]string, len(req.CreatePodReq))
wg sync.WaitGroup
requestIds = make([]string, 0)
)
wg.Add(len(req.CreatePodReq))
c := make(chan string)
for k := range req.CreatePodReq {
resp, err := CreatePod(ctx, req.CreatePodReq[k])
if err != nil {
return nil, errors.Wrap(err, "Batch pod creation error")
}
requestIds[k] = resp.RequestId
reqPod := req.CreatePodReq[k]
go func() {
defer wg.Done()
resp, err := CreatePod(ctx, reqPod)
if err != nil || resp == nil {
fmt.Println(errors.Wrap(err, "Batch pod creation error"))
return
}
c <- resp.RequestId
}()
}
go func() {
defer close(c)
wg.Wait()
}()
isFinished := false
if len(pods) > 0 {
if len(requestIds) > 0 {
isFinished = true
}
for v := range c {
requestIds = append(requestIds, v)
}
return &pbpod.CreatePodsResp{
Finished: isFinished,
RequestId: requestIds,
@ -173,6 +190,7 @@ func ListPod(ctx context.Context, req *pbpod.ListPodReq) (*pbpod.ListPodResp, er
Provider: req.Provider,
AccountName: tenant.AccountName(),
RegionId: region.GetId(),
Namespace: req.Namespace,
PageNumber: 1,
PageSize: 100,
NextToken: "",
@ -212,15 +230,27 @@ func ListPodAll(ctx context.Context) (*pbpod.ListPodResp, error) {
go func(provider int32) {
defer wg.Done()
resp, err := ListPod(ctx, &pbpod.ListPodReq{Provider: pbtenant.CloudProvider(provider)})
if err != nil {
glog.Errorf("List error %v", err)
return
//针对私有K8S集群调用listAll时默认只查询default namespace下的pod
if provider == 3 {
resp, err := ListPod(ctx, &pbpod.ListPodReq{Provider: pbtenant.CloudProvider(provider), Namespace: "default"})
if err != nil {
glog.Errorf("List error %v", err)
return
}
mutex.Lock()
pods = append(pods, resp.Pods...)
mutex.Unlock()
} else {
resp, err := ListPod(ctx, &pbpod.ListPodReq{Provider: pbtenant.CloudProvider(provider)})
if err != nil {
glog.Errorf("List error %v", err)
return
}
mutex.Lock()
pods = append(pods, resp.Pods...)
mutex.Unlock()
}
mutex.Lock()
pods = append(pods, resp.Pods...)
mutex.Unlock()
}(k)
}

View File

@ -73,7 +73,7 @@ func (eci *AliEci) CreatePod(ctx context.Context, req *pbpod.CreatePodReq) (*pbp
return &pbpod.CreatePodResp{
Pods: nil,
Finished: isFinished,
RequestId: resp.RequestId,
RequestId: "ali pod ID:" + resp.ContainerGroupId,
}, nil
}

View File

@ -49,7 +49,6 @@ func newHuaweiCciClient(region tenanter.Region, tenant tenanter.Tenanter) (Poder
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))
@ -87,7 +86,7 @@ func (cci *HuaweiCci) CreatePod(ctx context.Context, req *pbpod.CreatePodReq) (*
ObjectMeta: metav1.ObjectMeta{
Name: req.PodName,
Namespace: req.Namespace,
Labels: map[string]string{"name": "testapi"},
Labels: map[string]string{"name": "test_api"},
},
Spec: corev1.PodSpec{
RestartPolicy: corev1.RestartPolicyAlways,
@ -119,9 +118,9 @@ func (cci *HuaweiCci) CreatePod(ctx context.Context, req *pbpod.CreatePodReq) (*
}
return &pbpod.CreatePodResp{
Pods: nil,
Finished: isFinished,
//RequestId: resp.RequestId,
Pods: nil,
Finished: isFinished,
RequestId: "huawei pod Name:" + resp.Name,
}, nil
}
@ -184,9 +183,9 @@ func (cci *HuaweiCci) ListPodDetail(ctx context.Context, req *pbpod.ListPodDetai
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))
var pods = make([]*pbpod.PodInstance, len(resp.Items))
for k, v := range resp.Items {
podes[k] = &pbpod.PodInstance{
pods[k] = &pbpod.PodInstance{
Provider: pbtenant.CloudProvider_huawei,
AccountName: cci.tenanter.AccountName(),
PodId: string(v.GetUID()),
@ -202,12 +201,12 @@ func (cci *HuaweiCci) ListPodDetail(ctx context.Context, req *pbpod.ListPodDetai
}
isFinished := false
if len(podes) < int(req.PageSize) {
if len(pods) < int(req.PageSize) {
isFinished = true
}
return &pbpod.ListPodDetailResp{
Pods: podes,
Pods: pods,
Finished: isFinished,
PageNumber: req.PageNumber + 1,
PageSize: req.PageSize,

View File

@ -0,0 +1,210 @@
package poder
import (
"context"
"fmt"
"github.com/golang/glog"
"github.com/pkg/errors"
"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"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
k8s "k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"sync"
)
var k8sClientMutex sync.Mutex
type Config struct {
Host string
Token string
Port int
}
type K8SPoder struct {
cli *k8s.Clientset
region tenanter.Region
tenanter tenanter.Tenanter
}
func newK8SClient(tenant tenanter.Tenanter) (Poder, error) {
var (
client *k8s.Clientset
err error
)
switch t := tenant.(type) {
case *tenanter.AccessKeyTenant:
kubeConf := &rest.Config{
Host: fmt.Sprintf("%s:%d", t.GetUrl(), 6443),
BearerToken: t.GetToken(),
TLSClientConfig: rest.TLSClientConfig{
Insecure: true,
},
}
k8sClientMutex.Lock()
client, err = k8s.NewForConfig(kubeConf)
k8sClientMutex.Unlock()
default:
}
if err != nil {
return nil, errors.Wrap(err, "init k8s client error")
}
return &K8SPoder{
cli: client,
region: nil,
tenanter: tenant,
}, nil
}
func (k K8SPoder) ListPodDetail(ctx context.Context, req *pbpod.ListPodDetailReq) (*pbpod.ListPodDetailResp, error) {
//TODO implement me
resp, err := k.cli.CoreV1().Pods(req.GetNamespace()).List(metav1.ListOptions{})
if err != nil {
return nil, errors.Wrap(err, "K8S ListDetail pod error")
}
glog.Info("K8S ListDetail pod success", resp.Items)
var pods = make([]*pbpod.PodInstance, len(resp.Items))
for k, v := range resp.Items {
pods[k] = &pbpod.PodInstance{
Provider: pbtenant.CloudProvider_k8s,
AccountName: req.AccountName,
PodId: string(v.GetUID()),
PodName: v.Name,
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,
Status: string(v.Status.Phase),
}
}
isFinished := false
if len(pods) < int(req.PageSize) {
isFinished = true
}
return &pbpod.ListPodDetailResp{
Pods: pods,
Finished: isFinished,
PageNumber: req.PageNumber + 1,
PageSize: req.PageSize,
//NextToken: resp.NextToken,
//RequestId: resp.RequestId,
}, nil
}
func (k *K8SPoder) CreatePod(ctx context.Context, req *pbpod.CreatePodReq) (*pbpod.CreatePodResp, error) {
pod := corev1.Pod{
TypeMeta: metav1.TypeMeta{
APIVersion: "core/V1",
Kind: "Pod",
},
ObjectMeta: metav1.ObjectMeta{
Name: req.PodName,
Namespace: req.Namespace,
Labels: map[string]string{"name": "test_api"},
},
Spec: corev1.PodSpec{
RestartPolicy: corev1.RestartPolicyAlways,
Containers: []corev1.Container{
{
Name: req.ContainerName,
Image: req.ContainerImage,
Resources: corev1.ResourceRequirements{
Limits: map[corev1.ResourceName]resource.Quantity{
corev1.ResourceCPU: resource.MustParse(req.CpuPod),
corev1.ResourceMemory: resource.MustParse(req.MemoryPod),
},
},
},
},
},
Status: corev1.PodStatus{},
}
resp, err := k.cli.CoreV1().Pods(req.Namespace).Create(&pod)
glog.Info("K8S create pod resp", resp)
if err != nil {
return nil, errors.Wrap(err, "K8S CreatePod error")
}
isFinished := false
if len(resp.UID) > 0 {
isFinished = true
}
return &pbpod.CreatePodResp{
Pods: nil,
Finished: isFinished,
RequestId: "K8S pod Name:" + resp.Name,
}, nil
}
func (k K8SPoder) DeletePod(ctx context.Context, req *pbpod.DeletePodReq) (*pbpod.DeletePodResp, error) {
podName := req.PodName
fmt.Println("K8S ContainerGroup:", podName, " Deleted")
err := k.cli.CoreV1().Pods(req.Namespace).Delete(podName, &metav1.DeleteOptions{})
glog.Info("K8S delete pod resp", err)
isFinished := true
if err != nil {
isFinished = false
return nil, errors.Wrap(err, "K8S DeletePod error")
}
return &pbpod.DeletePodResp{
//Pods: err,
Finished: isFinished,
//RequestId: resp.RequestId,
}, nil
}
func (k K8SPoder) UpdatePod(ctx context.Context, req *pbpod.UpdatePodReq) (*pbpod.UpdatePodResp, error) {
qresp, err := k.cli.CoreV1().Pods(req.GetNamespace()).Get(req.PodName, metav1.GetOptions{})
if err != nil {
return nil, errors.Wrap(err, "K8S UpdatePod error")
}
pod := corev1.Pod{
TypeMeta: qresp.TypeMeta,
ObjectMeta: metav1.ObjectMeta{
Name: req.PodName,
Namespace: req.Namespace,
Labels: map[string]string{"name": req.Labels},
},
Spec: qresp.Spec,
Status: qresp.Status,
}
pod.Spec.Containers[0].Image = req.ContainerImage
resp, err := k.cli.CoreV1().Pods(req.Namespace).Update(&pod)
glog.Info("K8S update pod resp", resp)
if err != nil {
return nil, errors.Wrap(err, "K8S UpdatePod error")
}
isFinished := false
if len(resp.UID) > 0 {
isFinished = true
}
return &pbpod.UpdatePodResp{
Pod: nil,
Finished: isFinished,
//RequestId: resp.RequestId,
}, nil
}

View File

@ -26,7 +26,7 @@ func TestMain(m *testing.M) {
if hwTenant, err = tenanter.GetTenanters(pbtenant.CloudProvider_huawei); err != nil {
panic("get hwTenant failed")
}
if awsTenant, err = tenanter.GetTenanters(pbtenant.CloudProvider_aws); err != nil {
if awsTenant, err = tenanter.GetTenanters(pbtenant.CloudProvider_k8s); err != nil {
panic("get awsTenant failed")
}
os.Exit(m.Run())

View File

@ -39,6 +39,8 @@ func NewPodClient(provider pbtenant.CloudProvider, region tenanter.Region, tenan
return newTencentEksClient(region, tenant)
case pbtenant.CloudProvider_huawei:
return newHuaweiCciClient(region, tenant)
case pbtenant.CloudProvider_k8s:
return newK8SClient(tenant)
//TODO aws
//case pbtenant.CloudProvider_aws:
// return newAwsPodClient(region, tenant)

View File

@ -2,61 +2,61 @@ package poder
import (
"context"
"gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbpod"
"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", "", ""))
ali, _ := NewPodClient(pbtenant.CloudProvider_ali, region, aliTenant[0])
aliFailed, _ := NewPodClient(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", "", ""))
tc, _ := NewPodClient(pbtenant.CloudProvider_tencent, region, tcTenant[0])
tcFailed, _ := NewPodClient(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])
hw, _ := NewPodClient(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])
region, _ = tenanter.NewRegion(pbtenant.CloudProvider_k8s, int32(pbtenant.AwsRegionId_aws_us_east_2))
aws, _ := NewPodClient(pbtenant.CloudProvider_k8s, region, awsTenant[0])
// google, _ := NewGoogleEcsClient(tenanter.NewTenantWithAccessKey("", ""))
type args struct {
req *pbecs.ListDetailReq
req *pbpod.ListPodDetailReq
}
tests := []struct {
name string
fields Ecser
fields Poder
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: "ali wrong cli", fields: aliFailed, args: args{&pbpod.ListPodDetailReq{PageNumber: 1, PageSize: 1}}, wantErr: true},
{name: "ali wrong page number", fields: ali, args: args{&pbpod.ListPodDetailReq{PageNumber: 0, PageSize: 1}}, wantErr: true},
{name: "ali wrong page size", fields: ali, args: args{&pbpod.ListPodDetailReq{PageNumber: 1, PageSize: 0}}, wantErr: true},
{name: "ali right cli", fields: ali, args: args{&pbpod.ListPodDetailReq{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: "tc wrong cli", fields: tcFailed, args: args{&pbpod.ListPodDetailReq{PageNumber: 1, PageSize: 1}}, wantErr: true},
{name: "tc wrong page number", fields: tc, args: args{&pbpod.ListPodDetailReq{PageNumber: 0, PageSize: 1}}, wantErr: true},
{name: "tc wrong page size", fields: tc, args: args{&pbpod.ListPodDetailReq{PageNumber: 1, PageSize: 0}}, wantErr: true},
{name: "tc right cli", fields: tc, args: args{&pbpod.ListPodDetailReq{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: "hw right cli", fields: hw, args: args{&pbpod.ListPodDetailReq{PageNumber: 1, PageSize: 10}}, wantErr: false},
{name: "aws right cli", fields: aws, args: args{&pbecs.ListDetailReq{PageNumber: 1, PageSize: 10}}, wantErr: false},
{name: "aws right cli", fields: aws, args: args{&pbpod.ListPodDetailReq{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)
resp, err := tt.fields.ListPodDetail(context.Background(), tt.args.req)
if (err != nil) != tt.wantErr {
t.Errorf("ListDetail() error = %+v, wantErr %v", err, tt.wantErr)
return

View File

@ -149,12 +149,11 @@ func (eks *TencentEks) UpdatePod(ctx context.Context, req *pbpod.UpdatePodReq) (
glog.Errorf("Tencent UpdatePod error: %v", err)
return nil, errors.Wrap(err, "Tencent UpdatePod error")
}
requestId := resp.Response.RequestId
return &pbpod.UpdatePodResp{
Pod: nil,
Finished: isFinished,
RequestId: *requestId,
RequestId: "tencent pod ID:" + *resp.Response.EksCiId,
}, nil
}

View File

@ -4,15 +4,112 @@ import (
"context"
"sync"
"github.com/golang/glog"
"github.com/pkg/errors"
"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"
"github.com/golang/glog"
"github.com/pkg/errors"
)
//CreateMultipleEcs 创建多云ECS
func CreateMultipleEcs(ctx context.Context, reqs *pbecs.CreateEcsMultipleReq) (*pbecs.CreateEcsMultipleResp, error) {
var (
wg sync.WaitGroup
requestIds = make([]string, 0)
)
wg.Add(len(reqs.GetCreateEcsReqs()))
c := make(chan string, len(reqs.GetCreateEcsReqs()))
for _, k := range reqs.GetCreateEcsReqs() {
k := k
go func() {
defer wg.Done()
resp, err := CreateEcs(ctx, k)
if err != nil {
glog.Errorf(k.Provider.String()+"CreateEcs error: %v", err)
c <- k.Provider.String()
return
}
c <- resp.GetRequestId()
}()
}
go func() {
defer close(c)
wg.Wait()
}()
for v := range c {
requestIds = append(requestIds, v)
}
isFinished := false
if len(requestIds) > 0 {
isFinished = true
}
return &pbecs.CreateEcsMultipleResp{
RequestId: requestIds,
Finished: isFinished,
}, nil
}
func CreateEcs(ctx context.Context, req *pbecs.CreateEcsReq) (*pbecs.CreateEcsResp, error) {
var (
ecs ecser.Ecser
)
tenanters, err := tenanter.GetTenanters(req.Provider)
region, err := tenanter.NewRegion(req.Provider, req.RegionId)
if err != nil {
return nil, errors.Wrap(err, "get tenanters failed")
}
for _, tenanter := range tenanters {
if req.AccountName == "" || tenanter.AccountName() == req.AccountName {
if ecs, err = ecser.NewEcsClient(req.Provider, region, tenanter); err != nil {
return nil, errors.WithMessage(err, "NewEcsClient error")
}
break
}
}
return ecs.CreateEcs(ctx, req)
}
func DeleteEcs(ctx context.Context, req *pbecs.DeleteEcsReq) (*pbecs.DeleteEcsResp, error) {
var (
ecs ecser.Ecser
)
tenanters, err := tenanter.GetTenanters(req.Provider)
region, err := tenanter.NewRegion(req.Provider, req.RegionId)
if err != nil {
return nil, errors.Wrap(err, "get tenanters failed")
}
for _, tenanter := range tenanters {
if req.AccountName == "" || tenanter.AccountName() == req.AccountName {
if ecs, err = ecser.NewEcsClient(req.Provider, region, tenanter); err != nil {
return nil, errors.WithMessage(err, "NewEcsClient error")
}
break
}
}
return ecs.DeleteEcs(ctx, req)
}
func UpdateEcs(ctx context.Context, req *pbecs.UpdateEcsReq) (*pbecs.UpdateEcsResp, error) {
var (
ecs ecser.Ecser
)
tenanters, err := tenanter.GetTenanters(req.Provider)
region, err := tenanter.NewRegion(req.Provider, req.RegionId)
if err != nil {
return nil, errors.Wrap(err, "get tenanters failed")
}
for _, tenanter := range tenanters {
if req.AccountName == "" || tenanter.AccountName() == req.AccountName {
if ecs, err = ecser.NewEcsClient(req.Provider, region, tenanter); err != nil {
return nil, errors.WithMessage(err, "NewEcsClient error")
}
break
}
}
return ecs.UpdateEcs(ctx, req)
}
//ListDetail returns the detail of ecs instances
func ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (*pbecs.ListDetailResp, error) {
var (

View File

@ -8,7 +8,7 @@ import (
)
var (
aliTenant, tcTenant, hwTenant, awsTenant []tenanter.Tenanter
aliTenant, tcTenant, hwTenant, k8sTenant []tenanter.Tenanter
)
func TestMain(m *testing.M) {
@ -25,7 +25,7 @@ func TestMain(m *testing.M) {
if hwTenant, err = tenanter.GetTenanters(pbtenant.CloudProvider_huawei); err != nil {
panic("get hwTenant failed")
}
if awsTenant, err = tenanter.GetTenanters(pbtenant.CloudProvider_aws); err != nil {
if k8sTenant, err = tenanter.GetTenanters(pbtenant.CloudProvider_k8s); err != nil {
panic("get awsTenant failed")
}
os.Exit(m.Run())

View File

@ -2,14 +2,18 @@ package ecser
import (
"context"
"sync"
openapi "github.com/alibabacloud-go/darabonba-openapi/client"
string_ "github.com/alibabacloud-go/darabonba-string/client"
aliecs "github.com/alibabacloud-go/ecs-20140526/v2/client"
util "github.com/alibabacloud-go/tea-utils/service"
"github.com/alibabacloud-go/tea/tea"
"github.com/golang/glog"
"github.com/pkg/errors"
"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/aliyun/alibaba-cloud-sdk-go/sdk/requests"
aliecs "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
"github.com/pkg/errors"
)
var aliClientMutex sync.Mutex
@ -25,14 +29,21 @@ func newAliEcsClient(region tenanter.Region, tenant tenanter.Tenanter) (Ecser, e
client *aliecs.Client
err error
)
switch t := tenant.(type) {
case *tenanter.AccessKeyTenant:
// 阿里云的sdk有一个 map 的并发问题go test 加上-race 能检测出来,所以这里加一个锁
aliClientMutex.Lock()
client, err = aliecs.NewClientWithAccessKey(region.GetName(), t.GetId(), t.GetSecret())
config := &openapi.Config{}
AccessKeyId := t.GetId()
AccessKeySecret := t.GetSecret()
RegionId := region.GetName()
config.AccessKeyId = &AccessKeyId
config.AccessKeySecret = &AccessKeySecret
config.RegionId = &RegionId
client, err = aliecs.NewClient(config)
aliClientMutex.Unlock()
default:
return nil, errors.New("unsupported tenant type")
}
if err != nil {
@ -45,40 +56,170 @@ func newAliEcsClient(region tenanter.Region, tenant tenanter.Tenanter) (Ecser, e
tenanter: tenant,
}, nil
}
func (ecs *AliEcs) CreateEcs(ctx context.Context, req *pbecs.CreateEcsReq) (*pbecs.CreateEcsResp, error) {
RegionId := ecs.region.GetName()
ImageId := req.GetImageId()
InstanceType := req.GetInstanceType()
SecurityGroupId := req.GetSecurityGroupId()
InstanceName := req.GetInstanceName()
Description := req.GetDescription()
ZoneId := req.GetZoneId()
VSwitchId := req.GetVSwitchId()
Amount := req.GetAmount()
DryRun := req.GetDryRun()
Category := req.GetCategory()
InstanceChargeType := req.GetInstanceChargeType()
request := &aliecs.RunInstancesRequest{
RegionId: &RegionId,
InstanceType: &InstanceType,
ImageId: &ImageId,
SecurityGroupId: &SecurityGroupId,
InstanceName: &InstanceName,
Description: &Description,
ZoneId: &ZoneId,
VSwitchId: &VSwitchId,
Amount: &Amount,
DryRun: util.EqualString(&DryRun, tea.String("true")),
SystemDisk: &aliecs.RunInstancesRequestSystemDisk{
Category: &Category,
},
InstanceChargeType: &InstanceChargeType,
}
// 创建并运行实例
resp, err := ecs.cli.RunInstances(request)
if err != nil {
return nil, errors.Wrap(err, "Ali Create ECS error")
}
isFinished := false
if len(resp.Body.InstanceIdSets.InstanceIdSet) > 0 {
isFinished = true
}
glog.Infof("--------------------阿里ECS实例创建成功--------------------")
glog.Infof(*util.ToJSONString(util.ToMap(resp)))
requestId := *resp.Body.RequestId
//订单ID。该参数只有创建包年包月ECS实例请求参数InstanceChargeType=PrePaid时有返回值。
OrderId := ""
if req.InstanceChargeType == "PrePaid" {
OrderId = *resp.Body.OrderId
}
TradePrice := float32(0)
if resp.Body.TradePrice != nil {
TradePrice = *resp.Body.TradePrice
}
InstanceIds := make([]string, 0)
for _, v := range resp.Body.InstanceIdSets.InstanceIdSet {
InstanceIds = append(InstanceIds, *v)
}
return &pbecs.CreateEcsResp{
OrderId: OrderId,
TradePrice: TradePrice,
RequestId: "Ali ECS RequestId: " + requestId,
InstanceIdSets: InstanceIds,
Finished: isFinished,
}, nil
}
func (ecs *AliEcs) DeleteEcs(ctx context.Context, req *pbecs.DeleteEcsReq) (*pbecs.DeleteEcsResp, error) {
RegionId := ecs.region.GetName()
InstanceIds := req.GetInstanceIds()
DryRun := req.GetDryRun()
Force := req.GetForce()
TerminateSubscription := req.GetTerminateSubscription()
deleteReq := &aliecs.DeleteInstancesRequest{
RegionId: &RegionId,
InstanceId: string_.Split(&InstanceIds, tea.String(","), tea.Int(-1)),
Force: util.EqualString(&Force, tea.String("true")),
DryRun: util.EqualString(&DryRun, tea.String("true")),
TerminateSubscription: util.EqualString(&TerminateSubscription, tea.String("true")),
}
resp, err := ecs.cli.DeleteInstances(deleteReq)
if err != nil {
return nil, errors.Wrap(err, "Ali Delete ECS error")
}
glog.Infof("--------------------阿里ECS实例释放成功--------------------")
glog.Infof(*util.ToJSONString(util.ToMap(resp)))
return &pbecs.DeleteEcsResp{
RequestId: *resp.Body.RequestId,
AccountName: req.AccountName,
RegionId: req.RegionId,
}, nil
}
func (ecs *AliEcs) UpdateEcs(ctx context.Context, req *pbecs.UpdateEcsReq) (*pbecs.UpdateEcsResp, error) {
Password := req.GetPassword()
HostName := req.GetHostName()
InstanceName := req.GetInstanceName()
Description := req.GetDescription()
InstanceId := req.GetInstanceIds()
UpdateReq := &aliecs.ModifyInstanceAttributeRequest{}
if req.GetInstanceIds() == "" {
return nil, errors.New("InstanceId is empty")
}
UpdateReq.InstanceId = &InstanceId
if Password != "" {
UpdateReq.Password = &Password
}
if HostName != "" {
UpdateReq.HostName = &HostName
}
if InstanceName != "" {
UpdateReq.InstanceName = &InstanceName
}
if Description != "" {
UpdateReq.Description = &Description
}
resp, err := ecs.cli.ModifyInstanceAttribute(UpdateReq)
if err != nil {
return nil, errors.Wrap(err, "Ali Update ECS error")
}
glog.Infof("--------------------阿里ECS实例修改成功--------------------")
glog.Infof(*util.ToJSONString(util.ToMap(resp)))
return &pbecs.UpdateEcsResp{
RequestId: *resp.Body.RequestId,
}, nil
}
func (ecs *AliEcs) ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (*pbecs.ListDetailResp, error) {
request := aliecs.CreateDescribeInstancesRequest()
request.PageNumber = requests.NewInteger(int(req.PageNumber))
request.PageSize = requests.NewInteger(int(req.PageSize))
request.NextToken = req.NextToken
request := &aliecs.DescribeInstancesRequest{}
request.PageNumber = &req.PageNumber
request.PageSize = &req.PageSize
request.NextToken = &req.NextToken
request.RegionId = ecs.cli.RegionId
resp, err := ecs.cli.DescribeInstances(request)
if err != nil {
return nil, errors.Wrap(err, "Aliyun ListDetail error")
return nil, errors.Wrap(err, "Ali ListDetail error")
}
var ecses = make([]*pbecs.EcsInstance, len(resp.Instances.Instance))
for k, v := range resp.Instances.Instance {
var ecses = make([]*pbecs.EcsInstance, len(resp.Body.Instances.Instance))
for k, v := range resp.Body.Instances.Instance {
publicIps := make([]string, 0)
for _, vv := range v.PublicIpAddress.IpAddress {
publicIps = append(publicIps, *vv)
}
InnerIps := make([]string, 0)
for _, vv := range v.VpcAttributes.PrivateIpAddress.IpAddress {
InnerIps = append(InnerIps, *vv)
}
ecses[k] = &pbecs.EcsInstance{
Provider: pbtenant.CloudProvider_ali,
AccountName: ecs.tenanter.AccountName(),
InstanceId: v.InstanceId,
InstanceName: v.InstanceName,
RegionName: ecs.region.GetName(),
PublicIps: v.PublicIpAddress.IpAddress,
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.InnerIpAddress.IpAddress,
VpcId: v.VpcAttributes.VpcId,
ResourceGroupId: v.ResourceGroupId,
ChargeType: v.InstanceChargeType,
Provider: pbtenant.CloudProvider_ali,
AccountName: ecs.tenanter.AccountName(),
InstanceId: *v.InstanceId,
InstanceName: *v.InstanceName,
RegionName: ecs.region.GetName(),
PublicIps: publicIps,
InstanceType: *v.InstanceType,
Cpu: *v.Cpu,
Memory: *v.Memory,
Description: *v.Description,
Status: *v.Status,
CreationTime: *v.CreationTime,
ExpireTime: *v.ExpiredTime,
InnerIps: InnerIps,
VpcId: *v.VpcAttributes.VpcId,
ResourceGroupId: *v.ResourceGroupId,
InstanceChargeType: *v.InstanceChargeType,
}
}
isFinished := false
if len(ecses) < int(req.PageSize) {
isFinished = true
@ -89,7 +230,7 @@ func (ecs *AliEcs) ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (*p
Finished: isFinished,
PageNumber: req.PageNumber + 1,
PageSize: req.PageSize,
NextToken: resp.NextToken,
RequestId: resp.RequestId,
NextToken: *resp.Body.NextToken,
RequestId: *resp.Body.RequestId,
}, nil
}

View File

@ -2,6 +2,7 @@ package ecser
import (
"context"
"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"
@ -16,7 +17,10 @@ var (
)
type Ecser interface {
ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (resp *pbecs.ListDetailResp, err error)
CreateEcs(ctx context.Context, req *pbecs.CreateEcsReq) (resp *pbecs.CreateEcsResp, err error) //创建ecs
DeleteEcs(ctx context.Context, req *pbecs.DeleteEcsReq) (resp *pbecs.DeleteEcsResp, err error) //批量删除ecs
UpdateEcs(ctx context.Context, req *pbecs.UpdateEcsReq) (resp *pbecs.UpdateEcsResp, err error) //修改ecs
ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (resp *pbecs.ListDetailResp, err error) //查询ecs详情
}
func NewEcsClient(provider pbtenant.CloudProvider, region tenanter.Region, tenant tenanter.Tenanter) (ecser Ecser, err error) {

View File

@ -2,10 +2,12 @@ package ecser
import (
"context"
"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"
"strconv"
string_ "github.com/alibabacloud-go/darabonba-string/client"
util "github.com/alibabacloud-go/tea-utils/service"
"github.com/alibabacloud-go/tea/tea"
"github.com/golang/glog"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
hwecs "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ecs/v2"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ecs/v2/model"
@ -14,6 +16,9 @@ import (
iammodel "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/iam/v3/model"
iamregion "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/iam/v3/region"
"github.com/pkg/errors"
"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"
)
type HuaweiEcs struct {
@ -58,6 +63,139 @@ func newHuaweiEcsClient(region tenanter.Region, tenant tenanter.Tenanter) (Ecser
}, nil
}
func (ecs *HuaweiEcs) CreateEcs(ctx context.Context, req *pbecs.CreateEcsReq) (*pbecs.CreateEcsResp, error) {
subnetIds := string_.Split(&req.SubnetId, tea.String(","), tea.Int(-1))
Nics := make([]model.PrePaidServerNic, 0)
for _, nic := range subnetIds {
Nics = append(Nics, model.PrePaidServerNic{
SubnetId: *nic,
})
}
Volumetype := &model.PrePaidServerRootVolume{}
switch req.SystemDisk.Category {
case "SATA":
Volumetype.Volumetype = model.GetPrePaidServerRootVolumeVolumetypeEnum().SATA
case "SAS":
Volumetype.Volumetype = model.GetPrePaidServerRootVolumeVolumetypeEnum().SAS
case "SSD":
Volumetype.Volumetype = model.GetPrePaidServerRootVolumeVolumetypeEnum().SSD
case "GPSSD":
Volumetype.Volumetype = model.GetPrePaidServerRootVolumeVolumetypeEnum().GPSSD
case "co-p1":
Volumetype.Volumetype = model.GetPrePaidServerRootVolumeVolumetypeEnum().CO_P1
case "uh-l1":
Volumetype.Volumetype = model.GetPrePaidServerRootVolumeVolumetypeEnum().UH_L1
case "ESSD":
Volumetype.Volumetype = model.GetPrePaidServerRootVolumeVolumetypeEnum().ESSD
}
PrePaidServerExtendParam := &model.PrePaidServerExtendParam{}
prePaid := model.GetPrePaidServerExtendParamChargingModeEnum().PRE_PAID
if req.InstanceChargeType == "PrePaid" {
PrePaidServerExtendParam.ChargingMode = &prePaid
}
request := &model.CreateServersRequest{
Body: &model.CreateServersRequestBody{
DryRun: util.EqualString(&req.DryRun, tea.String("true")),
Server: &model.PrePaidServer{
ImageRef: req.GetImageId(),
FlavorRef: req.InstanceType,
Name: req.InstanceName,
Vpcid: req.VpcId,
Nics: Nics,
RootVolume: Volumetype,
Count: &req.Amount,
Extendparam: PrePaidServerExtendParam,
},
}}
resp, err := ecs.cli.CreateServers(request)
if err != nil {
return nil, errors.Wrap(err, "Huawei create ecs error")
}
glog.Infof("--------------------华为ECS实例创建成功--------------------")
glog.Infof(resp.String())
isFinished := false
if len(*resp.ServerIds) > 0 {
isFinished = true
}
//订单ID。该参数只有创建包年包月ECS实例请求参数InstanceChargeType=PrePaid时有返回值。
OrderId := ""
if req.InstanceChargeType == "PrePaid" {
OrderId = *resp.OrderId
}
InstanceIds := make([]string, 0)
for _, v := range *resp.ServerIds {
InstanceIds = append(InstanceIds, v)
}
return &pbecs.CreateEcsResp{
OrderId: OrderId,
RequestId: "Huawei ECS RequestId: " + *resp.JobId,
InstanceIdSets: InstanceIds,
Finished: isFinished,
}, nil
}
func (ecs *HuaweiEcs) DeleteEcs(ctx context.Context, req *pbecs.DeleteEcsReq) (*pbecs.DeleteEcsResp, error) {
if req.GetInstanceIds() == "" {
return nil, errors.New("InstanceId is empty")
}
deleteReq := &model.DeleteServersRequest{}
InstanceIds := string_.Split(&req.InstanceIds, tea.String(","), tea.Int(-1))
Servers := make([]model.ServerId, 0)
for _, v := range InstanceIds {
Servers = append(Servers, model.ServerId{
Id: *v,
})
}
deleteReq.Body = &model.DeleteServersRequestBody{
DeletePublicip: util.EqualString(&req.DeletePublicip, tea.String("true")),
DeleteVolume: util.EqualString(&req.DeleteVolume, tea.String("true")),
Servers: Servers,
}
resp, err := ecs.cli.DeleteServers(deleteReq)
if err != nil {
return nil, errors.Wrap(err, "Huawei Delete ECS error")
}
glog.Infof("--------------------华为ECS实例删除成功--------------------")
glog.Infof(resp.String())
return &pbecs.DeleteEcsResp{
RequestId: *resp.JobId,
}, nil
}
func (ecs *HuaweiEcs) UpdateEcs(ctx context.Context, req *pbecs.UpdateEcsReq) (*pbecs.UpdateEcsResp, error) {
HostName := req.GetHostName()
InstanceName := req.GetInstanceName()
Description := req.GetDescription()
UpdateReq := &model.UpdateServerRequest{}
if req.GetInstanceIds() == "" {
return nil, errors.New("InstanceId is empty")
}
Server := &model.UpdateServerOption{}
UpdateReq.ServerId = req.GetInstanceIds()
if HostName != "" {
Server.Hostname = &HostName
}
if InstanceName != "" {
Server.Name = &InstanceName
}
if Description != "" {
Server.Description = &Description
}
UpdateReq.Body = &model.UpdateServerRequestBody{
Server: Server,
}
resp, err := ecs.cli.UpdateServer(UpdateReq)
if err != nil {
return nil, errors.Wrap(err, "Huawei Update ECS error")
}
glog.Infof("--------------------华为ECS实例修改成功--------------------")
glog.Infof(resp.String())
return &pbecs.UpdateEcsResp{
RequestId: resp.Server.Id,
}, nil
}
func (ecs *HuaweiEcs) ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (*pbecs.ListDetailResp, error) {
request := new(model.ListServersDetailsRequest)
offset := (req.PageNumber - 1) * req.PageSize
@ -73,20 +211,39 @@ func (ecs *HuaweiEcs) ListDetail(ctx context.Context, req *pbecs.ListDetailReq)
servers := *resp.Servers
var ecses = make([]*pbecs.EcsInstance, len(servers))
for k, v := range servers {
vCpu, err := strconv.ParseInt(v.Flavor.Vcpus, 10, 32)
vMemory, err := strconv.ParseInt(v.Flavor.Vcpus, 10, 32)
if err != nil {
return nil, errors.Wrap(err, "Huawei ListDetail error")
}
PublicIps := make([]string, 0)
InnerIps := make([]string, 0)
for s := range v.Addresses {
for _, a := range v.Addresses[s] {
// 判断是内网ip还是公网ip
if *a.OSEXTIPStype == model.GetServerAddressOSEXTIPStypeEnum().FIXED {
InnerIps = append(InnerIps, a.Addr)
} else {
PublicIps = append(PublicIps, a.Addr)
}
}
}
ecses[k] = &pbecs.EcsInstance{
Provider: pbtenant.CloudProvider_huawei,
AccountName: ecs.tenanter.AccountName(),
InstanceId: v.Id,
InstanceName: v.Name,
RegionName: ecs.region.GetName(),
InstanceType: v.Flavor.Name,
PublicIps: []string{v.AccessIPv4},
// Cpu: v.Flavor.Vcpus,
// Memory: v.Flavor.Ram,
Description: *v.Description,
Status: v.Status,
CreationTime: v.Created,
ExpireTime: v.OSSRVUSGterminatedAt,
Provider: pbtenant.CloudProvider_huawei,
AccountName: ecs.tenanter.AccountName(),
InstanceId: v.Id,
InstanceName: v.Name,
RegionName: ecs.region.GetName(),
InstanceType: v.Flavor.Name,
PublicIps: PublicIps,
InnerIps: InnerIps,
Cpu: int32(vCpu),
Memory: int32(vMemory),
Description: *v.Description,
Status: v.Status,
CreationTime: v.Created,
ExpireTime: v.OSSRVUSGterminatedAt,
InstanceChargeType: v.Metadata["charging_mode"],
}
}

View File

@ -2,15 +2,18 @@ package ecser
import (
"context"
"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"
string_ "github.com/alibabacloud-go/darabonba-string/client"
util "github.com/alibabacloud-go/tea-utils/service"
"github.com/alibabacloud-go/tea/tea"
"github.com/golang/glog"
"github.com/pkg/errors"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"
cvm "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312"
"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"
)
type TencentCvm struct {
@ -41,6 +44,90 @@ func newTencentCvmClient(region tenanter.Region, tenant tenanter.Tenanter) (Ecse
}, nil
}
func (ecs *TencentCvm) CreateEcs(ctx context.Context, req *pbecs.CreateEcsReq) (*pbecs.CreateEcsResp, error) {
ImageId := req.GetImageId()
InstanceType := req.GetInstanceType()
InstanceName := req.GetInstanceName()
Amount := int64(req.GetAmount())
DryRun := req.GetDryRun()
InstanceChargeType := req.GetInstanceChargeType()
ZoneId := req.GetZoneId()
request := cvm.NewRunInstancesRequest()
request.ImageId = &ImageId
request.InstanceType = &InstanceType
request.InstanceName = &InstanceName
request.DryRun = util.EqualString(&DryRun, tea.String("true"))
request.InstanceChargeType = &InstanceChargeType
request.InstanceCount = &Amount
request.Placement = &cvm.Placement{
Zone: &ZoneId,
}
resp, err := ecs.cli.RunInstances(request)
if err != nil {
return nil, errors.Wrap(err, "Tencent Create ECS error")
}
InstanceIds := make([]string, 0)
for _, v := range resp.Response.InstanceIdSet {
InstanceIds = append(InstanceIds, *v)
}
isFinished := false
if len(resp.Response.InstanceIdSet) > 0 {
isFinished = true
}
glog.Infof("--------------------腾讯ECS实例创建成功--------------------")
glog.Infof(*util.ToJSONString(util.ToMap(resp)))
return &pbecs.CreateEcsResp{
RequestId: "Tencent ECS RequestId: " + *resp.Response.RequestId,
InstanceIdSets: InstanceIds,
Finished: isFinished,
}, nil
}
func (ecs *TencentCvm) DeleteEcs(ctx context.Context, req *pbecs.DeleteEcsReq) (*pbecs.DeleteEcsResp, error) {
idStr := req.GetInstanceIds()
InstanceIds := string_.Split(&idStr, tea.String(","), tea.Int(-1))
//腾讯云支持批量操作每次请求批量实例的上限为100
if len(InstanceIds) > 100 {
return nil, errors.New("Tencent Delete ECS error InstanceIds > 100")
}
deleteReq := cvm.NewTerminateInstancesRequest()
deleteReq.InstanceIds = InstanceIds
resp, err := ecs.cli.TerminateInstances(deleteReq)
if err != nil {
return nil, errors.Wrap(err, "Tencent Delete ECS error")
}
glog.Infof("--------------------腾讯ECS实例释放成功--------------------")
glog.Infof(*util.ToJSONString(util.ToMap(resp)))
return &pbecs.DeleteEcsResp{
Provider: req.Provider,
RequestId: *resp.Response.RequestId,
AccountName: req.AccountName,
RegionId: req.RegionId,
}, nil
}
func (ecs *TencentCvm) UpdateEcs(ctx context.Context, req *pbecs.UpdateEcsReq) (*pbecs.UpdateEcsResp, error) {
InstanceName := req.GetInstanceName()
InstanceId := req.GetInstanceIds()
UpdateReq := cvm.NewModifyInstancesAttributeRequest()
if req.GetInstanceIds() == "" {
return nil, errors.New("InstanceId is empty")
}
UpdateReq.InstanceIds = string_.Split(&InstanceId, tea.String(","), tea.Int(-1))
if InstanceName != "" {
UpdateReq.InstanceName = &InstanceName
}
resp, err := ecs.cli.ModifyInstancesAttribute(UpdateReq)
if err != nil {
return nil, errors.Wrap(err, "Tencent Update ECS error")
}
glog.Infof("--------------------腾讯ECS实例修改成功--------------------")
glog.Infof(*util.ToJSONString(util.ToMap(resp)))
return &pbecs.UpdateEcsResp{
RequestId: *resp.Response.RequestId,
}, nil
}
func (ecs *TencentCvm) ListDetail(ctx context.Context, req *pbecs.ListDetailReq) (*pbecs.ListDetailResp, error) {
request := cvm.NewDescribeInstancesRequest()
request.Offset = common.Int64Ptr(int64((req.PageNumber - 1) * req.PageSize))
@ -52,24 +139,28 @@ func (ecs *TencentCvm) ListDetail(ctx context.Context, req *pbecs.ListDetailReq)
var ecses = make([]*pbecs.EcsInstance, len(resp.Response.InstanceSet))
for k, v := range resp.Response.InstanceSet {
ExpiredTime := ""
if v.ExpiredTime != nil {
ExpiredTime = *v.ExpiredTime
}
ecses[k] = &pbecs.EcsInstance{
Provider: pbtenant.CloudProvider_tencent,
AccountName: ecs.tenanter.AccountName(),
InstanceId: *v.InstanceId,
InstanceName: *v.InstanceName,
RegionName: ecs.region.GetName(),
PublicIps: make([]string, len(v.PublicIpAddresses)),
InstanceType: *v.InstanceType,
Cpu: int32(*v.CPU),
Memory: int32(*v.Memory),
Description: "",
Status: *v.InstanceState,
CreationTime: *v.CreatedTime,
ExpireTime: *v.ExpiredTime,
InnerIps: make([]string, len(v.PrivateIpAddresses)),
VpcId: *v.VirtualPrivateCloud.VpcId,
ResourceGroupId: "",
ChargeType: *v.InstanceChargeType,
Provider: pbtenant.CloudProvider_tencent,
AccountName: ecs.tenanter.AccountName(),
InstanceId: *v.InstanceId,
InstanceName: *v.InstanceName,
RegionName: ecs.region.GetName(),
PublicIps: make([]string, len(v.PublicIpAddresses)),
InstanceType: *v.InstanceType,
Cpu: int32(*v.CPU),
Memory: int32(*v.Memory),
Description: "",
Status: *v.InstanceState,
CreationTime: *v.CreatedTime,
ExpireTime: ExpiredTime,
InnerIps: make([]string, len(v.PrivateIpAddresses)),
VpcId: *v.VirtualPrivateCloud.VpcId,
ResourceGroupId: "",
InstanceChargeType: *v.InstanceChargeType,
}
for k1, v1 := range v.PublicIpAddresses {
ecses[k].PublicIps[k1] = *v1

View File

@ -11,6 +11,46 @@ import (
"google.golang.org/grpc/status"
)
// CreateMultipleEcs return create cloudy ecs
func (s *Server) CreateMultipleEcs(ctx context.Context, reqs *pbecs.CreateEcsMultipleReq) (*pbecs.CreateEcsMultipleResp, error) {
resp, err := ecs.CreateMultipleEcs(ctx, reqs)
if err != nil {
glog.Errorf("ListEcsDetail error %+v", err)
return nil, status.Errorf(codes.Internal, err.Error())
}
return resp, nil
}
// CreateEcs return create ecs
func (s *Server) CreateEcs(ctx context.Context, req *pbecs.CreateEcsReq) (*pbecs.CreateEcsResp, error) {
resp, err := ecs.CreateEcs(ctx, req)
if err != nil {
glog.Errorf("ListEcsDetail error %+v", err)
return nil, status.Errorf(codes.Internal, err.Error())
}
return resp, nil
}
// DeleteEcs return Delete ecs
func (s *Server) DeleteEcs(ctx context.Context, req *pbecs.DeleteEcsReq) (*pbecs.DeleteEcsResp, error) {
resp, err := ecs.DeleteEcs(ctx, req)
if err != nil {
glog.Errorf("ListEcsDetail error %+v", err)
return nil, status.Errorf(codes.Internal, err.Error())
}
return resp, nil
}
// UpdateEcs return Update ecs
func (s *Server) UpdateEcs(ctx context.Context, req *pbecs.UpdateEcsReq) (*pbecs.UpdateEcsResp, error) {
resp, err := ecs.UpdateEcs(ctx, req)
if err != nil {
glog.Errorf("ListEcsDetail error %+v", err)
return nil, status.Errorf(codes.Internal, err.Error())
}
return resp, nil
}
// ListEcsDetail return ecs detail
func (s *Server) ListEcsDetail(ctx context.Context, req *pbecs.ListDetailReq) (*pbecs.ListDetailResp, error) {
resp, err := ecs.ListDetail(ctx, req)

View File

@ -4,13 +4,17 @@ type AccessKeyTenant struct {
name string
id string
secret string
url string
token string
}
func NewTenantWithAccessKey(name, accessKeyId, accessKeySecret string) Tenanter {
func NewTenantWithAccessKey(name, accessKeyId, accessKeySecret, url, token string) Tenanter {
return &AccessKeyTenant{
name: name,
id: accessKeyId,
secret: accessKeySecret,
url: url,
token: token,
}
}
@ -23,6 +27,8 @@ func (tenant *AccessKeyTenant) Clone() Tenanter {
id: tenant.id,
secret: tenant.secret,
name: tenant.name,
url: tenant.url,
token: tenant.token,
}
}
@ -33,3 +39,11 @@ func (tenant *AccessKeyTenant) GetId() string {
func (tenant *AccessKeyTenant) GetSecret() string {
return tenant.secret
}
func (tenant *AccessKeyTenant) GetUrl() string {
return tenant.url
}
func (tenant *AccessKeyTenant) GetToken() string {
return tenant.token
}

View File

@ -78,15 +78,12 @@ func GetAllRegionIds(provider pbtenant.CloudProvider) (regions []Region) {
regions = append(regions, region)
}
}
case pbtenant.CloudProvider_aws:
for rId := range pbtenant.AwsRegionId_name {
if rId != int32(pbtenant.AwsRegionId_aws_all) {
region, _ := NewRegion(provider, rId)
regions = append(regions, region)
}
case pbtenant.CloudProvider_k8s:
for rId := range pbtenant.K8SRegionId_name {
region, _ := NewRegion(provider, rId)
regions = append(regions, region)
}
}
return
}

View File

@ -78,9 +78,9 @@ func load(configs *pbtenant.CloudConfigs) error {
defer gStore.Unlock()
for _, c := range configs.Configs {
if c.AccessId != "" && c.AccessSecret != "" {
gStore.stores[c.Provider] = append(gStore.stores[c.Provider], NewTenantWithAccessKey(c.Name, c.AccessId, c.AccessSecret))
}
//if c.AccessId != "" && c.AccessSecret != "" {
gStore.stores[c.Provider] = append(gStore.stores[c.Provider], NewTenantWithAccessKey(c.Name, c.AccessId, c.AccessSecret, c.Url, c.Token))
//}
}
return nil
}

14
go.mod
View File

@ -3,6 +3,11 @@ module gitlink.org.cn/JCCE/PCM
go 1.17
require (
github.com/alibabacloud-go/darabonba-openapi v0.1.4
github.com/alibabacloud-go/darabonba-string v1.0.0
github.com/alibabacloud-go/ecs-20140526/v2 v2.1.0
github.com/alibabacloud-go/tea v1.1.15
github.com/alibabacloud-go/tea-utils v1.3.9
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
@ -21,18 +26,22 @@ require (
)
require (
github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 // indirect
github.com/alibabacloud-go/endpoint-util v1.1.0 // indirect
github.com/alibabacloud-go/openapi-util v0.0.7 // indirect
github.com/aliyun/credentials-go v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // 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/imdario/mergo v0.3.5 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // 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/spf13/pflag v1.0.1 // indirect
github.com/tjfoc/gmsm v1.3.2 // indirect
golang.org/x/crypto v0.0.0-20210920023735-84f357641f63 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a // indirect
@ -41,7 +50,6 @@ 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

View File

@ -6,6 +6,7 @@ option go_package = "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbecs";
import "idl/pbtenant/tenant.proto";
import "google/api/annotations.proto";
//ECS
message EcsInstance {
//
pbtenant.CloudProvider provider = 1;
@ -40,9 +41,180 @@ message EcsInstance {
// id
string resource_group_id = 16;
//
string charge_type = 17;
string instance_charge_type = 17;
}
//
enum InternetChargeType {
//
PayByBandwidth = 0;
//使
PayByTraffic = 1;
}
//ECS入参
message CreateEcsMultipleReq {
repeated CreateEcsReq createEcsReqs = 1;
}
//ECS返回值
message CreateEcsMultipleResp {
// ID
repeated string request_id = 1;
// -false
bool finished = 2;
}
//ECS入参
message CreateEcsReq {
//
pbtenant.CloudProvider provider = 1;
//
string account_name = 2;
//
int32 region_id = 3;
//id
string image_id = 4;
//
string instance_charge_type = 5;
//
string instance_type = 6;
// id
string security_group_id = 7;
//id
string v_switch_id = 8;
//
string instance_name = 9;
//
string description = 10;
//id
string zone_id = 11;
//
SystemDisk system_disk = 12;
//ECS的数量
int32 amount = 13;
//,true时请求通过 Request validation has been passed with DryRun flag set
string dry_run = 14;
//N的云盘种类cloud_efficiencycloud_ssdSSD云盘cloud_essdESSD云盘cloud
string category = 15;
//PayByBandwidthPayByTraffic使
InternetChargeType internet_charge_type = 16;
//Mbit/sInternetMaxBandwidthOut的值大于0IP
int32 internet_max_bandwidth_out = 17;
// vpc id
string vpc_id = 18;
//vpcid对应VPC下已创建的子网subnetIDUUID格式
string subnet_id =19;
}
//
message SystemDisk {
//GiB20~500max{20, ImageSize}max{40, ImageId对应的镜像大小}
string size = 1;
//cloud_efficiencycloud_ssdSSD云盘cloud_essdESSD云盘cloud
string category = 2;
//
string disk_name = 3;
//
string description = 4;
//ESSD云盘作为系统盘使用时PL0IOPS 1PL1IOPS 5PL2IOPS 10PL3IOPS 100
string performance_level = 5;
//ID
string auto_snapshot_policy_id = 6;
}
//ECS返回值
message CreateEcsResp {
//
pbtenant.CloudProvider provider = 1;
// config.yaml中的配置
string account_name = 2;
// Id tenant.proto
int32 region_id = 3;
// ID
string request_id = 4;
// id
string order_id = 5;
//
float trade_price = 6;
//IDInstanceIdSet
repeated string instance_id_sets = 7;
// -false
bool finished = 8;
}
//ECS入参
message DeleteEcsReq {
//
pbtenant.CloudProvider provider = 1;
//
string account_name = 2;
//
int32 region_id = 3;
//trueAccessKey是否有效RAM用户的授权情况和是否填写了必需参数DRYRUN.SUCCESS
//false2XX HTTP状态码并直接查询资源状况
string dry_run = 4;
//Force是否强制释放****trueRunning
//falseStopped
string force = 5;
// true,false
string terminate_subscription = 6;
//ID数组以,i-8vb2nlubkow0fxbq2218,i-8vb2nlubkow0fxbq2216
string instance_ids = 7;
//IPIP资源
//true或falsefalse
string delete_publicip = 8;
//false
//true或falsefalse
string delete_volume = 9;
}
//ECS返回值
message DeleteEcsResp {
//
pbtenant.CloudProvider provider = 1;
// config.yaml中的配置
string account_name = 2;
// Id tenant.proto
int32 region_id = 3;
// ID
string request_id = 4;
}
//ECS入参
message UpdateEcsReq {
//
pbtenant.CloudProvider provider = 1;
//
string account_name = 2;
//
int32 region_id = 3;
//id
string instance_ids = 4;
// StartingECS控制台重启或者调用API RebootInstance重启
string password = 5;
//
string host_name = 6;
//
string instance_name = 7;
//
string description = 8;
//ID不能重复,
string security_group_ids = 9;
}
//ECS返回值
message UpdateEcsResp {
//
pbtenant.CloudProvider provider = 1;
// config.yaml中的配置
string account_name = 2;
// Id tenant.proto
int32 region_id = 3;
// ID
string request_id = 4;
}
//ECS入参
message ListDetailReq {
//
pbtenant.CloudProvider provider = 1;
@ -58,6 +230,7 @@ message ListDetailReq {
string next_token = 6;
}
//ECS返回值
message ListDetailResp {
// Ecs
repeated EcsInstance ecses = 1;
@ -93,27 +266,56 @@ message ListAllReq{}
// - EC2
service EcsService {
// ECS
rpc CreateMultipleEcs(CreateEcsMultipleReq) returns (CreateEcsMultipleResp) {
option (google.api.http) = {
post : "/apis/ecs/createMultiple"
body : "*"
};
}
// ECS
rpc CreateEcs(CreateEcsReq) returns (CreateEcsResp) {
option (google.api.http) = {
post : "/apis/ecs/create"
body : "*"
};
}
// ECS
rpc DeleteEcs(DeleteEcsReq) returns (DeleteEcsResp) {
option (google.api.http) = {
post : "/apis/ecs/delete"
body : "*"
};
}
// ECS
rpc UpdateEcs(UpdateEcsReq) returns (UpdateEcsResp) {
option (google.api.http) = {
put : "/apis/ecs/update"
body : "*"
};
}
// ECS明细 -
rpc ListEcsDetail(ListDetailReq) returns (ListDetailResp) {
option (google.api.http) = {
post : "/apis/ecs/detail"
body : "*"
get : "/apis/ecs/detail"
};
}
// ECS全量 -
rpc ListEcs(ListReq) returns (ListResp) {
option (google.api.http) = {
post : "/apis/ecs"
body : "*"
get : "/apis/ecs"
};
}
// ECS
rpc ListEcsAll(ListAllReq) returns (ListResp) {
option (google.api.http) = {
post : "/apis/ecs/all"
body : "*"
get : "/apis/ecs/all"
};
}
}

View File

@ -189,6 +189,8 @@ message ListPodDetailResp {
message ListPodReq {
//
pbtenant.CloudProvider provider = 1;
//
string namespace =2;
}
message ListPodResp {

View File

@ -10,12 +10,14 @@ import "protoc-gen-openapiv2/options/annotations.proto";
enum CloudProvider {
// 0 -
ali = 0;
// 1 - EK目前转内测,
// 1 -
tencent = 1;
// 2 -
huawei = 2;
// 3 -
aws = 3;
// 3 - K8S
k8s = 3;
// 3 - Harvester
harvester = 4;
}
//
@ -49,6 +51,10 @@ message CloudConfig {
string access_id = 3;
// 1 access_id 使
string access_secret = 4;
// URL
string url = 5;
// URL
string token = 6;
}
// _ -
@ -81,25 +87,27 @@ enum AliRegionId {
// _ -
enum TencentRegionId {
tc_all = 0;
tc_ap_bangkok = 1; //
tc_ap_beijing = 2; //
tc_ap_chengdu = 3; //
tc_ap_chongqing = 4; //
tc_ap_guangzhou = 5; // 广
tc_ap_guangzhou_open = 6; // 广Open
tc_ap_hongkong = 7; //
tc_ap_mumbai = 8; //
tc_ap_seoul = 9; //
tc_ap_shanghai = 10; //
tc_ap_shanghai_fsi = 11; //
tc_ap_shenzhen_fsi = 12; //
tc_ap_singapore = 13; //
tc_ap_tokyo = 14; //
tc_eu_frankfurt = 15; //
tc_eu_moscow = 16; //
tc_na_ashburn = 17; //
tc_na_siliconvalley = 18; //
tc_na_toronto = 19; //
tc_ap_bangkok =1; //()
tc_ap_beijing =2; //()
tc_ap_chengdu =3; //西()
tc_ap_chongqing =4; //西()
tc_ap_guangzhou =5; //(广)
tc_ap_hongkong =6; //()
tc_ap_jakarta =7; //
tc_ap_mumbai=8; // ()
tc_ap_nanjing =9; //()
tc_ap_seoul =10; //()
tc_ap_shanghai =11; //()
tc_ap_shanghai_fsi=12; //()
tc_ap_shenzhen_fsi =13; //()
tc_ap_singapore =14; //()
tc_ap_tokyo =15; //()
tc_eu_frankfurt=16; //()
tc_eu_moscow =17; //()
tc_na_ashburn =18; //()
tc_na_siliconvalley=19; //西()
tc_na_toronto =20; //()
tc_sa_saopaulo =21; //
}
// _ -
@ -118,6 +126,13 @@ enum HuaweiRegionId {
hw_cn_south_2 = 11; // -
}
//
enum K8SRegionId {
k8s_all = 0;
}
// _ -
enum AwsRegionId {
aws_all = 0;

File diff suppressed because it is too large Load Diff

View File

@ -31,8 +31,8 @@ var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = metadata.Join
func request_EcsService_ListEcsDetail_0(ctx context.Context, marshaler runtime.Marshaler, client EcsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListDetailReq
func request_EcsService_CreateMultipleEcs_0(ctx context.Context, marshaler runtime.Marshaler, client EcsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateEcsMultipleReq
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
@ -43,6 +43,145 @@ func request_EcsService_ListEcsDetail_0(ctx context.Context, marshaler runtime.M
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.CreateMultipleEcs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_EcsService_CreateMultipleEcs_0(ctx context.Context, marshaler runtime.Marshaler, server EcsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateEcsMultipleReq
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.CreateMultipleEcs(ctx, &protoReq)
return msg, metadata, err
}
func request_EcsService_CreateEcs_0(ctx context.Context, marshaler runtime.Marshaler, client EcsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateEcsReq
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.CreateEcs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_EcsService_CreateEcs_0(ctx context.Context, marshaler runtime.Marshaler, server EcsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateEcsReq
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.CreateEcs(ctx, &protoReq)
return msg, metadata, err
}
func request_EcsService_DeleteEcs_0(ctx context.Context, marshaler runtime.Marshaler, client EcsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq DeleteEcsReq
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.DeleteEcs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_EcsService_DeleteEcs_0(ctx context.Context, marshaler runtime.Marshaler, server EcsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq DeleteEcsReq
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.DeleteEcs(ctx, &protoReq)
return msg, metadata, err
}
func request_EcsService_UpdateEcs_0(ctx context.Context, marshaler runtime.Marshaler, client EcsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq UpdateEcsReq
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.UpdateEcs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_EcsService_UpdateEcs_0(ctx context.Context, marshaler runtime.Marshaler, server EcsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq UpdateEcsReq
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.UpdateEcs(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_EcsService_ListEcsDetail_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_EcsService_ListEcsDetail_0(ctx context.Context, marshaler runtime.Marshaler, client EcsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListDetailReq
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_EcsService_ListEcsDetail_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListEcsDetail(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
@ -52,11 +191,10 @@ func local_request_EcsService_ListEcsDetail_0(ctx context.Context, marshaler run
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 := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_EcsService_ListEcsDetail_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
@ -65,15 +203,18 @@ func local_request_EcsService_ListEcsDetail_0(ctx context.Context, marshaler run
}
var (
filter_EcsService_ListEcs_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_EcsService_ListEcs_0(ctx context.Context, marshaler runtime.Marshaler, client EcsServiceClient, 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 := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_EcsService_ListEcs_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
@ -86,11 +227,10 @@ func local_request_EcsService_ListEcs_0(ctx context.Context, marshaler runtime.M
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 := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_EcsService_ListEcs_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
@ -103,14 +243,6 @@ func request_EcsService_ListEcsAll_0(ctx context.Context, marshaler runtime.Mars
var protoReq ListAllReq
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.ListEcsAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
@ -120,14 +252,6 @@ func local_request_EcsService_ListEcsAll_0(ctx context.Context, marshaler runtim
var protoReq ListAllReq
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.ListEcsAll(ctx, &protoReq)
return msg, metadata, err
@ -139,7 +263,99 @@ func local_request_EcsService_ListEcsAll_0(ctx context.Context, marshaler runtim
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterEcsServiceHandlerFromEndpoint instead.
func RegisterEcsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EcsServiceServer) error {
mux.Handle("POST", pattern_EcsService_ListEcsDetail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("POST", pattern_EcsService_CreateMultipleEcs_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, "/pbecs.EcsService/CreateMultipleEcs")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_EcsService_CreateMultipleEcs_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_EcsService_CreateMultipleEcs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_EcsService_CreateEcs_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, "/pbecs.EcsService/CreateEcs")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_EcsService_CreateEcs_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_EcsService_CreateEcs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_EcsService_DeleteEcs_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, "/pbecs.EcsService/DeleteEcs")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_EcsService_DeleteEcs_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_EcsService_DeleteEcs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("PUT", pattern_EcsService_UpdateEcs_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, "/pbecs.EcsService/UpdateEcs")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_EcsService_UpdateEcs_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_EcsService_UpdateEcs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_EcsService_ListEcsDetail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
@ -163,7 +379,7 @@ func RegisterEcsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux,
})
mux.Handle("POST", pattern_EcsService_ListEcs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("GET", pattern_EcsService_ListEcs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
@ -187,7 +403,7 @@ func RegisterEcsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux,
})
mux.Handle("POST", pattern_EcsService_ListEcsAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("GET", pattern_EcsService_ListEcsAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
@ -252,7 +468,87 @@ func RegisterEcsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn
// "EcsServiceClient" to call the correct interceptors.
func RegisterEcsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EcsServiceClient) error {
mux.Handle("POST", pattern_EcsService_ListEcsDetail_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("POST", pattern_EcsService_CreateMultipleEcs_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, "/pbecs.EcsService/CreateMultipleEcs")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_EcsService_CreateMultipleEcs_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_EcsService_CreateMultipleEcs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_EcsService_CreateEcs_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, "/pbecs.EcsService/CreateEcs")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_EcsService_CreateEcs_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_EcsService_CreateEcs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_EcsService_DeleteEcs_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, "/pbecs.EcsService/DeleteEcs")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_EcsService_DeleteEcs_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_EcsService_DeleteEcs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("PUT", pattern_EcsService_UpdateEcs_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, "/pbecs.EcsService/UpdateEcs")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_EcsService_UpdateEcs_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_EcsService_UpdateEcs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_EcsService_ListEcsDetail_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)
@ -273,7 +569,7 @@ func RegisterEcsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux,
})
mux.Handle("POST", pattern_EcsService_ListEcs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("GET", pattern_EcsService_ListEcs_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)
@ -294,7 +590,7 @@ func RegisterEcsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux,
})
mux.Handle("POST", pattern_EcsService_ListEcsAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("GET", pattern_EcsService_ListEcsAll_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)
@ -319,6 +615,14 @@ func RegisterEcsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux,
}
var (
pattern_EcsService_CreateMultipleEcs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "ecs", "createMultiple"}, ""))
pattern_EcsService_CreateEcs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "ecs", "create"}, ""))
pattern_EcsService_DeleteEcs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "ecs", "delete"}, ""))
pattern_EcsService_UpdateEcs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "ecs", "update"}, ""))
pattern_EcsService_ListEcsDetail_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "ecs", "detail"}, ""))
pattern_EcsService_ListEcs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"apis", "ecs"}, ""))
@ -327,6 +631,14 @@ var (
)
var (
forward_EcsService_CreateMultipleEcs_0 = runtime.ForwardResponseMessage
forward_EcsService_CreateEcs_0 = runtime.ForwardResponseMessage
forward_EcsService_DeleteEcs_0 = runtime.ForwardResponseMessage
forward_EcsService_UpdateEcs_0 = runtime.ForwardResponseMessage
forward_EcsService_ListEcsDetail_0 = runtime.ForwardResponseMessage
forward_EcsService_ListEcs_0 = runtime.ForwardResponseMessage

View File

@ -22,6 +22,14 @@ const _ = grpc.SupportPackageIsVersion7
//
// 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 EcsServiceClient interface {
// 创建多家云ECS
CreateMultipleEcs(ctx context.Context, in *CreateEcsMultipleReq, opts ...grpc.CallOption) (*CreateEcsMultipleResp, error)
// 创建ECS
CreateEcs(ctx context.Context, in *CreateEcsReq, opts ...grpc.CallOption) (*CreateEcsResp, error)
// 删除ECS
DeleteEcs(ctx context.Context, in *DeleteEcsReq, opts ...grpc.CallOption) (*DeleteEcsResp, error)
// 修改ECS
UpdateEcs(ctx context.Context, in *UpdateEcsReq, opts ...grpc.CallOption) (*UpdateEcsResp, error)
// 查询ECS明细 - 支持云类型、区域、账户、分页等过滤条件
ListEcsDetail(ctx context.Context, in *ListDetailReq, opts ...grpc.CallOption) (*ListDetailResp, error)
// 查询ECS全量 - 根据云类型
@ -38,6 +46,42 @@ func NewEcsServiceClient(cc grpc.ClientConnInterface) EcsServiceClient {
return &ecsServiceClient{cc}
}
func (c *ecsServiceClient) CreateMultipleEcs(ctx context.Context, in *CreateEcsMultipleReq, opts ...grpc.CallOption) (*CreateEcsMultipleResp, error) {
out := new(CreateEcsMultipleResp)
err := c.cc.Invoke(ctx, "/pbecs.EcsService/CreateMultipleEcs", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *ecsServiceClient) CreateEcs(ctx context.Context, in *CreateEcsReq, opts ...grpc.CallOption) (*CreateEcsResp, error) {
out := new(CreateEcsResp)
err := c.cc.Invoke(ctx, "/pbecs.EcsService/CreateEcs", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *ecsServiceClient) DeleteEcs(ctx context.Context, in *DeleteEcsReq, opts ...grpc.CallOption) (*DeleteEcsResp, error) {
out := new(DeleteEcsResp)
err := c.cc.Invoke(ctx, "/pbecs.EcsService/DeleteEcs", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *ecsServiceClient) UpdateEcs(ctx context.Context, in *UpdateEcsReq, opts ...grpc.CallOption) (*UpdateEcsResp, error) {
out := new(UpdateEcsResp)
err := c.cc.Invoke(ctx, "/pbecs.EcsService/UpdateEcs", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *ecsServiceClient) ListEcsDetail(ctx context.Context, in *ListDetailReq, opts ...grpc.CallOption) (*ListDetailResp, error) {
out := new(ListDetailResp)
err := c.cc.Invoke(ctx, "/pbecs.EcsService/ListEcsDetail", in, out, opts...)
@ -69,6 +113,14 @@ func (c *ecsServiceClient) ListEcsAll(ctx context.Context, in *ListAllReq, opts
// All implementations must embed UnimplementedEcsServiceServer
// for forward compatibility
type EcsServiceServer interface {
// 创建多家云ECS
CreateMultipleEcs(context.Context, *CreateEcsMultipleReq) (*CreateEcsMultipleResp, error)
// 创建ECS
CreateEcs(context.Context, *CreateEcsReq) (*CreateEcsResp, error)
// 删除ECS
DeleteEcs(context.Context, *DeleteEcsReq) (*DeleteEcsResp, error)
// 修改ECS
UpdateEcs(context.Context, *UpdateEcsReq) (*UpdateEcsResp, error)
// 查询ECS明细 - 支持云类型、区域、账户、分页等过滤条件
ListEcsDetail(context.Context, *ListDetailReq) (*ListDetailResp, error)
// 查询ECS全量 - 根据云类型
@ -82,6 +134,18 @@ type EcsServiceServer interface {
type UnimplementedEcsServiceServer struct {
}
func (UnimplementedEcsServiceServer) CreateMultipleEcs(context.Context, *CreateEcsMultipleReq) (*CreateEcsMultipleResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateMultipleEcs not implemented")
}
func (UnimplementedEcsServiceServer) CreateEcs(context.Context, *CreateEcsReq) (*CreateEcsResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateEcs not implemented")
}
func (UnimplementedEcsServiceServer) DeleteEcs(context.Context, *DeleteEcsReq) (*DeleteEcsResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteEcs not implemented")
}
func (UnimplementedEcsServiceServer) UpdateEcs(context.Context, *UpdateEcsReq) (*UpdateEcsResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateEcs not implemented")
}
func (UnimplementedEcsServiceServer) ListEcsDetail(context.Context, *ListDetailReq) (*ListDetailResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListEcsDetail not implemented")
}
@ -104,6 +168,78 @@ func RegisterEcsServiceServer(s grpc.ServiceRegistrar, srv EcsServiceServer) {
s.RegisterService(&EcsService_ServiceDesc, srv)
}
func _EcsService_CreateMultipleEcs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateEcsMultipleReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EcsServiceServer).CreateMultipleEcs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pbecs.EcsService/CreateMultipleEcs",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EcsServiceServer).CreateMultipleEcs(ctx, req.(*CreateEcsMultipleReq))
}
return interceptor(ctx, in, info, handler)
}
func _EcsService_CreateEcs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateEcsReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EcsServiceServer).CreateEcs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pbecs.EcsService/CreateEcs",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EcsServiceServer).CreateEcs(ctx, req.(*CreateEcsReq))
}
return interceptor(ctx, in, info, handler)
}
func _EcsService_DeleteEcs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteEcsReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EcsServiceServer).DeleteEcs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pbecs.EcsService/DeleteEcs",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EcsServiceServer).DeleteEcs(ctx, req.(*DeleteEcsReq))
}
return interceptor(ctx, in, info, handler)
}
func _EcsService_UpdateEcs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateEcsReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EcsServiceServer).UpdateEcs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pbecs.EcsService/UpdateEcs",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EcsServiceServer).UpdateEcs(ctx, req.(*UpdateEcsReq))
}
return interceptor(ctx, in, info, handler)
}
func _EcsService_ListEcsDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListDetailReq)
if err := dec(in); err != nil {
@ -165,6 +301,22 @@ var EcsService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "pbecs.EcsService",
HandlerType: (*EcsServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateMultipleEcs",
Handler: _EcsService_CreateMultipleEcs_Handler,
},
{
MethodName: "CreateEcs",
Handler: _EcsService_CreateEcs_Handler,
},
{
MethodName: "DeleteEcs",
Handler: _EcsService_DeleteEcs_Handler,
},
{
MethodName: "UpdateEcs",
Handler: _EcsService_UpdateEcs_Handler,
},
{
MethodName: "ListEcsDetail",
Handler: _EcsService_ListEcsDetail_Handler,

View File

@ -1115,6 +1115,8 @@ type ListPodReq struct {
// 云名称
Provider pbtenant.CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=pbtenant.CloudProvider" json:"provider,omitempty"`
//
Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
}
func (x *ListPodReq) Reset() {
@ -1156,6 +1158,13 @@ func (x *ListPodReq) GetProvider() pbtenant.CloudProvider {
return pbtenant.CloudProvider(0)
}
func (x *ListPodReq) GetNamespace() string {
if x != nil {
return x.Namespace
}
return ""
}
type ListPodResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -1413,56 +1422,58 @@ var file_idl_pbpod_pod_proto_rawDesc = []byte{
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,
0x22, 0x5f, 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, 0xda, 0x04, 0x0a, 0x0a,
0x50, 0x6f, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5b, 0x0a, 0x0a, 0x43, 0x72,
0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x73, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64,
0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x15,
0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64,
0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x22, 0x15, 0x2f,
0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d,
0x75, 0x6c, 0x74, 0x69, 0x3a, 0x01, 0x2a, 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, 0x53, 0x0a, 0x09,
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x70, 0x6f,
0x64, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x14,
0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x44, 0x65, 0x6c, 0x65, 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, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x3a, 0x01,
0x2a, 0x12, 0x53, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x12, 0x13,
0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64,
0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x50, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02,
0x15, 0x1a, 0x10, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x75, 0x70, 0x64,
0x61, 0x74, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x5c, 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, 0x18, 0x82, 0xd3, 0xe4, 0x93,
0x02, 0x12, 0x12, 0x10, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x64, 0x65,
0x74, 0x61, 0x69, 0x6c, 0x12, 0x43, 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, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09,
0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x12, 0x4d, 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, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x73,
0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x61, 0x6c, 0x6c, 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,
0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63,
0x65, 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, 0xda, 0x04, 0x0a, 0x0a, 0x50, 0x6f,
0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5b, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61,
0x74, 0x65, 0x50, 0x6f, 0x64, 0x73, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x43,
0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70,
0x62, 0x70, 0x6f, 0x64, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x73, 0x52,
0x65, 0x73, 0x70, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x22, 0x15, 0x2f, 0x61, 0x70,
0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x75, 0x6c,
0x74, 0x69, 0x3a, 0x01, 0x2a, 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, 0x53, 0x0a, 0x09, 0x44, 0x65,
0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x12, 0x13, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e,
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70,
0x62, 0x70, 0x6f, 0x64, 0x2e, 0x44, 0x65, 0x6c, 0x65, 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, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x3a, 0x01, 0x2a, 0x12,
0x53, 0x0a, 0x09, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x12, 0x13, 0x2e, 0x70,
0x62, 0x70, 0x6f, 0x64, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x52, 0x65,
0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x70, 0x6f, 0x64, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x50, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x1a,
0x10, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74,
0x65, 0x3a, 0x01, 0x2a, 0x12, 0x5c, 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, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12,
0x12, 0x10, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x2f, 0x64, 0x65, 0x74, 0x61,
0x69, 0x6c, 0x12, 0x43, 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, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x61,
0x70, 0x69, 0x73, 0x2f, 0x70, 0x6f, 0x64, 0x12, 0x4d, 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,
0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x70,
0x6f, 0x64, 0x2f, 0x61, 0x6c, 0x6c, 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 (

View File

@ -269,13 +269,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/CreatePods", runtime.WithHTTPPathPattern("/apis/pod/createMulti"))
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pbpod.PodService/CreatePods")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_PodService_CreatePods_0(ctx, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_PodService_CreatePods_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 {
@ -293,13 +292,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 {
@ -317,13 +315,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/DeletePod", runtime.WithHTTPPathPattern("/apis/pod/delete"))
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pbpod.PodService/DeletePod")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_PodService_DeletePod_0(ctx, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_PodService_DeletePod_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 {
@ -341,13 +338,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/UpdatePod", runtime.WithHTTPPathPattern("/apis/pod/update"))
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/pbpod.PodService/UpdatePod")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_PodService_UpdatePod_0(ctx, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_PodService_UpdatePod_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 {
@ -365,13 +361,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 {
@ -389,13 +384,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 {
@ -413,13 +407,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 {
@ -476,13 +469,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/CreatePods", runtime.WithHTTPPathPattern("/apis/pod/createMulti"))
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/pbpod.PodService/CreatePods")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_PodService_CreatePods_0(ctx, inboundMarshaler, client, req, pathParams)
resp, md, err := request_PodService_CreatePods_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
@ -497,13 +489,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)
@ -518,13 +509,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/DeletePod", runtime.WithHTTPPathPattern("/apis/pod/delete"))
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/pbpod.PodService/DeletePod")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_PodService_DeletePod_0(ctx, inboundMarshaler, client, req, pathParams)
resp, md, err := request_PodService_DeletePod_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
@ -539,13 +529,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/UpdatePod", runtime.WithHTTPPathPattern("/apis/pod/update"))
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/pbpod.PodService/UpdatePod")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_PodService_UpdatePod_0(ctx, inboundMarshaler, client, req, pathParams)
resp, md, err := request_PodService_UpdatePod_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
@ -560,13 +549,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)
@ -581,13 +569,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)
@ -602,13 +589,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)

View File

@ -28,12 +28,14 @@ type CloudProvider int32
const (
// 0 - 阿里云
CloudProvider_ali CloudProvider = 0
// 1 - 腾讯云 腾讯EK目前转内测,接口无法调用,暂时搁置
// 1 - 腾讯云
CloudProvider_tencent CloudProvider = 1
// 2 - 华为云
CloudProvider_huawei CloudProvider = 2
// 3 - 亚马逊云
CloudProvider_aws CloudProvider = 3
// 3 - K8S
CloudProvider_k8s CloudProvider = 3
// 3 - Harvester
CloudProvider_harvester CloudProvider = 4
)
// Enum value maps for CloudProvider.
@ -42,13 +44,15 @@ var (
0: "ali",
1: "tencent",
2: "huawei",
3: "aws",
3: "k8s",
4: "harvester",
}
CloudProvider_value = map[string]int32{
"ali": 0,
"tencent": 1,
"huawei": 2,
"aws": 3,
"ali": 0,
"tencent": 1,
"huawei": 2,
"k8s": 3,
"harvester": 4,
}
)
@ -258,26 +262,28 @@ func (AliRegionId) EnumDescriptor() ([]byte, []int) {
type TencentRegionId int32
const (
TencentRegionId_tc_all TencentRegionId = 0
TencentRegionId_tc_ap_bangkok TencentRegionId = 1 // 曼谷
TencentRegionId_tc_ap_beijing TencentRegionId = 2 // 北京
TencentRegionId_tc_ap_chengdu TencentRegionId = 3 // 成都
TencentRegionId_tc_ap_chongqing TencentRegionId = 4 // 重庆
TencentRegionId_tc_ap_guangzhou TencentRegionId = 5 // 广州
TencentRegionId_tc_ap_guangzhou_open TencentRegionId = 6 // 广州Open
TencentRegionId_tc_ap_hongkong TencentRegionId = 7 // 中国香港
TencentRegionId_tc_ap_mumbai TencentRegionId = 8 // 孟买
TencentRegionId_tc_ap_seoul TencentRegionId = 9 // 首尔
TencentRegionId_tc_ap_shanghai TencentRegionId = 10 // 上海
TencentRegionId_tc_ap_shanghai_fsi TencentRegionId = 11 // 上海金融
TencentRegionId_tc_ap_shenzhen_fsi TencentRegionId = 12 // 深圳金融
TencentRegionId_tc_ap_singapore TencentRegionId = 13 // 新加坡
TencentRegionId_tc_ap_tokyo TencentRegionId = 14 // 东京
TencentRegionId_tc_eu_frankfurt TencentRegionId = 15 // 法兰克福
TencentRegionId_tc_eu_moscow TencentRegionId = 16 // 莫斯科
TencentRegionId_tc_na_ashburn TencentRegionId = 17 // 阿什本
TencentRegionId_tc_na_siliconvalley TencentRegionId = 18 // 硅谷
TencentRegionId_tc_na_toronto TencentRegionId = 19 // 多伦多
TencentRegionId_tc_all TencentRegionId = 0
TencentRegionId_tc_ap_bangkok TencentRegionId = 1 //亚太东南(曼谷)
TencentRegionId_tc_ap_beijing TencentRegionId = 2 //华北地区(北京)
TencentRegionId_tc_ap_chengdu TencentRegionId = 3 //西南地区(成都)
TencentRegionId_tc_ap_chongqing TencentRegionId = 4 //西南地区(重庆)
TencentRegionId_tc_ap_guangzhou TencentRegionId = 5 //华南地区(广州)
TencentRegionId_tc_ap_hongkong TencentRegionId = 6 //港澳台地区(中国香港)
TencentRegionId_tc_ap_jakarta TencentRegionId = 7 //亚太东南(雅加达)
TencentRegionId_tc_ap_mumbai TencentRegionId = 8 // 亚太南部(孟买)
TencentRegionId_tc_ap_nanjing TencentRegionId = 9 //华东地区(南京)
TencentRegionId_tc_ap_seoul TencentRegionId = 10 //亚太东北(首尔)
TencentRegionId_tc_ap_shanghai TencentRegionId = 11 //华东地区(上海)
TencentRegionId_tc_ap_shanghai_fsi TencentRegionId = 12 //华东地区(上海金融)
TencentRegionId_tc_ap_shenzhen_fsi TencentRegionId = 13 //华南地区(深圳金融)
TencentRegionId_tc_ap_singapore TencentRegionId = 14 //亚太东南(新加坡)
TencentRegionId_tc_ap_tokyo TencentRegionId = 15 //亚太东北(东京)
TencentRegionId_tc_eu_frankfurt TencentRegionId = 16 //欧洲地区(法兰克福)
TencentRegionId_tc_eu_moscow TencentRegionId = 17 //欧洲地区(莫斯科)
TencentRegionId_tc_na_ashburn TencentRegionId = 18 //美国东部(弗吉尼亚)
TencentRegionId_tc_na_siliconvalley TencentRegionId = 19 //美国西部(硅谷)
TencentRegionId_tc_na_toronto TencentRegionId = 20 //北美地区(多伦多)
TencentRegionId_tc_sa_saopaulo TencentRegionId = 21 //南美地区(圣保罗)
)
// Enum value maps for TencentRegionId.
@ -289,42 +295,46 @@ var (
3: "tc_ap_chengdu",
4: "tc_ap_chongqing",
5: "tc_ap_guangzhou",
6: "tc_ap_guangzhou_open",
7: "tc_ap_hongkong",
6: "tc_ap_hongkong",
7: "tc_ap_jakarta",
8: "tc_ap_mumbai",
9: "tc_ap_seoul",
10: "tc_ap_shanghai",
11: "tc_ap_shanghai_fsi",
12: "tc_ap_shenzhen_fsi",
13: "tc_ap_singapore",
14: "tc_ap_tokyo",
15: "tc_eu_frankfurt",
16: "tc_eu_moscow",
17: "tc_na_ashburn",
18: "tc_na_siliconvalley",
19: "tc_na_toronto",
9: "tc_ap_nanjing",
10: "tc_ap_seoul",
11: "tc_ap_shanghai",
12: "tc_ap_shanghai_fsi",
13: "tc_ap_shenzhen_fsi",
14: "tc_ap_singapore",
15: "tc_ap_tokyo",
16: "tc_eu_frankfurt",
17: "tc_eu_moscow",
18: "tc_na_ashburn",
19: "tc_na_siliconvalley",
20: "tc_na_toronto",
21: "tc_sa_saopaulo",
}
TencentRegionId_value = map[string]int32{
"tc_all": 0,
"tc_ap_bangkok": 1,
"tc_ap_beijing": 2,
"tc_ap_chengdu": 3,
"tc_ap_chongqing": 4,
"tc_ap_guangzhou": 5,
"tc_ap_guangzhou_open": 6,
"tc_ap_hongkong": 7,
"tc_ap_mumbai": 8,
"tc_ap_seoul": 9,
"tc_ap_shanghai": 10,
"tc_ap_shanghai_fsi": 11,
"tc_ap_shenzhen_fsi": 12,
"tc_ap_singapore": 13,
"tc_ap_tokyo": 14,
"tc_eu_frankfurt": 15,
"tc_eu_moscow": 16,
"tc_na_ashburn": 17,
"tc_na_siliconvalley": 18,
"tc_na_toronto": 19,
"tc_all": 0,
"tc_ap_bangkok": 1,
"tc_ap_beijing": 2,
"tc_ap_chengdu": 3,
"tc_ap_chongqing": 4,
"tc_ap_guangzhou": 5,
"tc_ap_hongkong": 6,
"tc_ap_jakarta": 7,
"tc_ap_mumbai": 8,
"tc_ap_nanjing": 9,
"tc_ap_seoul": 10,
"tc_ap_shanghai": 11,
"tc_ap_shanghai_fsi": 12,
"tc_ap_shenzhen_fsi": 13,
"tc_ap_singapore": 14,
"tc_ap_tokyo": 15,
"tc_eu_frankfurt": 16,
"tc_eu_moscow": 17,
"tc_na_ashburn": 18,
"tc_na_siliconvalley": 19,
"tc_na_toronto": 20,
"tc_sa_saopaulo": 21,
}
)
@ -432,6 +442,50 @@ func (HuaweiRegionId) EnumDescriptor() ([]byte, []int) {
return file_idl_pbtenant_tenant_proto_rawDescGZIP(), []int{4}
}
// 私有云区域 预留
type K8SRegionId int32
const (
K8SRegionId_k8s_all K8SRegionId = 0
)
// Enum value maps for K8SRegionId.
var (
K8SRegionId_name = map[int32]string{
0: "k8s_all",
}
K8SRegionId_value = map[string]int32{
"k8s_all": 0,
}
)
func (x K8SRegionId) Enum() *K8SRegionId {
p := new(K8SRegionId)
*p = x
return p
}
func (x K8SRegionId) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (K8SRegionId) Descriptor() protoreflect.EnumDescriptor {
return file_idl_pbtenant_tenant_proto_enumTypes[5].Descriptor()
}
func (K8SRegionId) Type() protoreflect.EnumType {
return &file_idl_pbtenant_tenant_proto_enumTypes[5]
}
func (x K8SRegionId) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use K8SRegionId.Descriptor instead.
func (K8SRegionId) EnumDescriptor() ([]byte, []int) {
return file_idl_pbtenant_tenant_proto_rawDescGZIP(), []int{5}
}
// 亚马逊云区域,需要将对应的 _ 转化为 -
type AwsRegionId int32
@ -523,11 +577,11 @@ func (x AwsRegionId) String() string {
}
func (AwsRegionId) Descriptor() protoreflect.EnumDescriptor {
return file_idl_pbtenant_tenant_proto_enumTypes[5].Descriptor()
return file_idl_pbtenant_tenant_proto_enumTypes[6].Descriptor()
}
func (AwsRegionId) Type() protoreflect.EnumType {
return &file_idl_pbtenant_tenant_proto_enumTypes[5]
return &file_idl_pbtenant_tenant_proto_enumTypes[6]
}
func (x AwsRegionId) Number() protoreflect.EnumNumber {
@ -536,7 +590,7 @@ func (x AwsRegionId) Number() protoreflect.EnumNumber {
// Deprecated: Use AwsRegionId.Descriptor instead.
func (AwsRegionId) EnumDescriptor() ([]byte, []int) {
return file_idl_pbtenant_tenant_proto_rawDescGZIP(), []int{5}
return file_idl_pbtenant_tenant_proto_rawDescGZIP(), []int{6}
}
// 云配置信息
@ -601,6 +655,10 @@ type CloudConfig struct {
AccessId string `protobuf:"bytes,3,opt,name=access_id,json=accessId,proto3" json:"access_id,omitempty"`
// 认证方式1与 access_id 结合使用,两者均非空时生效
AccessSecret string `protobuf:"bytes,4,opt,name=access_secret,json=accessSecret,proto3" json:"access_secret,omitempty"`
// 如果是私有云需要提供URL
Url string `protobuf:"bytes,5,opt,name=url,proto3" json:"url,omitempty"`
// 如果是私有云需要提供URL
Token string `protobuf:"bytes,6,opt,name=token,proto3" json:"token,omitempty"`
}
func (x *CloudConfig) Reset() {
@ -663,6 +721,20 @@ func (x *CloudConfig) GetAccessSecret() string {
return ""
}
func (x *CloudConfig) GetUrl() string {
if x != nil {
return x.Url
}
return ""
}
func (x *CloudConfig) GetToken() string {
if x != nil {
return x.Token
}
return ""
}
var File_idl_pbtenant_tenant_proto protoreflect.FileDescriptor
var file_idl_pbtenant_tenant_proto_rawDesc = []byte{
@ -677,7 +749,7 @@ var file_idl_pbtenant_tenant_proto_rawDesc = []byte{
0x69, 0x67, 0x73, 0x12, 0x2f, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x62, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x2e,
0x43, 0x6c, 0x6f, 0x75, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x63, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x73, 0x22, 0x98, 0x01, 0x0a, 0x0b, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x43, 0x6f,
0x66, 0x69, 0x67, 0x73, 0x22, 0xc0, 0x01, 0x0a, 0x0b, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 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,
@ -686,132 +758,139 @@ var file_idl_pbtenant_tenant_proto_rawDesc = []byte{
0x09, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x52, 0x08, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x63,
0x63, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x2a,
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, 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, 0x12, 0x0f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x70,
0x6f, 0x64, 0x10, 0x05, 0x2a, 0xf3, 0x03, 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, 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, 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, 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,
0x09, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12,
0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72,
0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09,
0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2a, 0x49, 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, 0x6b, 0x38,
0x73, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x68, 0x61, 0x72, 0x76, 0x65, 0x73, 0x74, 0x65, 0x72,
0x10, 0x04, 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, 0x12, 0x0f, 0x0a, 0x0b, 0x70, 0x72,
0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x70, 0x6f, 0x64, 0x10, 0x05, 0x2a, 0xf3, 0x03, 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, 0x2a, 0xc1, 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, 0x12, 0x0a, 0x0e, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x68, 0x6f,
0x6e, 0x67, 0x6b, 0x6f, 0x6e, 0x67, 0x10, 0x06, 0x12, 0x11, 0x0a, 0x0d, 0x74, 0x63, 0x5f, 0x61,
0x70, 0x5f, 0x6a, 0x61, 0x6b, 0x61, 0x72, 0x74, 0x61, 0x10, 0x07, 0x12, 0x10, 0x0a, 0x0c, 0x74,
0x63, 0x5f, 0x61, 0x70, 0x5f, 0x6d, 0x75, 0x6d, 0x62, 0x61, 0x69, 0x10, 0x08, 0x12, 0x11, 0x0a,
0x0d, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x6e, 0x61, 0x6e, 0x6a, 0x69, 0x6e, 0x67, 0x10, 0x09,
0x12, 0x0f, 0x0a, 0x0b, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x65, 0x6f, 0x75, 0x6c, 0x10,
0x0a, 0x12, 0x12, 0x0a, 0x0e, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x68, 0x61, 0x6e, 0x67,
0x68, 0x61, 0x69, 0x10, 0x0b, 0x12, 0x16, 0x0a, 0x12, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73,
0x68, 0x61, 0x6e, 0x67, 0x68, 0x61, 0x69, 0x5f, 0x66, 0x73, 0x69, 0x10, 0x0c, 0x12, 0x16, 0x0a,
0x12, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73, 0x68, 0x65, 0x6e, 0x7a, 0x68, 0x65, 0x6e, 0x5f,
0x66, 0x73, 0x69, 0x10, 0x0d, 0x12, 0x13, 0x0a, 0x0f, 0x74, 0x63, 0x5f, 0x61, 0x70, 0x5f, 0x73,
0x69, 0x6e, 0x67, 0x61, 0x70, 0x6f, 0x72, 0x65, 0x10, 0x0e, 0x12, 0x0f, 0x0a, 0x0b, 0x74, 0x63,
0x5f, 0x61, 0x70, 0x5f, 0x74, 0x6f, 0x6b, 0x79, 0x6f, 0x10, 0x0f, 0x12, 0x13, 0x0a, 0x0f, 0x74,
0x63, 0x5f, 0x65, 0x75, 0x5f, 0x66, 0x72, 0x61, 0x6e, 0x6b, 0x66, 0x75, 0x72, 0x74, 0x10, 0x10,
0x12, 0x10, 0x0a, 0x0c, 0x74, 0x63, 0x5f, 0x65, 0x75, 0x5f, 0x6d, 0x6f, 0x73, 0x63, 0x6f, 0x77,
0x10, 0x11, 0x12, 0x11, 0x0a, 0x0d, 0x74, 0x63, 0x5f, 0x6e, 0x61, 0x5f, 0x61, 0x73, 0x68, 0x62,
0x75, 0x72, 0x6e, 0x10, 0x12, 0x12, 0x17, 0x0a, 0x13, 0x74, 0x63, 0x5f, 0x6e, 0x61, 0x5f, 0x73,
0x69, 0x6c, 0x69, 0x63, 0x6f, 0x6e, 0x76, 0x61, 0x6c, 0x6c, 0x65, 0x79, 0x10, 0x13, 0x12, 0x11,
0x0a, 0x0d, 0x74, 0x63, 0x5f, 0x6e, 0x61, 0x5f, 0x74, 0x6f, 0x72, 0x6f, 0x6e, 0x74, 0x6f, 0x10,
0x14, 0x12, 0x12, 0x0a, 0x0e, 0x74, 0x63, 0x5f, 0x73, 0x61, 0x5f, 0x73, 0x61, 0x6f, 0x70, 0x61,
0x75, 0x6c, 0x6f, 0x10, 0x15, 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, 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, 0x33, 0x10, 0x09, 0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, 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,
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,
0x12, 0x11, 0x0a, 0x0d, 0x68, 0x77, 0x5f, 0x63, 0x6e, 0x5f, 0x73, 0x6f, 0x75, 0x74, 0x68, 0x5f,
0x32, 0x10, 0x0b, 0x2a, 0x1a, 0x0a, 0x0b, 0x4b, 0x38, 0x53, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e,
0x49, 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x6b, 0x38, 0x73, 0x5f, 0x61, 0x6c, 0x6c, 0x10, 0x00, 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 (
@ -826,7 +905,7 @@ func file_idl_pbtenant_tenant_proto_rawDescGZIP() []byte {
return file_idl_pbtenant_tenant_proto_rawDescData
}
var file_idl_pbtenant_tenant_proto_enumTypes = make([]protoimpl.EnumInfo, 6)
var file_idl_pbtenant_tenant_proto_enumTypes = make([]protoimpl.EnumInfo, 7)
var file_idl_pbtenant_tenant_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_idl_pbtenant_tenant_proto_goTypes = []interface{}{
(CloudProvider)(0), // 0: pbtenant.CloudProvider
@ -834,12 +913,13 @@ var file_idl_pbtenant_tenant_proto_goTypes = []interface{}{
(AliRegionId)(0), // 2: pbtenant.AliRegionId
(TencentRegionId)(0), // 3: pbtenant.TencentRegionId
(HuaweiRegionId)(0), // 4: pbtenant.HuaweiRegionId
(AwsRegionId)(0), // 5: pbtenant.AwsRegionId
(*CloudConfigs)(nil), // 6: pbtenant.CloudConfigs
(*CloudConfig)(nil), // 7: pbtenant.CloudConfig
(K8SRegionId)(0), // 5: pbtenant.K8SRegionId
(AwsRegionId)(0), // 6: pbtenant.AwsRegionId
(*CloudConfigs)(nil), // 7: pbtenant.CloudConfigs
(*CloudConfig)(nil), // 8: pbtenant.CloudConfig
}
var file_idl_pbtenant_tenant_proto_depIdxs = []int32{
7, // 0: pbtenant.CloudConfigs.configs:type_name -> pbtenant.CloudConfig
8, // 0: pbtenant.CloudConfigs.configs:type_name -> pbtenant.CloudConfig
0, // 1: pbtenant.CloudConfig.provider:type_name -> pbtenant.CloudProvider
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
@ -884,7 +964,7 @@ func file_idl_pbtenant_tenant_proto_init() {
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_idl_pbtenant_tenant_proto_rawDesc,
NumEnums: 6,
NumEnums: 7,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,

View File

@ -17,7 +17,7 @@
],
"paths": {
"/apis/ecs": {
"post": {
"get": {
"summary": "查询ECS全量 - 根据云类型",
"operationId": "EcsService_ListEcs",
"responses": {
@ -36,12 +36,19 @@
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/pbecsListReq"
}
"name": "provider",
"description": "云名称.\n\n - ali: 0 - 阿里云\n - tencent: 1 - 腾讯云\n - huawei: 2 - 华为云\n - k8s: 3 - K8S\n - harvester: 3 - Harvester",
"in": "query",
"required": false,
"type": "string",
"enum": [
"ali",
"tencent",
"huawei",
"k8s",
"harvester"
],
"default": "ali"
}
],
"tags": [
@ -50,7 +57,7 @@
}
},
"/apis/ecs/all": {
"post": {
"get": {
"summary": "查询所有云的ECS",
"operationId": "EcsService_ListEcsAll",
"responses": {
@ -67,13 +74,102 @@
}
}
},
"tags": [
"EcsService"
]
}
},
"/apis/ecs/create": {
"post": {
"summary": "创建ECS",
"operationId": "EcsService_CreateEcs",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/pbecsCreateEcsResp"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/pbecsListAllReq"
"$ref": "#/definitions/pbecsCreateEcsReq"
}
}
],
"tags": [
"EcsService"
]
}
},
"/apis/ecs/createMultiple": {
"post": {
"summary": "创建多家云ECS",
"operationId": "EcsService_CreateMultipleEcs",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/pbecsCreateEcsMultipleResp"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/pbecsCreateEcsMultipleReq"
}
}
],
"tags": [
"EcsService"
]
}
},
"/apis/ecs/delete": {
"post": {
"summary": "删除ECS",
"operationId": "EcsService_DeleteEcs",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/pbecsDeleteEcsResp"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/pbecsDeleteEcsReq"
}
}
],
@ -83,7 +179,7 @@
}
},
"/apis/ecs/detail": {
"post": {
"get": {
"summary": "查询ECS明细 - 支持云类型、区域、账户、分页等过滤条件",
"operationId": "EcsService_ListEcsDetail",
"responses": {
@ -100,13 +196,91 @@
}
}
},
"parameters": [
{
"name": "provider",
"description": "云名称.\n\n - ali: 0 - 阿里云\n - tencent: 1 - 腾讯云\n - huawei: 2 - 华为云\n - k8s: 3 - K8S\n - harvester: 3 - Harvester",
"in": "query",
"required": false,
"type": "string",
"enum": [
"ali",
"tencent",
"huawei",
"k8s",
"harvester"
],
"default": "ali"
},
{
"name": "accountName",
"description": "账户名称根据config.yaml中的配置默认为第一个配置的账户.",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "regionId",
"description": "区域Id参考 tenant.proto 中的各个云的区域.",
"in": "query",
"required": false,
"type": "integer",
"format": "int32"
},
{
"name": "pageNumber",
"description": "分页相关参数,页码.",
"in": "query",
"required": false,
"type": "integer",
"format": "int32"
},
{
"name": "pageSize",
"description": "分页相关参数,每页数量.",
"in": "query",
"required": false,
"type": "integer",
"format": "int32"
},
{
"name": "nextToken",
"description": "分页相关参数下一页的token.",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"EcsService"
]
}
},
"/apis/ecs/update": {
"put": {
"summary": "修改ECS",
"operationId": "EcsService_UpdateEcs",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/pbecsUpdateEcsResp"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/pbecsListDetailReq"
"$ref": "#/definitions/pbecsUpdateEcsReq"
}
}
],
@ -117,6 +291,229 @@
}
},
"definitions": {
"pbecsCreateEcsMultipleReq": {
"type": "object",
"properties": {
"createEcsReqs": {
"type": "array",
"items": {
"$ref": "#/definitions/pbecsCreateEcsReq"
}
}
},
"title": "创建多家云ECS入参"
},
"pbecsCreateEcsMultipleResp": {
"type": "object",
"properties": {
"requestId": {
"type": "array",
"items": {
"type": "string"
},
"title": "请求ID"
},
"finished": {
"type": "boolean",
"title": "查询是否完成,如果为否-false则可以将下面三个分页参数填入到请求中继续查询"
}
},
"title": "创建多家云ECS返回值"
},
"pbecsCreateEcsReq": {
"type": "object",
"properties": {
"provider": {
"$ref": "#/definitions/pbtenantCloudProvider",
"title": "云类型"
},
"accountName": {
"type": "string",
"title": "账号名称"
},
"regionId": {
"type": "integer",
"format": "int32",
"title": "地域,数据中心"
},
"imageId": {
"type": "string",
"title": "镜像id"
},
"instanceChargeType": {
"type": "string",
"title": "实例的付费方式"
},
"instanceType": {
"type": "string",
"title": "实例的资源规格"
},
"securityGroupId": {
"type": "string",
"title": "安全组id"
},
"vSwitchId": {
"type": "string",
"title": "交换机id"
},
"instanceName": {
"type": "string",
"title": "实例名称"
},
"description": {
"type": "string",
"title": "实例描述"
},
"zoneId": {
"type": "string",
"title": "可用区id"
},
"systemDisk": {
"$ref": "#/definitions/pbecsSystemDisk",
"title": "系统磁盘"
},
"amount": {
"type": "integer",
"format": "int32",
"title": "创建ECS的数量"
},
"dryRun": {
"type": "string",
"title": "预检此次请求,为true时请求通过则返回 Request validation has been passed with DryRun flag set"
},
"category": {
"type": "string",
"title": "数据盘N的云盘种类。取值范围cloud_efficiency高效云盘cloud_ssdSSD云盘cloud_essdESSD云盘cloud普通云盘。"
},
"internetChargeType": {
"$ref": "#/definitions/pbecsInternetChargeType",
"title": "网络计费类型。取值范围PayByBandwidth按固定带宽计费。PayByTraffic默认按使用流量计费"
},
"internetMaxBandwidthOut": {
"type": "integer",
"format": "int32",
"title": "公网入带宽最大值单位为Mbit/s。创建的实例如果参数InternetMaxBandwidthOut的值大于0则自动为实例分配公网IP。"
},
"vpcId": {
"type": "string",
"title": "vpc id 华为云必需"
},
"subnetId": {
"type": "string",
"title": "待创建云服务器所在的子网信息。需要指定vpcid对应VPC下已创建的子网subnet的网络IDUUID格式。华为云必需"
}
},
"title": "创建ECS入参"
},
"pbecsCreateEcsResp": {
"type": "object",
"properties": {
"provider": {
"$ref": "#/definitions/pbtenantCloudProvider",
"title": "云名称"
},
"accountName": {
"type": "string",
"title": "账户名称根据config.yaml中的配置默认为第一个配置的账户"
},
"regionId": {
"type": "integer",
"format": "int32",
"title": "区域Id参考 tenant.proto 中的各个云的区域"
},
"requestId": {
"type": "string",
"title": "请求ID"
},
"orderId": {
"type": "string",
"title": "订单id"
},
"tradePrice": {
"type": "number",
"format": "float",
"title": "订单成交价"
},
"instanceIdSets": {
"type": "array",
"items": {
"type": "string"
},
"title": "实例IDInstanceIdSet列表"
},
"finished": {
"type": "boolean",
"title": "查询是否完成,如果为否-false则可以将下面三个分页参数填入到请求中继续查询"
}
},
"title": "创建ECS返回值"
},
"pbecsDeleteEcsReq": {
"type": "object",
"properties": {
"provider": {
"$ref": "#/definitions/pbtenantCloudProvider",
"title": "云类型"
},
"accountName": {
"type": "string",
"title": "账号名称"
},
"regionId": {
"type": "integer",
"format": "int32",
"title": "地域,数据中心"
},
"dryRun": {
"type": "string",
"title": "是否只预检此次请求是否只预检此次请求。true发送检查请求不会查询资源状况。检查项包括AccessKey是否有效、RAM用户的授权情况和是否填写了必需参数。如果检查不通过则返回对应错误。如果检查通过会返回错误码DRYRUN.SUCCESS。\nfalse默认值发送正常请求通过检查后返回2XX HTTP状态码并直接查询资源状况。"
},
"force": {
"type": "string",
"title": "Force是否强制释放**运行中**true强制释放运行中Running的实例。强制释放相当于断电实例内存以及存储中的临时数据都会被擦除无法恢复。\nfalse默认值正常释放实例此时实例必须处于已停止Stopped状态"
},
"terminateSubscription": {
"type": "string",
"title": "是否释放已到期的包年包月实例 true,false"
},
"instanceIds": {
"type": "string",
"title": "实例ID数组以”,“分割。列i-8vb2nlubkow0fxbq2218,i-8vb2nlubkow0fxbq2216"
},
"deletePublicip": {
"type": "string",
"title": "配置删除云服务器是否删除云服务器绑定的弹性IP。如果选择不删除则系统仅做解绑定操作保留弹性IP资源。\n取值为true或false。默认false华为云"
},
"deleteVolume": {
"type": "string",
"title": "配置删除云服务器是否删除云服务器对应的数据盘如果选择不删除则系统仅做卸载操作保留云硬盘资源。默认为false。\n取值为true或false。默认false华为云"
}
},
"title": "删除ECS入参"
},
"pbecsDeleteEcsResp": {
"type": "object",
"properties": {
"provider": {
"$ref": "#/definitions/pbtenantCloudProvider",
"title": "云名称"
},
"accountName": {
"type": "string",
"title": "账户名称根据config.yaml中的配置默认为第一个配置的账户"
},
"regionId": {
"type": "integer",
"format": "int32",
"title": "区域Id参考 tenant.proto 中的各个云的区域"
},
"requestId": {
"type": "string",
"title": "请求ID"
}
},
"title": "删除ECS返回值"
},
"pbecsEcsInstance": {
"type": "object",
"properties": {
@ -192,46 +589,22 @@
"type": "string",
"title": "资源组id"
},
"chargeType": {
"instanceChargeType": {
"type": "string",
"title": "收费类型"
}
}
},
"title": "ECS 实例"
},
"pbecsListAllReq": {
"type": "object"
},
"pbecsListDetailReq": {
"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"
}
}
"pbecsInternetChargeType": {
"type": "string",
"enum": [
"PayByBandwidth",
"PayByTraffic"
],
"default": "PayByBandwidth",
"description": "- PayByBandwidth: 按固定带宽计费。\n - PayByTraffic: (默认):按使用流量计费",
"title": "网络计费类型"
},
"pbecsListDetailResp": {
"type": "object",
@ -265,16 +638,8 @@
"type": "string",
"title": "请求id出现问题后提供给云厂商排查问题"
}
}
},
"pbecsListReq": {
"type": "object",
"properties": {
"provider": {
"$ref": "#/definitions/pbtenantCloudProvider",
"title": "云名称"
}
}
},
"title": "查询ECS返回值"
},
"pbecsListResp": {
"type": "object",
@ -288,16 +653,113 @@
}
}
},
"pbecsSystemDisk": {
"type": "object",
"properties": {
"size": {
"type": "string",
"title": "系统盘大小单位为GiB。取值范围20~500。该参数的取值必须大于或者等于max{20, ImageSize}。默认值max{40, 参数ImageId对应的镜像大小}"
},
"category": {
"type": "string",
"title": "系统盘类型。系统盘的云盘种类。取值范围cloud_efficiency高效云盘。cloud_ssdSSD云盘。cloud_essdESSD云盘。cloud普通云盘。"
},
"diskName": {
"type": "string",
"title": "系统盘名称"
},
"description": {
"type": "string",
"title": "系统盘描述"
},
"performanceLevel": {
"type": "string",
"title": "创建ESSD云盘作为系统盘使用时设置云盘的性能等级。取值范围PL0单盘最高随机读写IOPS 1万。PL1默认单盘最高随机读写IOPS 5万。PL2单盘最高随机读写IOPS 10万。PL3单盘最高随机读写IOPS 100万。"
},
"autoSnapshotPolicyId": {
"type": "string",
"title": "系统盘采用的自动快照策略ID。"
}
},
"title": "系统磁盘"
},
"pbecsUpdateEcsReq": {
"type": "object",
"properties": {
"provider": {
"$ref": "#/definitions/pbtenantCloudProvider",
"title": "云类型"
},
"accountName": {
"type": "string",
"title": "账号名称"
},
"regionId": {
"type": "integer",
"format": "int32",
"title": "地域,数据中心"
},
"instanceIds": {
"type": "string",
"title": "实例id"
},
"password": {
"type": "string",
"title": "实例状态不能为启动中Starting。重启实例后重置生效且必须是在ECS控制台重启或者调用API RebootInstance重启新密码才能生效。在操作系统内部重启不能生效。"
},
"hostName": {
"type": "string",
"title": "操作系统的主机名"
},
"instanceName": {
"type": "string",
"title": "实例名称"
},
"description": {
"type": "string",
"title": "实例描述"
},
"securityGroupIds": {
"type": "string",
"title": "实例重新加入的安全组列表安全组ID不能重复。以”,“分割"
}
},
"title": "更新ECS入参"
},
"pbecsUpdateEcsResp": {
"type": "object",
"properties": {
"provider": {
"$ref": "#/definitions/pbtenantCloudProvider",
"title": "云名称"
},
"accountName": {
"type": "string",
"title": "账户名称根据config.yaml中的配置默认为第一个配置的账户"
},
"regionId": {
"type": "integer",
"format": "int32",
"title": "区域Id参考 tenant.proto 中的各个云的区域"
},
"requestId": {
"type": "string",
"title": "请求ID"
}
},
"title": "更新ECS返回值"
},
"pbtenantCloudProvider": {
"type": "string",
"enum": [
"ali",
"tencent",
"huawei",
"aws"
"k8s",
"harvester"
],
"default": "ali",
"description": "- ali: 0 - 阿里云\n - tencent: 1 - 腾讯云 腾讯EK目前转内测,接口无法调用,暂时搁置\n - huawei: 2 - 华为云\n - aws: 3 - 亚马逊云",
"description": "- ali: 0 - 阿里云\n - tencent: 1 - 腾讯云\n - huawei: 2 - 华为云\n - k8s: 3 - K8S\n - harvester: 3 - Harvester",
"title": "云提供商"
},
"protobufAny": {

View File

@ -37,7 +37,7 @@
"parameters": [
{
"name": "provider",
"description": "云名称\n\n - ali: 0 - 阿里云\n - tencent: 1 - 腾讯云 腾讯EK目前转内测,接口无法调用,暂时搁置\n - huawei: 2 - 华为云\n - aws: 3 - 亚马逊云",
"description": "云名称.\n\n - ali: 0 - 阿里云\n - tencent: 1 - 腾讯云\n - huawei: 2 - 华为云\n - k8s: 3 - K8S\n - harvester: 3 - Harvester",
"in": "query",
"required": false,
"type": "string",
@ -45,9 +45,16 @@
"ali",
"tencent",
"huawei",
"aws"
"k8s",
"harvester"
],
"default": "ali"
},
{
"name": "namespace",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
@ -198,7 +205,7 @@
"parameters": [
{
"name": "provider",
"description": "云名称\n\n - ali: 0 - 阿里云\n - tencent: 1 - 腾讯云 腾讯EK目前转内测,接口无法调用,暂时搁置\n - huawei: 2 - 华为云\n - aws: 3 - 亚马逊云",
"description": "云名称.\n\n - ali: 0 - 阿里云\n - tencent: 1 - 腾讯云\n - huawei: 2 - 华为云\n - k8s: 3 - K8S\n - harvester: 3 - Harvester",
"in": "query",
"required": false,
"type": "string",
@ -206,20 +213,21 @@
"ali",
"tencent",
"huawei",
"aws"
"k8s",
"harvester"
],
"default": "ali"
},
{
"name": "accountName",
"description": "账户名称根据config.yaml中的配置默认为第一个配置的账户",
"description": "账户名称根据config.yaml中的配置默认为第一个配置的账户.",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "regionId",
"description": "区域Id参考 tenant.proto 中的各个云的区域",
"description": "区域Id参考 tenant.proto 中的各个云的区域.",
"in": "query",
"required": false,
"type": "integer",
@ -227,7 +235,7 @@
},
{
"name": "regionName",
"description": "区域名称各云厂商自定义的region name",
"description": "区域名称各云厂商自定义的region name.",
"in": "query",
"required": false,
"type": "integer",
@ -235,7 +243,7 @@
},
{
"name": "podId",
"description": "podID",
"description": "podID.",
"in": "query",
"required": false,
"type": "integer",
@ -243,7 +251,7 @@
},
{
"name": "pageNumber",
"description": "分页相关参数,页码",
"description": "分页相关参数,页码.",
"in": "query",
"required": false,
"type": "integer",
@ -251,7 +259,7 @@
},
{
"name": "pageSize",
"description": "分页相关参数,每页数量",
"description": "分页相关参数,每页数量.",
"in": "query",
"required": false,
"type": "integer",
@ -259,14 +267,14 @@
},
{
"name": "nextToken",
"description": "分页相关参数下一页的token",
"description": "分页相关参数下一页的token.",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "namespace",
"description": "namespace",
"description": "namespace.",
"in": "query",
"required": false,
"type": "string"
@ -657,20 +665,24 @@
"ali",
"tencent",
"huawei",
"aws"
"k8s",
"harvester"
],
"default": "ali",
"description": "- ali: 0 - 阿里云\n - tencent: 1 - 腾讯云 腾讯EK目前转内测,接口无法调用,暂时搁置\n - huawei: 2 - 华为云\n - aws: 3 - 亚马逊云",
"description": "- ali: 0 - 阿里云\n - tencent: 1 - 腾讯云\n - huawei: 2 - 华为云\n - k8s: 3 - K8S\n - harvester: 3 - Harvester",
"title": "云提供商"
},
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"typeUrl": {
"type": "string"
},
"value": {
"type": "string",
"format": "byte"
}
},
"additionalProperties": {}
}
},
"rpcStatus": {
"type": "object",