Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type BasePagerV2
- type Describe
- func (*Describe) Descriptor() ([]byte, []int)deprecated
- func (x *Describe) GetCpu() int64
- func (x *Describe) GetExtra() map[string]string
- func (x *Describe) GetGpuAmount() int32
- func (x *Describe) GetGpuSpec() string
- func (x *Describe) GetImageId() string
- func (x *Describe) GetInternetMaxBandwidthIn() int64
- func (x *Describe) GetInternetMaxBandwidthOut() int64
- func (x *Describe) GetKeyPairName() []string
- func (x *Describe) GetMemory() int64
- func (x *Describe) GetOsName() string
- func (x *Describe) GetOsType() string
- func (x *Describe) GetSecurityGroups() []string
- func (x *Describe) GetSerialNumber() string
- func (d *Describe) KeyPairNameToString() string
- func (d *Describe) LoadKeyPairNameString(s string)
- func (d *Describe) LoadSecurityGroupsString(s string)
- func (*Describe) ProtoMessage()
- func (x *Describe) ProtoReflect() protoreflect.Message
- func (x *Describe) Reset()
- func (d *Describe) SecurityGroupsToString() string
- func (x *Describe) String() string
- type DescribeBy
- func (DescribeBy) Descriptor() protoreflect.EnumDescriptor
- func (x DescribeBy) Enum() *DescribeBy
- func (DescribeBy) EnumDescriptor() ([]byte, []int)deprecated
- func (t DescribeBy) Equal(target DescribeBy) bool
- func (t DescribeBy) IsIn(targets ...DescribeBy) bool
- func (t DescribeBy) MarshalJSON() ([]byte, error)
- func (x DescribeBy) Number() protoreflect.EnumNumber
- func (x DescribeBy) String() string
- func (DescribeBy) Type() protoreflect.EnumType
- func (t *DescribeBy) UnmarshalJSON(b []byte) error
- type DescribeHostRequest
- func (*DescribeHostRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DescribeHostRequest) GetDescribeBy() DescribeBy
- func (x *DescribeHostRequest) GetValue() string
- func (*DescribeHostRequest) ProtoMessage()
- func (x *DescribeHostRequest) ProtoReflect() protoreflect.Message
- func (x *DescribeHostRequest) Reset()
- func (x *DescribeHostRequest) String() string
- func (req *DescribeHostRequest) Where() (string, interface{})
- type Host
- func (*Host) Descriptor() ([]byte, []int)deprecated
- func (h *Host) GenHash() error
- func (x *Host) GetBase() *resource.Base
- func (x *Host) GetDescribe() *Describe
- func (x *Host) GetInformation() *resource.Information
- func (*Host) ProtoMessage()
- func (x *Host) ProtoReflect() protoreflect.Message
- func (h *Host) Put(req *UpdateHostData)
- func (x *Host) Reset()
- func (h *Host) ShortDesc() string
- func (x *Host) String() string
- type HostSet
- func (s *HostSet) Add(item any)
- func (s *HostSet) Clone() *HostSet
- func (*HostSet) Descriptor() ([]byte, []int)deprecated
- func (x *HostSet) GetItems() []*Host
- func (x *HostSet) GetTotal() int64
- func (s *HostSet) Length() int64
- func (*HostSet) ProtoMessage()
- func (x *HostSet) ProtoReflect() protoreflect.Message
- func (x *HostSet) Reset()
- func (s *HostSet) ResourceIds() (ids []string)
- func (x *HostSet) String() string
- func (s *HostSet) UpdateTag(tags []*resource.Tag)
- type PagerV2
- type Pagger
- type QueryHostRequest
- func (*QueryHostRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryHostRequest) GetKeywords() string
- func (x *QueryHostRequest) GetPage() *request.PageRequest
- func (*QueryHostRequest) ProtoMessage()
- func (x *QueryHostRequest) ProtoReflect() protoreflect.Message
- func (x *QueryHostRequest) Reset()
- func (x *QueryHostRequest) String() string
- type ReleaseHostRequest
- type ServiceClient
- type ServiceServer
- type Set
- type UnimplementedServiceServer
- func (UnimplementedServiceServer) DescribeHost(context.Context, *DescribeHostRequest) (*Host, error)
- func (UnimplementedServiceServer) QueryHost(context.Context, *QueryHostRequest) (*HostSet, error)
- func (UnimplementedServiceServer) ReleaseHost(context.Context, *ReleaseHostRequest) (*Host, error)
- func (UnimplementedServiceServer) SyncHost(context.Context, *Host) (*Host, error)
- func (UnimplementedServiceServer) UpdateHost(context.Context, *UpdateHostRequest) (*Host, error)
- type UnsafeServiceServer
- type UpdateHostData
- func (*UpdateHostData) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateHostData) GetDescribe() *Describe
- func (x *UpdateHostData) GetInformation() *resource.Information
- func (*UpdateHostData) ProtoMessage()
- func (x *UpdateHostData) ProtoReflect() protoreflect.Message
- func (x *UpdateHostData) Reset()
- func (x *UpdateHostData) String() string
- type UpdateHostRequest
- func (*UpdateHostRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateHostRequest) GetId() string
- func (x *UpdateHostRequest) GetUpdateHostData() *UpdateHostData
- func (x *UpdateHostRequest) GetUpdateMode() request1.UpdateMode
- func (*UpdateHostRequest) ProtoMessage()
- func (x *UpdateHostRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateHostRequest) Reset()
- func (x *UpdateHostRequest) String() string
- func (req *UpdateHostRequest) Validate() error
Constants ¶
const (
AppName = "host"
)
Variables ¶
var ( DescribeBy_name = map[int32]string{ 0: "HOST_ID", } DescribeBy_value = map[string]int32{ "HOST_ID": 0, } )
Enum value maps for DescribeBy.
var File_apps_host_pb_host_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "course.cmdb.host.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SyncHost", Handler: _Service_SyncHost_Handler, }, { MethodName: "QueryHost", Handler: _Service_QueryHost_Handler, }, { MethodName: "DescribeHost", Handler: _Service_DescribeHost_Handler, }, { MethodName: "UpdateHost", Handler: _Service_UpdateHost_Handler, }, { MethodName: "ReleaseHost", Handler: _Service_ReleaseHost_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apps/host/pb/host.proto", }
Service_ServiceDesc is the grpc.ServiceDesc for Service service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterServiceServer ¶
func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
Types ¶
type BasePagerV2 ¶
type BasePagerV2 struct {
// contains filtered or unexported fields
}
func NewBasePagerV2 ¶
func NewBasePagerV2() *BasePagerV2
func (*BasePagerV2) CheckHasNext ¶
func (p *BasePagerV2) CheckHasNext(current int64)
func (*BasePagerV2) Next ¶
func (p *BasePagerV2) Next() bool
func (*BasePagerV2) Offset ¶
func (p *BasePagerV2) Offset() int64
func (*BasePagerV2) PageNumber ¶
func (p *BasePagerV2) PageNumber() int64
func (*BasePagerV2) PageSize ¶
func (p *BasePagerV2) PageSize() int64
func (*BasePagerV2) SetPageSize ¶
func (p *BasePagerV2) SetPageSize(ps int64)
func (*BasePagerV2) SetRate ¶
func (p *BasePagerV2) SetRate(r float64)
type Describe ¶
type Describe struct { // 核数 // @gotags: json:"cpu" Cpu int64 `protobuf:"varint,1,opt,name=cpu,proto3" json:"cpu"` // 内存 // @gotags: json:"memory" Memory int64 `protobuf:"varint,2,opt,name=memory,proto3" json:"memory"` // GPU数量 // @gotags: json:"gpu_amount" GpuAmount int32 `protobuf:"varint,3,opt,name=gpu_amount,json=gpuAmount,proto3" json:"gpu_amount"` // GPU类型 // @gotags: json:"gpu_spec" GpuSpec string `protobuf:"bytes,4,opt,name=gpu_spec,json=gpuSpec,proto3" json:"gpu_spec"` // 操作系统类型,分为Windows和Linux // @gotags: json:"os_type" OsType string `protobuf:"bytes,5,opt,name=os_type,json=osType,proto3" json:"os_type"` // 操作系统名称 // @gotags: json:"os_name" OsName string `protobuf:"bytes,6,opt,name=os_name,json=osName,proto3" json:"os_name"` // 序列号 // @gotags: json:"serial_number" SerialNumber string `protobuf:"bytes,7,opt,name=serial_number,json=serialNumber,proto3" json:"serial_number"` // 镜像ID // @gotags: json:"image_id" ImageId string `protobuf:"bytes,8,opt,name=image_id,json=imageId,proto3" json:"image_id"` // 公网出带宽最大值,单位为 Mbps // @gotags: json:"internet_max_bandwidth_out" InternetMaxBandwidthOut int64 `protobuf:"varint,9,opt,name=internet_max_bandwidth_out,json=internetMaxBandwidthOut,proto3" json:"internet_max_bandwidth_out"` // 公网入带宽最大值,单位为 Mbps // @gotags: json:"internet_max_bandwidth_in" InternetMaxBandwidthIn int64 `protobuf:"varint,10,opt,name=internet_max_bandwidth_in,json=internetMaxBandwidthIn,proto3" json:"internet_max_bandwidth_in"` // 秘钥对名称 // @gotags: json:"key_pair_name" KeyPairName []string `protobuf:"bytes,11,rep,name=key_pair_name,json=keyPairName,proto3" json:"key_pair_name"` // 安全组 采用逗号分隔 // @gotags: json:"security_groups" SecurityGroups []string `protobuf:"bytes,12,rep,name=security_groups,json=securityGroups,proto3" json:"security_groups"` // 额外的无法通用的一些属性, 比如只有腾讯云独有的一些属性 // @gotags: json:"extra" Extra map[string]string `` /* 142-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Describe) Descriptor
deprecated
func (*Describe) GetGpuAmount ¶
func (*Describe) GetGpuSpec ¶
func (*Describe) GetImageId ¶
func (*Describe) GetInternetMaxBandwidthIn ¶
func (*Describe) GetInternetMaxBandwidthOut ¶
func (*Describe) GetKeyPairName ¶
func (*Describe) GetSecurityGroups ¶
func (*Describe) GetSerialNumber ¶
func (*Describe) KeyPairNameToString ¶
func (*Describe) LoadKeyPairNameString ¶
func (*Describe) LoadSecurityGroupsString ¶
func (*Describe) ProtoMessage ¶
func (*Describe) ProtoMessage()
func (*Describe) ProtoReflect ¶
func (x *Describe) ProtoReflect() protoreflect.Message
func (*Describe) SecurityGroupsToString ¶
type DescribeBy ¶
type DescribeBy int32
const (
DescribeBy_HOST_ID DescribeBy = 0
)
func ParseDescribeByFromString ¶
func ParseDescribeByFromString(str string) (DescribeBy, error)
ParseDescribeByFromString Parse DescribeBy from string
func (DescribeBy) Descriptor ¶
func (DescribeBy) Descriptor() protoreflect.EnumDescriptor
func (DescribeBy) Enum ¶
func (x DescribeBy) Enum() *DescribeBy
func (DescribeBy) EnumDescriptor
deprecated
func (DescribeBy) EnumDescriptor() ([]byte, []int)
Deprecated: Use DescribeBy.Descriptor instead.
func (DescribeBy) Number ¶
func (x DescribeBy) Number() protoreflect.EnumNumber
func (DescribeBy) String ¶
func (x DescribeBy) String() string
func (DescribeBy) Type ¶
func (DescribeBy) Type() protoreflect.EnumType
func (*DescribeBy) UnmarshalJSON ¶
func (t *DescribeBy) UnmarshalJSON(b []byte) error
UnmarshalJSON todo
type DescribeHostRequest ¶
type DescribeHostRequest struct { // @gotags: json:"describe_by" DescribeBy DescribeBy `protobuf:"varint,1,opt,name=describe_by,json=describeBy,proto3,enum=course.cmdb.host.DescribeBy" json:"describe_by"` // @gotags: json:"value" validate:"required" Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value" validate:"required"` // contains filtered or unexported fields }
func NewDescribeHostRequestWithID ¶
func NewDescribeHostRequestWithID(id string) *DescribeHostRequest
func (*DescribeHostRequest) Descriptor
deprecated
func (*DescribeHostRequest) Descriptor() ([]byte, []int)
Deprecated: Use DescribeHostRequest.ProtoReflect.Descriptor instead.
func (*DescribeHostRequest) GetDescribeBy ¶
func (x *DescribeHostRequest) GetDescribeBy() DescribeBy
func (*DescribeHostRequest) GetValue ¶
func (x *DescribeHostRequest) GetValue() string
func (*DescribeHostRequest) ProtoMessage ¶
func (*DescribeHostRequest) ProtoMessage()
func (*DescribeHostRequest) ProtoReflect ¶
func (x *DescribeHostRequest) ProtoReflect() protoreflect.Message
func (*DescribeHostRequest) Reset ¶
func (x *DescribeHostRequest) Reset()
func (*DescribeHostRequest) String ¶
func (x *DescribeHostRequest) String() string
func (*DescribeHostRequest) Where ¶
func (req *DescribeHostRequest) Where() (string, interface{})
type Host ¶
type Host struct { // 固有基础属性 // @gotags: json:"base" Base *resource.Base `protobuf:"bytes,1,opt,name=base,proto3" json:"base"` // 非固有的基础属性 // @gotags: json:"information" Information *resource.Information `protobuf:"bytes,2,opt,name=information,proto3" json:"information"` // 主机资源 固有的属性 // @gotags: json:"describe" Describe *Describe `protobuf:"bytes,3,opt,name=describe,proto3" json:"describe"` // contains filtered or unexported fields }
func NewDefaultHost ¶
func NewDefaultHost() *Host
func (*Host) Descriptor
deprecated
func (*Host) GetDescribe ¶
func (*Host) GetInformation ¶
func (x *Host) GetInformation() *resource.Information
func (*Host) ProtoMessage ¶
func (*Host) ProtoMessage()
func (*Host) ProtoReflect ¶
func (x *Host) ProtoReflect() protoreflect.Message
func (*Host) Put ¶
func (h *Host) Put(req *UpdateHostData)
type HostSet ¶
type HostSet struct { // @gotags: json:"total" Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` // @gotags: json:"items" Items []*Host `protobuf:"bytes,2,rep,name=items,proto3" json:"items"` // contains filtered or unexported fields }
func NewHostSet ¶
func NewHostSet() *HostSet
func (*HostSet) Descriptor
deprecated
func (*HostSet) ProtoMessage ¶
func (*HostSet) ProtoMessage()
func (*HostSet) ProtoReflect ¶
func (x *HostSet) ProtoReflect() protoreflect.Message
func (*HostSet) ResourceIds ¶
type QueryHostRequest ¶
type QueryHostRequest struct { // 分页参数 // @gotags: json:"page" Page *request.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"` // 关键字参数 // @gotags: json:"keywords" Keywords string `protobuf:"bytes,2,opt,name=keywords,proto3" json:"keywords"` // contains filtered or unexported fields }
func NewQueryHostRequestFromHTTP ¶
func NewQueryHostRequestFromHTTP(r *http.Request) *QueryHostRequest
func (*QueryHostRequest) Descriptor
deprecated
func (*QueryHostRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryHostRequest.ProtoReflect.Descriptor instead.
func (*QueryHostRequest) GetKeywords ¶
func (x *QueryHostRequest) GetKeywords() string
func (*QueryHostRequest) GetPage ¶
func (x *QueryHostRequest) GetPage() *request.PageRequest
func (*QueryHostRequest) ProtoMessage ¶
func (*QueryHostRequest) ProtoMessage()
func (*QueryHostRequest) ProtoReflect ¶
func (x *QueryHostRequest) ProtoReflect() protoreflect.Message
func (*QueryHostRequest) Reset ¶
func (x *QueryHostRequest) Reset()
func (*QueryHostRequest) String ¶
func (x *QueryHostRequest) String() string
type ReleaseHostRequest ¶
type ReleaseHostRequest struct { // 主机Id // @gotags: json:"id" validate:"required" Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" validate:"required"` // contains filtered or unexported fields }
func NewDeleteHostRequestWithID ¶
func NewDeleteHostRequestWithID(id string) *ReleaseHostRequest
func (*ReleaseHostRequest) Descriptor
deprecated
func (*ReleaseHostRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReleaseHostRequest.ProtoReflect.Descriptor instead.
func (*ReleaseHostRequest) GetId ¶
func (x *ReleaseHostRequest) GetId() string
func (*ReleaseHostRequest) ProtoMessage ¶
func (*ReleaseHostRequest) ProtoMessage()
func (*ReleaseHostRequest) ProtoReflect ¶
func (x *ReleaseHostRequest) ProtoReflect() protoreflect.Message
func (*ReleaseHostRequest) Reset ¶
func (x *ReleaseHostRequest) Reset()
func (*ReleaseHostRequest) String ¶
func (x *ReleaseHostRequest) String() string
type ServiceClient ¶
type ServiceClient interface { // 同步云商的主机资源 SyncHost(ctx context.Context, in *Host, opts ...grpc.CallOption) (*Host, error) // 查询本地同步后的主机资源列表 QueryHost(ctx context.Context, in *QueryHostRequest, opts ...grpc.CallOption) (*HostSet, error) // 查询主机详情信息 DescribeHost(ctx context.Context, in *DescribeHostRequest, opts ...grpc.CallOption) (*Host, error) // 更新主机信息, 同步更新云商资源信息 UpdateHost(ctx context.Context, in *UpdateHostRequest, opts ...grpc.CallOption) (*Host, error) // 释放主机, 按计划释放后, 信息会保留一段时间 ReleaseHost(ctx context.Context, in *ReleaseHostRequest, opts ...grpc.CallOption) (*Host, error) }
ServiceClient is the client API for Service 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 NewServiceClient ¶
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient
type ServiceServer ¶
type ServiceServer interface { // 同步云商的主机资源 SyncHost(context.Context, *Host) (*Host, error) // 查询本地同步后的主机资源列表 QueryHost(context.Context, *QueryHostRequest) (*HostSet, error) // 查询主机详情信息 DescribeHost(context.Context, *DescribeHostRequest) (*Host, error) // 更新主机信息, 同步更新云商资源信息 UpdateHost(context.Context, *UpdateHostRequest) (*Host, error) // 释放主机, 按计划释放后, 信息会保留一段时间 ReleaseHost(context.Context, *ReleaseHostRequest) (*Host, error) // contains filtered or unexported methods }
ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility
type UnimplementedServiceServer ¶
type UnimplementedServiceServer struct { }
UnimplementedServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedServiceServer) DescribeHost ¶
func (UnimplementedServiceServer) DescribeHost(context.Context, *DescribeHostRequest) (*Host, error)
func (UnimplementedServiceServer) QueryHost ¶
func (UnimplementedServiceServer) QueryHost(context.Context, *QueryHostRequest) (*HostSet, error)
func (UnimplementedServiceServer) ReleaseHost ¶
func (UnimplementedServiceServer) ReleaseHost(context.Context, *ReleaseHostRequest) (*Host, error)
func (UnimplementedServiceServer) UpdateHost ¶
func (UnimplementedServiceServer) UpdateHost(context.Context, *UpdateHostRequest) (*Host, error)
type UnsafeServiceServer ¶
type UnsafeServiceServer interface {
// contains filtered or unexported methods
}
UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceServer will result in compilation errors.
type UpdateHostData ¶
type UpdateHostData struct { // @gotags: json:"information" Information *resource.Information `protobuf:"bytes,1,opt,name=information,proto3" json:"information"` // @gotags: json:"describe" Describe *Describe `protobuf:"bytes,2,opt,name=describe,proto3" json:"describe"` // contains filtered or unexported fields }
func NewUpdateHostDataByIns ¶
func NewUpdateHostDataByIns(ins *Host) *UpdateHostData
func (*UpdateHostData) Descriptor
deprecated
func (*UpdateHostData) Descriptor() ([]byte, []int)
Deprecated: Use UpdateHostData.ProtoReflect.Descriptor instead.
func (*UpdateHostData) GetDescribe ¶
func (x *UpdateHostData) GetDescribe() *Describe
func (*UpdateHostData) GetInformation ¶
func (x *UpdateHostData) GetInformation() *resource.Information
func (*UpdateHostData) ProtoMessage ¶
func (*UpdateHostData) ProtoMessage()
func (*UpdateHostData) ProtoReflect ¶
func (x *UpdateHostData) ProtoReflect() protoreflect.Message
func (*UpdateHostData) Reset ¶
func (x *UpdateHostData) Reset()
func (*UpdateHostData) String ¶
func (x *UpdateHostData) String() string
type UpdateHostRequest ¶
type UpdateHostRequest struct { // @gotags: json:"id" validate:"required" Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" validate:"required"` // 更新模式 // @gotags: json:"update_mode" UpdateMode request1.UpdateMode `protobuf:"varint,2,opt,name=update_mode,json=updateMode,proto3,enum=infraboard.mcube.request.UpdateMode" json:"update_mode"` // @gotags: json:"data" validate:"required" UpdateHostData *UpdateHostData `protobuf:"bytes,3,opt,name=update_host_data,json=updateHostData,proto3" json:"data" validate:"required"` // contains filtered or unexported fields }
func NewUpdateHostRequest ¶
func NewUpdateHostRequest(id string) *UpdateHostRequest
func (*UpdateHostRequest) Descriptor
deprecated
func (*UpdateHostRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateHostRequest.ProtoReflect.Descriptor instead.
func (*UpdateHostRequest) GetId ¶
func (x *UpdateHostRequest) GetId() string
func (*UpdateHostRequest) GetUpdateHostData ¶
func (x *UpdateHostRequest) GetUpdateHostData() *UpdateHostData
func (*UpdateHostRequest) GetUpdateMode ¶
func (x *UpdateHostRequest) GetUpdateMode() request1.UpdateMode
func (*UpdateHostRequest) ProtoMessage ¶
func (*UpdateHostRequest) ProtoMessage()
func (*UpdateHostRequest) ProtoReflect ¶
func (x *UpdateHostRequest) ProtoReflect() protoreflect.Message
func (*UpdateHostRequest) Reset ¶
func (x *UpdateHostRequest) Reset()
func (*UpdateHostRequest) String ¶
func (x *UpdateHostRequest) String() string
func (*UpdateHostRequest) Validate ¶
func (req *UpdateHostRequest) Validate() error