Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type Describe
- func (*Describe) Descriptor() ([]byte, []int)deprecated
- func (x *Describe) GetAttachedTime() int64
- func (x *Describe) GetDeleteWithInstance() bool
- func (x *Describe) GetDetachedTime() int64
- func (x *Describe) GetDevice() string
- func (x *Describe) GetEnableAutoSnapshot() bool
- func (x *Describe) GetEncrypted() bool
- func (x *Describe) GetInstanceId() string
- func (x *Describe) GetIops() int32
- func (x *Describe) GetMultiAttach() bool
- func (x *Describe) GetPortable() bool
- func (x *Describe) GetSize() uint64
- func (x *Describe) GetType() string
- func (*Describe) ProtoMessage()
- func (x *Describe) ProtoReflect() protoreflect.Message
- func (x *Describe) Reset()
- func (x *Describe) String() string
- type Disk
- type DiskSet
- func (s *DiskSet) Add(items ...any)
- func (*DiskSet) Descriptor() ([]byte, []int)deprecated
- func (x *DiskSet) GetItems() []*Disk
- func (x *DiskSet) GetTotal() int64
- func (s *DiskSet) Length() int64
- func (*DiskSet) ProtoMessage()
- func (x *DiskSet) ProtoReflect() protoreflect.Message
- func (x *DiskSet) Reset()
- func (s *DiskSet) ResourceIds() (ids []string)
- func (x *DiskSet) String() string
- func (s *DiskSet) ToAny() (items []any)
- func (s *DiskSet) ToJsonString() string
- type QueryDiskRequest
- func (*QueryDiskRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryDiskRequest) GetPage() *request.PageRequest
- func (*QueryDiskRequest) ProtoMessage()
- func (x *QueryDiskRequest) ProtoReflect() protoreflect.Message
- func (x *QueryDiskRequest) Reset()
- func (x *QueryDiskRequest) String() string
- type STATUS
- func (STATUS) Descriptor() protoreflect.EnumDescriptor
- func (x STATUS) Enum() *STATUS
- func (STATUS) EnumDescriptor() ([]byte, []int)deprecated
- func (t STATUS) Equal(target STATUS) bool
- func (t STATUS) IsIn(targets ...STATUS) bool
- func (t STATUS) MarshalJSON() ([]byte, error)
- func (x STATUS) Number() protoreflect.EnumNumber
- func (x STATUS) String() string
- func (STATUS) Type() protoreflect.EnumType
- func (t *STATUS) UnmarshalJSON(b []byte) error
- type ServiceClient
- type ServiceServer
- type UnimplementedServiceServer
- type UnsafeServiceServer
Constants ¶
const (
AppName = "disk"
)
Variables ¶
var ( STATUS_name = map[int32]string{ 0: "UNKNOW", 5: "PENDING", 6: "ATTACHING", 7: "UNATTACHED", 11: "ATTACHED", 30: "DETACHING", 31: "ROLLBACKING", 32: "EXPANDING", 34: "DUMPING", 80: "RECYCLE", 90: "DESTROYED", } STATUS_value = map[string]int32{ "UNKNOW": 0, "PENDING": 5, "ATTACHING": 6, "UNATTACHED": 7, "ATTACHED": 11, "DETACHING": 30, "ROLLBACKING": 31, "EXPANDING": 32, "DUMPING": 34, "RECYCLE": 80, "DESTROYED": 90, } )
Enum value maps for STATUS.
var File_apps_disk_pb_disk_proto protoreflect.FileDescriptor
var File_apps_disk_pb_rpc_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "infraboard.cmdb.disk.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SyncDisk", Handler: _Service_SyncDisk_Handler, }, { MethodName: "QueryDisk", Handler: _Service_QueryDisk_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apps/disk/pb/rpc.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 Describe ¶
type Describe struct { // 类型 (系统盘, 数据盘) 阿里: system:系统盘; data:数据盘 // @gotags: json:"type" Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type"` // 关联的实例 // @gotags: json:"instance_id" InstanceId string `protobuf:"bytes,2,opt,name=instance_id,json=instanceId,proto3" json:"instance_id"` // 容量大小 // @gotags: json:"size" Size uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size"` // IOPS // @gotags: json:"iops" Iops int32 `protobuf:"varint,11,opt,name=iops,proto3" json:"iops"` // 卸载时间 // @gotags: json:"detached_time" DetachedTime int64 `protobuf:"varint,4,opt,name=detached_time,json=detachedTime,proto3" json:"detached_time"` // 挂载时间 // @gotags: json:"attached_time" AttachedTime int64 `protobuf:"varint,5,opt,name=attached_time,json=attachedTime,proto3" json:"attached_time"` // 是否为弹性云盘 // @gotags: json:"portable" Portable bool `protobuf:"varint,6,opt,name=portable,proto3" json:"portable"` // 比如: /dev/xvdc // @gotags: json:"device" Device string `protobuf:"bytes,7,opt,name=device,proto3" json:"device"` // 是否加密 // @gotags: json:"encrypted" Encrypted bool `protobuf:"varint,8,opt,name=encrypted,proto3" json:"encrypted"` // 自动快照 // @gotags: json:"enable_auto_snapshot" EnableAutoSnapshot bool `protobuf:"varint,9,opt,name=enable_auto_snapshot,json=enableAutoSnapshot,proto3" json:"enable_auto_snapshot"` // 随实例销毁 // @gotags: json:"delete_with_instance" DeleteWithInstance bool `protobuf:"varint,10,opt,name=delete_with_instance,json=deleteWithInstance,proto3" json:"delete_with_instance"` // 是否是共享盘 // @gotags: json:"multi_attach" MultiAttach bool `protobuf:"varint,12,opt,name=multi_attach,json=multiAttach,proto3" json:"multi_attach"` // contains filtered or unexported fields }
func (*Describe) Descriptor
deprecated
func (*Describe) GetAttachedTime ¶
func (*Describe) GetDeleteWithInstance ¶
func (*Describe) GetDetachedTime ¶
func (*Describe) GetEnableAutoSnapshot ¶
func (*Describe) GetEncrypted ¶
func (*Describe) GetInstanceId ¶
func (*Describe) GetMultiAttach ¶
func (*Describe) GetPortable ¶
func (*Describe) ProtoMessage ¶
func (*Describe) ProtoMessage()
func (*Describe) ProtoReflect ¶
func (x *Describe) ProtoReflect() protoreflect.Message
type Disk ¶
type Disk struct { // @gotags: json:"resource" Resource *resource.Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource"` // @gotags: json:"describe" Describe *Describe `protobuf:"bytes,2,opt,name=describe,proto3" json:"describe"` // contains filtered or unexported fields }
func NewDefaultDisk ¶
func NewDefaultDisk() *Disk
func (*Disk) Descriptor
deprecated
func (*Disk) GetDescribe ¶
func (*Disk) GetResource ¶
func (*Disk) ProtoMessage ¶
func (*Disk) ProtoMessage()
func (*Disk) ProtoReflect ¶
func (x *Disk) ProtoReflect() protoreflect.Message
type DiskSet ¶
type DiskSet struct { // 总数量 // @gotags: json:"total" Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` // 列表项 // @gotags: json:"items" Items []*Disk `protobuf:"bytes,2,rep,name=items,proto3" json:"items"` // contains filtered or unexported fields }
func NewDiskSet ¶
func NewDiskSet() *DiskSet
func (*DiskSet) Descriptor
deprecated
func (*DiskSet) ProtoMessage ¶
func (*DiskSet) ProtoMessage()
func (*DiskSet) ProtoReflect ¶
func (x *DiskSet) ProtoReflect() protoreflect.Message
func (*DiskSet) ResourceIds ¶
func (*DiskSet) ToJsonString ¶
type QueryDiskRequest ¶
type QueryDiskRequest struct { // 分页参数 // @gotags: json:"page" Page *request.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"` // contains filtered or unexported fields }
func (*QueryDiskRequest) Descriptor
deprecated
func (*QueryDiskRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryDiskRequest.ProtoReflect.Descriptor instead.
func (*QueryDiskRequest) GetPage ¶
func (x *QueryDiskRequest) GetPage() *request.PageRequest
func (*QueryDiskRequest) ProtoMessage ¶
func (*QueryDiskRequest) ProtoMessage()
func (*QueryDiskRequest) ProtoReflect ¶
func (x *QueryDiskRequest) ProtoReflect() protoreflect.Message
func (*QueryDiskRequest) Reset ¶
func (x *QueryDiskRequest) Reset()
func (*QueryDiskRequest) String ¶
func (x *QueryDiskRequest) String() string
type STATUS ¶
type STATUS int32
const ( // 未知状态 STATUS_UNKNOW STATUS = 0 // 表示创建中 STATUS_PENDING STATUS = 5 // 挂载中 STATUS_ATTACHING STATUS = 6 // 未挂载 STATUS_UNATTACHED STATUS = 7 // 已挂载 STATUS_ATTACHED STATUS = 11 // 解挂中 STATUS_DETACHING STATUS = 30 // 回滚中 STATUS_ROLLBACKING STATUS = 31 // 扩容中 STATUS_EXPANDING STATUS = 32 // 实例克隆中 STATUS_DUMPING STATUS = 34 // 表示停止待销毁 STATUS_RECYCLE STATUS = 80 // 已销毁 STATUS_DESTROYED STATUS = 90 )
func ParseSTATUSFromString ¶
ParseSTATUSFromString Parse STATUS from string
func (STATUS) Descriptor ¶
func (STATUS) Descriptor() protoreflect.EnumDescriptor
func (STATUS) EnumDescriptor
deprecated
func (STATUS) Number ¶
func (x STATUS) Number() protoreflect.EnumNumber
func (STATUS) Type ¶
func (STATUS) Type() protoreflect.EnumType
type ServiceClient ¶
type ServiceClient interface { SyncDisk(ctx context.Context, in *Disk, opts ...grpc.CallOption) (*Disk, error) QueryDisk(ctx context.Context, in *QueryDiskRequest, opts ...grpc.CallOption) (*DiskSet, 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 { SyncDisk(context.Context, *Disk) (*Disk, error) QueryDisk(context.Context, *QueryDiskRequest) (*DiskSet, 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) QueryDisk ¶
func (UnimplementedServiceServer) QueryDisk(context.Context, *QueryDiskRequest) (*DiskSet, 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.