pbecs

package
v0.0.0-...-a156103 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package pbecs is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var EcsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pbecs.EcsService",
	HandlerType: (*EcsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListEcsDetail",
			Handler:    _EcsService_ListEcsDetail_Handler,
		},
		{
			MethodName: "ListEcs",
			Handler:    _EcsService_ListEcs_Handler,
		},
		{
			MethodName: "ListEcsAll",
			Handler:    _EcsService_ListEcsAll_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "idl/pbecs/ecs.proto",
}

EcsService_ServiceDesc is the grpc.ServiceDesc for EcsService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_idl_pbecs_ecs_proto protoreflect.FileDescriptor

Functions

func RegisterEcsServiceHandler

func RegisterEcsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterEcsServiceHandler registers the http handlers for service EcsService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterEcsServiceHandlerClient

func RegisterEcsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EcsServiceClient) error

RegisterEcsServiceHandlerClient registers the http handlers for service EcsService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "EcsServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "EcsServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "EcsServiceClient" to call the correct interceptors.

func RegisterEcsServiceHandlerFromEndpoint

func RegisterEcsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterEcsServiceHandlerFromEndpoint is same as RegisterEcsServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterEcsServiceHandlerServer

func RegisterEcsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EcsServiceServer) error

RegisterEcsServiceHandlerServer registers the http handlers for service EcsService to "mux". UnaryRPC :call EcsServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterEcsServiceHandlerFromEndpoint instead.

func RegisterEcsServiceServer

func RegisterEcsServiceServer(s grpc.ServiceRegistrar, srv EcsServiceServer)

Types

type EcsInstance

type EcsInstance struct {

	// 云类型
	Provider pbtenant.CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=pbtenant.CloudProvider" json:"provider,omitempty"`
	// 账号名称
	AccountName string `protobuf:"bytes,2,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"`
	// 实例id
	InstanceId string `protobuf:"bytes,3,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"`
	// 实例名称
	InstanceName string `protobuf:"bytes,4,opt,name=instance_name,json=instanceName,proto3" json:"instance_name,omitempty"`
	// 地域,数据中心
	RegionName string `protobuf:"bytes,5,opt,name=region_name,json=regionName,proto3" json:"region_name,omitempty"`
	// 公网ip
	PublicIps []string `protobuf:"bytes,6,rep,name=public_ips,json=publicIps,proto3" json:"public_ips,omitempty"`
	// 实例类型
	InstanceType string `protobuf:"bytes,7,opt,name=instance_type,json=instanceType,proto3" json:"instance_type,omitempty"`
	// vcpu数
	Cpu int32 `protobuf:"varint,8,opt,name=cpu,proto3" json:"cpu,omitempty"`
	// 内存MB
	Memory int32 `protobuf:"varint,9,opt,name=memory,proto3" json:"memory,omitempty"`
	// 实例描述
	Description string `protobuf:"bytes,10,opt,name=description,proto3" json:"description,omitempty"`
	// 状态
	Status string `protobuf:"bytes,11,opt,name=status,proto3" json:"status,omitempty"`
	// 创建时间,ISO8601
	CreationTime string `protobuf:"bytes,12,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"`
	// 过期时间
	ExpireTime string `protobuf:"bytes,13,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"`
	// 内网ip
	InnerIps []string `protobuf:"bytes,14,rep,name=inner_ips,json=innerIps,proto3" json:"inner_ips,omitempty"`
	// vcp id
	VpcId string `protobuf:"bytes,15,opt,name=vpc_id,json=vpcId,proto3" json:"vpc_id,omitempty"`
	// 资源组id
	ResourceGroupId string `protobuf:"bytes,16,opt,name=resource_group_id,json=resourceGroupId,proto3" json:"resource_group_id,omitempty"`
	// 收费类型
	ChargeType string `protobuf:"bytes,17,opt,name=charge_type,json=chargeType,proto3" json:"charge_type,omitempty"`
	// contains filtered or unexported fields
}

func (*EcsInstance) Descriptor deprecated

func (*EcsInstance) Descriptor() ([]byte, []int)

Deprecated: Use EcsInstance.ProtoReflect.Descriptor instead.

func (*EcsInstance) GetAccountName

func (x *EcsInstance) GetAccountName() string

func (*EcsInstance) GetChargeType

func (x *EcsInstance) GetChargeType() string

func (*EcsInstance) GetCpu

func (x *EcsInstance) GetCpu() int32

func (*EcsInstance) GetCreationTime

func (x *EcsInstance) GetCreationTime() string

func (*EcsInstance) GetDescription

func (x *EcsInstance) GetDescription() string

func (*EcsInstance) GetExpireTime

func (x *EcsInstance) GetExpireTime() string

func (*EcsInstance) GetInnerIps

func (x *EcsInstance) GetInnerIps() []string

func (*EcsInstance) GetInstanceId

func (x *EcsInstance) GetInstanceId() string

func (*EcsInstance) GetInstanceName

func (x *EcsInstance) GetInstanceName() string

func (*EcsInstance) GetInstanceType

func (x *EcsInstance) GetInstanceType() string

func (*EcsInstance) GetMemory

func (x *EcsInstance) GetMemory() int32

func (*EcsInstance) GetProvider

func (x *EcsInstance) GetProvider() pbtenant.CloudProvider

func (*EcsInstance) GetPublicIps

func (x *EcsInstance) GetPublicIps() []string

func (*EcsInstance) GetRegionName

func (x *EcsInstance) GetRegionName() string

func (*EcsInstance) GetResourceGroupId

func (x *EcsInstance) GetResourceGroupId() string

func (*EcsInstance) GetStatus

func (x *EcsInstance) GetStatus() string

func (*EcsInstance) GetVpcId

func (x *EcsInstance) GetVpcId() string

func (*EcsInstance) ProtoMessage

func (*EcsInstance) ProtoMessage()

func (*EcsInstance) ProtoReflect

func (x *EcsInstance) ProtoReflect() protoreflect.Message

func (*EcsInstance) Reset

func (x *EcsInstance) Reset()

func (*EcsInstance) String

func (x *EcsInstance) String() string

type EcsServiceClient

type EcsServiceClient interface {
	// 查询ECS明细 - 支持云类型、区域、账户、分页等过滤条件
	ListEcsDetail(ctx context.Context, in *ListDetailReq, opts ...grpc.CallOption) (*ListDetailResp, error)
	// 查询ECS全量 - 根据云类型
	ListEcs(ctx context.Context, in *ListReq, opts ...grpc.CallOption) (*ListResp, error)
	// 查询所有云的ECS
	ListEcsAll(ctx context.Context, in *ListAllReq, opts ...grpc.CallOption) (*ListResp, error)
}

EcsServiceClient is the client API for EcsService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewEcsServiceClient

func NewEcsServiceClient(cc grpc.ClientConnInterface) EcsServiceClient

type EcsServiceServer

type EcsServiceServer interface {
	// 查询ECS明细 - 支持云类型、区域、账户、分页等过滤条件
	ListEcsDetail(context.Context, *ListDetailReq) (*ListDetailResp, error)
	// 查询ECS全量 - 根据云类型
	ListEcs(context.Context, *ListReq) (*ListResp, error)
	// 查询所有云的ECS
	ListEcsAll(context.Context, *ListAllReq) (*ListResp, error)
	// contains filtered or unexported methods
}

EcsServiceServer is the server API for EcsService service. All implementations must embed UnimplementedEcsServiceServer for forward compatibility

type ListAllReq

type ListAllReq struct {
	// contains filtered or unexported fields
}

func (*ListAllReq) Descriptor deprecated

func (*ListAllReq) Descriptor() ([]byte, []int)

Deprecated: Use ListAllReq.ProtoReflect.Descriptor instead.

func (*ListAllReq) ProtoMessage

func (*ListAllReq) ProtoMessage()

func (*ListAllReq) ProtoReflect

func (x *ListAllReq) ProtoReflect() protoreflect.Message

func (*ListAllReq) Reset

func (x *ListAllReq) Reset()

func (*ListAllReq) String

func (x *ListAllReq) String() string

type ListDetailReq

type ListDetailReq struct {

	// 云名称
	Provider pbtenant.CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=pbtenant.CloudProvider" json:"provider,omitempty"`
	// 账户名称,根据config.yaml中的配置,默认为第一个配置的账户
	AccountName string `protobuf:"bytes,2,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"`
	// 区域Id,参考 tenant.proto 中的各个云的区域
	RegionId int32 `protobuf:"varint,3,opt,name=region_id,json=regionId,proto3" json:"region_id,omitempty"`
	// 分页相关参数,页码
	PageNumber int32 `protobuf:"varint,4,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"`
	// 分页相关参数,每页数量
	PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// 分页相关参数,下一页的token
	NextToken string `protobuf:"bytes,6,opt,name=next_token,json=nextToken,proto3" json:"next_token,omitempty"`
	// contains filtered or unexported fields
}

func (*ListDetailReq) Descriptor deprecated

func (*ListDetailReq) Descriptor() ([]byte, []int)

Deprecated: Use ListDetailReq.ProtoReflect.Descriptor instead.

func (*ListDetailReq) GetAccountName

func (x *ListDetailReq) GetAccountName() string

func (*ListDetailReq) GetNextToken

func (x *ListDetailReq) GetNextToken() string

func (*ListDetailReq) GetPageNumber

func (x *ListDetailReq) GetPageNumber() int32

func (*ListDetailReq) GetPageSize

func (x *ListDetailReq) GetPageSize() int32

func (*ListDetailReq) GetProvider

func (x *ListDetailReq) GetProvider() pbtenant.CloudProvider

func (*ListDetailReq) GetRegionId

func (x *ListDetailReq) GetRegionId() int32

func (*ListDetailReq) ProtoMessage

func (*ListDetailReq) ProtoMessage()

func (*ListDetailReq) ProtoReflect

func (x *ListDetailReq) ProtoReflect() protoreflect.Message

func (*ListDetailReq) Reset

func (x *ListDetailReq) Reset()

func (*ListDetailReq) String

func (x *ListDetailReq) String() string

type ListDetailResp

type ListDetailResp struct {

	// Ecs 机器集合
	Ecses []*EcsInstance `protobuf:"bytes,1,rep,name=ecses,proto3" json:"ecses,omitempty"`
	// 查询是否完成,如果为否-false,则可以将下面三个分页参数填入到请求中,继续查询
	Finished bool `protobuf:"varint,2,opt,name=finished,proto3" json:"finished,omitempty"`
	// 分页相关参数,页码
	PageNumber int32 `protobuf:"varint,3,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"`
	// 分页相关参数,每页数量
	PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// 分页相关参数,下一页的token
	NextToken string `protobuf:"bytes,5,opt,name=next_token,json=nextToken,proto3" json:"next_token,omitempty"`
	// 请求id,出现问题后提供给云厂商,排查问题
	RequestId string `protobuf:"bytes,6,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// contains filtered or unexported fields
}

func (*ListDetailResp) Descriptor deprecated

func (*ListDetailResp) Descriptor() ([]byte, []int)

Deprecated: Use ListDetailResp.ProtoReflect.Descriptor instead.

func (*ListDetailResp) GetEcses

func (x *ListDetailResp) GetEcses() []*EcsInstance

func (*ListDetailResp) GetFinished

func (x *ListDetailResp) GetFinished() bool

func (*ListDetailResp) GetNextToken

func (x *ListDetailResp) GetNextToken() string

func (*ListDetailResp) GetPageNumber

func (x *ListDetailResp) GetPageNumber() int32

func (*ListDetailResp) GetPageSize

func (x *ListDetailResp) GetPageSize() int32

func (*ListDetailResp) GetRequestId

func (x *ListDetailResp) GetRequestId() string

func (*ListDetailResp) ProtoMessage

func (*ListDetailResp) ProtoMessage()

func (*ListDetailResp) ProtoReflect

func (x *ListDetailResp) ProtoReflect() protoreflect.Message

func (*ListDetailResp) Reset

func (x *ListDetailResp) Reset()

func (*ListDetailResp) String

func (x *ListDetailResp) String() string

type ListReq

type ListReq struct {

	// 云名称
	Provider pbtenant.CloudProvider `protobuf:"varint,1,opt,name=provider,proto3,enum=pbtenant.CloudProvider" json:"provider,omitempty"`
	// contains filtered or unexported fields
}

func (*ListReq) Descriptor deprecated

func (*ListReq) Descriptor() ([]byte, []int)

Deprecated: Use ListReq.ProtoReflect.Descriptor instead.

func (*ListReq) GetProvider

func (x *ListReq) GetProvider() pbtenant.CloudProvider

func (*ListReq) ProtoMessage

func (*ListReq) ProtoMessage()

func (*ListReq) ProtoReflect

func (x *ListReq) ProtoReflect() protoreflect.Message

func (*ListReq) Reset

func (x *ListReq) Reset()

func (*ListReq) String

func (x *ListReq) String() string

type ListResp

type ListResp struct {

	// Ecs 机器集合
	Ecses []*EcsInstance `protobuf:"bytes,1,rep,name=ecses,proto3" json:"ecses,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResp) Descriptor deprecated

func (*ListResp) Descriptor() ([]byte, []int)

Deprecated: Use ListResp.ProtoReflect.Descriptor instead.

func (*ListResp) GetEcses

func (x *ListResp) GetEcses() []*EcsInstance

func (*ListResp) ProtoMessage

func (*ListResp) ProtoMessage()

func (*ListResp) ProtoReflect

func (x *ListResp) ProtoReflect() protoreflect.Message

func (*ListResp) Reset

func (x *ListResp) Reset()

func (*ListResp) String

func (x *ListResp) String() string

type UnimplementedEcsServiceServer

type UnimplementedEcsServiceServer struct {
}

UnimplementedEcsServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedEcsServiceServer) ListEcs

func (UnimplementedEcsServiceServer) ListEcsAll

func (UnimplementedEcsServiceServer) ListEcsDetail

type UnsafeEcsServiceServer

type UnsafeEcsServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeEcsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EcsServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL