Documentation ¶
Index ¶
- Constants
- Variables
- func MustHash(data string) string
- func RegisterRPCServer(s grpc.ServiceRegistrar, srv RPCServer)
- type ContentHash
- func (*ContentHash) Descriptor() ([]byte, []int)deprecated
- func (x *ContentHash) GetCostHash() string
- func (x *ContentHash) GetCustomHash() string
- func (x *ContentHash) GetRelationHash() string
- func (x *ContentHash) GetSpecHash() string
- func (x *ContentHash) GetStatusHash() string
- func (x *ContentHash) GetTagHash() string
- func (*ContentHash) ProtoMessage()
- func (x *ContentHash) ProtoReflect() protoreflect.Message
- func (x *ContentHash) Reset()
- func (x *ContentHash) String() string
- type Cost
- func (*Cost) Descriptor() ([]byte, []int)deprecated
- func (x *Cost) GetPayMode() PAY_MODE
- func (x *Cost) GetPayModeDetail() string
- func (x *Cost) GetPolicy() float64
- func (x *Cost) GetRealCost() float64
- func (x *Cost) GetSalePrice() float64
- func (x *Cost) GetUnitPrice() float64
- func (*Cost) ProtoMessage()
- func (x *Cost) ProtoReflect() protoreflect.Message
- func (x *Cost) Reset()
- func (x *Cost) String() string
- func (c *Cost) TableName() string
- type Meta
- func (*Meta) Descriptor() ([]byte, []int)deprecated
- func (x *Meta) GetCreateAt() int64
- func (x *Meta) GetCredentialId() string
- func (x *Meta) GetDeleteAt() int64
- func (x *Meta) GetDeleteBy() string
- func (x *Meta) GetDomain() string
- func (x *Meta) GetEnv() string
- func (x *Meta) GetExtra() map[string]string
- func (x *Meta) GetId() string
- func (x *Meta) GetNamespace() string
- func (x *Meta) GetSerialNumber() string
- func (x *Meta) GetSyncAt() int64
- func (x *Meta) GetSyncBy() string
- func (*Meta) ProtoMessage()
- func (x *Meta) ProtoReflect() protoreflect.Message
- func (x *Meta) Reset()
- func (x *Meta) String() string
- func (m *Meta) TableName() string
- type PAY_MODE
- type RPCClient
- type RPCServer
- type Resource
- func (c *Resource) AddTag(tag *Tag)
- func (*Resource) Descriptor() ([]byte, []int)deprecated
- func (x *Resource) GetContentHash() *ContentHash
- func (x *Resource) GetCost() *Cost
- func (x *Resource) GetMeta() *Meta
- func (x *Resource) GetSpec() *Spec
- func (x *Resource) GetStatus() *Status
- func (x *Resource) GetTags() []*Tag
- func (r *Resource) HasTag() bool
- func (r *Resource) MakeContentHash()
- func (*Resource) ProtoMessage()
- func (x *Resource) ProtoReflect() protoreflect.Message
- func (x *Resource) Reset()
- func (x *Resource) String() string
- type ResourceSet
- func (s *ResourceSet) Add(item *Resource)
- func (*ResourceSet) Descriptor() ([]byte, []int)deprecated
- func (x *ResourceSet) GetItems() []*Resource
- func (x *ResourceSet) GetTotal() int64
- func (*ResourceSet) ProtoMessage()
- func (x *ResourceSet) ProtoReflect() protoreflect.Message
- func (x *ResourceSet) Reset()
- func (x *ResourceSet) String() string
- type SearchRequest
- func (*SearchRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SearchRequest) GetDomain() string
- func (x *SearchRequest) GetEnv() string
- func (x *SearchRequest) GetKeywords() string
- func (x *SearchRequest) GetNamespace() string
- func (x *SearchRequest) GetOwner() string
- func (x *SearchRequest) GetPage() *request.PageRequest
- func (x *SearchRequest) GetStatus() string
- func (x *SearchRequest) GetTag() map[string]string
- func (x *SearchRequest) GetType() TYPE
- func (x *SearchRequest) GetVendor() VENDOR
- func (x *SearchRequest) GetWithTags() bool
- func (*SearchRequest) ProtoMessage()
- func (x *SearchRequest) ProtoReflect() protoreflect.Message
- func (x *SearchRequest) Reset()
- func (x *SearchRequest) String() string
- type Service
- type Spec
- func (*Spec) Descriptor() ([]byte, []int)deprecated
- func (x *Spec) GetBandWidth() int32
- func (x *Spec) GetCategory() string
- func (x *Spec) GetCpu() int32
- func (x *Spec) GetDescription() string
- func (x *Spec) GetExpireAt() int64
- func (x *Spec) GetExtra() map[string]string
- func (x *Spec) GetGpu() int32
- func (x *Spec) GetMemory() int32
- func (x *Spec) GetName() string
- func (x *Spec) GetOwner() string
- func (x *Spec) GetRegion() string
- func (x *Spec) GetResourceType() TYPE
- func (x *Spec) GetStorage() int32
- func (x *Spec) GetType() string
- func (x *Spec) GetUpdateAt() int64
- func (x *Spec) GetVendor() VENDOR
- func (x *Spec) GetZone() string
- func (*Spec) ProtoMessage()
- func (x *Spec) ProtoReflect() protoreflect.Message
- func (x *Spec) Reset()
- func (x *Spec) String() string
- func (c *Spec) TableName() string
- type Status
- func (*Status) Descriptor() ([]byte, []int)deprecated
- func (x *Status) GetDescribe() string
- func (x *Status) GetLockMode() string
- func (x *Status) GetLockReason() string
- func (x *Status) GetPhase() string
- func (x *Status) GetPrivateAddress() []string
- func (x *Status) GetPublicAddress() []string
- func (*Status) ProtoMessage()
- func (x *Status) ProtoReflect() protoreflect.Message
- func (x *Status) Reset()
- func (x *Status) String() string
- func (c *Status) TableName() string
- type TAG_PURPOSE
- func (TAG_PURPOSE) Descriptor() protoreflect.EnumDescriptor
- func (x TAG_PURPOSE) Enum() *TAG_PURPOSE
- func (TAG_PURPOSE) EnumDescriptor() ([]byte, []int)deprecated
- func (x TAG_PURPOSE) Number() protoreflect.EnumNumber
- func (x TAG_PURPOSE) String() string
- func (TAG_PURPOSE) Type() protoreflect.EnumType
- type TYPE
- type Tag
- func (*Tag) Descriptor() ([]byte, []int)deprecated
- func (x *Tag) GetDeleteAt() int64
- func (x *Tag) GetDeleteBy() bool
- func (x *Tag) GetDescription() string
- func (x *Tag) GetExtra() map[string]string
- func (x *Tag) GetHidden() bool
- func (x *Tag) GetKey() string
- func (x *Tag) GetPurpose() TAG_PURPOSE
- func (x *Tag) GetReadOnly() bool
- func (x *Tag) GetUpdateAt() int64
- func (x *Tag) GetUpdateBy() bool
- func (x *Tag) GetValue() string
- func (x *Tag) GetWeight() int64
- func (*Tag) ProtoMessage()
- func (x *Tag) ProtoReflect() protoreflect.Message
- func (x *Tag) Reset()
- func (x *Tag) String() string
- func (c *Tag) TableName() string
- type UnimplementedRPCServer
- type UnsafeRPCServer
- type VENDOR
Constants ¶
const (
AppName = "resources"
)
Variables ¶
var ( TAG_PURPOSE_name = map[int32]string{ 0: "GROUP", 1: "SYSTEM", 2: "MONITOR", 3: "THIRDPARTY", } TAG_PURPOSE_value = map[string]int32{ "GROUP": 0, "SYSTEM": 1, "MONITOR": 2, "THIRDPARTY": 3, } )
Enum value maps for TAG_PURPOSE.
var ( VENDOR_name = map[int32]string{ 0: "ALIYUN", 1: "TENCENT", 2: "HUAWEI", 3: "VSPHERE", 4: "AMAZON", } VENDOR_value = map[string]int32{ "ALIYUN": 0, "TENCENT": 1, "HUAWEI": 2, "VSPHERE": 3, "AMAZON": 4, } )
Enum value maps for VENDOR.
var ( TYPE_name = map[int32]string{ 0: "HOST", 1: "RDS", 2: "REDIS", 3: "BUCKET", 4: "DISK", 5: "LB", 6: "DOMAIN", 7: "EIP", 8: "MONGODB", 199: "OTHER", 200: "BILL", 201: "ORDER", } TYPE_value = map[string]int32{ "HOST": 0, "RDS": 1, "REDIS": 2, "BUCKET": 3, "DISK": 4, "LB": 5, "DOMAIN": 6, "EIP": 7, "MONGODB": 8, "OTHER": 199, "BILL": 200, "ORDER": 201, } )
Enum value maps for TYPE.
var ( PAY_MODE_name = map[int32]string{ 0: "PRE_PAY", 1: "POST_PAY", 2: "RESERVED_PAY", 3: "SPOT_PAY", 9: "NULL", } PAY_MODE_value = map[string]int32{ "PRE_PAY": 0, "POST_PAY": 1, "RESERVED_PAY": 2, "SPOT_PAY": 3, "NULL": 9, } )
Enum value maps for PAY_MODE.
var File_apps_resource_pb_resource_proto protoreflect.FileDescriptor
var File_apps_resource_pb_rpc_proto protoreflect.FileDescriptor
var File_apps_resource_pb_types_proto protoreflect.FileDescriptor
var RPC_ServiceDesc = grpc.ServiceDesc{ ServiceName: "go9.devcloud.cmdb.resource.RPC", HandlerType: (*RPCServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Search", Handler: _RPC_Search_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "apps/resource/pb/rpc.proto", }
RPC_ServiceDesc is the grpc.ServiceDesc for RPC service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterRPCServer ¶
func RegisterRPCServer(s grpc.ServiceRegistrar, srv RPCServer)
Types ¶
type ContentHash ¶
type ContentHash struct { // 规格数据Hash // @gotags: json:"spec_hash" SpecHash string `protobuf:"bytes,1,opt,name=spec_hash,json=specHash,proto3" json:"spec_hash"` // 费用数据Hash // @gotags: json:"cost_hash" CostHash string `protobuf:"bytes,2,opt,name=cost_hash,json=costHash,proto3" json:"cost_hash"` // 状态数据Hash // @gotags: json:"status_hash" StatusHash string `protobuf:"bytes,3,opt,name=status_hash,json=statusHash,proto3" json:"status_hash"` // 标签数据Hash // @gotags: json:"tag_hash" TagHash string `protobuf:"bytes,4,opt,name=tag_hash,json=tagHash,proto3" json:"tag_hash"` // 关系数据Hash // @gotags: json:"relation_hash" RelationHash string `protobuf:"bytes,5,opt,name=relation_hash,json=relationHash,proto3" json:"relation_hash"` // 资源自定义属性Hash // @gotags: json:"custom_hash" CustomHash string `protobuf:"bytes,6,opt,name=custom_hash,json=customHash,proto3" json:"custom_hash"` // contains filtered or unexported fields }
func NewContentHash ¶
func NewContentHash() *ContentHash
func (*ContentHash) Descriptor
deprecated
func (*ContentHash) Descriptor() ([]byte, []int)
Deprecated: Use ContentHash.ProtoReflect.Descriptor instead.
func (*ContentHash) GetCostHash ¶
func (x *ContentHash) GetCostHash() string
func (*ContentHash) GetCustomHash ¶
func (x *ContentHash) GetCustomHash() string
func (*ContentHash) GetRelationHash ¶
func (x *ContentHash) GetRelationHash() string
func (*ContentHash) GetSpecHash ¶
func (x *ContentHash) GetSpecHash() string
func (*ContentHash) GetStatusHash ¶
func (x *ContentHash) GetStatusHash() string
func (*ContentHash) GetTagHash ¶
func (x *ContentHash) GetTagHash() string
func (*ContentHash) ProtoMessage ¶
func (*ContentHash) ProtoMessage()
func (*ContentHash) ProtoReflect ¶
func (x *ContentHash) ProtoReflect() protoreflect.Message
func (*ContentHash) Reset ¶
func (x *ContentHash) Reset()
func (*ContentHash) String ¶
func (x *ContentHash) String() string
type Cost ¶
type Cost struct { // 实例付费方式 // @gotags: json:"pay_mode" PayMode PAY_MODE `protobuf:"varint,1,opt,name=pay_mode,json=payMode,proto3,enum=go9.devcloud.cmdb.resource.PAY_MODE" json:"pay_mode"` // 付费方式详情 // @gotags: json:"pay_mode_detail" PayModeDetail string `protobuf:"bytes,2,opt,name=pay_mode_detail,json=payModeDetail,proto3" json:"pay_mode_detail"` // 官网价,原价(分) // @gotags: json:"sale_price" SalePrice float64 `protobuf:"fixed64,3,opt,name=sale_price,json=salePrice,proto3" json:"sale_price"` // 实际支付金额(分) // @gotags: json:"real_cost" RealCost float64 `protobuf:"fixed64,4,opt,name=real_cost,json=realCost,proto3" json:"real_cost"` // 折扣率 // @gotags: json:"policy" Policy float64 `protobuf:"fixed64,5,opt,name=policy,proto3" json:"policy"` // 单价(分) // @gotags: json:"unit_price" UnitPrice float64 `protobuf:"fixed64,6,opt,name=unit_price,json=unitPrice,proto3" json:"unit_price"` // contains filtered or unexported fields }
资产价格, 包年包月 记录月, 通过同步账单获取
func (*Cost) Descriptor
deprecated
func (*Cost) GetPayMode ¶
func (*Cost) GetPayModeDetail ¶
func (*Cost) GetRealCost ¶
func (*Cost) GetSalePrice ¶
func (*Cost) GetUnitPrice ¶
func (*Cost) ProtoMessage ¶
func (*Cost) ProtoMessage()
func (*Cost) ProtoReflect ¶
func (x *Cost) ProtoReflect() protoreflect.Message
type Meta ¶
type Meta struct { // 全局唯一Id, 直接使用个云商自己的Id // @gotags: json:"id" validate:"required" gorm:"primaryKey" Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" validate:"required" gorm:"primaryKey"` // 资源所属域 // @gotags: json:"domain" validate:"required" Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain" validate:"required"` // 资源所属空间 // @gotags: json:"namespace" validate:"required" Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace" validate:"required"` // 资源所属环境 // @gotags: json:"env" Env string `protobuf:"bytes,4,opt,name=env,proto3" json:"env"` // 创建时间 // @gotags: json:"create_at" CreateAt int64 `protobuf:"varint,5,opt,name=create_at,json=createAt,proto3" json:"create_at"` // 删除时间 // @gotags: json:"delete_at" DeleteAt int64 `protobuf:"varint,6,opt,name=delete_at,json=deleteAt,proto3" json:"delete_at"` // 删除人 // @gotags: json:"delete_by" DeleteBy string `protobuf:"bytes,7,opt,name=delete_by,json=deleteBy,proto3" json:"delete_by"` // 同步时间 // @gotags: json:"sync_at" validate:"required" SyncAt int64 `protobuf:"varint,8,opt,name=sync_at,json=syncAt,proto3" json:"sync_at" validate:"required"` // 同步人 // @gotags: json:"sync_by" SyncBy string `protobuf:"bytes,9,opt,name=sync_by,json=syncBy,proto3" json:"sync_by"` // 用于同步的凭证ID // @gotags: json:"credential_id" CredentialId string `protobuf:"bytes,10,opt,name=credential_id,json=credentialId,proto3" json:"credential_id"` // 序列号 // @gotags: json:"serial_number" SerialNumber string `protobuf:"bytes,11,opt,name=serial_number,json=serialNumber,proto3" json:"serial_number"` // 扩展字段 // @gotags: json:"extra" gorm:"serializer:json" Extra map[string]string `` /* 165-byte string literal not displayed */ // contains filtered or unexported fields }
资源静态数据, 创建后不允许修改
func (*Meta) Descriptor
deprecated
func (*Meta) GetCreateAt ¶
func (*Meta) GetCredentialId ¶
func (*Meta) GetDeleteAt ¶
func (*Meta) GetDeleteBy ¶
func (*Meta) GetNamespace ¶
func (*Meta) GetSerialNumber ¶
func (*Meta) ProtoMessage ¶
func (*Meta) ProtoMessage()
func (*Meta) ProtoReflect ¶
func (x *Meta) ProtoReflect() protoreflect.Message
type PAY_MODE ¶
type PAY_MODE int32
func (PAY_MODE) Descriptor ¶
func (PAY_MODE) Descriptor() protoreflect.EnumDescriptor
func (PAY_MODE) EnumDescriptor
deprecated
func (PAY_MODE) Number ¶
func (x PAY_MODE) Number() protoreflect.EnumNumber
func (PAY_MODE) Type ¶
func (PAY_MODE) Type() protoreflect.EnumType
type RPCClient ¶
type RPCClient interface {
Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*ResourceSet, error)
}
RPCClient is the client API for RPC 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 NewRPCClient ¶
func NewRPCClient(cc grpc.ClientConnInterface) RPCClient
type RPCServer ¶
type RPCServer interface { Search(context.Context, *SearchRequest) (*ResourceSet, error) // contains filtered or unexported methods }
RPCServer is the server API for RPC service. All implementations must embed UnimplementedRPCServer for forward compatibility
type Resource ¶
type Resource struct { // 资源元数据信息 // @gotags: json:"meta" Meta *Meta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta"` // 资源规格信息 // @gotags: json:"spec" Spec *Spec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec"` // 资源费用 // @gotags: json:"cost" Cost *Cost `protobuf:"bytes,3,opt,name=cost,proto3" json:"cost"` // 资源状态 // @gotags: json:"status" Status *Status `protobuf:"bytes,4,opt,name=status,proto3" json:"status"` // 资源标签 // @gotags: json:"tags" Tags []*Tag `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags"` // 关联资源 // @gotags: json:"related_resources" // repeated Resource related_resources = 6; // 资源内容的hash,用来控制那些需要更新 // @gotags: json:"content_hash,omitempty" ContentHash *ContentHash `protobuf:"bytes,10,opt,name=content_hash,json=contentHash,proto3" json:"related_resources"` // contains filtered or unexported fields }
func NewResource ¶
func NewResource() *Resource
func (*Resource) Descriptor
deprecated
func (*Resource) GetContentHash ¶
func (x *Resource) GetContentHash() *ContentHash
func (*Resource) MakeContentHash ¶
func (r *Resource) MakeContentHash()
func (*Resource) ProtoMessage ¶
func (*Resource) ProtoMessage()
func (*Resource) ProtoReflect ¶
func (x *Resource) ProtoReflect() protoreflect.Message
type ResourceSet ¶
type ResourceSet struct { // @gotags: json:"total" Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"` // @gotags: json:"items" Items []*Resource `protobuf:"bytes,2,rep,name=items,proto3" json:"items"` // contains filtered or unexported fields }
func NewResourceSet ¶
func NewResourceSet() *ResourceSet
func (*ResourceSet) Add ¶
func (s *ResourceSet) Add(item *Resource)
func (*ResourceSet) Descriptor
deprecated
func (*ResourceSet) Descriptor() ([]byte, []int)
Deprecated: Use ResourceSet.ProtoReflect.Descriptor instead.
func (*ResourceSet) GetItems ¶
func (x *ResourceSet) GetItems() []*Resource
func (*ResourceSet) GetTotal ¶
func (x *ResourceSet) GetTotal() int64
func (*ResourceSet) ProtoMessage ¶
func (*ResourceSet) ProtoMessage()
func (*ResourceSet) ProtoReflect ¶
func (x *ResourceSet) ProtoReflect() protoreflect.Message
func (*ResourceSet) Reset ¶
func (x *ResourceSet) Reset()
func (*ResourceSet) String ¶
func (x *ResourceSet) String() string
type SearchRequest ¶
type SearchRequest struct { // 分页参数 // @gotags: json:"page" Page *request.PageRequest `protobuf:"bytes,1,opt,name=page,proto3" json:"page"` // 资源所属域 // @gotags: json:"domain" Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain"` // 资源所属空间 // @gotags: json:"namespace" Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace"` // 资源所属环境 // @gotags: json:"env" Env string `protobuf:"bytes,4,opt,name=env,proto3" json:"env"` // 厂商 // @gotags: json:"vendor" Vendor *VENDOR `protobuf:"varint,6,opt,name=vendor,proto3,enum=go9.devcloud.cmdb.resource.VENDOR,oneof" json:"vendor"` // 资源所属账号 // @gotags: json:"owner" Owner string `protobuf:"bytes,7,opt,name=owner,proto3" json:"owner"` // 资源类型 // @gotags: json:"type" Type *TYPE `protobuf:"varint,8,opt,name=type,proto3,enum=go9.devcloud.cmdb.resource.TYPE,oneof" json:"type"` // 服务商中的状态 // @gotags: json:"status" Status string `protobuf:"bytes,9,opt,name=status,proto3" json:"status"` // 根据服务Tag过滤 // @gotags: json:"tag" Tag map[string]string `` /* 138-byte string literal not displayed */ // 是否返回资源的标签 // @gotags: json:"with_tags" WithTags bool `protobuf:"varint,11,opt,name=with_tags,json=withTags,proto3" json:"with_tags"` // 关键字参数 // @gotags: json:"keywords" Keywords string `protobuf:"bytes,14,opt,name=keywords,proto3" json:"keywords"` // contains filtered or unexported fields }
func NewSearchRequest ¶
func NewSearchRequest() *SearchRequest
func (*SearchRequest) Descriptor
deprecated
func (*SearchRequest) Descriptor() ([]byte, []int)
Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.
func (*SearchRequest) GetDomain ¶
func (x *SearchRequest) GetDomain() string
func (*SearchRequest) GetEnv ¶
func (x *SearchRequest) GetEnv() string
func (*SearchRequest) GetKeywords ¶
func (x *SearchRequest) GetKeywords() string
func (*SearchRequest) GetNamespace ¶
func (x *SearchRequest) GetNamespace() string
func (*SearchRequest) GetOwner ¶
func (x *SearchRequest) GetOwner() string
func (*SearchRequest) GetPage ¶
func (x *SearchRequest) GetPage() *request.PageRequest
func (*SearchRequest) GetStatus ¶
func (x *SearchRequest) GetStatus() string
func (*SearchRequest) GetTag ¶
func (x *SearchRequest) GetTag() map[string]string
func (*SearchRequest) GetType ¶
func (x *SearchRequest) GetType() TYPE
func (*SearchRequest) GetVendor ¶
func (x *SearchRequest) GetVendor() VENDOR
func (*SearchRequest) GetWithTags ¶
func (x *SearchRequest) GetWithTags() bool
func (*SearchRequest) ProtoMessage ¶
func (*SearchRequest) ProtoMessage()
func (*SearchRequest) ProtoReflect ¶
func (x *SearchRequest) ProtoReflect() protoreflect.Message
func (*SearchRequest) Reset ¶
func (x *SearchRequest) Reset()
func (*SearchRequest) String ¶
func (x *SearchRequest) String() string
type Spec ¶
type Spec struct { // 厂商 // @gotags: json:"vendor" Vendor VENDOR `protobuf:"varint,1,opt,name=vendor,proto3,enum=go9.devcloud.cmdb.resource.VENDOR" json:"vendor"` // 资源类型 // @gotags: json:"resource_type" ResourceType TYPE `protobuf:"varint,2,opt,name=resource_type,json=resourceType,proto3,enum=go9.devcloud.cmdb.resource.TYPE" json:"resource_type"` // 地域 // @gotags: json:"region" Region string `protobuf:"bytes,3,opt,name=region,proto3" json:"region"` // 区域 // @gotags: json:"zone" Zone string `protobuf:"bytes,4,opt,name=zone,proto3" json:"zone"` // 资源所属账号 // @gotags: json:"owner" Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner"` // 名称 // @gotags: json:"name" Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name"` // 种类 // @gotags: json:"category" Category string `protobuf:"bytes,7,opt,name=category,proto3" json:"category"` // 规格 // @gotags: json:"type" Type string `protobuf:"bytes,8,opt,name=type,proto3" json:"type"` // 描述 // @gotags: json:"description" Description string `protobuf:"bytes,9,opt,name=description,proto3" json:"description"` // 过期时间 // @gotags: json:"expire_at" ExpireAt int64 `protobuf:"varint,10,opt,name=expire_at,json=expireAt,proto3" json:"expire_at"` // 更新时间 // @gotags: json:"update_at" UpdateAt int64 `protobuf:"varint,11,opt,name=update_at,json=updateAt,proto3" json:"update_at"` // 资源占用Cpu数量 // @gotags: json:"cpu" Cpu int32 `protobuf:"varint,15,opt,name=cpu,proto3" json:"cpu"` // GPU数量 // @gotags: json:"gpu" Gpu int32 `protobuf:"varint,16,opt,name=gpu,proto3" json:"gpu"` // 资源使用的内存, 单位M // @gotags: json:"memory" Memory int32 `protobuf:"varint,17,opt,name=memory,proto3" json:"memory"` // 资源使用的存储 // @gotags: json:"storage" Storage int32 `protobuf:"varint,18,opt,name=storage,proto3" json:"storage"` // 公网IP带宽, 单位M // @gotags: json:"band_width" BandWidth int32 `protobuf:"varint,19,opt,name=band_width,json=bandWidth,proto3" json:"band_width"` // 额外的通用属性 // @gotags: json:"extra" gorm:"serializer:json" Extra map[string]string `` /* 165-byte string literal not displayed */ // contains filtered or unexported fields }
通用属性: 动态属性, 用于定义资源, 比如资源申请的时候需要填写
func (*Spec) Descriptor
deprecated
func (*Spec) GetBandWidth ¶
func (*Spec) GetCategory ¶
func (*Spec) GetDescription ¶
func (*Spec) GetExpireAt ¶
func (*Spec) GetResourceType ¶
func (*Spec) GetStorage ¶
func (*Spec) GetUpdateAt ¶
func (*Spec) ProtoMessage ¶
func (*Spec) ProtoMessage()
func (*Spec) ProtoReflect ¶
func (x *Spec) ProtoReflect() protoreflect.Message
type Status ¶
type Status struct { // 资源当前状态 // @gotags: json:"phase" Phase string `protobuf:"bytes,1,opt,name=phase,proto3" json:"phase"` // 资源当前状态描述 // @gotags: json:"describe" Describe string `protobuf:"bytes,2,opt,name=describe,proto3" json:"describe"` // 实例锁定模式; Unlock:正常;ManualLock:手动触发锁定;LockByExpiration:实例过期自动锁定;LockByRestoration:实例回滚前的自动锁定;LockByDiskQuota:实例空间满自动锁定 // @gotags: json:"lock_mode" LockMode string `protobuf:"bytes,3,opt,name=lock_mode,json=lockMode,proto3" json:"lock_mode"` // 锁定原因 // @gotags: json:"lock_reason" LockReason string `protobuf:"bytes,4,opt,name=lock_reason,json=lockReason,proto3" json:"lock_reason"` // 资源访问地址 ["10.10.10.10"] // 公网地址, 或者域名 // @gotags: json:"public_address" gorm:"serializer:json" PublicAddress []string `protobuf:"bytes,5,rep,name=public_address,json=publicAddress,proto3" json:"public_address" gorm:"serializer:json"` // 内网地址, 或者域名 // @gotags: json:"private_address" gorm:"serializer:json" PrivateAddress []string `protobuf:"bytes,6,rep,name=private_address,json=privateAddress,proto3" json:"private_address" gorm:"serializer:json"` // contains filtered or unexported fields }
资源当前状态
func (*Status) Descriptor
deprecated
func (*Status) GetDescribe ¶
func (*Status) GetLockMode ¶
func (*Status) GetLockReason ¶
func (*Status) GetPrivateAddress ¶
func (*Status) GetPublicAddress ¶
func (*Status) ProtoMessage ¶
func (*Status) ProtoMessage()
func (*Status) ProtoReflect ¶
func (x *Status) ProtoReflect() protoreflect.Message
type TAG_PURPOSE ¶
type TAG_PURPOSE int32
标签用途
const ( // 用于资源分组 TAG_PURPOSE_GROUP TAG_PURPOSE = 0 // 系统使用标签, 表示被其他系统引用, 比如应用关联标签 TAG_PURPOSE_SYSTEM TAG_PURPOSE = 1 // 用于资源监控 TAG_PURPOSE_MONITOR TAG_PURPOSE = 2 // 来自第三方的标签, 比如同步时的第三方提供的标签 TAG_PURPOSE_THIRDPARTY TAG_PURPOSE = 3 )
func (TAG_PURPOSE) Descriptor ¶
func (TAG_PURPOSE) Descriptor() protoreflect.EnumDescriptor
func (TAG_PURPOSE) Enum ¶
func (x TAG_PURPOSE) Enum() *TAG_PURPOSE
func (TAG_PURPOSE) EnumDescriptor
deprecated
func (TAG_PURPOSE) EnumDescriptor() ([]byte, []int)
Deprecated: Use TAG_PURPOSE.Descriptor instead.
func (TAG_PURPOSE) Number ¶
func (x TAG_PURPOSE) Number() protoreflect.EnumNumber
func (TAG_PURPOSE) String ¶
func (x TAG_PURPOSE) String() string
func (TAG_PURPOSE) Type ¶
func (TAG_PURPOSE) Type() protoreflect.EnumType
type TYPE ¶
type TYPE int32
func (TYPE) Descriptor ¶
func (TYPE) Descriptor() protoreflect.EnumDescriptor
func (TYPE) EnumDescriptor
deprecated
func (TYPE) Number ¶
func (x TYPE) Number() protoreflect.EnumNumber
func (TYPE) Type ¶
func (TYPE) Type() protoreflect.EnumType
type Tag ¶
type Tag struct { // 标签的类型 // @gotags: json:"purpose" Purpose TAG_PURPOSE `protobuf:"varint,1,opt,name=purpose,proto3,enum=go9.devcloud.cmdb.resource.TAG_PURPOSE" json:"purpose"` // 标签的Key // @gotags: json:"key" gorm:"column:t_key" validate:"lte=255,required" Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key" gorm:"column:t_key" validate:"lte=255,required"` // 标签的值, app01 // @gotags: json:"value" gorm:"column:t_value" validate:"lte=255,required" Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value" gorm:"column:t_value" validate:"lte=255,required"` // 标签的值的描述, 通常用于展示, 应用01 // @gotags: json:"description" Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description"` // 标签权重, 针对同一个key, 多个value场景, 默认值1 // @gotags: json:"weight" Weight int64 `protobuf:"varint,5,opt,name=weight,proto3" json:"weight"` // 是否是只读标签 // @gotags: json:"read_only" ReadOnly bool `protobuf:"varint,6,opt,name=read_only,json=readOnly,proto3" json:"read_only"` // 标签是否隐藏, 用于控制是否在前端展示 // @gotags: json:"hidden" Hidden bool `protobuf:"varint,7,opt,name=hidden,proto3" json:"hidden"` // 标签删除时间 // @gotags: json:"delete_at" DeleteAt int64 `protobuf:"varint,8,opt,name=delete_at,json=deleteAt,proto3" json:"delete_at"` // 标签删除人 // @gotags: json:"delete_by" DeleteBy bool `protobuf:"varint,9,opt,name=delete_by,json=deleteBy,proto3" json:"delete_by"` // 标签更新时间 // @gotags: json:"update_at" UpdateAt int64 `protobuf:"varint,10,opt,name=update_at,json=updateAt,proto3" json:"update_at"` // 标签更新人 // @gotags: json:"update_by" UpdateBy bool `protobuf:"varint,11,opt,name=update_by,json=updateBy,proto3" json:"update_by"` // 标签extra信息, 比如前端需要设置标签的颜色,gorm:"serializer:json" // 默认 gorm 无法存入Json到数据库的某个字段, meta: {"a":1, "b":2} // @gotags: json:"extra" gorm:"serializer:json" Extra map[string]string `` /* 165-byte string literal not displayed */ // contains filtered or unexported fields }
func NewKVTag ¶
func NewKVTag(p TAG_PURPOSE, key, value string) *Tag
func (*Tag) Descriptor
deprecated
func (*Tag) GetDeleteAt ¶
func (*Tag) GetDeleteBy ¶
func (*Tag) GetDescription ¶
func (*Tag) GetPurpose ¶
func (x *Tag) GetPurpose() TAG_PURPOSE
func (*Tag) GetReadOnly ¶
func (*Tag) GetUpdateAt ¶
func (*Tag) GetUpdateBy ¶
func (*Tag) ProtoMessage ¶
func (*Tag) ProtoMessage()
func (*Tag) ProtoReflect ¶
func (x *Tag) ProtoReflect() protoreflect.Message
type UnimplementedRPCServer ¶
type UnimplementedRPCServer struct { }
UnimplementedRPCServer must be embedded to have forward compatible implementations.
func (UnimplementedRPCServer) Search ¶
func (UnimplementedRPCServer) Search(context.Context, *SearchRequest) (*ResourceSet, error)
type UnsafeRPCServer ¶
type UnsafeRPCServer interface {
// contains filtered or unexported methods
}
UnsafeRPCServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RPCServer will result in compilation errors.
type VENDOR ¶
type VENDOR int32
func (VENDOR) Descriptor ¶
func (VENDOR) Descriptor() protoreflect.EnumDescriptor
func (VENDOR) EnumDescriptor
deprecated
func (VENDOR) Number ¶
func (x VENDOR) Number() protoreflect.EnumNumber
func (VENDOR) Type ¶
func (VENDOR) Type() protoreflect.EnumType