diff --git a/Makefile b/Makefile index 95f48a6284a..89dbc0ad130 100644 --- a/Makefile +++ b/Makefile @@ -379,7 +379,7 @@ protobuf: ## Compile protobuf definitions # buf generate pkg/plugins/backendplugin/pluginextensionv2 --template pkg/plugins/backendplugin/pluginextensionv2/buf.gen.yaml # buf generate pkg/plugins/backendplugin/secretsmanagerplugin --template pkg/plugins/backendplugin/secretsmanagerplugin/buf.gen.yaml # buf generate pkg/services/store/entity --template pkg/services/store/entity/buf.gen.yaml - buf generate pkg/storage/api --template pkg/storage/api/buf.gen.yaml + buf generate pkg/storage/unified --template pkg/storage/unified/buf.gen.yaml .PHONY: clean clean: ## Clean up intermediate build artifacts. diff --git a/go.work b/go.work index c45ca2146fb..bc3f2fe8192 100644 --- a/go.work +++ b/go.work @@ -6,7 +6,7 @@ use ( ./pkg/apiserver ./pkg/build/wire ./pkg/promlib - ./pkg/storage/api + ./pkg/storage/unified ./pkg/util/xorm ) diff --git a/pkg/services/store/resource/buf.gen.yaml b/pkg/services/store/resource/buf.gen.yaml deleted file mode 100644 index 8d4748d3a2f..00000000000 --- a/pkg/services/store/resource/buf.gen.yaml +++ /dev/null @@ -1,10 +0,0 @@ -version: v1 -plugins: - - plugin: go - out: pkg/services/store/resource - opt: paths=source_relative - - plugin: go-grpc - out: pkg/services/store/resource - opt: - - paths=source_relative - - require_unimplemented_servers=false diff --git a/pkg/services/store/resource/event.go b/pkg/services/store/resource/event.go deleted file mode 100644 index 06e2d95afb4..00000000000 --- a/pkg/services/store/resource/event.go +++ /dev/null @@ -1,219 +0,0 @@ -package resource - -import ( - "context" - "encoding/json" - "fmt" - "net/http" - "sync/atomic" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/grafana/grafana/pkg/apimachinery/utils" - "github.com/grafana/grafana/pkg/infra/appcontext" - "github.com/grafana/grafana/pkg/services/auth/identity" -) - -type WriteEvent struct { - EventID int64 - Key *Key // the request key - Requester identity.Requester - Operation ResourceOperation - PreviousRV int64 // only for Update+Delete - Value []byte - - Object utils.GrafanaMetaAccessor - OldObject utils.GrafanaMetaAccessor - - // Change metadata - FolderChanged bool - - // The status will be populated for any error - Status *StatusResult - Error error -} - -func (e *WriteEvent) BadRequest(err error, message string, a ...any) *WriteEvent { - e.Error = err - e.Status = &StatusResult{ - Status: "Failure", - Message: fmt.Sprintf(message, a...), - Code: http.StatusBadRequest, - } - return e -} - -// Verify that all required fields are set, and the user has permission to set the common metadata fields -type EventValidator interface { - PrepareCreate(ctx context.Context, req *CreateRequest) (*WriteEvent, error) - PrepareUpdate(ctx context.Context, req *UpdateRequest, current []byte) (*WriteEvent, error) -} - -type EventValidatorOptions struct { - // Get the next EventID - NextEventID func() int64 - - // Check if a user has access to write folders - // When this is nil, no resources can have folders configured - FolderAccess func(ctx context.Context, user identity.Requester, uid string) bool - - // When configured, this will make sure a user is allowed to save to a given origin - OriginAccess func(ctx context.Context, user identity.Requester, origin string) bool -} - -type eventValidator struct { - opts EventValidatorOptions -} - -func NewEventValidator(opts EventValidatorOptions) EventValidator { - if opts.NextEventID == nil { - counter := atomic.Int64{} - opts.NextEventID = func() int64 { - return counter.Add(1) - } - } - return &eventValidator{opts} -} - -type dummyObject struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` -} - -var _ EventValidator = &eventValidator{} - -func (v *eventValidator) newEvent(ctx context.Context, key *Key, value, oldValue []byte) *WriteEvent { - var err error - event := &WriteEvent{ - EventID: v.opts.NextEventID(), - Key: key, - Value: value, - } - event.Requester, err = appcontext.User(ctx) - if err != nil { - return event.BadRequest(err, "unable to get user") - } - - dummy := &dummyObject{} - err = json.Unmarshal(value, dummy) - if err != nil { - return event.BadRequest(err, "error reading json") - } - - obj, err := utils.MetaAccessor(dummy) - if err != nil { - return event.BadRequest(err, "invalid object in json") - } - if obj.GetUID() == "" { - return event.BadRequest(nil, "the UID must be set") - } - if obj.GetGenerateName() != "" { - return event.BadRequest(nil, "can not save value with generate name") - } - if obj.GetKind() == "" { - return event.BadRequest(nil, "expecting resources with a kind in the body") - } - if obj.GetName() != key.Name { - return event.BadRequest(nil, "key name does not match the name in the body") - } - if obj.GetNamespace() != key.Namespace { - return event.BadRequest(nil, "key namespace does not match the namespace in the body") - } - folder := obj.GetFolder() - if folder != "" { - if v.opts.FolderAccess == nil { - return event.BadRequest(err, "folders are not supported") - } else if !v.opts.FolderAccess(ctx, event.Requester, folder) { - return event.BadRequest(err, "unable to add resource to folder") // 403? - } - } - origin, err := obj.GetOriginInfo() - if err != nil { - return event.BadRequest(err, "invalid origin info") - } - if origin != nil && v.opts.OriginAccess != nil { - if !v.opts.OriginAccess(ctx, event.Requester, origin.Name) { - return event.BadRequest(err, "not allowed to write resource to origin (%s)", origin.Name) - } - } - event.Object = obj - - // This is an update - if oldValue != nil { - dummy := &dummyObject{} - err = json.Unmarshal(oldValue, dummy) - if err != nil { - return event.BadRequest(err, "error reading old json value") - } - old, err := utils.MetaAccessor(dummy) - if err != nil { - return event.BadRequest(err, "invalid object inside old json") - } - if key.Name != old.GetName() { - return event.BadRequest(err, "the old value has a different name (%s != %s)", key.Name, old.GetName()) - } - - // Can not change creation timestamps+user - if obj.GetCreatedBy() != old.GetCreatedBy() { - return event.BadRequest(err, "can not change the created by metadata (%s != %s)", obj.GetCreatedBy(), old.GetCreatedBy()) - } - if obj.GetCreationTimestamp() != old.GetCreationTimestamp() { - return event.BadRequest(err, "can not change the CreationTimestamp metadata (%v != %v)", obj.GetCreationTimestamp(), old.GetCreationTimestamp()) - } - - oldFolder := obj.GetFolder() - if oldFolder != folder { - event.FolderChanged = true - } - event.OldObject = old - } else if folder != "" { - event.FolderChanged = true - } - return event -} - -func (v *eventValidator) PrepareCreate(ctx context.Context, req *CreateRequest) (*WriteEvent, error) { - event := v.newEvent(ctx, req.Key, req.Value, nil) - event.Operation = ResourceOperation_CREATED - if event.Status != nil { - return event, nil - } - - // Make sure the created by user is accurate - //---------------------------------------- - val := event.Object.GetCreatedBy() - if val != "" && val != event.Requester.GetUID().String() { - return event.BadRequest(nil, "created by annotation does not match: metadata.annotations#"+utils.AnnoKeyCreatedBy), nil - } - - // Create can not have updated properties - //---------------------------------------- - if event.Object.GetUpdatedBy() != "" { - return event.BadRequest(nil, "unexpected metadata.annotations#"+utils.AnnoKeyCreatedBy), nil - } - ts, err := event.Object.GetUpdatedTimestamp() - if err != nil { - return event.BadRequest(nil, fmt.Sprintf("invalid timestamp: %s", err)), nil - } - if ts != nil { - return event.BadRequest(nil, "unexpected metadata.annotations#"+utils.AnnoKeyUpdatedTimestamp), nil - } - return event, nil -} - -func (v *eventValidator) PrepareUpdate(ctx context.Context, req *UpdateRequest, current []byte) (*WriteEvent, error) { - event := v.newEvent(ctx, req.Key, req.Value, current) - event.Operation = ResourceOperation_UPDATED - if event.Status != nil { - return event, nil - } - - // Make sure the update user is accurate - //---------------------------------------- - val := event.Object.GetUpdatedBy() - if val != "" && val != event.Requester.GetUID().String() { - return event.BadRequest(nil, "created by annotation does not match: metadata.annotations#"+utils.AnnoKeyUpdatedBy), nil - } - - return event, nil -} diff --git a/pkg/services/store/resource/resource.go b/pkg/services/store/resource/resource.go deleted file mode 100644 index af7ceec53c0..00000000000 --- a/pkg/services/store/resource/resource.go +++ /dev/null @@ -1,50 +0,0 @@ -package resource - -import ( - "bytes" - "fmt" -) - -// NamespacedPath is a path that can be used to isolate tenant data -// NOTE: this strategy does not allow quickly searching across namespace boundaries with a prefix -func (x *Key) NamespacedPath() string { - var buffer bytes.Buffer - if x.Namespace == "" { - buffer.WriteString("__cluster__") - } else { - buffer.WriteString(x.Namespace) - } - if x.Group == "" { - return buffer.String() - } - buffer.WriteString("/") - buffer.WriteString(x.Group) - - if x.Resource == "" { - return buffer.String() - } - buffer.WriteString("/") - buffer.WriteString(x.Resource) - - if x.Name == "" { - return buffer.String() - } - buffer.WriteString("/") - buffer.WriteString(x.Name) - - if x.ResourceVersion > 0 { - buffer.WriteString("/") - buffer.WriteString(fmt.Sprintf("%.20d", x.ResourceVersion)) - } - return buffer.String() -} - -// Return a copy without the resource version -func (x *Key) WithoutResourceVersion() *Key { - return &Key{ - Namespace: x.Namespace, - Group: x.Group, - Resource: x.Resource, - Name: x.Name, - } -} diff --git a/pkg/services/store/resource/resource.pb.go b/pkg/services/store/resource/resource.pb.go deleted file mode 100644 index c308bca453b..00000000000 --- a/pkg/services/store/resource/resource.pb.go +++ /dev/null @@ -1,3052 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc (unknown) -// source: resource.proto - -package resource - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ResourceOperation int32 - -const ( - ResourceOperation_UNKNOWN ResourceOperation = 0 - ResourceOperation_CREATED ResourceOperation = 1 - ResourceOperation_UPDATED ResourceOperation = 2 - ResourceOperation_DELETED ResourceOperation = 3 - ResourceOperation_BOOKMARK ResourceOperation = 4 -) - -// Enum value maps for ResourceOperation. -var ( - ResourceOperation_name = map[int32]string{ - 0: "UNKNOWN", - 1: "CREATED", - 2: "UPDATED", - 3: "DELETED", - 4: "BOOKMARK", - } - ResourceOperation_value = map[string]int32{ - "UNKNOWN": 0, - "CREATED": 1, - "UPDATED": 2, - "DELETED": 3, - "BOOKMARK": 4, - } -) - -func (x ResourceOperation) Enum() *ResourceOperation { - p := new(ResourceOperation) - *p = x - return p -} - -func (x ResourceOperation) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ResourceOperation) Descriptor() protoreflect.EnumDescriptor { - return file_resource_proto_enumTypes[0].Descriptor() -} - -func (ResourceOperation) Type() protoreflect.EnumType { - return &file_resource_proto_enumTypes[0] -} - -func (x ResourceOperation) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ResourceOperation.Descriptor instead. -func (ResourceOperation) EnumDescriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{0} -} - -type Sort_Order int32 - -const ( - Sort_ASC Sort_Order = 0 - Sort_DESC Sort_Order = 1 -) - -// Enum value maps for Sort_Order. -var ( - Sort_Order_name = map[int32]string{ - 0: "ASC", - 1: "DESC", - } - Sort_Order_value = map[string]int32{ - "ASC": 0, - "DESC": 1, - } -) - -func (x Sort_Order) Enum() *Sort_Order { - p := new(Sort_Order) - *p = x - return p -} - -func (x Sort_Order) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Sort_Order) Descriptor() protoreflect.EnumDescriptor { - return file_resource_proto_enumTypes[1].Descriptor() -} - -func (Sort_Order) Type() protoreflect.EnumType { - return &file_resource_proto_enumTypes[1] -} - -func (x Sort_Order) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Sort_Order.Descriptor instead. -func (Sort_Order) EnumDescriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{17, 0} -} - -type HealthCheckResponse_ServingStatus int32 - -const ( - HealthCheckResponse_UNKNOWN HealthCheckResponse_ServingStatus = 0 - HealthCheckResponse_SERVING HealthCheckResponse_ServingStatus = 1 - HealthCheckResponse_NOT_SERVING HealthCheckResponse_ServingStatus = 2 - HealthCheckResponse_SERVICE_UNKNOWN HealthCheckResponse_ServingStatus = 3 // Used only by the Watch method. -) - -// Enum value maps for HealthCheckResponse_ServingStatus. -var ( - HealthCheckResponse_ServingStatus_name = map[int32]string{ - 0: "UNKNOWN", - 1: "SERVING", - 2: "NOT_SERVING", - 3: "SERVICE_UNKNOWN", - } - HealthCheckResponse_ServingStatus_value = map[string]int32{ - "UNKNOWN": 0, - "SERVING": 1, - "NOT_SERVING": 2, - "SERVICE_UNKNOWN": 3, - } -) - -func (x HealthCheckResponse_ServingStatus) Enum() *HealthCheckResponse_ServingStatus { - p := new(HealthCheckResponse_ServingStatus) - *p = x - return p -} - -func (x HealthCheckResponse_ServingStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (HealthCheckResponse_ServingStatus) Descriptor() protoreflect.EnumDescriptor { - return file_resource_proto_enumTypes[2].Descriptor() -} - -func (HealthCheckResponse_ServingStatus) Type() protoreflect.EnumType { - return &file_resource_proto_enumTypes[2] -} - -func (x HealthCheckResponse_ServingStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use HealthCheckResponse_ServingStatus.Descriptor instead. -func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{29, 0} -} - -type Key struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Namespace (tenant) - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - // Resource Group - Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` - // The resource type - Resource string `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` - // Resource identifier (unique within namespace+group+resource) - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - // The resource version - ResourceVersion int64 `protobuf:"varint,5,opt,name=resource_version,json=resourceVersion,proto3" json:"resource_version,omitempty"` -} - -func (x *Key) Reset() { - *x = Key{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Key) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Key) ProtoMessage() {} - -func (x *Key) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Key.ProtoReflect.Descriptor instead. -func (*Key) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{0} -} - -func (x *Key) GetNamespace() string { - if x != nil { - return x.Namespace - } - return "" -} - -func (x *Key) GetGroup() string { - if x != nil { - return x.Group - } - return "" -} - -func (x *Key) GetResource() string { - if x != nil { - return x.Resource - } - return "" -} - -func (x *Key) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Key) GetResourceVersion() int64 { - if x != nil { - return x.ResourceVersion - } - return 0 -} - -type ResourceWrapper struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The resource version - ResourceVersion int64 `protobuf:"varint,1,opt,name=resource_version,json=resourceVersion,proto3" json:"resource_version,omitempty"` - // Full kubernetes json bytes (although the resource version may not be accurate) - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - // Operation - Operation ResourceOperation `protobuf:"varint,3,opt,name=operation,proto3,enum=resource.ResourceOperation" json:"operation,omitempty"` - // The resource has an attached blob - HasBlob bool `protobuf:"varint,4,opt,name=has_blob,json=hasBlob,proto3" json:"has_blob,omitempty"` -} - -func (x *ResourceWrapper) Reset() { - *x = ResourceWrapper{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResourceWrapper) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResourceWrapper) ProtoMessage() {} - -func (x *ResourceWrapper) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResourceWrapper.ProtoReflect.Descriptor instead. -func (*ResourceWrapper) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{1} -} - -func (x *ResourceWrapper) GetResourceVersion() int64 { - if x != nil { - return x.ResourceVersion - } - return 0 -} - -func (x *ResourceWrapper) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -func (x *ResourceWrapper) GetOperation() ResourceOperation { - if x != nil { - return x.Operation - } - return ResourceOperation_UNKNOWN -} - -func (x *ResourceWrapper) GetHasBlob() bool { - if x != nil { - return x.HasBlob - } - return false -} - -// The history and trash commands need access to commit messages -type ResourceMeta struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The resource version - ResourceVersion int64 `protobuf:"varint,1,opt,name=resource_version,json=resourceVersion,proto3" json:"resource_version,omitempty"` - // The optional commit message - Operation ResourceOperation `protobuf:"varint,2,opt,name=operation,proto3,enum=resource.ResourceOperation" json:"operation,omitempty"` - // Size of the full resource body - Size int32 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` - // Hash for the resource - Hash string `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` - // The optional commit message - Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` - // The kubernetes metadata section (not the full resource) - // https://github.com/kubernetes/kubernetes/blob/v1.30.1/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/types.go#L111 - ObjectMeta []byte `protobuf:"bytes,6,opt,name=object_meta,json=objectMeta,proto3" json:"object_meta,omitempty"` - // The resource has an attached blob - HasBlob bool `protobuf:"varint,7,opt,name=has_blob,json=hasBlob,proto3" json:"has_blob,omitempty"` -} - -func (x *ResourceMeta) Reset() { - *x = ResourceMeta{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResourceMeta) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResourceMeta) ProtoMessage() {} - -func (x *ResourceMeta) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResourceMeta.ProtoReflect.Descriptor instead. -func (*ResourceMeta) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{2} -} - -func (x *ResourceMeta) GetResourceVersion() int64 { - if x != nil { - return x.ResourceVersion - } - return 0 -} - -func (x *ResourceMeta) GetOperation() ResourceOperation { - if x != nil { - return x.Operation - } - return ResourceOperation_UNKNOWN -} - -func (x *ResourceMeta) GetSize() int32 { - if x != nil { - return x.Size - } - return 0 -} - -func (x *ResourceMeta) GetHash() string { - if x != nil { - return x.Hash - } - return "" -} - -func (x *ResourceMeta) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -func (x *ResourceMeta) GetObjectMeta() []byte { - if x != nil { - return x.ObjectMeta - } - return nil -} - -func (x *ResourceMeta) GetHasBlob() bool { - if x != nil { - return x.HasBlob - } - return false -} - -// Basic blob metadata -type BlobInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Content Length - Size int64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` - // MD5 digest of the body - ETag string `protobuf:"bytes,2,opt,name=ETag,proto3" json:"ETag,omitempty"` - // Content type header - ContentType string `protobuf:"bytes,3,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` -} - -func (x *BlobInfo) Reset() { - *x = BlobInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BlobInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BlobInfo) ProtoMessage() {} - -func (x *BlobInfo) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BlobInfo.ProtoReflect.Descriptor instead. -func (*BlobInfo) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{3} -} - -func (x *BlobInfo) GetSize() int64 { - if x != nil { - return x.Size - } - return 0 -} - -func (x *BlobInfo) GetETag() string { - if x != nil { - return x.ETag - } - return "" -} - -func (x *BlobInfo) GetContentType() string { - if x != nil { - return x.ContentType - } - return "" -} - -// Status structure is copied from: -// https://github.com/kubernetes/apimachinery/blob/v0.30.1/pkg/apis/meta/v1/generated.proto#L979 -type StatusResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Status of the operation. - // One of: "Success" or "Failure". - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - // A human-readable description of the status of this operation. - // +optional - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - // A machine-readable description of why this operation is in the - // "Failure" status. If this value is empty there - // is no information available. A Reason clarifies an HTTP status - // code but does not override it. - // +optional - Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"` - // Suggested HTTP return code for this status, 0 if not set. - // +optional - Code int32 `protobuf:"varint,4,opt,name=code,proto3" json:"code,omitempty"` -} - -func (x *StatusResult) Reset() { - *x = StatusResult{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StatusResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StatusResult) ProtoMessage() {} - -func (x *StatusResult) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StatusResult.ProtoReflect.Descriptor instead. -func (*StatusResult) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{4} -} - -func (x *StatusResult) GetStatus() string { - if x != nil { - return x.Status - } - return "" -} - -func (x *StatusResult) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -func (x *StatusResult) GetReason() string { - if x != nil { - return x.Reason - } - return "" -} - -func (x *StatusResult) GetCode() int32 { - if x != nil { - return x.Code - } - return 0 -} - -// TODO? support PresignedUrls for upload? -type CreateBlob struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Content type header - ContentType string `protobuf:"bytes,1,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` - // Raw value to write - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *CreateBlob) Reset() { - *x = CreateBlob{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateBlob) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateBlob) ProtoMessage() {} - -func (x *CreateBlob) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateBlob.ProtoReflect.Descriptor instead. -func (*CreateBlob) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{5} -} - -func (x *CreateBlob) GetContentType() string { - if x != nil { - return x.ContentType - } - return "" -} - -func (x *CreateBlob) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -type CreateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Requires group+resource to be configuired - // If name is not set, a unique name will be generated - // The resourceVersion should not be set - Key *Key `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // The resource JSON. - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - // Optional commit message - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` - // Optionally include a large binary object - Blob *CreateBlob `protobuf:"bytes,4,opt,name=blob,proto3" json:"blob,omitempty"` -} - -func (x *CreateRequest) Reset() { - *x = CreateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRequest) ProtoMessage() {} - -func (x *CreateRequest) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead. -func (*CreateRequest) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{6} -} - -func (x *CreateRequest) GetKey() *Key { - if x != nil { - return x.Key - } - return nil -} - -func (x *CreateRequest) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -func (x *CreateRequest) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -func (x *CreateRequest) GetBlob() *CreateBlob { - if x != nil { - return x.Blob - } - return nil -} - -type CreateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Status code - Status *StatusResult `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - // The updated resource version - ResourceVersion int64 `protobuf:"varint,2,opt,name=resource_version,json=resourceVersion,proto3" json:"resource_version,omitempty"` -} - -func (x *CreateResponse) Reset() { - *x = CreateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateResponse) ProtoMessage() {} - -func (x *CreateResponse) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead. -func (*CreateResponse) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{7} -} - -func (x *CreateResponse) GetStatus() *StatusResult { - if x != nil { - return x.Status - } - return nil -} - -func (x *CreateResponse) GetResourceVersion() int64 { - if x != nil { - return x.ResourceVersion - } - return 0 -} - -type UpdateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Full key must be set - Key *Key `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // The resource JSON. - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - // Optional commit message - // +optional - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` - // Optionally link a resource object - Blob *CreateBlob `protobuf:"bytes,4,opt,name=blob,proto3" json:"blob,omitempty"` -} - -func (x *UpdateRequest) Reset() { - *x = UpdateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateRequest) ProtoMessage() {} - -func (x *UpdateRequest) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead. -func (*UpdateRequest) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{8} -} - -func (x *UpdateRequest) GetKey() *Key { - if x != nil { - return x.Key - } - return nil -} - -func (x *UpdateRequest) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -func (x *UpdateRequest) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -func (x *UpdateRequest) GetBlob() *CreateBlob { - if x != nil { - return x.Blob - } - return nil -} - -type UpdateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Status code - Status *StatusResult `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - // The updated resource version - ResourceVersion int64 `protobuf:"varint,2,opt,name=resource_version,json=resourceVersion,proto3" json:"resource_version,omitempty"` -} - -func (x *UpdateResponse) Reset() { - *x = UpdateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateResponse) ProtoMessage() {} - -func (x *UpdateResponse) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead. -func (*UpdateResponse) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{9} -} - -func (x *UpdateResponse) GetStatus() *StatusResult { - if x != nil { - return x.Status - } - return nil -} - -func (x *UpdateResponse) GetResourceVersion() int64 { - if x != nil { - return x.ResourceVersion - } - return 0 -} - -type DeleteRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key *Key `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Preconditions: make sure the uid matches the current saved value - // +optional - Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` -} - -func (x *DeleteRequest) Reset() { - *x = DeleteRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRequest) ProtoMessage() {} - -func (x *DeleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. -func (*DeleteRequest) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{10} -} - -func (x *DeleteRequest) GetKey() *Key { - if x != nil { - return x.Key - } - return nil -} - -func (x *DeleteRequest) GetUid() string { - if x != nil { - return x.Uid - } - return "" -} - -type DeleteResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Status code - Status *StatusResult `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - // The new resource version - ResourceVersion int64 `protobuf:"varint,2,opt,name=resource_version,json=resourceVersion,proto3" json:"resource_version,omitempty"` -} - -func (x *DeleteResponse) Reset() { - *x = DeleteResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteResponse) ProtoMessage() {} - -func (x *DeleteResponse) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. -func (*DeleteResponse) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{11} -} - -func (x *DeleteResponse) GetStatus() *StatusResult { - if x != nil { - return x.Status - } - return nil -} - -func (x *DeleteResponse) GetResourceVersion() int64 { - if x != nil { - return x.ResourceVersion - } - return 0 -} - -type GetResourceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key *Key `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` -} - -func (x *GetResourceRequest) Reset() { - *x = GetResourceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetResourceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResourceRequest) ProtoMessage() {} - -func (x *GetResourceRequest) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetResourceRequest.ProtoReflect.Descriptor instead. -func (*GetResourceRequest) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{12} -} - -func (x *GetResourceRequest) GetKey() *Key { - if x != nil { - return x.Key - } - return nil -} - -type GetResourceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Status code - Status *StatusResult `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - // The new resource version - ResourceVersion int64 `protobuf:"varint,2,opt,name=resource_version,json=resourceVersion,proto3" json:"resource_version,omitempty"` - // The properties - Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - // A Signed URL that will let you fetch the blob - // If this value starts with # you must read the bytes using the GetResourceBlob request - BlobUrl string `protobuf:"bytes,4,opt,name=blob_url,json=blobUrl,proto3" json:"blob_url,omitempty"` -} - -func (x *GetResourceResponse) Reset() { - *x = GetResourceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetResourceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResourceResponse) ProtoMessage() {} - -func (x *GetResourceResponse) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetResourceResponse.ProtoReflect.Descriptor instead. -func (*GetResourceResponse) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{13} -} - -func (x *GetResourceResponse) GetStatus() *StatusResult { - if x != nil { - return x.Status - } - return nil -} - -func (x *GetResourceResponse) GetResourceVersion() int64 { - if x != nil { - return x.ResourceVersion - } - return 0 -} - -func (x *GetResourceResponse) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -func (x *GetResourceResponse) GetBlobUrl() string { - if x != nil { - return x.BlobUrl - } - return "" -} - -type GetBlobRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key *Key `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` -} - -func (x *GetBlobRequest) Reset() { - *x = GetBlobRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetBlobRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBlobRequest) ProtoMessage() {} - -func (x *GetBlobRequest) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetBlobRequest.ProtoReflect.Descriptor instead. -func (*GetBlobRequest) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{14} -} - -func (x *GetBlobRequest) GetKey() *Key { - if x != nil { - return x.Key - } - return nil -} - -type GetBlobResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Status code - Status *StatusResult `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - // Headers - Info *BlobInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` - // The raw object value - Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *GetBlobResponse) Reset() { - *x = GetBlobResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetBlobResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBlobResponse) ProtoMessage() {} - -func (x *GetBlobResponse) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetBlobResponse.ProtoReflect.Descriptor instead. -func (*GetBlobResponse) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{15} -} - -func (x *GetBlobResponse) GetStatus() *StatusResult { - if x != nil { - return x.Status - } - return nil -} - -func (x *GetBlobResponse) GetInfo() *BlobInfo { - if x != nil { - return x.Info - } - return nil -} - -func (x *GetBlobResponse) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -// The label filtering requirements: -// https://github.com/kubernetes/kubernetes/blob/v1.30.1/staging/src/k8s.io/apimachinery/pkg/labels/selector.go#L141 -type Requirement struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Operator string `protobuf:"bytes,2,opt,name=operator,proto3" json:"operator,omitempty"` // See https://github.com/kubernetes/kubernetes/blob/v1.30.1/staging/src/k8s.io/apimachinery/pkg/selection/operator.go#L21 - Values []string `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty"` // typically one value, but depends on the operator -} - -func (x *Requirement) Reset() { - *x = Requirement{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Requirement) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Requirement) ProtoMessage() {} - -func (x *Requirement) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Requirement.ProtoReflect.Descriptor instead. -func (*Requirement) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{16} -} - -func (x *Requirement) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *Requirement) GetOperator() string { - if x != nil { - return x.Operator - } - return "" -} - -func (x *Requirement) GetValues() []string { - if x != nil { - return x.Values - } - return nil -} - -type Sort struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` - Order Sort_Order `protobuf:"varint,2,opt,name=order,proto3,enum=resource.Sort_Order" json:"order,omitempty"` -} - -func (x *Sort) Reset() { - *x = Sort{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Sort) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Sort) ProtoMessage() {} - -func (x *Sort) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Sort.ProtoReflect.Descriptor instead. -func (*Sort) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{17} -} - -func (x *Sort) GetField() string { - if x != nil { - return x.Field - } - return "" -} - -func (x *Sort) GetOrder() Sort_Order { - if x != nil { - return x.Order - } - return Sort_ASC -} - -type ListOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Maximum number of items to return - // NOTE responses will also be limited by the response payload size - Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` - // Namespace+Group+Resource+etc - Key *Key `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - // Match label - Labels []*Requirement `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty"` - // Match fields (not yet supported) - Fields []*Requirement `protobuf:"bytes,5,rep,name=fields,proto3" json:"fields,omitempty"` - // Limit results to items in a specific folder (not a query for everything under that folder!) - Folder string `protobuf:"bytes,6,opt,name=folder,proto3" json:"folder,omitempty"` -} - -func (x *ListOptions) Reset() { - *x = ListOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOptions) ProtoMessage() {} - -func (x *ListOptions) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOptions.ProtoReflect.Descriptor instead. -func (*ListOptions) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{18} -} - -func (x *ListOptions) GetLimit() int64 { - if x != nil { - return x.Limit - } - return 0 -} - -func (x *ListOptions) GetKey() *Key { - if x != nil { - return x.Key - } - return nil -} - -func (x *ListOptions) GetLabels() []*Requirement { - if x != nil { - return x.Labels - } - return nil -} - -func (x *ListOptions) GetFields() []*Requirement { - if x != nil { - return x.Fields - } - return nil -} - -func (x *ListOptions) GetFolder() string { - if x != nil { - return x.Folder - } - return "" -} - -type ListRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Starting from the requested page (other query parameters must match!) - NextPageToken string `protobuf:"bytes,1,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` - // Filtering - Options *ListOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` - // Sorting instructions `field ASC/DESC` - Sort []*Sort `protobuf:"bytes,3,rep,name=sort,proto3" json:"sort,omitempty"` -} - -func (x *ListRequest) Reset() { - *x = ListRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRequest) ProtoMessage() {} - -func (x *ListRequest) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRequest.ProtoReflect.Descriptor instead. -func (*ListRequest) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{19} -} - -func (x *ListRequest) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -func (x *ListRequest) GetOptions() *ListOptions { - if x != nil { - return x.Options - } - return nil -} - -func (x *ListRequest) GetSort() []*Sort { - if x != nil { - return x.Sort - } - return nil -} - -type ListResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Items []*ResourceWrapper `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` - // When more results exist, pass this in the next request - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` - // ResourceVersion of the list response - ResourceVersion int64 `protobuf:"varint,3,opt,name=resource_version,json=resourceVersion,proto3" json:"resource_version,omitempty"` - // remainingItemCount is the number of subsequent items in the list which are not included in this - // list response. If the list request contained label or field selectors, then the number of - // remaining items is unknown and the field will be left unset and omitted during serialization. - // If the list is complete (either because it is not chunking or because this is the last chunk), - // then there are no more remaining items and this field will be left unset and omitted during - // serialization. - // - // The intended use of the remainingItemCount is *estimating* the size of a collection. Clients - // should not rely on the remainingItemCount to be set or to be exact. - // +optional - RemainingItemCount int64 `protobuf:"varint,4,opt,name=remaining_item_count,json=remainingItemCount,proto3" json:"remaining_item_count,omitempty"` // 0 won't be set either (no next page token) -} - -func (x *ListResponse) Reset() { - *x = ListResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListResponse) ProtoMessage() {} - -func (x *ListResponse) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. -func (*ListResponse) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{20} -} - -func (x *ListResponse) GetItems() []*ResourceWrapper { - if x != nil { - return x.Items - } - return nil -} - -func (x *ListResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -func (x *ListResponse) GetResourceVersion() int64 { - if x != nil { - return x.ResourceVersion - } - return 0 -} - -func (x *ListResponse) GetRemainingItemCount() int64 { - if x != nil { - return x.RemainingItemCount - } - return 0 -} - -type WatchRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // ResourceVersion of last changes. Empty will default to full history - Since int64 `protobuf:"varint,1,opt,name=since,proto3" json:"since,omitempty"` - // Watch specific entities - Key *Key `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - // Additional options - Options *ListOptions `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"` - // Return initial events - SendInitialEvents bool `protobuf:"varint,4,opt,name=send_initial_events,json=sendInitialEvents,proto3" json:"send_initial_events,omitempty"` - // When done with initial events, send a bookmark event - AllowWatchBookmarks bool `protobuf:"varint,5,opt,name=allow_watch_bookmarks,json=allowWatchBookmarks,proto3" json:"allow_watch_bookmarks,omitempty"` -} - -func (x *WatchRequest) Reset() { - *x = WatchRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WatchRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WatchRequest) ProtoMessage() {} - -func (x *WatchRequest) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use WatchRequest.ProtoReflect.Descriptor instead. -func (*WatchRequest) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{21} -} - -func (x *WatchRequest) GetSince() int64 { - if x != nil { - return x.Since - } - return 0 -} - -func (x *WatchRequest) GetKey() *Key { - if x != nil { - return x.Key - } - return nil -} - -func (x *WatchRequest) GetOptions() *ListOptions { - if x != nil { - return x.Options - } - return nil -} - -func (x *WatchRequest) GetSendInitialEvents() bool { - if x != nil { - return x.SendInitialEvents - } - return false -} - -func (x *WatchRequest) GetAllowWatchBookmarks() bool { - if x != nil { - return x.AllowWatchBookmarks - } - return false -} - -type WatchResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Timestamp the event was sent - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // Entity that was created, updated, or deleted - Resource *ResourceWrapper `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` - // previous version of the entity (in update+delete events) - Previous *ResourceWrapper `protobuf:"bytes,3,opt,name=previous,proto3" json:"previous,omitempty"` -} - -func (x *WatchResponse) Reset() { - *x = WatchResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WatchResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WatchResponse) ProtoMessage() {} - -func (x *WatchResponse) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use WatchResponse.ProtoReflect.Descriptor instead. -func (*WatchResponse) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{22} -} - -func (x *WatchResponse) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *WatchResponse) GetResource() *ResourceWrapper { - if x != nil { - return x.Resource - } - return nil -} - -func (x *WatchResponse) GetPrevious() *ResourceWrapper { - if x != nil { - return x.Previous - } - return nil -} - -type HistoryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Starting from the requested page (other query parameters must match!) - NextPageToken string `protobuf:"bytes,1,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` - // Maximum number of items to return - Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` - // Resource identifier - Key *Key `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - // List the deleted values (eg, show trash) - ShowDeleted bool `protobuf:"varint,4,opt,name=show_deleted,json=showDeleted,proto3" json:"show_deleted,omitempty"` -} - -func (x *HistoryRequest) Reset() { - *x = HistoryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HistoryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HistoryRequest) ProtoMessage() {} - -func (x *HistoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HistoryRequest.ProtoReflect.Descriptor instead. -func (*HistoryRequest) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{23} -} - -func (x *HistoryRequest) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -func (x *HistoryRequest) GetLimit() int64 { - if x != nil { - return x.Limit - } - return 0 -} - -func (x *HistoryRequest) GetKey() *Key { - if x != nil { - return x.Key - } - return nil -} - -func (x *HistoryRequest) GetShowDeleted() bool { - if x != nil { - return x.ShowDeleted - } - return false -} - -type HistoryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Items []*ResourceMeta `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` - // More results exist... pass this in the next request - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` - // ResourceVersion of the list response - ResourceVersion int64 `protobuf:"varint,3,opt,name=resource_version,json=resourceVersion,proto3" json:"resource_version,omitempty"` -} - -func (x *HistoryResponse) Reset() { - *x = HistoryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HistoryResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HistoryResponse) ProtoMessage() {} - -func (x *HistoryResponse) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HistoryResponse.ProtoReflect.Descriptor instead. -func (*HistoryResponse) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{24} -} - -func (x *HistoryResponse) GetItems() []*ResourceMeta { - if x != nil { - return x.Items - } - return nil -} - -func (x *HistoryResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -func (x *HistoryResponse) GetResourceVersion() int64 { - if x != nil { - return x.ResourceVersion - } - return 0 -} - -type OriginRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Starting from the requested page (other query parameters must match!) - NextPageToken string `protobuf:"bytes,1,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` - // Maximum number of items to return - Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` - // Resource identifier - Key *Key `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - // List the deleted values (eg, show trash) - Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` -} - -func (x *OriginRequest) Reset() { - *x = OriginRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OriginRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OriginRequest) ProtoMessage() {} - -func (x *OriginRequest) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OriginRequest.ProtoReflect.Descriptor instead. -func (*OriginRequest) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{25} -} - -func (x *OriginRequest) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -func (x *OriginRequest) GetLimit() int64 { - if x != nil { - return x.Limit - } - return 0 -} - -func (x *OriginRequest) GetKey() *Key { - if x != nil { - return x.Key - } - return nil -} - -func (x *OriginRequest) GetOrigin() string { - if x != nil { - return x.Origin - } - return "" -} - -type ResourceOriginInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The resource - Key *Key `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Size of the full resource body - ResourceSize int32 `protobuf:"varint,2,opt,name=resource_size,json=resourceSize,proto3" json:"resource_size,omitempty"` - // Hash for the resource - ResourceHash string `protobuf:"bytes,3,opt,name=resource_hash,json=resourceHash,proto3" json:"resource_hash,omitempty"` - // The origin name - Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` - // Path on the origin - Path string `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"` - // Verification hash from the origin - Hash string `protobuf:"bytes,6,opt,name=hash,proto3" json:"hash,omitempty"` - // Change time from the origin - Timestamp int64 `protobuf:"varint,7,opt,name=timestamp,proto3" json:"timestamp,omitempty"` -} - -func (x *ResourceOriginInfo) Reset() { - *x = ResourceOriginInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResourceOriginInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResourceOriginInfo) ProtoMessage() {} - -func (x *ResourceOriginInfo) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResourceOriginInfo.ProtoReflect.Descriptor instead. -func (*ResourceOriginInfo) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{26} -} - -func (x *ResourceOriginInfo) GetKey() *Key { - if x != nil { - return x.Key - } - return nil -} - -func (x *ResourceOriginInfo) GetResourceSize() int32 { - if x != nil { - return x.ResourceSize - } - return 0 -} - -func (x *ResourceOriginInfo) GetResourceHash() string { - if x != nil { - return x.ResourceHash - } - return "" -} - -func (x *ResourceOriginInfo) GetOrigin() string { - if x != nil { - return x.Origin - } - return "" -} - -func (x *ResourceOriginInfo) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *ResourceOriginInfo) GetHash() string { - if x != nil { - return x.Hash - } - return "" -} - -func (x *ResourceOriginInfo) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -type OriginResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Items []*ResourceOriginInfo `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` - // More results exist... pass this in the next request - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` - // ResourceVersion of the list response - ResourceVersion int64 `protobuf:"varint,3,opt,name=resource_version,json=resourceVersion,proto3" json:"resource_version,omitempty"` -} - -func (x *OriginResponse) Reset() { - *x = OriginResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OriginResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OriginResponse) ProtoMessage() {} - -func (x *OriginResponse) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OriginResponse.ProtoReflect.Descriptor instead. -func (*OriginResponse) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{27} -} - -func (x *OriginResponse) GetItems() []*ResourceOriginInfo { - if x != nil { - return x.Items - } - return nil -} - -func (x *OriginResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -func (x *OriginResponse) GetResourceVersion() int64 { - if x != nil { - return x.ResourceVersion - } - return 0 -} - -type HealthCheckRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` -} - -func (x *HealthCheckRequest) Reset() { - *x = HealthCheckRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HealthCheckRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HealthCheckRequest) ProtoMessage() {} - -func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HealthCheckRequest.ProtoReflect.Descriptor instead. -func (*HealthCheckRequest) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{28} -} - -func (x *HealthCheckRequest) GetService() string { - if x != nil { - return x.Service - } - return "" -} - -type HealthCheckResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=resource.HealthCheckResponse_ServingStatus" json:"status,omitempty"` -} - -func (x *HealthCheckResponse) Reset() { - *x = HealthCheckResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_resource_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HealthCheckResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HealthCheckResponse) ProtoMessage() {} - -func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message { - mi := &file_resource_proto_msgTypes[29] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HealthCheckResponse.ProtoReflect.Descriptor instead. -func (*HealthCheckResponse) Descriptor() ([]byte, []int) { - return file_resource_proto_rawDescGZIP(), []int{29} -} - -func (x *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus { - if x != nil { - return x.Status - } - return HealthCheckResponse_UNKNOWN -} - -var File_resource_proto protoreflect.FileDescriptor - -var file_resource_proto_rawDesc = []byte{ - 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x94, 0x01, 0x0a, 0x03, 0x4b, - 0x65, 0x79, 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, - 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x22, 0xa8, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x57, 0x72, - 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x22, 0xf2, 0x01, 0x0a, - 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x29, 0x0a, - 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x6d, 0x65, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x62, 0x6c, - 0x6f, 0x62, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x42, 0x6c, 0x6f, - 0x62, 0x22, 0x55, 0x0a, 0x08, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, - 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x45, 0x54, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x45, 0x54, 0x61, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, 0x6c, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, - 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, - 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x45, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x8a, 0x01, - 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1f, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x28, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x22, 0x6b, 0x0a, 0x0e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x29, 0x0a, 0x10, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8a, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x28, 0x0a, 0x04, 0x62, 0x6c, - 0x6f, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, - 0x62, 0x6c, 0x6f, 0x62, 0x22, 0x6b, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x22, 0x42, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x6b, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x22, 0x35, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0xa1, 0x01, 0x0a, 0x13, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x55, 0x72, 0x6c, 0x22, 0x31, 0x0a, - 0x0e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1f, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x22, 0x7f, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x26, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x42, 0x6c, 0x6f, - 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0x53, 0x0a, 0x0b, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x16, - 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x64, 0x0a, 0x04, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x12, 0x2a, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x53, - 0x6f, 0x72, 0x74, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x22, 0x1a, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x53, 0x43, - 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x45, 0x53, 0x43, 0x10, 0x01, 0x22, 0xba, 0x01, 0x0a, - 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, - 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x12, 0x2d, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, - 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x73, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x22, 0x8a, 0x01, 0x0a, 0x0b, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, - 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x22, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0e, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x53, 0x6f, 0x72, 0x74, - 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x22, 0xc4, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, - 0x72, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, - 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x14, 0x72, - 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x72, 0x65, 0x6d, 0x61, 0x69, - 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xda, 0x01, - 0x0a, 0x0c, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, - 0x69, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4b, 0x65, 0x79, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x69, - 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x11, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, - 0x77, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x62, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x57, 0x61, 0x74, 0x63, - 0x68, 0x42, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x22, 0x9b, 0x01, 0x0a, 0x0d, 0x57, - 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x12, 0x35, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x08, - 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x22, 0x92, 0x01, 0x0a, 0x0e, 0x48, 0x69, 0x73, - 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, - 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x68, - 0x6f, 0x77, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0b, 0x73, 0x68, 0x6f, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0x92, 0x01, - 0x0a, 0x0f, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x16, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, - 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, - 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x22, 0x86, 0x01, 0x0a, 0x0d, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, - 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, - 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x22, 0xdd, 0x01, 0x0a, 0x12, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x1f, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, - 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, - 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, - 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x1c, 0x0a, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x97, 0x01, 0x0a, 0x0e, - 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, - 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x69, 0x74, 0x65, - 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, - 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x2e, 0x0a, 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0xab, 0x01, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x22, 0x4f, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, - 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0f, 0x0a, - 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x13, - 0x0a, 0x0f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, - 0x4e, 0x10, 0x03, 0x2a, 0x55, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, - 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, - 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, - 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, - 0x42, 0x4f, 0x4f, 0x4b, 0x4d, 0x41, 0x52, 0x4b, 0x10, 0x04, 0x32, 0x8c, 0x05, 0x0a, 0x0d, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x4a, 0x0a, 0x0b, - 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1c, 0x2e, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x12, 0x17, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, - 0x17, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x35, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, - 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x05, 0x57, 0x61, 0x74, 0x63, 0x68, 0x12, - 0x16, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x30, 0x01, 0x12, 0x3e, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x18, 0x2e, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x18, 0x2e, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x06, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x17, 0x2e, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x48, 0x0a, 0x09, 0x49, 0x73, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x12, 0x1c, 0x2e, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, - 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x61, 0x66, 0x61, 0x6e, 0x61, 0x2f, - 0x67, 0x72, 0x61, 0x66, 0x61, 0x6e, 0x61, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_resource_proto_rawDescOnce sync.Once - file_resource_proto_rawDescData = file_resource_proto_rawDesc -) - -func file_resource_proto_rawDescGZIP() []byte { - file_resource_proto_rawDescOnce.Do(func() { - file_resource_proto_rawDescData = protoimpl.X.CompressGZIP(file_resource_proto_rawDescData) - }) - return file_resource_proto_rawDescData -} - -var file_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 30) -var file_resource_proto_goTypes = []interface{}{ - (ResourceOperation)(0), // 0: resource.ResourceOperation - (Sort_Order)(0), // 1: resource.Sort.Order - (HealthCheckResponse_ServingStatus)(0), // 2: resource.HealthCheckResponse.ServingStatus - (*Key)(nil), // 3: resource.Key - (*ResourceWrapper)(nil), // 4: resource.ResourceWrapper - (*ResourceMeta)(nil), // 5: resource.ResourceMeta - (*BlobInfo)(nil), // 6: resource.BlobInfo - (*StatusResult)(nil), // 7: resource.StatusResult - (*CreateBlob)(nil), // 8: resource.CreateBlob - (*CreateRequest)(nil), // 9: resource.CreateRequest - (*CreateResponse)(nil), // 10: resource.CreateResponse - (*UpdateRequest)(nil), // 11: resource.UpdateRequest - (*UpdateResponse)(nil), // 12: resource.UpdateResponse - (*DeleteRequest)(nil), // 13: resource.DeleteRequest - (*DeleteResponse)(nil), // 14: resource.DeleteResponse - (*GetResourceRequest)(nil), // 15: resource.GetResourceRequest - (*GetResourceResponse)(nil), // 16: resource.GetResourceResponse - (*GetBlobRequest)(nil), // 17: resource.GetBlobRequest - (*GetBlobResponse)(nil), // 18: resource.GetBlobResponse - (*Requirement)(nil), // 19: resource.Requirement - (*Sort)(nil), // 20: resource.Sort - (*ListOptions)(nil), // 21: resource.ListOptions - (*ListRequest)(nil), // 22: resource.ListRequest - (*ListResponse)(nil), // 23: resource.ListResponse - (*WatchRequest)(nil), // 24: resource.WatchRequest - (*WatchResponse)(nil), // 25: resource.WatchResponse - (*HistoryRequest)(nil), // 26: resource.HistoryRequest - (*HistoryResponse)(nil), // 27: resource.HistoryResponse - (*OriginRequest)(nil), // 28: resource.OriginRequest - (*ResourceOriginInfo)(nil), // 29: resource.ResourceOriginInfo - (*OriginResponse)(nil), // 30: resource.OriginResponse - (*HealthCheckRequest)(nil), // 31: resource.HealthCheckRequest - (*HealthCheckResponse)(nil), // 32: resource.HealthCheckResponse -} -var file_resource_proto_depIdxs = []int32{ - 0, // 0: resource.ResourceWrapper.operation:type_name -> resource.ResourceOperation - 0, // 1: resource.ResourceMeta.operation:type_name -> resource.ResourceOperation - 3, // 2: resource.CreateRequest.key:type_name -> resource.Key - 8, // 3: resource.CreateRequest.blob:type_name -> resource.CreateBlob - 7, // 4: resource.CreateResponse.status:type_name -> resource.StatusResult - 3, // 5: resource.UpdateRequest.key:type_name -> resource.Key - 8, // 6: resource.UpdateRequest.blob:type_name -> resource.CreateBlob - 7, // 7: resource.UpdateResponse.status:type_name -> resource.StatusResult - 3, // 8: resource.DeleteRequest.key:type_name -> resource.Key - 7, // 9: resource.DeleteResponse.status:type_name -> resource.StatusResult - 3, // 10: resource.GetResourceRequest.key:type_name -> resource.Key - 7, // 11: resource.GetResourceResponse.status:type_name -> resource.StatusResult - 3, // 12: resource.GetBlobRequest.key:type_name -> resource.Key - 7, // 13: resource.GetBlobResponse.status:type_name -> resource.StatusResult - 6, // 14: resource.GetBlobResponse.info:type_name -> resource.BlobInfo - 1, // 15: resource.Sort.order:type_name -> resource.Sort.Order - 3, // 16: resource.ListOptions.key:type_name -> resource.Key - 19, // 17: resource.ListOptions.labels:type_name -> resource.Requirement - 19, // 18: resource.ListOptions.fields:type_name -> resource.Requirement - 21, // 19: resource.ListRequest.options:type_name -> resource.ListOptions - 20, // 20: resource.ListRequest.sort:type_name -> resource.Sort - 4, // 21: resource.ListResponse.items:type_name -> resource.ResourceWrapper - 3, // 22: resource.WatchRequest.key:type_name -> resource.Key - 21, // 23: resource.WatchRequest.options:type_name -> resource.ListOptions - 4, // 24: resource.WatchResponse.resource:type_name -> resource.ResourceWrapper - 4, // 25: resource.WatchResponse.previous:type_name -> resource.ResourceWrapper - 3, // 26: resource.HistoryRequest.key:type_name -> resource.Key - 5, // 27: resource.HistoryResponse.items:type_name -> resource.ResourceMeta - 3, // 28: resource.OriginRequest.key:type_name -> resource.Key - 3, // 29: resource.ResourceOriginInfo.key:type_name -> resource.Key - 29, // 30: resource.OriginResponse.items:type_name -> resource.ResourceOriginInfo - 2, // 31: resource.HealthCheckResponse.status:type_name -> resource.HealthCheckResponse.ServingStatus - 15, // 32: resource.ResourceStore.GetResource:input_type -> resource.GetResourceRequest - 9, // 33: resource.ResourceStore.Create:input_type -> resource.CreateRequest - 11, // 34: resource.ResourceStore.Update:input_type -> resource.UpdateRequest - 13, // 35: resource.ResourceStore.Delete:input_type -> resource.DeleteRequest - 22, // 36: resource.ResourceStore.List:input_type -> resource.ListRequest - 24, // 37: resource.ResourceStore.Watch:input_type -> resource.WatchRequest - 17, // 38: resource.ResourceStore.GetBlob:input_type -> resource.GetBlobRequest - 26, // 39: resource.ResourceStore.History:input_type -> resource.HistoryRequest - 28, // 40: resource.ResourceStore.Origin:input_type -> resource.OriginRequest - 31, // 41: resource.ResourceStore.IsHealthy:input_type -> resource.HealthCheckRequest - 16, // 42: resource.ResourceStore.GetResource:output_type -> resource.GetResourceResponse - 10, // 43: resource.ResourceStore.Create:output_type -> resource.CreateResponse - 12, // 44: resource.ResourceStore.Update:output_type -> resource.UpdateResponse - 14, // 45: resource.ResourceStore.Delete:output_type -> resource.DeleteResponse - 23, // 46: resource.ResourceStore.List:output_type -> resource.ListResponse - 25, // 47: resource.ResourceStore.Watch:output_type -> resource.WatchResponse - 18, // 48: resource.ResourceStore.GetBlob:output_type -> resource.GetBlobResponse - 27, // 49: resource.ResourceStore.History:output_type -> resource.HistoryResponse - 30, // 50: resource.ResourceStore.Origin:output_type -> resource.OriginResponse - 32, // 51: resource.ResourceStore.IsHealthy:output_type -> resource.HealthCheckResponse - 42, // [42:52] is the sub-list for method output_type - 32, // [32:42] is the sub-list for method input_type - 32, // [32:32] is the sub-list for extension type_name - 32, // [32:32] is the sub-list for extension extendee - 0, // [0:32] is the sub-list for field type_name -} - -func init() { file_resource_proto_init() } -func file_resource_proto_init() { - if File_resource_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_resource_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Key); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResourceWrapper); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResourceMeta); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlobInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatusResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateBlob); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResourceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResourceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBlobRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBlobResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Requirement); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Sort); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WatchRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WatchResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HistoryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HistoryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OriginRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResourceOriginInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OriginResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HealthCheckRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_resource_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HealthCheckResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_resource_proto_rawDesc, - NumEnums: 3, - NumMessages: 30, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_resource_proto_goTypes, - DependencyIndexes: file_resource_proto_depIdxs, - EnumInfos: file_resource_proto_enumTypes, - MessageInfos: file_resource_proto_msgTypes, - }.Build() - File_resource_proto = out.File - file_resource_proto_rawDesc = nil - file_resource_proto_goTypes = nil - file_resource_proto_depIdxs = nil -} diff --git a/pkg/services/store/resource/resource.proto b/pkg/services/store/resource/resource.proto deleted file mode 100644 index 97c6673ff39..00000000000 --- a/pkg/services/store/resource/resource.proto +++ /dev/null @@ -1,416 +0,0 @@ -syntax = "proto3"; -package resource; - -option go_package = "github.com/grafana/grafana/pkg/services/store/resource"; - - -message Key { - // Namespace (tenant) - string namespace = 2; - // Resource Group - string group = 1; - // The resource type - string resource = 3; - // Resource identifier (unique within namespace+group+resource) - string name = 4; - // The resource version - int64 resource_version = 5; -} - -enum ResourceOperation { - UNKNOWN = 0; - CREATED = 1; - UPDATED = 2; - DELETED = 3; - BOOKMARK = 4; -} - -message ResourceWrapper { - // The resource version - int64 resource_version = 1; - - // Full kubernetes json bytes (although the resource version may not be accurate) - bytes value = 2; - - // Operation - ResourceOperation operation = 3; - - // The resource has an attached blob - bool has_blob = 4; -} - -// The history and trash commands need access to commit messages -message ResourceMeta { - // The resource version - int64 resource_version = 1; - - // The optional commit message - ResourceOperation operation = 2; - - // Size of the full resource body - int32 size = 3; - - // Hash for the resource - string hash = 4; - - // The optional commit message - string message = 5; - - // The kubernetes metadata section (not the full resource) - // https://github.com/kubernetes/kubernetes/blob/v1.30.1/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/types.go#L111 - bytes object_meta = 6; - - // The resource has an attached blob - bool has_blob = 7; -} - -// Basic blob metadata -message BlobInfo { - // Content Length - int64 size = 1; - - // MD5 digest of the body - string ETag = 2; - - // Content type header - string content_type = 3; -} - -// Status structure is copied from: -// https://github.com/kubernetes/apimachinery/blob/v0.30.1/pkg/apis/meta/v1/generated.proto#L979 -message StatusResult { - // Status of the operation. - // One of: "Success" or "Failure". - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - string status = 1; - // A human-readable description of the status of this operation. - // +optional - string message = 2; - // A machine-readable description of why this operation is in the - // "Failure" status. If this value is empty there - // is no information available. A Reason clarifies an HTTP status - // code but does not override it. - // +optional - string reason = 3; - // Suggested HTTP return code for this status, 0 if not set. - // +optional - int32 code = 4; -} - -// TODO? support PresignedUrls for upload? -message CreateBlob { - // Content type header - string content_type = 1; - - // Raw value to write - bytes value = 2; -} - -// ---------------------------------- -// CRUD Objects -// ---------------------------------- - -message CreateRequest { - // Requires group+resource to be configuired - // If name is not set, a unique name will be generated - // The resourceVersion should not be set - Key key = 1; - - // The resource JSON. - bytes value = 2; - - // Optional commit message - string message = 3; - - // Optionally include a large binary object - CreateBlob blob = 4; -} - -message CreateResponse { - // Status code - StatusResult status = 1; - - // The updated resource version - int64 resource_version = 2; -} - -message UpdateRequest { - // Full key must be set - Key key = 1; - - // The resource JSON. - bytes value = 2; - - // Optional commit message - // +optional - string message = 3; - - // Optionally link a resource object - CreateBlob blob = 4; -} - -message UpdateResponse { - // Status code - StatusResult status = 1; - - // The updated resource version - int64 resource_version = 2; -} - -message DeleteRequest { - Key key = 1; - - // Preconditions: make sure the uid matches the current saved value - // +optional - string uid = 2; -} - -message DeleteResponse { - // Status code - StatusResult status = 1; - - // The new resource version - int64 resource_version = 2; -} - -message GetResourceRequest { - Key key = 1; -} - -message GetResourceResponse { - // Status code - StatusResult status = 1; - - // The new resource version - int64 resource_version = 2; - - // The properties - bytes value = 3; - - // A Signed URL that will let you fetch the blob - // If this value starts with # you must read the bytes using the GetResourceBlob request - string blob_url = 4; -} - -message GetBlobRequest { - Key key = 1; -} - -message GetBlobResponse { - // Status code - StatusResult status = 1; - - // Headers - BlobInfo info = 2; - - // The raw object value - bytes value = 3; -} - -// ---------------------------------- -// List Request/Response -// ---------------------------------- - -// The label filtering requirements: -// https://github.com/kubernetes/kubernetes/blob/v1.30.1/staging/src/k8s.io/apimachinery/pkg/labels/selector.go#L141 -message Requirement { - string key = 1; - string operator = 2; // See https://github.com/kubernetes/kubernetes/blob/v1.30.1/staging/src/k8s.io/apimachinery/pkg/selection/operator.go#L21 - repeated string values = 3; // typically one value, but depends on the operator -} - -message Sort { - enum Order { - ASC = 0; - DESC = 1; - } - string field = 1; - Order order = 2; -} - -message ListOptions { - // Maximum number of items to return - // NOTE responses will also be limited by the response payload size - int64 limit = 2; - - // Namespace+Group+Resource+etc - Key key = 3; - - // Match label - repeated Requirement labels = 4; - - // Match fields (not yet supported) - repeated Requirement fields = 5; - - // Limit results to items in a specific folder (not a query for everything under that folder!) - string folder = 6; -} - -message ListRequest { - // Starting from the requested page (other query parameters must match!) - string next_page_token = 1; - - // Filtering - ListOptions options = 2; - - // Sorting instructions `field ASC/DESC` - repeated Sort sort = 3; -} - -message ListResponse { - repeated ResourceWrapper items = 1; - - // When more results exist, pass this in the next request - string next_page_token = 2; - - // ResourceVersion of the list response - int64 resource_version = 3; - - // remainingItemCount is the number of subsequent items in the list which are not included in this - // list response. If the list request contained label or field selectors, then the number of - // remaining items is unknown and the field will be left unset and omitted during serialization. - // If the list is complete (either because it is not chunking or because this is the last chunk), - // then there are no more remaining items and this field will be left unset and omitted during - // serialization. - // - // The intended use of the remainingItemCount is *estimating* the size of a collection. Clients - // should not rely on the remainingItemCount to be set or to be exact. - // +optional - int64 remaining_item_count = 4; // 0 won't be set either (no next page token) -} - -message WatchRequest { - // ResourceVersion of last changes. Empty will default to full history - int64 since = 1; - - // Watch specific entities - Key key = 2; - - // Additional options - ListOptions options = 3; - - // Return initial events - bool send_initial_events = 4; - - // When done with initial events, send a bookmark event - bool allow_watch_bookmarks = 5; -} - -message WatchResponse { - // Timestamp the event was sent - int64 timestamp = 1; - - // Entity that was created, updated, or deleted - ResourceWrapper resource = 2; - - // previous version of the entity (in update+delete events) - ResourceWrapper previous = 3; -} - -message HistoryRequest { - // Starting from the requested page (other query parameters must match!) - string next_page_token = 1; - - // Maximum number of items to return - int64 limit = 2; - - // Resource identifier - Key key = 3; - - // List the deleted values (eg, show trash) - bool show_deleted = 4; -} - -message HistoryResponse { - repeated ResourceMeta items = 1; - - // More results exist... pass this in the next request - string next_page_token = 2; - - // ResourceVersion of the list response - int64 resource_version = 3; -} - -message OriginRequest { - // Starting from the requested page (other query parameters must match!) - string next_page_token = 1; - - // Maximum number of items to return - int64 limit = 2; - - // Resource identifier - Key key = 3; - - // List the deleted values (eg, show trash) - string origin = 4; -} - -message ResourceOriginInfo { - // The resource - Key key = 1; - - // Size of the full resource body - int32 resource_size = 2; - - // Hash for the resource - string resource_hash = 3; - - // The origin name - string origin = 4; - - // Path on the origin - string path = 5; - - // Verification hash from the origin - string hash = 6; - - // Change time from the origin - int64 timestamp = 7; -} - -message OriginResponse { - repeated ResourceOriginInfo items = 1; - - // More results exist... pass this in the next request - string next_page_token = 2; - - // ResourceVersion of the list response - int64 resource_version = 3; -} - -message HealthCheckRequest { - string service = 1; -} - -message HealthCheckResponse { - enum ServingStatus { - UNKNOWN = 0; - SERVING = 1; - NOT_SERVING = 2; - SERVICE_UNKNOWN = 3; // Used only by the Watch method. - } - ServingStatus status = 1; -} - -// The entity store provides a basic CRUD (+watch eventually) interface for generic entities -service ResourceStore { - rpc GetResource(GetResourceRequest) returns (GetResourceResponse); - rpc Create(CreateRequest) returns (CreateResponse); - rpc Update(UpdateRequest) returns (UpdateResponse); - rpc Delete(DeleteRequest) returns (DeleteResponse); - rpc List(ListRequest) returns (ListResponse); - rpc Watch(WatchRequest) returns (stream WatchResponse); - - // Get the raw blob bytes and metadata - rpc GetBlob(GetBlobRequest) returns (GetBlobResponse); - - // Show resource history (and trash) - rpc History(HistoryRequest) returns (HistoryResponse); - - // Used for efficient provisioning - rpc Origin(OriginRequest) returns (OriginResponse); - - // Check if the service is healthy - rpc IsHealthy(HealthCheckRequest) returns (HealthCheckResponse); -} diff --git a/pkg/services/store/resource/resource_grpc.pb.go b/pkg/services/store/resource/resource_grpc.pb.go deleted file mode 100644 index 9c774814f57..00000000000 --- a/pkg/services/store/resource/resource_grpc.pb.go +++ /dev/null @@ -1,490 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc (unknown) -// source: resource.proto - -package resource - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 - -const ( - ResourceStore_GetResource_FullMethodName = "/resource.ResourceStore/GetResource" - ResourceStore_Create_FullMethodName = "/resource.ResourceStore/Create" - ResourceStore_Update_FullMethodName = "/resource.ResourceStore/Update" - ResourceStore_Delete_FullMethodName = "/resource.ResourceStore/Delete" - ResourceStore_List_FullMethodName = "/resource.ResourceStore/List" - ResourceStore_Watch_FullMethodName = "/resource.ResourceStore/Watch" - ResourceStore_GetBlob_FullMethodName = "/resource.ResourceStore/GetBlob" - ResourceStore_History_FullMethodName = "/resource.ResourceStore/History" - ResourceStore_Origin_FullMethodName = "/resource.ResourceStore/Origin" - ResourceStore_IsHealthy_FullMethodName = "/resource.ResourceStore/IsHealthy" -) - -// ResourceStoreClient is the client API for ResourceStore 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. -// -// The entity store provides a basic CRUD (+watch eventually) interface for generic entities -type ResourceStoreClient interface { - GetResource(ctx context.Context, in *GetResourceRequest, opts ...grpc.CallOption) (*GetResourceResponse, error) - Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) - Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) - Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) - List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) - Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (ResourceStore_WatchClient, error) - // Get the raw blob bytes and metadata - GetBlob(ctx context.Context, in *GetBlobRequest, opts ...grpc.CallOption) (*GetBlobResponse, error) - // Show resource history (and trash) - History(ctx context.Context, in *HistoryRequest, opts ...grpc.CallOption) (*HistoryResponse, error) - // Used for efficient provisioning - Origin(ctx context.Context, in *OriginRequest, opts ...grpc.CallOption) (*OriginResponse, error) - // Check if the service is healthy - IsHealthy(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) -} - -type resourceStoreClient struct { - cc grpc.ClientConnInterface -} - -func NewResourceStoreClient(cc grpc.ClientConnInterface) ResourceStoreClient { - return &resourceStoreClient{cc} -} - -func (c *resourceStoreClient) GetResource(ctx context.Context, in *GetResourceRequest, opts ...grpc.CallOption) (*GetResourceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetResourceResponse) - err := c.cc.Invoke(ctx, ResourceStore_GetResource_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *resourceStoreClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreateResponse) - err := c.cc.Invoke(ctx, ResourceStore_Create_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *resourceStoreClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UpdateResponse) - err := c.cc.Invoke(ctx, ResourceStore_Update_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *resourceStoreClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeleteResponse) - err := c.cc.Invoke(ctx, ResourceStore_Delete_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *resourceStoreClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListResponse) - err := c.cc.Invoke(ctx, ResourceStore_List_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *resourceStoreClient) Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (ResourceStore_WatchClient, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &ResourceStore_ServiceDesc.Streams[0], ResourceStore_Watch_FullMethodName, cOpts...) - if err != nil { - return nil, err - } - x := &resourceStoreWatchClient{ClientStream: stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type ResourceStore_WatchClient interface { - Recv() (*WatchResponse, error) - grpc.ClientStream -} - -type resourceStoreWatchClient struct { - grpc.ClientStream -} - -func (x *resourceStoreWatchClient) Recv() (*WatchResponse, error) { - m := new(WatchResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *resourceStoreClient) GetBlob(ctx context.Context, in *GetBlobRequest, opts ...grpc.CallOption) (*GetBlobResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetBlobResponse) - err := c.cc.Invoke(ctx, ResourceStore_GetBlob_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *resourceStoreClient) History(ctx context.Context, in *HistoryRequest, opts ...grpc.CallOption) (*HistoryResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(HistoryResponse) - err := c.cc.Invoke(ctx, ResourceStore_History_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *resourceStoreClient) Origin(ctx context.Context, in *OriginRequest, opts ...grpc.CallOption) (*OriginResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(OriginResponse) - err := c.cc.Invoke(ctx, ResourceStore_Origin_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *resourceStoreClient) IsHealthy(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(HealthCheckResponse) - err := c.cc.Invoke(ctx, ResourceStore_IsHealthy_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ResourceStoreServer is the server API for ResourceStore service. -// All implementations should embed UnimplementedResourceStoreServer -// for forward compatibility -// -// The entity store provides a basic CRUD (+watch eventually) interface for generic entities -type ResourceStoreServer interface { - GetResource(context.Context, *GetResourceRequest) (*GetResourceResponse, error) - Create(context.Context, *CreateRequest) (*CreateResponse, error) - Update(context.Context, *UpdateRequest) (*UpdateResponse, error) - Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) - List(context.Context, *ListRequest) (*ListResponse, error) - Watch(*WatchRequest, ResourceStore_WatchServer) error - // Get the raw blob bytes and metadata - GetBlob(context.Context, *GetBlobRequest) (*GetBlobResponse, error) - // Show resource history (and trash) - History(context.Context, *HistoryRequest) (*HistoryResponse, error) - // Used for efficient provisioning - Origin(context.Context, *OriginRequest) (*OriginResponse, error) - // Check if the service is healthy - IsHealthy(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) -} - -// UnimplementedResourceStoreServer should be embedded to have forward compatible implementations. -type UnimplementedResourceStoreServer struct { -} - -func (UnimplementedResourceStoreServer) GetResource(context.Context, *GetResourceRequest) (*GetResourceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetResource not implemented") -} -func (UnimplementedResourceStoreServer) Create(context.Context, *CreateRequest) (*CreateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") -} -func (UnimplementedResourceStoreServer) Update(context.Context, *UpdateRequest) (*UpdateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") -} -func (UnimplementedResourceStoreServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") -} -func (UnimplementedResourceStoreServer) List(context.Context, *ListRequest) (*ListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method List not implemented") -} -func (UnimplementedResourceStoreServer) Watch(*WatchRequest, ResourceStore_WatchServer) error { - return status.Errorf(codes.Unimplemented, "method Watch not implemented") -} -func (UnimplementedResourceStoreServer) GetBlob(context.Context, *GetBlobRequest) (*GetBlobResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetBlob not implemented") -} -func (UnimplementedResourceStoreServer) History(context.Context, *HistoryRequest) (*HistoryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method History not implemented") -} -func (UnimplementedResourceStoreServer) Origin(context.Context, *OriginRequest) (*OriginResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Origin not implemented") -} -func (UnimplementedResourceStoreServer) IsHealthy(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IsHealthy not implemented") -} - -// UnsafeResourceStoreServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ResourceStoreServer will -// result in compilation errors. -type UnsafeResourceStoreServer interface { - mustEmbedUnimplementedResourceStoreServer() -} - -func RegisterResourceStoreServer(s grpc.ServiceRegistrar, srv ResourceStoreServer) { - s.RegisterService(&ResourceStore_ServiceDesc, srv) -} - -func _ResourceStore_GetResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetResourceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ResourceStoreServer).GetResource(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ResourceStore_GetResource_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ResourceStoreServer).GetResource(ctx, req.(*GetResourceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ResourceStore_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ResourceStoreServer).Create(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ResourceStore_Create_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ResourceStoreServer).Create(ctx, req.(*CreateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ResourceStore_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ResourceStoreServer).Update(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ResourceStore_Update_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ResourceStoreServer).Update(ctx, req.(*UpdateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ResourceStore_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ResourceStoreServer).Delete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ResourceStore_Delete_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ResourceStoreServer).Delete(ctx, req.(*DeleteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ResourceStore_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ResourceStoreServer).List(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ResourceStore_List_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ResourceStoreServer).List(ctx, req.(*ListRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ResourceStore_Watch_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(WatchRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(ResourceStoreServer).Watch(m, &resourceStoreWatchServer{ServerStream: stream}) -} - -type ResourceStore_WatchServer interface { - Send(*WatchResponse) error - grpc.ServerStream -} - -type resourceStoreWatchServer struct { - grpc.ServerStream -} - -func (x *resourceStoreWatchServer) Send(m *WatchResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _ResourceStore_GetBlob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetBlobRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ResourceStoreServer).GetBlob(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ResourceStore_GetBlob_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ResourceStoreServer).GetBlob(ctx, req.(*GetBlobRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ResourceStore_History_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HistoryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ResourceStoreServer).History(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ResourceStore_History_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ResourceStoreServer).History(ctx, req.(*HistoryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ResourceStore_Origin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(OriginRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ResourceStoreServer).Origin(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ResourceStore_Origin_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ResourceStoreServer).Origin(ctx, req.(*OriginRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ResourceStore_IsHealthy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(HealthCheckRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ResourceStoreServer).IsHealthy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ResourceStore_IsHealthy_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ResourceStoreServer).IsHealthy(ctx, req.(*HealthCheckRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// ResourceStore_ServiceDesc is the grpc.ServiceDesc for ResourceStore service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ResourceStore_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "resource.ResourceStore", - HandlerType: (*ResourceStoreServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetResource", - Handler: _ResourceStore_GetResource_Handler, - }, - { - MethodName: "Create", - Handler: _ResourceStore_Create_Handler, - }, - { - MethodName: "Update", - Handler: _ResourceStore_Update_Handler, - }, - { - MethodName: "Delete", - Handler: _ResourceStore_Delete_Handler, - }, - { - MethodName: "List", - Handler: _ResourceStore_List_Handler, - }, - { - MethodName: "GetBlob", - Handler: _ResourceStore_GetBlob_Handler, - }, - { - MethodName: "History", - Handler: _ResourceStore_History_Handler, - }, - { - MethodName: "Origin", - Handler: _ResourceStore_Origin_Handler, - }, - { - MethodName: "IsHealthy", - Handler: _ResourceStore_IsHealthy_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Watch", - Handler: _ResourceStore_Watch_Handler, - ServerStreams: true, - }, - }, - Metadata: "resource.proto", -} diff --git a/pkg/services/store/resource/tests/common_test.go b/pkg/services/store/resource/tests/common_test.go deleted file mode 100644 index c9ceb92aa7e..00000000000 --- a/pkg/services/store/resource/tests/common_test.go +++ /dev/null @@ -1,105 +0,0 @@ -package resource_server_tests - -import ( - "context" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/grafana/grafana/pkg/infra/tracing" - - "github.com/grafana/grafana/pkg/components/satokengen" - "github.com/grafana/grafana/pkg/infra/appcontext" - "github.com/grafana/grafana/pkg/server" - "github.com/grafana/grafana/pkg/services/featuremgmt" - "github.com/grafana/grafana/pkg/services/org" - saAPI "github.com/grafana/grafana/pkg/services/serviceaccounts/api" - saTests "github.com/grafana/grafana/pkg/services/serviceaccounts/tests" - "github.com/grafana/grafana/pkg/services/store/entity/db/dbimpl" - "github.com/grafana/grafana/pkg/services/store/resource" - "github.com/grafana/grafana/pkg/services/store/resource/sqlstash" - "github.com/grafana/grafana/pkg/services/user" - "github.com/grafana/grafana/pkg/tests/testinfra" - "github.com/grafana/grafana/pkg/tests/testsuite" -) - -func TestMain(m *testing.M) { - testsuite.Run(m) -} - -func createServiceAccountAdminToken(t *testing.T, env *server.TestEnv) (string, *user.SignedInUser) { - t.Helper() - - account := saTests.SetupUserServiceAccount(t, env.SQLStore, env.Cfg, saTests.TestUser{ - Name: "grpc-server-sa", - Role: string(org.RoleAdmin), - Login: "grpc-server-sa", - IsServiceAccount: true, - }) - - keyGen, err := satokengen.New(saAPI.ServiceID) - require.NoError(t, err) - - _ = saTests.SetupApiKey(t, env.SQLStore, env.Cfg, saTests.TestApiKey{ - Name: "grpc-server-test", - Role: org.RoleAdmin, - OrgId: account.OrgID, - Key: keyGen.HashedKey, - ServiceAccountID: &account.ID, - }) - - return keyGen.ClientSecret, &user.SignedInUser{ - UserID: account.ID, - Email: account.Email, - Name: account.Name, - Login: account.Login, - OrgID: account.OrgID, - IsServiceAccount: account.IsServiceAccount, - } -} - -type testContext struct { - authToken string - client resource.ResourceStoreClient - user *user.SignedInUser - ctx context.Context -} - -func createTestContext(t *testing.T) testContext { - t.Helper() - - dir, path := testinfra.CreateGrafDir(t, testinfra.GrafanaOpts{ - EnableFeatureToggles: []string{ - featuremgmt.FlagGrpcServer, - featuremgmt.FlagUnifiedStorage, - }, - AppModeProduction: false, // required for migrations to run - GRPCServerAddress: "127.0.0.1:0", // :0 for choosing the port automatically - }) - - _, env := testinfra.StartGrafanaEnv(t, dir, path) - - authToken, serviceAccountUser := createServiceAccountAdminToken(t, env) - - eDB, err := dbimpl.ProvideEntityDB(env.SQLStore, env.Cfg, env.FeatureToggles, nil) - require.NoError(t, err) - - err = eDB.Init() - require.NoError(t, err) - - traceConfig, err := tracing.ParseTracingConfig(env.Cfg) - require.NoError(t, err) - tracer, err := tracing.ProvideService(traceConfig) - require.NoError(t, err) - store, err := sqlstash.ProvideSQLResourceServer(eDB, tracer) - require.NoError(t, err) - - client := resource.NewResourceStoreClientLocal(store) - - return testContext{ - authToken: authToken, - client: client, - user: serviceAccountUser, - ctx: appcontext.WithUser(context.Background(), serviceAccountUser), - } -} diff --git a/pkg/services/store/resource/tests/server_integration_test.go b/pkg/services/store/resource/tests/server_integration_test.go deleted file mode 100644 index 83305c25fc6..00000000000 --- a/pkg/services/store/resource/tests/server_integration_test.go +++ /dev/null @@ -1,84 +0,0 @@ -package resource_server_tests - -import ( - _ "embed" - "encoding/json" - "fmt" - "net/http" - "testing" - - "github.com/stretchr/testify/require" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - - "github.com/grafana/grafana/pkg/apis/playlist/v0alpha1" - "github.com/grafana/grafana/pkg/infra/appcontext" - "github.com/grafana/grafana/pkg/services/store/resource" -) - -var ( - //go:embed testdata/dashboard-with-tags-b-g.json - dashboardWithTagsBlueGreen string - //go:embed testdata/dashboard-with-tags-r-g.json - dashboardWithTagsRedGreen string -) - -func TestIntegrationEntityServer(t *testing.T) { - if testing.Short() { - t.Skip("skipping integration test") - } - - testCtx := createTestContext(t) - ctx := appcontext.WithUser(testCtx.ctx, testCtx.user) - - t.Run("should not retrieve non-existent objects", func(t *testing.T) { - resp, err := testCtx.client.GetResource(ctx, &resource.GetResourceRequest{ - Key: &resource.Key{ - Group: "X", - Namespace: "X", - }, - }) - require.NoError(t, err) - require.NotNil(t, resp) - require.NotNil(t, resp.Status) - require.Nil(t, resp.Value) - require.Equal(t, int32(http.StatusBadRequest), resp.Status.Code) - }) - - t.Run("insert an object", func(t *testing.T) { - var err error - key := &resource.Key{ - Namespace: "default", - Group: "playlists.grafana.app", - Resource: "Playlist", - Name: "x123", - } - sample := v0alpha1.Playlist{ - ObjectMeta: metav1.ObjectMeta{ - Name: key.Name, - Namespace: key.Namespace, - UID: types.UID("xyz"), - }, - TypeMeta: metav1.TypeMeta{ - Kind: key.Resource, - APIVersion: key.Group + "/v0alpha1", - }, - Spec: v0alpha1.Spec{ - Title: "hello", - }, - } - req := &resource.CreateRequest{ - Key: key, - } - req.Value, err = json.Marshal(sample) - require.NoError(t, err) - - fmt.Printf("%s", string(req.Value)) - - resp, err := testCtx.client.Create(ctx, req) - require.NoError(t, err) - require.NotNil(t, resp) - require.Nil(t, resp.Status) - require.True(t, resp.ResourceVersion > 0) // that it has a positive resource version - }) -} diff --git a/pkg/services/store/resource/tests/testdata/dashboard-with-tags-b-g.json b/pkg/services/store/resource/tests/testdata/dashboard-with-tags-b-g.json deleted file mode 100644 index 5bbe8e786fb..00000000000 --- a/pkg/services/store/resource/tests/testdata/dashboard-with-tags-b-g.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "tags": [ - "blue", - "green" - ], - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 221, - "links": [], - "liveNow": false, - "panels": [ - { - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 8 - }, - "id": 8, - "title": "Row title", - "type": "row" - } - ], - "schemaVersion": 36, - "templating": { - "list": [] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "special ds", - "uid": "mocpwtR4k", - "version": 1, - "weekStart": "" -} diff --git a/pkg/services/store/resource/tests/testdata/dashboard-with-tags-r-g.json b/pkg/services/store/resource/tests/testdata/dashboard-with-tags-r-g.json deleted file mode 100644 index 67fdda77352..00000000000 --- a/pkg/services/store/resource/tests/testdata/dashboard-with-tags-r-g.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "tags": [ - "red", - "green" - ], - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 221, - "links": [], - "liveNow": false, - "panels": [ - { - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 8 - }, - "id": 8, - "title": "Row title", - "type": "row" - } - ], - "schemaVersion": 36, - "templating": { - "list": [] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "special ds", - "uid": "mocpwtR4k", - "version": 1, - "weekStart": "" -} diff --git a/pkg/services/store/resource/utils.go b/pkg/services/store/resource/utils.go deleted file mode 100644 index 8eb6cc9ad00..00000000000 --- a/pkg/services/store/resource/utils.go +++ /dev/null @@ -1,36 +0,0 @@ -package resource - -import ( - "fmt" - "strconv" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// ObjectKey creates a key for a given object -func ObjectKey(gr schema.GroupResource, obj metav1.Object) (*Key, error) { - if gr.Group == "" { - return nil, fmt.Errorf("missing group") - } - if gr.Resource == "" { - return nil, fmt.Errorf("missing resource") - } - if obj.GetName() == "" { - return nil, fmt.Errorf("object is missing name") - } - key := &Key{ - Group: gr.Group, - Resource: gr.Resource, - Namespace: obj.GetNamespace(), - Name: obj.GetName(), - } - if obj.GetResourceVersion() != "" { - var err error - key.ResourceVersion, err = strconv.ParseInt(obj.GetResourceVersion(), 10, 64) - if err != nil { - return nil, fmt.Errorf("storage requires numeric revision version %w", err) - } - } - return key, nil -} diff --git a/pkg/storage/api/buf.yaml b/pkg/storage/api/buf.yaml deleted file mode 100644 index 1a5194568a9..00000000000 --- a/pkg/storage/api/buf.yaml +++ /dev/null @@ -1,7 +0,0 @@ -version: v1 -breaking: - use: - - FILE -lint: - use: - - DEFAULT diff --git a/pkg/storage/api/testdata/01_create_playlist.json b/pkg/storage/api/testdata/01_create_playlist.json deleted file mode 100644 index b0272532e8d..00000000000 --- a/pkg/storage/api/testdata/01_create_playlist.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "apiVersion": "playlist.grafana.app/v0alpha1", - "kind": "Playlist", - "metadata": { - "name": "fdgsv37qslr0ga", - "namespace": "default", - "annotations": { - "grafana.app/originName": "elsewhere", - "grafana.app/originPath": "path/to/item", - "grafana.app/originTimestamp": "2024-02-02T00:00:00Z" - }, - "creationTimestamp": "2024-03-03T00:00:00Z", - "uid": "8tGrXJgGbFI0" - }, - "spec": { - "title": "hello", - "interval": "5m", - "items": [ - { - "type": "dashboard_by_uid", - "value": "vmie2cmWz" - } - ] - } -} \ No newline at end of file diff --git a/pkg/services/store/resource/sqlstash/data/common.sql b/pkg/storage/sqlstash/data/common.sql similarity index 100% rename from pkg/services/store/resource/sqlstash/data/common.sql rename to pkg/storage/sqlstash/data/common.sql diff --git a/pkg/services/store/resource/sqlstash/data/resource_get.sql b/pkg/storage/sqlstash/data/resource_get.sql similarity index 100% rename from pkg/services/store/resource/sqlstash/data/resource_get.sql rename to pkg/storage/sqlstash/data/resource_get.sql diff --git a/pkg/services/store/resource/sqlstash/data/resource_insert.sql b/pkg/storage/sqlstash/data/resource_insert.sql similarity index 100% rename from pkg/services/store/resource/sqlstash/data/resource_insert.sql rename to pkg/storage/sqlstash/data/resource_insert.sql diff --git a/pkg/services/store/resource/sqlstash/data/rv_get.sql b/pkg/storage/sqlstash/data/rv_get.sql similarity index 100% rename from pkg/services/store/resource/sqlstash/data/rv_get.sql rename to pkg/storage/sqlstash/data/rv_get.sql diff --git a/pkg/services/store/resource/sqlstash/data/rv_inc.sql b/pkg/storage/sqlstash/data/rv_inc.sql similarity index 100% rename from pkg/services/store/resource/sqlstash/data/rv_inc.sql rename to pkg/storage/sqlstash/data/rv_inc.sql diff --git a/pkg/services/store/resource/sqlstash/data/rv_insert.sql b/pkg/storage/sqlstash/data/rv_insert.sql similarity index 100% rename from pkg/services/store/resource/sqlstash/data/rv_insert.sql rename to pkg/storage/sqlstash/data/rv_insert.sql diff --git a/pkg/services/store/resource/sqlstash/data/rv_lock.sql b/pkg/storage/sqlstash/data/rv_lock.sql similarity index 100% rename from pkg/services/store/resource/sqlstash/data/rv_lock.sql rename to pkg/storage/sqlstash/data/rv_lock.sql diff --git a/pkg/services/store/resource/sqlstash/queries.go b/pkg/storage/sqlstash/queries.go similarity index 100% rename from pkg/services/store/resource/sqlstash/queries.go rename to pkg/storage/sqlstash/queries.go diff --git a/pkg/services/store/resource/sqlstash/queries_test.go b/pkg/storage/sqlstash/queries_test.go similarity index 78% rename from pkg/services/store/resource/sqlstash/queries_test.go rename to pkg/storage/sqlstash/queries_test.go index 9e698515894..8120e8c3b00 100644 --- a/pkg/services/store/resource/sqlstash/queries_test.go +++ b/pkg/storage/sqlstash/queries_test.go @@ -8,29 +8,29 @@ import ( "github.com/stretchr/testify/require" + "github.com/grafana/grafana/pkg/apimachinery/identity" playlist "github.com/grafana/grafana/pkg/apis/playlist/v0alpha1" "github.com/grafana/grafana/pkg/infra/appcontext" - "github.com/grafana/grafana/pkg/models/roletype" - "github.com/grafana/grafana/pkg/services/store/resource" "github.com/grafana/grafana/pkg/services/user" + "github.com/grafana/grafana/pkg/storage/unified" ) func TestSQLCommands(t *testing.T) { ctx := appcontext.WithUser(context.Background(), &user.SignedInUser{ UserID: 123, UserUID: "u123", - OrgRole: roletype.RoleAdmin, + OrgRole: identity.RoleAdmin, }) - validator := resource.NewEventValidator(resource.EventValidatorOptions{ + validator := unified.NewEventValidator(unified.EventValidatorOptions{ // no folders for now }) t.Run("insert playlist SQL", func(t *testing.T) { input := testdataFromJSON(t, "01_create_playlist.json", &playlist.Playlist{}) - key, err := resource.ObjectKey(playlist.PlaylistResourceInfo.GroupResource(), input) + key, err := unified.ResourceKeyFor(playlist.PlaylistResourceInfo.GroupResource(), input) require.NoError(t, err) - req := &resource.CreateRequest{Key: key, Message: "test commit"} + req := &unified.CreateRequest{Key: key, Message: "test commit"} req.Value, err = json.Marshal(input) require.NoError(t, err) require.Equal(t, "default/playlist.grafana.app/playlists/fdgsv37qslr0ga", key.NamespacedPath()) diff --git a/pkg/services/store/resource/sqlstash/sql_storage_server.go b/pkg/storage/sqlstash/sql_storage_server.go similarity index 73% rename from pkg/services/store/resource/sqlstash/sql_storage_server.go rename to pkg/storage/sqlstash/sql_storage_server.go index 298b21c4dab..a75c4f683c9 100644 --- a/pkg/services/store/resource/sqlstash/sql_storage_server.go +++ b/pkg/storage/sqlstash/sql_storage_server.go @@ -18,7 +18,7 @@ import ( "github.com/grafana/grafana/pkg/services/store/entity/db" "github.com/grafana/grafana/pkg/services/store/entity/sqlstash" "github.com/grafana/grafana/pkg/services/store/entity/sqlstash/sqltemplate" - "github.com/grafana/grafana/pkg/services/store/resource" + "github.com/grafana/grafana/pkg/storage/unified" ) const resoruceTable = "resource" @@ -35,7 +35,7 @@ var ( ) // Make sure we implement correct interfaces -var _ resource.ResourceStoreServer = &sqlResourceServer{} +var _ unified.ResourceStoreServer = &sqlResourceServer{} func ProvideSQLResourceServer(db db.EntityDBInterface, tracer tracing.Tracer) (SqlResourceServer, error) { ctx, cancel := context.WithCancel(context.Background()) @@ -56,7 +56,7 @@ func ProvideSQLResourceServer(db db.EntityDBInterface, tracer tracing.Tracer) (S } type SqlResourceServer interface { - resource.ResourceStoreServer + unified.ResourceStoreServer Init() error Stop() @@ -67,12 +67,12 @@ type sqlResourceServer struct { db db.EntityDBInterface // needed to keep xorm engine in scope sess *session.SessionDB dialect migrator.Dialect - broadcaster sqlstash.Broadcaster[*resource.WatchResponse] + broadcaster sqlstash.Broadcaster[*unified.WatchResponse] ctx context.Context // TODO: remove cancel context.CancelFunc - stream chan *resource.WatchResponse + stream chan *unified.WatchResponse tracer trace.Tracer - validator resource.EventValidator + validator unified.EventValidator once sync.Once initErr error @@ -138,12 +138,12 @@ func (s *sqlResourceServer) init() error { s.sess = sess s.dialect = migrator.NewDialect(engine.DriverName()) - s.validator = resource.NewEventValidator(resource.EventValidatorOptions{ + s.validator = unified.NewEventValidator(unified.EventValidatorOptions{ // use snowflake IDs }) // set up the broadcaster - s.broadcaster, err = sqlstash.NewBroadcaster(s.ctx, func(stream chan *resource.WatchResponse) error { + s.broadcaster, err = sqlstash.NewBroadcaster(s.ctx, func(stream chan *unified.WatchResponse) error { s.stream = stream // start the poller @@ -158,7 +158,7 @@ func (s *sqlResourceServer) init() error { return nil } -func (s *sqlResourceServer) IsHealthy(ctx context.Context, r *resource.HealthCheckRequest) (*resource.HealthCheckResponse, error) { +func (s *sqlResourceServer) IsHealthy(ctx context.Context, r *unified.HealthCheckRequest) (*unified.HealthCheckResponse, error) { ctxLogger := s.log.FromContext(log.WithContextualAttributes(ctx, []any{"method", "isHealthy"})) if err := s.Init(); err != nil { ctxLogger.Error("init error", "error", err) @@ -169,14 +169,14 @@ func (s *sqlResourceServer) IsHealthy(ctx context.Context, r *resource.HealthChe return nil, err } // TODO: check the status of the watcher implementation as well - return &resource.HealthCheckResponse{Status: resource.HealthCheckResponse_SERVING}, nil + return &unified.HealthCheckResponse{Status: unified.HealthCheckResponse_SERVING}, nil } func (s *sqlResourceServer) Stop() { s.cancel() } -func (s *sqlResourceServer) GetResource(ctx context.Context, req *resource.GetResourceRequest) (*resource.GetResourceResponse, error) { +func (s *sqlResourceServer) GetResource(ctx context.Context, req *unified.GetResourceRequest) (*unified.GetResourceResponse, error) { ctx, span := s.tracer.Start(ctx, "storage_server.GetResource") defer span.End() @@ -185,10 +185,10 @@ func (s *sqlResourceServer) GetResource(ctx context.Context, req *resource.GetRe } if req.Key.Group == "" { - return &resource.GetResourceResponse{Status: badRequest("missing group")}, nil + return &unified.GetResourceResponse{Status: badRequest("missing group")}, nil } if req.Key.Resource == "" { - return &resource.GetResourceResponse{Status: badRequest("missing resource")}, nil + return &unified.GetResourceResponse{Status: badRequest("missing resource")}, nil } fmt.Printf("TODO, GET: %+v", req.Key) @@ -196,12 +196,12 @@ func (s *sqlResourceServer) GetResource(ctx context.Context, req *resource.GetRe return nil, ErrNotImplementedYet } -func (s *sqlResourceServer) Create(ctx context.Context, req *resource.CreateRequest) (*resource.CreateResponse, error) { +func (s *sqlResourceServer) Create(ctx context.Context, req *unified.CreateRequest) (*unified.CreateResponse, error) { ctx, span := s.tracer.Start(ctx, "storage_server.Create") defer span.End() if req.Key.ResourceVersion > 0 { - return &resource.CreateResponse{ + return &unified.CreateResponse{ Status: badRequest("can not update a specific resource version"), }, nil } @@ -215,7 +215,7 @@ func (s *sqlResourceServer) Create(ctx context.Context, req *resource.CreateRequ return nil, err } if event.Status != nil { - return &resource.CreateResponse{Status: event.Status}, nil + return &unified.CreateResponse{Status: event.Status}, nil } fmt.Printf("TODO, CREATE: %v", event) @@ -223,12 +223,12 @@ func (s *sqlResourceServer) Create(ctx context.Context, req *resource.CreateRequ return nil, ErrNotImplementedYet } -func (s *sqlResourceServer) Update(ctx context.Context, req *resource.UpdateRequest) (*resource.UpdateResponse, error) { +func (s *sqlResourceServer) Update(ctx context.Context, req *unified.UpdateRequest) (*unified.UpdateResponse, error) { ctx, span := s.tracer.Start(ctx, "storage_server.Update") defer span.End() if req.Key.ResourceVersion < 0 { - return &resource.UpdateResponse{ + return &unified.UpdateResponse{ Status: badRequest("update must include the previous version"), }, nil } @@ -237,29 +237,18 @@ func (s *sqlResourceServer) Update(ctx context.Context, req *resource.UpdateRequ return nil, err } - latest, err := s.GetResource(ctx, &resource.GetResourceRequest{ + latest, err := s.GetResource(ctx, &unified.GetResourceRequest{ Key: req.Key.WithoutResourceVersion(), }) if err != nil { return nil, err } - if latest.Value == nil { - return &resource.UpdateResponse{ - Status: badRequest("existing value does not exist"), - }, nil - } - if latest.ResourceVersion != req.Key.ResourceVersion { - return &resource.UpdateResponse{ - Status: badRequest("not the latest resource version"), - }, nil - } - - event, err := s.validator.PrepareUpdate(ctx, req, latest.Value) + event, err := s.validator.PrepareUpdate(ctx, req, latest) if err != nil { return nil, err } if event.Status != nil { - return &resource.UpdateResponse{Status: event.Status}, nil + return &unified.UpdateResponse{Status: event.Status}, nil } fmt.Printf("TODO, UPDATE: %v", event) @@ -267,20 +256,40 @@ func (s *sqlResourceServer) Update(ctx context.Context, req *resource.UpdateRequ return nil, ErrNotImplementedYet } -func (s *sqlResourceServer) Delete(ctx context.Context, req *resource.DeleteRequest) (*resource.DeleteResponse, error) { +func (s *sqlResourceServer) Delete(ctx context.Context, req *unified.DeleteRequest) (*unified.DeleteResponse, error) { ctx, span := s.tracer.Start(ctx, "storage_server.Delete") defer span.End() + if req.Key.ResourceVersion < 0 { + return &unified.DeleteResponse{ + Status: badRequest("update must include the previous version"), + }, nil + } + if err := s.Init(); err != nil { return nil, err } - fmt.Printf("TODO, DELETE: %+v // %s", req.Key, ctx.Value("X")) + latest, err := s.GetResource(ctx, &unified.GetResourceRequest{ + Key: req.Key.WithoutResourceVersion(), + }) + if err != nil { + return nil, err + } + event, err := s.validator.PrepareDelete(ctx, req, latest) + if err != nil { + return nil, err + } + if event.Status != nil { + return &unified.DeleteResponse{Status: event.Status}, nil + } + + fmt.Printf("TODO, DELETE: %+v ", req.Key) return nil, ErrNotImplementedYet } -func (s *sqlResourceServer) List(ctx context.Context, req *resource.ListRequest) (*resource.ListResponse, error) { +func (s *sqlResourceServer) List(ctx context.Context, req *unified.ListRequest) (*unified.ListResponse, error) { ctx, span := s.tracer.Start(ctx, "storage_server.List") defer span.End() @@ -315,7 +324,7 @@ func (s *sqlResourceServer) List(ctx context.Context, req *resource.ListRequest) } // Get the raw blob bytes and metadata -func (s *sqlResourceServer) GetBlob(ctx context.Context, req *resource.GetBlobRequest) (*resource.GetBlobResponse, error) { +func (s *sqlResourceServer) GetBlob(ctx context.Context, req *unified.GetBlobRequest) (*unified.GetBlobResponse, error) { ctx, span := s.tracer.Start(ctx, "storage_server.List") defer span.End() @@ -329,7 +338,7 @@ func (s *sqlResourceServer) GetBlob(ctx context.Context, req *resource.GetBlobRe } // Show resource history (and trash) -func (s *sqlResourceServer) History(ctx context.Context, req *resource.HistoryRequest) (*resource.HistoryResponse, error) { +func (s *sqlResourceServer) History(ctx context.Context, req *unified.HistoryRequest) (*unified.HistoryResponse, error) { ctx, span := s.tracer.Start(ctx, "storage_server.History") defer span.End() @@ -343,7 +352,7 @@ func (s *sqlResourceServer) History(ctx context.Context, req *resource.HistoryRe } // Used for efficient provisioning -func (s *sqlResourceServer) Origin(ctx context.Context, req *resource.OriginRequest) (*resource.OriginResponse, error) { +func (s *sqlResourceServer) Origin(ctx context.Context, req *unified.OriginRequest) (*unified.OriginResponse, error) { ctx, span := s.tracer.Start(ctx, "storage_server.History") defer span.End() diff --git a/pkg/services/store/resource/sqlstash/testdata/01_create_playlist.json b/pkg/storage/sqlstash/testdata/01_create_playlist.json similarity index 100% rename from pkg/services/store/resource/sqlstash/testdata/01_create_playlist.json rename to pkg/storage/sqlstash/testdata/01_create_playlist.json diff --git a/pkg/services/store/resource/sqlstash/utils.go b/pkg/storage/sqlstash/utils.go similarity index 95% rename from pkg/services/store/resource/sqlstash/utils.go rename to pkg/storage/sqlstash/utils.go index 9b22ab2e283..40c5d809e88 100644 --- a/pkg/services/store/resource/sqlstash/utils.go +++ b/pkg/storage/sqlstash/utils.go @@ -9,11 +9,11 @@ import ( "github.com/grafana/grafana/pkg/services/store/entity/db" "github.com/grafana/grafana/pkg/services/store/entity/sqlstash/sqltemplate" - "github.com/grafana/grafana/pkg/services/store/resource" + "github.com/grafana/grafana/pkg/storage/unified" ) -func badRequest(msg string) *resource.StatusResult { - return &resource.StatusResult{ +func badRequest(msg string) *unified.StatusResult { + return &unified.StatusResult{ Status: "Failure", Message: msg, Code: http.StatusBadRequest, diff --git a/pkg/services/store/resource/sqlstash/utils_test.go b/pkg/storage/sqlstash/utils_test.go similarity index 100% rename from pkg/services/store/resource/sqlstash/utils_test.go rename to pkg/storage/sqlstash/utils_test.go diff --git a/pkg/services/store/resource/sqlstash/watch.go b/pkg/storage/sqlstash/watch.go similarity index 70% rename from pkg/services/store/resource/sqlstash/watch.go rename to pkg/storage/sqlstash/watch.go index 3c25a8f7ce4..0a170e1103e 100644 --- a/pkg/services/store/resource/sqlstash/watch.go +++ b/pkg/storage/sqlstash/watch.go @@ -4,14 +4,14 @@ import ( "time" "github.com/grafana/grafana/pkg/infra/log" - "github.com/grafana/grafana/pkg/services/store/resource" + "github.com/grafana/grafana/pkg/storage/unified" ) -func (s *sqlResourceServer) Watch(*resource.WatchRequest, resource.ResourceStore_WatchServer) error { +func (s *sqlResourceServer) Watch(*unified.WatchRequest, unified.ResourceStore_WatchServer) error { return ErrNotImplementedYet } -func (s *sqlResourceServer) poller(stream chan *resource.WatchResponse) { +func (s *sqlResourceServer) poller(stream chan *unified.WatchResponse) { var err error since := int64(0) @@ -34,7 +34,7 @@ func (s *sqlResourceServer) poller(stream chan *resource.WatchResponse) { } } -func (s *sqlResourceServer) poll(since int64, out chan *resource.WatchResponse) (int64, error) { +func (s *sqlResourceServer) poll(since int64, out chan *unified.WatchResponse) (int64, error) { ctx, span := s.tracer.Start(s.ctx, "storage_server.poll") defer span.End() ctxLogger := s.log.FromContext(log.WithContextualAttributes(ctx, []any{"method", "poll"})) @@ -43,7 +43,7 @@ func (s *sqlResourceServer) poll(since int64, out chan *resource.WatchResponse) err := func() error { if false { // TODO - out <- &resource.WatchResponse{} + out <- &unified.WatchResponse{} } // TODO, copy from entity store diff --git a/pkg/storage/api/buf.gen.yaml b/pkg/storage/unified/buf.gen.yaml similarity index 74% rename from pkg/storage/api/buf.gen.yaml rename to pkg/storage/unified/buf.gen.yaml index 65658280dc1..d8ed501cf57 100644 --- a/pkg/storage/api/buf.gen.yaml +++ b/pkg/storage/unified/buf.gen.yaml @@ -1,10 +1,10 @@ version: v1 plugins: - plugin: go - out: pkg/storage/api + out: pkg/storage/unified opt: paths=source_relative - plugin: go-grpc - out: pkg/storage/api + out: pkg/storage/unified opt: - paths=source_relative - require_unimplemented_servers=false diff --git a/pkg/services/store/resource/buf.yaml b/pkg/storage/unified/buf.yaml similarity index 100% rename from pkg/services/store/resource/buf.yaml rename to pkg/storage/unified/buf.yaml diff --git a/pkg/storage/unified/client_wrapper.go b/pkg/storage/unified/client_wrapper.go new file mode 100644 index 00000000000..06a4e2caacb --- /dev/null +++ b/pkg/storage/unified/client_wrapper.go @@ -0,0 +1,30 @@ +package unified + +import ( + "github.com/fullstorydev/grpchan" + "github.com/fullstorydev/grpchan/inprocgrpc" + grpcAuth "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/auth" + "google.golang.org/grpc" + + grpcUtils "github.com/grafana/grafana/pkg/services/store/entity/grpc" +) + +func NewResourceStoreClientLocal(server ResourceStoreServer) ResourceStoreClient { + channel := &inprocgrpc.Channel{} + + auth := &grpcUtils.Authenticator{} + + channel.RegisterService( + grpchan.InterceptServer( + &ResourceStore_ServiceDesc, + grpcAuth.UnaryServerInterceptor(auth.Authenticate), + grpcAuth.StreamServerInterceptor(auth.Authenticate), + ), + server, + ) + return NewResourceStoreClient(grpchan.InterceptClientConn(channel, grpcUtils.UnaryClientInterceptor, grpcUtils.StreamClientInterceptor)) +} + +func NewEntityStoreClientGRPC(channel *grpc.ClientConn) ResourceStoreClient { + return NewResourceStoreClient(grpchan.InterceptClientConn(channel, grpcUtils.UnaryClientInterceptor, grpcUtils.StreamClientInterceptor)) +} diff --git a/pkg/storage/unified/deleted.go b/pkg/storage/unified/deleted.go new file mode 100644 index 00000000000..e1fc78ae664 --- /dev/null +++ b/pkg/storage/unified/deleted.go @@ -0,0 +1,37 @@ +package unified + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +// This object is written when an object is deleted +type DeletedMarker struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeletedMarker) DeepCopyInto(out *DeletedMarker) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeletedMarker. +func (in *DeletedMarker) DeepCopy() *DeletedMarker { + if in == nil { + return nil + } + out := new(DeletedMarker) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DeletedMarker) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} diff --git a/pkg/storage/api/event.go b/pkg/storage/unified/event.go similarity index 78% rename from pkg/storage/api/event.go rename to pkg/storage/unified/event.go index 9a4e5f31324..356153805b1 100644 --- a/pkg/storage/api/event.go +++ b/pkg/storage/unified/event.go @@ -1,11 +1,12 @@ -package api +package unified import ( + "encoding/json" "fmt" "net/http" + "github.com/grafana/grafana/pkg/apimachinery/identity" "github.com/grafana/grafana/pkg/apimachinery/utils" - "github.com/grafana/grafana/pkg/services/auth/identity" ) type WriteEvent struct { @@ -14,7 +15,10 @@ type WriteEvent struct { Requester identity.Requester Operation ResourceOperation PreviousRV int64 // only for Update+Delete - Value []byte + + // The raw JSON payload + // NOTE, this is never mutated, only parsed and validated + Value json.RawMessage Object utils.GrafanaMetaAccessor OldObject utils.GrafanaMetaAccessor diff --git a/pkg/storage/api/go.mod b/pkg/storage/unified/go.mod similarity index 90% rename from pkg/storage/api/go.mod rename to pkg/storage/unified/go.mod index 45f38e3e089..fa54af5209d 100644 --- a/pkg/storage/api/go.mod +++ b/pkg/storage/unified/go.mod @@ -1,8 +1,10 @@ -module github.com/grafana/grafana/pkg/storage/api +module github.com/grafana/grafana/pkg/storage/unified go 1.21.10 -require ( +require ( + github.com/bwmarrin/snowflake v0.3.0 + github.com/grafana/grafana/pkg/apimachinery v0.0.0-20240409140820-518d3341d58f github.com/fullstorydev/grpchan v1.1.1 github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 github.com/stretchr/testify v1.9.0 diff --git a/pkg/storage/api/go.sum b/pkg/storage/unified/go.sum similarity index 100% rename from pkg/storage/api/go.sum rename to pkg/storage/unified/go.sum diff --git a/pkg/storage/api/resource.go b/pkg/storage/unified/resource.go similarity index 67% rename from pkg/storage/api/resource.go rename to pkg/storage/unified/resource.go index 4458a9500fa..8a2c07949b4 100644 --- a/pkg/storage/api/resource.go +++ b/pkg/storage/unified/resource.go @@ -1,8 +1,12 @@ -package api +package unified import ( "bytes" "fmt" + "strconv" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" ) // NamespacedPath is a path that can be used to isolate tenant data @@ -48,3 +52,20 @@ func (x *ResourceKey) WithoutResourceVersion() *ResourceKey { Name: x.Name, } } + +func ResourceKeyFor(gr schema.GroupResource, obj metav1.Object) (*ResourceKey, error) { + key := &ResourceKey{ + Group: gr.Group, + Resource: gr.Resource, + Namespace: obj.GetNamespace(), + Name: obj.GetName(), + } + rv := obj.GetResourceVersion() + if rv != "" { + var err error + key.ResourceVersion, err = strconv.ParseInt(rv, 10, 64) + return key, err + } + return key, nil + +} diff --git a/pkg/storage/api/resource.pb.go b/pkg/storage/unified/resource.pb.go similarity index 65% rename from pkg/storage/api/resource.pb.go rename to pkg/storage/unified/resource.pb.go index 44f05065c5d..9d4d1c93580 100644 --- a/pkg/storage/api/resource.pb.go +++ b/pkg/storage/unified/resource.pb.go @@ -4,7 +4,7 @@ // protoc (unknown) // source: resource.proto -package api +package unified import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -75,6 +75,61 @@ func (ResourceOperation) EnumDescriptor() ([]byte, []int) { return file_resource_proto_rawDescGZIP(), []int{0} } +type LinkBlob_Action int32 + +const ( + LinkBlob_UNKNOWN LinkBlob_Action = 0 + // Upload raw bytes + LinkBlob_UPLOAD LinkBlob_Action = 1 + // Keep the existing blob (valid for updates) + LinkBlob_KEEP LinkBlob_Action = 2 + // Do not keep the existing version (same as not sending LinkBlob, only valid for updates) + LinkBlob_REMOVE LinkBlob_Action = 3 // TODO... support presigned uploads +) + +// Enum value maps for LinkBlob_Action. +var ( + LinkBlob_Action_name = map[int32]string{ + 0: "UNKNOWN", + 1: "UPLOAD", + 2: "KEEP", + 3: "REMOVE", + } + LinkBlob_Action_value = map[string]int32{ + "UNKNOWN": 0, + "UPLOAD": 1, + "KEEP": 2, + "REMOVE": 3, + } +) + +func (x LinkBlob_Action) Enum() *LinkBlob_Action { + p := new(LinkBlob_Action) + *p = x + return p +} + +func (x LinkBlob_Action) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (LinkBlob_Action) Descriptor() protoreflect.EnumDescriptor { + return file_resource_proto_enumTypes[1].Descriptor() +} + +func (LinkBlob_Action) Type() protoreflect.EnumType { + return &file_resource_proto_enumTypes[1] +} + +func (x LinkBlob_Action) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use LinkBlob_Action.Descriptor instead. +func (LinkBlob_Action) EnumDescriptor() ([]byte, []int) { + return file_resource_proto_rawDescGZIP(), []int{5, 0} +} + type Sort_Order int32 const ( @@ -105,11 +160,11 @@ func (x Sort_Order) String() string { } func (Sort_Order) Descriptor() protoreflect.EnumDescriptor { - return file_resource_proto_enumTypes[1].Descriptor() + return file_resource_proto_enumTypes[2].Descriptor() } func (Sort_Order) Type() protoreflect.EnumType { - return &file_resource_proto_enumTypes[1] + return &file_resource_proto_enumTypes[2] } func (x Sort_Order) Number() protoreflect.EnumNumber { @@ -157,11 +212,11 @@ func (x HealthCheckResponse_ServingStatus) String() string { } func (HealthCheckResponse_ServingStatus) Descriptor() protoreflect.EnumDescriptor { - return file_resource_proto_enumTypes[2].Descriptor() + return file_resource_proto_enumTypes[3].Descriptor() } func (HealthCheckResponse_ServingStatus) Type() protoreflect.EnumType { - return &file_resource_proto_enumTypes[2] + return &file_resource_proto_enumTypes[3] } func (x HealthCheckResponse_ServingStatus) Number() protoreflect.EnumNumber { @@ -267,7 +322,7 @@ type ResourceWrapper struct { // Full kubernetes json bytes (although the resource version may not be accurate) Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // Operation - Operation ResourceOperation `protobuf:"varint,3,opt,name=operation,proto3,enum=api.ResourceOperation" json:"operation,omitempty"` + Operation ResourceOperation `protobuf:"varint,3,opt,name=operation,proto3,enum=unified.ResourceOperation" json:"operation,omitempty"` // The resource has an attached blob HasBlob bool `protobuf:"varint,4,opt,name=has_blob,json=hasBlob,proto3" json:"has_blob,omitempty"` } @@ -341,7 +396,7 @@ type ResourceMeta struct { // The resource version ResourceVersion int64 `protobuf:"varint,1,opt,name=resource_version,json=resourceVersion,proto3" json:"resource_version,omitempty"` // The optional commit message - Operation ResourceOperation `protobuf:"varint,2,opt,name=operation,proto3,enum=api.ResourceOperation" json:"operation,omitempty"` + Operation ResourceOperation `protobuf:"varint,2,opt,name=operation,proto3,enum=unified.ResourceOperation" json:"operation,omitempty"` // Size of the full resource body Size int32 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` // Hash for the resource @@ -442,12 +497,14 @@ type BlobInfo struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // System identifier + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` // Content Length - Size int64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` - // MD5 digest of the body - ETag string `protobuf:"bytes,2,opt,name=ETag,proto3" json:"ETag,omitempty"` + Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` // Content type header ContentType string `protobuf:"bytes,3,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` + // Content hash used for an etag + Hash string `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` } func (x *BlobInfo) Reset() { @@ -482,6 +539,13 @@ func (*BlobInfo) Descriptor() ([]byte, []int) { return file_resource_proto_rawDescGZIP(), []int{3} } +func (x *BlobInfo) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + func (x *BlobInfo) GetSize() int64 { if x != nil { return x.Size @@ -489,16 +553,16 @@ func (x *BlobInfo) GetSize() int64 { return 0 } -func (x *BlobInfo) GetETag() string { +func (x *BlobInfo) GetContentType() string { if x != nil { - return x.ETag + return x.ContentType } return "" } -func (x *BlobInfo) GetContentType() string { +func (x *BlobInfo) GetHash() string { if x != nil { - return x.ContentType + return x.Hash } return "" } @@ -589,8 +653,7 @@ func (x *StatusResult) GetCode() int32 { return 0 } -// TODO? support PresignedUrls for upload? -type CreateBlob struct { +type LinkBlob struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -601,8 +664,8 @@ type CreateBlob struct { Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } -func (x *CreateBlob) Reset() { - *x = CreateBlob{} +func (x *LinkBlob) Reset() { + *x = LinkBlob{} if protoimpl.UnsafeEnabled { mi := &file_resource_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -610,13 +673,13 @@ func (x *CreateBlob) Reset() { } } -func (x *CreateBlob) String() string { +func (x *LinkBlob) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateBlob) ProtoMessage() {} +func (*LinkBlob) ProtoMessage() {} -func (x *CreateBlob) ProtoReflect() protoreflect.Message { +func (x *LinkBlob) ProtoReflect() protoreflect.Message { mi := &file_resource_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -628,19 +691,19 @@ func (x *CreateBlob) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateBlob.ProtoReflect.Descriptor instead. -func (*CreateBlob) Descriptor() ([]byte, []int) { +// Deprecated: Use LinkBlob.ProtoReflect.Descriptor instead. +func (*LinkBlob) Descriptor() ([]byte, []int) { return file_resource_proto_rawDescGZIP(), []int{5} } -func (x *CreateBlob) GetContentType() string { +func (x *LinkBlob) GetContentType() string { if x != nil { return x.ContentType } return "" } -func (x *CreateBlob) GetValue() []byte { +func (x *LinkBlob) GetValue() []byte { if x != nil { return x.Value } @@ -661,7 +724,7 @@ type CreateRequest struct { // Optional commit message Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // Optionally include a large binary object - Blob *CreateBlob `protobuf:"bytes,4,opt,name=blob,proto3" json:"blob,omitempty"` + Blob *LinkBlob `protobuf:"bytes,4,opt,name=blob,proto3" json:"blob,omitempty"` } func (x *CreateRequest) Reset() { @@ -717,7 +780,7 @@ func (x *CreateRequest) GetMessage() string { return "" } -func (x *CreateRequest) GetBlob() *CreateBlob { +func (x *CreateRequest) GetBlob() *LinkBlob { if x != nil { return x.Blob } @@ -794,7 +857,7 @@ type UpdateRequest struct { // +optional Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // Optionally link a resource object - Blob *CreateBlob `protobuf:"bytes,4,opt,name=blob,proto3" json:"blob,omitempty"` + Blob *LinkBlob `protobuf:"bytes,4,opt,name=blob,proto3" json:"blob,omitempty"` } func (x *UpdateRequest) Reset() { @@ -850,7 +913,7 @@ func (x *UpdateRequest) GetMessage() string { return "" } -func (x *UpdateRequest) GetBlob() *CreateBlob { +func (x *UpdateRequest) GetBlob() *LinkBlob { if x != nil { return x.Blob } @@ -1034,6 +1097,8 @@ type GetResourceRequest struct { unknownFields protoimpl.UnknownFields Key *ResourceKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // Do not include any blob details + IgnoreBlob bool `protobuf:"varint,2,opt,name=ignore_blob,json=ignoreBlob,proto3" json:"ignore_blob,omitempty"` } func (x *GetResourceRequest) Reset() { @@ -1075,6 +1140,13 @@ func (x *GetResourceRequest) GetKey() *ResourceKey { return nil } +func (x *GetResourceRequest) GetIgnoreBlob() bool { + if x != nil { + return x.IgnoreBlob + } + return false +} + type GetResourceResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1335,7 +1407,7 @@ type Sort struct { unknownFields protoimpl.UnknownFields Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` - Order Sort_Order `protobuf:"varint,2,opt,name=order,proto3,enum=api.Sort_Order" json:"order,omitempty"` + Order Sort_Order `protobuf:"varint,2,opt,name=order,proto3,enum=unified.Sort_Order" json:"order,omitempty"` } func (x *Sort) Reset() { @@ -2202,7 +2274,7 @@ type HealthCheckResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=api.HealthCheckResponse_ServingStatus" json:"status,omitempty"` + Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=unified.HealthCheckResponse_ServingStatus" json:"status,omitempty"` } func (x *HealthCheckResponse) Reset() { @@ -2248,298 +2320,318 @@ var File_resource_proto protoreflect.FileDescriptor var file_resource_proto_rawDesc = []byte{ 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x03, 0x61, 0x70, 0x69, 0x22, 0x9c, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x4b, 0x65, 0x79, 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, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xa3, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x22, 0xed, 0x01, 0x0a, 0x0c, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x10, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x34, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x68, 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, - 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, - 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x22, 0x55, 0x0a, 0x08, 0x42, 0x6c, - 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x45, 0x54, - 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x45, 0x54, 0x61, 0x67, 0x12, 0x21, - 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, - 0x65, 0x22, 0x6c, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x12, 0x07, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x22, 0x9c, 0x01, 0x0a, 0x0b, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, 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, 0x12, 0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1a, 0x0a, + 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, + 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xa7, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x38, 0x0a, + 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1a, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x62, + 0x6c, 0x6f, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x42, 0x6c, + 0x6f, 0x62, 0x22, 0xf1, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, + 0x65, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x38, + 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x1a, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, + 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0a, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x19, 0x0a, 0x08, 0x68, + 0x61, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, + 0x61, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x22, 0x69, 0x0a, 0x08, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, + 0x68, 0x22, 0x6c, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, - 0x45, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x21, 0x0a, - 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x88, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x04, - 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, - 0x62, 0x22, 0x66, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x29, - 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x88, 0x01, 0x0a, 0x0d, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, - 0x23, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, - 0x62, 0x6c, 0x6f, 0x62, 0x22, 0x66, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x45, 0x0a, 0x0d, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, + 0x7c, 0x0a, 0x08, 0x4c, 0x69, 0x6e, 0x6b, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x21, 0x0a, 0x0c, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0x37, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, + 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x55, + 0x50, 0x4c, 0x4f, 0x41, 0x44, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4b, 0x45, 0x45, 0x50, 0x10, + 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x10, 0x03, 0x22, 0x8e, 0x01, + 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x26, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x75, + 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, + 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, + 0x4c, 0x69, 0x6e, 0x6b, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x22, 0x6a, + 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x2d, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x15, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8e, 0x01, 0x0a, 0x0d, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x75, 0x6e, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x4c, 0x69, 0x6e, + 0x6b, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x22, 0x6a, 0x0a, 0x0e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x29, 0x0a, 0x10, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x49, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, + 0x69, 0x64, 0x22, 0x6a, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5d, + 0x0a, 0x12, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x0b, + 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0a, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x22, 0xa0, 0x01, + 0x0a, 0x13, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x75, 0x72, + 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x62, 0x55, 0x72, 0x6c, + 0x22, 0x38, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x26, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x7d, 0x0a, 0x0f, 0x47, 0x65, + 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x25, 0x0a, 0x04, + 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x75, 0x6e, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, + 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x53, 0x0a, 0x0b, 0x52, 0x65, 0x71, + 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x63, + 0x0a, 0x04, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x29, 0x0a, 0x05, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x75, 0x6e, + 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, + 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x22, 0x1a, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, + 0x12, 0x07, 0x0a, 0x03, 0x41, 0x53, 0x43, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x45, 0x53, + 0x43, 0x10, 0x01, 0x22, 0xbf, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x26, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x75, 0x69, 0x64, 0x22, 0x66, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x38, 0x0a, 0x12, 0x47, - 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x22, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x9c, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x6c, 0x6f, - 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x6c, 0x6f, - 0x62, 0x55, 0x72, 0x6c, 0x22, 0x34, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x75, 0x0a, 0x0f, 0x47, 0x65, - 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x6c, 0x6f, - 0x62, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0x53, 0x0a, 0x0b, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x16, - 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x5f, 0x0a, 0x04, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x12, 0x25, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x2e, 0x4f, - 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x22, 0x1a, 0x0a, 0x05, 0x4f, - 0x72, 0x64, 0x65, 0x72, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x53, 0x43, 0x10, 0x00, 0x12, 0x08, 0x0a, - 0x04, 0x44, 0x45, 0x53, 0x43, 0x10, 0x01, 0x22, 0xb3, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x22, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x28, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x28, 0x0a, 0x06, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x22, 0x80, 0x01, - 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, - 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2a, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x1d, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x09, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, - 0x22, 0xbf, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x57, - 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x26, 0x0a, - 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x30, 0x0a, 0x14, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x74, - 0x65, 0x6d, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, - 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x22, 0xd8, 0x01, 0x0a, 0x0c, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x05, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, - 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x73, 0x65, 0x6e, - 0x64, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x69, 0x74, - 0x69, 0x61, 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x61, 0x6c, 0x6c, - 0x6f, 0x77, 0x5f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x62, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, - 0x6b, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x57, - 0x61, 0x74, 0x63, 0x68, 0x42, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x22, 0x91, 0x01, - 0x0a, 0x0d, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x30, 0x0a, - 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x57, 0x72, + 0x79, 0x12, 0x2c, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, + 0x2c, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x16, 0x0a, + 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, + 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x22, 0x88, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, + 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2e, 0x0a, + 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x0a, + 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x75, 0x6e, + 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, + 0x22, 0xc3, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2e, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, + 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, + 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x14, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, + 0x67, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x12, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x74, 0x65, + 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xe0, 0x01, 0x0a, 0x0c, 0x57, 0x61, 0x74, 0x63, 0x68, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x69, 0x6e, 0x63, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x26, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x75, 0x6e, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x69, 0x6e, + 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x11, 0x73, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x77, + 0x61, 0x74, 0x63, 0x68, 0x5f, 0x62, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x57, 0x61, 0x74, 0x63, 0x68, + 0x42, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x22, 0x99, 0x01, 0x0a, 0x0d, 0x57, 0x61, + 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, 0x0a, 0x08, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x75, 0x6e, + 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, - 0x30, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x08, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, - 0x73, 0x22, 0x95, 0x01, 0x0a, 0x0e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, - 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, - 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x12, 0x22, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, - 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x64, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x73, 0x68, - 0x6f, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0x8d, 0x01, 0x0a, 0x0f, 0x48, 0x69, - 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, - 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, - 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x29, - 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x89, 0x01, 0x0a, 0x0d, 0x4f, 0x72, - 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, - 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x22, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, + 0x34, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x08, 0x70, 0x72, 0x65, + 0x76, 0x69, 0x6f, 0x75, 0x73, 0x22, 0x99, 0x01, 0x0a, 0x0e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, + 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x26, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x21, + 0x0a, 0x0c, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x73, 0x68, 0x6f, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x64, 0x22, 0x91, 0x01, 0x0a, 0x0f, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x05, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, + 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8d, 0x01, 0x0a, 0x0d, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, + 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, + 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x26, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, - 0x72, 0x69, 0x67, 0x69, 0x6e, 0x22, 0xe0, 0x01, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x22, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x73, 0x69, 0x7a, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, - 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, - 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x92, 0x01, 0x0a, 0x0e, 0x4f, 0x72, 0x69, - 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x69, - 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, - 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x2e, 0x0a, - 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0xa6, 0x01, - 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x61, 0x6c, - 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x4f, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, - 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x01, - 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, - 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x4b, - 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x03, 0x2a, 0x55, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x55, - 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x52, 0x45, 0x41, - 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x44, - 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, - 0x0c, 0x0a, 0x08, 0x42, 0x4f, 0x4f, 0x4b, 0x4d, 0x41, 0x52, 0x4b, 0x10, 0x04, 0x32, 0xa8, 0x04, - 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, - 0x40, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x17, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x31, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x12, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x12, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x12, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x57, 0x61, 0x74, 0x63, 0x68, - 0x12, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x34, 0x0a, 0x07, 0x47, 0x65, 0x74, - 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, - 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x34, 0x0a, 0x07, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x13, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, - 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x09, 0x49, 0x73, 0x48, 0x65, - 0x61, 0x6c, 0x74, 0x68, 0x79, 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x61, 0x6c, - 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x61, 0x66, 0x61, 0x6e, 0x61, 0x2f, 0x67, - 0x72, 0x61, 0x66, 0x61, 0x6e, 0x61, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x22, 0xe4, 0x01, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x75, 0x6e, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x16, + 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x1c, + 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x96, 0x01, 0x0a, + 0x0e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x31, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, + 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x2e, 0x0a, 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0xaa, 0x01, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, + 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x22, 0x4f, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, + 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, + 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x13, 0x0a, + 0x0f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, + 0x10, 0x03, 0x2a, 0x55, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, + 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, + 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0b, + 0x0a, 0x07, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x42, + 0x4f, 0x4f, 0x4b, 0x4d, 0x41, 0x52, 0x4b, 0x10, 0x04, 0x32, 0xf8, 0x04, 0x0a, 0x0d, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x48, 0x0a, 0x0b, 0x47, + 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1b, 0x2e, 0x75, 0x6e, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, + 0x64, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, + 0x16, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, + 0x64, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x39, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x75, 0x6e, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, + 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, + 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x05, 0x57, + 0x61, 0x74, 0x63, 0x68, 0x12, 0x15, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x57, + 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x75, 0x6e, + 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x3c, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, + 0x12, 0x17, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, + 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x75, 0x6e, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x17, + 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, + 0x64, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x39, 0x0a, 0x06, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x16, 0x2e, 0x75, 0x6e, + 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x4f, 0x72, + 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x09, + 0x49, 0x73, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x12, 0x1b, 0x2e, 0x75, 0x6e, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, + 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x61, 0x66, 0x61, 0x6e, 0x61, 0x2f, 0x67, 0x72, 0x61, 0x66, 0x61, + 0x6e, 0x61, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x75, + 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2554,96 +2646,97 @@ func file_resource_proto_rawDescGZIP() []byte { return file_resource_proto_rawDescData } -var file_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 4) var file_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 30) var file_resource_proto_goTypes = []interface{}{ - (ResourceOperation)(0), // 0: api.ResourceOperation - (Sort_Order)(0), // 1: api.Sort.Order - (HealthCheckResponse_ServingStatus)(0), // 2: api.HealthCheckResponse.ServingStatus - (*ResourceKey)(nil), // 3: api.ResourceKey - (*ResourceWrapper)(nil), // 4: api.ResourceWrapper - (*ResourceMeta)(nil), // 5: api.ResourceMeta - (*BlobInfo)(nil), // 6: api.BlobInfo - (*StatusResult)(nil), // 7: api.StatusResult - (*CreateBlob)(nil), // 8: api.CreateBlob - (*CreateRequest)(nil), // 9: api.CreateRequest - (*CreateResponse)(nil), // 10: api.CreateResponse - (*UpdateRequest)(nil), // 11: api.UpdateRequest - (*UpdateResponse)(nil), // 12: api.UpdateResponse - (*DeleteRequest)(nil), // 13: api.DeleteRequest - (*DeleteResponse)(nil), // 14: api.DeleteResponse - (*GetResourceRequest)(nil), // 15: api.GetResourceRequest - (*GetResourceResponse)(nil), // 16: api.GetResourceResponse - (*GetBlobRequest)(nil), // 17: api.GetBlobRequest - (*GetBlobResponse)(nil), // 18: api.GetBlobResponse - (*Requirement)(nil), // 19: api.Requirement - (*Sort)(nil), // 20: api.Sort - (*ListOptions)(nil), // 21: api.ListOptions - (*ListRequest)(nil), // 22: api.ListRequest - (*ListResponse)(nil), // 23: api.ListResponse - (*WatchRequest)(nil), // 24: api.WatchRequest - (*WatchResponse)(nil), // 25: api.WatchResponse - (*HistoryRequest)(nil), // 26: api.HistoryRequest - (*HistoryResponse)(nil), // 27: api.HistoryResponse - (*OriginRequest)(nil), // 28: api.OriginRequest - (*ResourceOriginInfo)(nil), // 29: api.ResourceOriginInfo - (*OriginResponse)(nil), // 30: api.OriginResponse - (*HealthCheckRequest)(nil), // 31: api.HealthCheckRequest - (*HealthCheckResponse)(nil), // 32: api.HealthCheckResponse + (ResourceOperation)(0), // 0: unified.ResourceOperation + (LinkBlob_Action)(0), // 1: unified.LinkBlob.Action + (Sort_Order)(0), // 2: unified.Sort.Order + (HealthCheckResponse_ServingStatus)(0), // 3: unified.HealthCheckResponse.ServingStatus + (*ResourceKey)(nil), // 4: unified.ResourceKey + (*ResourceWrapper)(nil), // 5: unified.ResourceWrapper + (*ResourceMeta)(nil), // 6: unified.ResourceMeta + (*BlobInfo)(nil), // 7: unified.BlobInfo + (*StatusResult)(nil), // 8: unified.StatusResult + (*LinkBlob)(nil), // 9: unified.LinkBlob + (*CreateRequest)(nil), // 10: unified.CreateRequest + (*CreateResponse)(nil), // 11: unified.CreateResponse + (*UpdateRequest)(nil), // 12: unified.UpdateRequest + (*UpdateResponse)(nil), // 13: unified.UpdateResponse + (*DeleteRequest)(nil), // 14: unified.DeleteRequest + (*DeleteResponse)(nil), // 15: unified.DeleteResponse + (*GetResourceRequest)(nil), // 16: unified.GetResourceRequest + (*GetResourceResponse)(nil), // 17: unified.GetResourceResponse + (*GetBlobRequest)(nil), // 18: unified.GetBlobRequest + (*GetBlobResponse)(nil), // 19: unified.GetBlobResponse + (*Requirement)(nil), // 20: unified.Requirement + (*Sort)(nil), // 21: unified.Sort + (*ListOptions)(nil), // 22: unified.ListOptions + (*ListRequest)(nil), // 23: unified.ListRequest + (*ListResponse)(nil), // 24: unified.ListResponse + (*WatchRequest)(nil), // 25: unified.WatchRequest + (*WatchResponse)(nil), // 26: unified.WatchResponse + (*HistoryRequest)(nil), // 27: unified.HistoryRequest + (*HistoryResponse)(nil), // 28: unified.HistoryResponse + (*OriginRequest)(nil), // 29: unified.OriginRequest + (*ResourceOriginInfo)(nil), // 30: unified.ResourceOriginInfo + (*OriginResponse)(nil), // 31: unified.OriginResponse + (*HealthCheckRequest)(nil), // 32: unified.HealthCheckRequest + (*HealthCheckResponse)(nil), // 33: unified.HealthCheckResponse } var file_resource_proto_depIdxs = []int32{ - 0, // 0: api.ResourceWrapper.operation:type_name -> api.ResourceOperation - 0, // 1: api.ResourceMeta.operation:type_name -> api.ResourceOperation - 3, // 2: api.CreateRequest.key:type_name -> api.ResourceKey - 8, // 3: api.CreateRequest.blob:type_name -> api.CreateBlob - 7, // 4: api.CreateResponse.status:type_name -> api.StatusResult - 3, // 5: api.UpdateRequest.key:type_name -> api.ResourceKey - 8, // 6: api.UpdateRequest.blob:type_name -> api.CreateBlob - 7, // 7: api.UpdateResponse.status:type_name -> api.StatusResult - 3, // 8: api.DeleteRequest.key:type_name -> api.ResourceKey - 7, // 9: api.DeleteResponse.status:type_name -> api.StatusResult - 3, // 10: api.GetResourceRequest.key:type_name -> api.ResourceKey - 7, // 11: api.GetResourceResponse.status:type_name -> api.StatusResult - 3, // 12: api.GetBlobRequest.key:type_name -> api.ResourceKey - 7, // 13: api.GetBlobResponse.status:type_name -> api.StatusResult - 6, // 14: api.GetBlobResponse.info:type_name -> api.BlobInfo - 1, // 15: api.Sort.order:type_name -> api.Sort.Order - 3, // 16: api.ListOptions.key:type_name -> api.ResourceKey - 19, // 17: api.ListOptions.labels:type_name -> api.Requirement - 19, // 18: api.ListOptions.fields:type_name -> api.Requirement - 21, // 19: api.ListRequest.options:type_name -> api.ListOptions - 20, // 20: api.ListRequest.sort:type_name -> api.Sort - 4, // 21: api.ListResponse.items:type_name -> api.ResourceWrapper - 3, // 22: api.WatchRequest.key:type_name -> api.ResourceKey - 21, // 23: api.WatchRequest.options:type_name -> api.ListOptions - 4, // 24: api.WatchResponse.resource:type_name -> api.ResourceWrapper - 4, // 25: api.WatchResponse.previous:type_name -> api.ResourceWrapper - 3, // 26: api.HistoryRequest.key:type_name -> api.ResourceKey - 5, // 27: api.HistoryResponse.items:type_name -> api.ResourceMeta - 3, // 28: api.OriginRequest.key:type_name -> api.ResourceKey - 3, // 29: api.ResourceOriginInfo.key:type_name -> api.ResourceKey - 29, // 30: api.OriginResponse.items:type_name -> api.ResourceOriginInfo - 2, // 31: api.HealthCheckResponse.status:type_name -> api.HealthCheckResponse.ServingStatus - 15, // 32: api.ResourceStore.GetResource:input_type -> api.GetResourceRequest - 9, // 33: api.ResourceStore.Create:input_type -> api.CreateRequest - 11, // 34: api.ResourceStore.Update:input_type -> api.UpdateRequest - 13, // 35: api.ResourceStore.Delete:input_type -> api.DeleteRequest - 22, // 36: api.ResourceStore.List:input_type -> api.ListRequest - 24, // 37: api.ResourceStore.Watch:input_type -> api.WatchRequest - 17, // 38: api.ResourceStore.GetBlob:input_type -> api.GetBlobRequest - 26, // 39: api.ResourceStore.History:input_type -> api.HistoryRequest - 28, // 40: api.ResourceStore.Origin:input_type -> api.OriginRequest - 31, // 41: api.ResourceStore.IsHealthy:input_type -> api.HealthCheckRequest - 16, // 42: api.ResourceStore.GetResource:output_type -> api.GetResourceResponse - 10, // 43: api.ResourceStore.Create:output_type -> api.CreateResponse - 12, // 44: api.ResourceStore.Update:output_type -> api.UpdateResponse - 14, // 45: api.ResourceStore.Delete:output_type -> api.DeleteResponse - 23, // 46: api.ResourceStore.List:output_type -> api.ListResponse - 25, // 47: api.ResourceStore.Watch:output_type -> api.WatchResponse - 18, // 48: api.ResourceStore.GetBlob:output_type -> api.GetBlobResponse - 27, // 49: api.ResourceStore.History:output_type -> api.HistoryResponse - 30, // 50: api.ResourceStore.Origin:output_type -> api.OriginResponse - 32, // 51: api.ResourceStore.IsHealthy:output_type -> api.HealthCheckResponse + 0, // 0: unified.ResourceWrapper.operation:type_name -> unified.ResourceOperation + 0, // 1: unified.ResourceMeta.operation:type_name -> unified.ResourceOperation + 4, // 2: unified.CreateRequest.key:type_name -> unified.ResourceKey + 9, // 3: unified.CreateRequest.blob:type_name -> unified.LinkBlob + 8, // 4: unified.CreateResponse.status:type_name -> unified.StatusResult + 4, // 5: unified.UpdateRequest.key:type_name -> unified.ResourceKey + 9, // 6: unified.UpdateRequest.blob:type_name -> unified.LinkBlob + 8, // 7: unified.UpdateResponse.status:type_name -> unified.StatusResult + 4, // 8: unified.DeleteRequest.key:type_name -> unified.ResourceKey + 8, // 9: unified.DeleteResponse.status:type_name -> unified.StatusResult + 4, // 10: unified.GetResourceRequest.key:type_name -> unified.ResourceKey + 8, // 11: unified.GetResourceResponse.status:type_name -> unified.StatusResult + 4, // 12: unified.GetBlobRequest.key:type_name -> unified.ResourceKey + 8, // 13: unified.GetBlobResponse.status:type_name -> unified.StatusResult + 7, // 14: unified.GetBlobResponse.info:type_name -> unified.BlobInfo + 2, // 15: unified.Sort.order:type_name -> unified.Sort.Order + 4, // 16: unified.ListOptions.key:type_name -> unified.ResourceKey + 20, // 17: unified.ListOptions.labels:type_name -> unified.Requirement + 20, // 18: unified.ListOptions.fields:type_name -> unified.Requirement + 22, // 19: unified.ListRequest.options:type_name -> unified.ListOptions + 21, // 20: unified.ListRequest.sort:type_name -> unified.Sort + 5, // 21: unified.ListResponse.items:type_name -> unified.ResourceWrapper + 4, // 22: unified.WatchRequest.key:type_name -> unified.ResourceKey + 22, // 23: unified.WatchRequest.options:type_name -> unified.ListOptions + 5, // 24: unified.WatchResponse.resource:type_name -> unified.ResourceWrapper + 5, // 25: unified.WatchResponse.previous:type_name -> unified.ResourceWrapper + 4, // 26: unified.HistoryRequest.key:type_name -> unified.ResourceKey + 6, // 27: unified.HistoryResponse.items:type_name -> unified.ResourceMeta + 4, // 28: unified.OriginRequest.key:type_name -> unified.ResourceKey + 4, // 29: unified.ResourceOriginInfo.key:type_name -> unified.ResourceKey + 30, // 30: unified.OriginResponse.items:type_name -> unified.ResourceOriginInfo + 3, // 31: unified.HealthCheckResponse.status:type_name -> unified.HealthCheckResponse.ServingStatus + 16, // 32: unified.ResourceStore.GetResource:input_type -> unified.GetResourceRequest + 10, // 33: unified.ResourceStore.Create:input_type -> unified.CreateRequest + 12, // 34: unified.ResourceStore.Update:input_type -> unified.UpdateRequest + 14, // 35: unified.ResourceStore.Delete:input_type -> unified.DeleteRequest + 23, // 36: unified.ResourceStore.List:input_type -> unified.ListRequest + 25, // 37: unified.ResourceStore.Watch:input_type -> unified.WatchRequest + 18, // 38: unified.ResourceStore.GetBlob:input_type -> unified.GetBlobRequest + 27, // 39: unified.ResourceStore.History:input_type -> unified.HistoryRequest + 29, // 40: unified.ResourceStore.Origin:input_type -> unified.OriginRequest + 32, // 41: unified.ResourceStore.IsHealthy:input_type -> unified.HealthCheckRequest + 17, // 42: unified.ResourceStore.GetResource:output_type -> unified.GetResourceResponse + 11, // 43: unified.ResourceStore.Create:output_type -> unified.CreateResponse + 13, // 44: unified.ResourceStore.Update:output_type -> unified.UpdateResponse + 15, // 45: unified.ResourceStore.Delete:output_type -> unified.DeleteResponse + 24, // 46: unified.ResourceStore.List:output_type -> unified.ListResponse + 26, // 47: unified.ResourceStore.Watch:output_type -> unified.WatchResponse + 19, // 48: unified.ResourceStore.GetBlob:output_type -> unified.GetBlobResponse + 28, // 49: unified.ResourceStore.History:output_type -> unified.HistoryResponse + 31, // 50: unified.ResourceStore.Origin:output_type -> unified.OriginResponse + 33, // 51: unified.ResourceStore.IsHealthy:output_type -> unified.HealthCheckResponse 42, // [42:52] is the sub-list for method output_type 32, // [32:42] is the sub-list for method input_type 32, // [32:32] is the sub-list for extension type_name @@ -2718,7 +2811,7 @@ func file_resource_proto_init() { } } file_resource_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateBlob); i { + switch v := v.(*LinkBlob); i { case 0: return &v.state case 1: @@ -3023,7 +3116,7 @@ func file_resource_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_resource_proto_rawDesc, - NumEnums: 3, + NumEnums: 4, NumMessages: 30, NumExtensions: 0, NumServices: 1, diff --git a/pkg/storage/api/resource.proto b/pkg/storage/unified/resource.proto similarity index 93% rename from pkg/storage/api/resource.proto rename to pkg/storage/unified/resource.proto index 7221c223607..d0de9404839 100644 --- a/pkg/storage/api/resource.proto +++ b/pkg/storage/unified/resource.proto @@ -1,7 +1,7 @@ syntax = "proto3"; -package api; +package unified; -option go_package = "github.com/grafana/grafana/pkg/storage/api"; +option go_package = "github.com/grafana/grafana/pkg/storage/unified"; message ResourceKey { // Namespace (tenant) @@ -65,14 +65,17 @@ message ResourceMeta { // Basic blob metadata message BlobInfo { - // Content Length - int64 size = 1; + // System identifier + string path = 1; - // MD5 digest of the body - string ETag = 2; + // Content Length + int64 size = 2; // Content type header string content_type = 3; + + // Content hash used for an etag + string hash = 4; } // Status structure is copied from: @@ -97,8 +100,18 @@ message StatusResult { int32 code = 4; } -// TODO? support PresignedUrls for upload? -message CreateBlob { +message LinkBlob { + enum Action { + UNKNOWN = 0; + // Upload raw bytes + UPLOAD = 1; + // Keep the existing blob (valid for updates) + KEEP = 2; + // Do not keep the existing version (same as not sending LinkBlob, only valid for updates) + REMOVE = 3; + // TODO... support presigned uploads + } + // Content type header string content_type = 1; @@ -123,7 +136,7 @@ message CreateRequest { string message = 3; // Optionally include a large binary object - CreateBlob blob = 4; + LinkBlob blob = 4; } message CreateResponse { @@ -146,7 +159,7 @@ message UpdateRequest { string message = 3; // Optionally link a resource object - CreateBlob blob = 4; + LinkBlob blob = 4; } message UpdateResponse { @@ -175,6 +188,9 @@ message DeleteResponse { message GetResourceRequest { ResourceKey key = 1; + + // Do not include any blob details + bool ignore_blob = 2; } message GetResourceResponse { @@ -200,7 +216,7 @@ message GetBlobResponse { // Status code StatusResult status = 1; - // Headers + // Headers BlobInfo info = 2; // The raw object value diff --git a/pkg/storage/api/resource_grpc.pb.go b/pkg/storage/unified/resource_grpc.pb.go similarity index 95% rename from pkg/storage/api/resource_grpc.pb.go rename to pkg/storage/unified/resource_grpc.pb.go index 656a467c97c..7078ebba248 100644 --- a/pkg/storage/api/resource_grpc.pb.go +++ b/pkg/storage/unified/resource_grpc.pb.go @@ -4,7 +4,7 @@ // - protoc (unknown) // source: resource.proto -package api +package unified import ( context "context" @@ -19,16 +19,16 @@ import ( const _ = grpc.SupportPackageIsVersion8 const ( - ResourceStore_GetResource_FullMethodName = "/api.ResourceStore/GetResource" - ResourceStore_Create_FullMethodName = "/api.ResourceStore/Create" - ResourceStore_Update_FullMethodName = "/api.ResourceStore/Update" - ResourceStore_Delete_FullMethodName = "/api.ResourceStore/Delete" - ResourceStore_List_FullMethodName = "/api.ResourceStore/List" - ResourceStore_Watch_FullMethodName = "/api.ResourceStore/Watch" - ResourceStore_GetBlob_FullMethodName = "/api.ResourceStore/GetBlob" - ResourceStore_History_FullMethodName = "/api.ResourceStore/History" - ResourceStore_Origin_FullMethodName = "/api.ResourceStore/Origin" - ResourceStore_IsHealthy_FullMethodName = "/api.ResourceStore/IsHealthy" + ResourceStore_GetResource_FullMethodName = "/unified.ResourceStore/GetResource" + ResourceStore_Create_FullMethodName = "/unified.ResourceStore/Create" + ResourceStore_Update_FullMethodName = "/unified.ResourceStore/Update" + ResourceStore_Delete_FullMethodName = "/unified.ResourceStore/Delete" + ResourceStore_List_FullMethodName = "/unified.ResourceStore/List" + ResourceStore_Watch_FullMethodName = "/unified.ResourceStore/Watch" + ResourceStore_GetBlob_FullMethodName = "/unified.ResourceStore/GetBlob" + ResourceStore_History_FullMethodName = "/unified.ResourceStore/History" + ResourceStore_Origin_FullMethodName = "/unified.ResourceStore/Origin" + ResourceStore_IsHealthy_FullMethodName = "/unified.ResourceStore/IsHealthy" ) // ResourceStoreClient is the client API for ResourceStore service. @@ -439,7 +439,7 @@ func _ResourceStore_IsHealthy_Handler(srv interface{}, ctx context.Context, dec // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var ResourceStore_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "api.ResourceStore", + ServiceName: "unified.ResourceStore", HandlerType: (*ResourceStoreServer)(nil), Methods: []grpc.MethodDesc{ { diff --git a/pkg/storage/api/resource_test.go b/pkg/storage/unified/resource_test.go similarity index 85% rename from pkg/storage/api/resource_test.go rename to pkg/storage/unified/resource_test.go index 5090ddce833..6784017e339 100644 --- a/pkg/storage/api/resource_test.go +++ b/pkg/storage/unified/resource_test.go @@ -1,16 +1,16 @@ -package api_test +package unified_test import ( "testing" "github.com/stretchr/testify/require" - "github.com/grafana/grafana/pkg/storage/api" + "github.com/grafana/grafana/pkg/storage/unified" ) func TestResourceModels(t *testing.T) { t.Run("key namespaced path", func(t *testing.T) { - key := &api.ResourceKey{} + key := &unified.ResourceKey{} require.Equal(t, "__cluster__", key.NamespacedPath()) key.Namespace = "ns" diff --git a/pkg/services/store/resource/testdata/01_create_playlist.json b/pkg/storage/unified/testdata/01_create_playlist.json similarity index 100% rename from pkg/services/store/resource/testdata/01_create_playlist.json rename to pkg/storage/unified/testdata/01_create_playlist.json diff --git a/pkg/storage/api/validator.go b/pkg/storage/unified/validator.go similarity index 68% rename from pkg/storage/api/validator.go rename to pkg/storage/unified/validator.go index 2961f1a412a..74c9e1cd2eb 100644 --- a/pkg/storage/api/validator.go +++ b/pkg/storage/unified/validator.go @@ -1,26 +1,33 @@ -package api +package unified import ( "context" "encoding/json" "fmt" "sync/atomic" + "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/bwmarrin/snowflake" + + "github.com/grafana/grafana/pkg/apimachinery/identity" "github.com/grafana/grafana/pkg/apimachinery/utils" - "github.com/grafana/grafana/pkg/infra/appcontext" - "github.com/grafana/grafana/pkg/services/auth/identity" ) // Verify that all required fields are set, and the user has permission to set the common metadata fields type EventValidator interface { PrepareCreate(ctx context.Context, req *CreateRequest) (*WriteEvent, error) - PrepareUpdate(ctx context.Context, req *UpdateRequest, current []byte) (*WriteEvent, error) + PrepareUpdate(ctx context.Context, req *UpdateRequest, current *GetResourceResponse) (*WriteEvent, error) + PrepareDelete(ctx context.Context, req *DeleteRequest, current *GetResourceResponse) (*WriteEvent, error) } type EventValidatorOptions struct { - // Get the next EventID + // When running in a cluster, each node should have a different ID + // This is used for snowflake generation and log identification + NodeID int64 + + // Get the next EventID. When not set, this will be a snowflake ID NextEventID func() int64 // Check if a user has access to write folders @@ -37,9 +44,16 @@ type eventValidator struct { func NewEventValidator(opts EventValidatorOptions) EventValidator { if opts.NextEventID == nil { - counter := atomic.Int64{} - opts.NextEventID = func() int64 { - return counter.Add(1) + rvGenerationNode, err := snowflake.NewNode(opts.NodeID) + if err == nil { + opts.NextEventID = func() int64 { + return rvGenerationNode.Generate().Int64() + } + } else { + counter := atomic.Int64{} + opts.NextEventID = func() int64 { + return counter.Add(1) + } } } return &eventValidator{opts} @@ -59,7 +73,7 @@ func (v *eventValidator) newEvent(ctx context.Context, key *ResourceKey, value, Key: key, Value: value, } - event.Requester, err = appcontext.User(ctx) + event.Requester, err = identity.GetRequester(ctx) if err != nil { return event.BadRequest(err, "unable to get user") } @@ -178,9 +192,13 @@ func (v *eventValidator) PrepareCreate(ctx context.Context, req *CreateRequest) return event, nil } -func (v *eventValidator) PrepareUpdate(ctx context.Context, req *UpdateRequest, current []byte) (*WriteEvent, error) { - event := v.newEvent(ctx, req.Key, req.Value, current) +func (v *eventValidator) PrepareUpdate(ctx context.Context, req *UpdateRequest, current *GetResourceResponse) (*WriteEvent, error) { + event := v.newEvent(ctx, req.Key, req.Value, current.Value) event.Operation = ResourceOperation_UPDATED + event.PreviousRV = current.ResourceVersion + if current.Value == nil { + return event.BadRequest(nil, "current value does not exist"), nil + } if event.Status != nil { return event, nil } @@ -189,8 +207,50 @@ func (v *eventValidator) PrepareUpdate(ctx context.Context, req *UpdateRequest, //---------------------------------------- val := event.Object.GetUpdatedBy() if val != "" && val != event.Requester.GetUID().String() { - return event.BadRequest(nil, "created by annotation does not match: metadata.annotations#"+utils.AnnoKeyUpdatedBy), nil + return event.BadRequest(nil, "updated by annotation does not match: metadata.annotations#"+utils.AnnoKeyUpdatedBy), nil } return event, nil } + +func (v *eventValidator) PrepareDelete(ctx context.Context, req *DeleteRequest, current *GetResourceResponse) (*WriteEvent, error) { + now := metav1.NewTime(time.Now()) + var err error + event := &WriteEvent{ + EventID: v.opts.NextEventID(), + Key: req.Key, + Operation: ResourceOperation_DELETED, + PreviousRV: current.ResourceVersion, + } + if event.PreviousRV != req.Key.ResourceVersion { + return event.BadRequest(err, "deletion request does not match current revision (%d != %d)", req.Key.ResourceVersion, event.PreviousRV), nil + } + event.Requester, err = identity.GetRequester(ctx) + if err != nil { + return event.BadRequest(err, "unable to get user"), nil + } + marker := &DeletedMarker{} + err = json.Unmarshal(current.Value, marker) + if err != nil { + return nil, fmt.Errorf("unable to read previous object, %w", err) + } + event.Object, err = utils.MetaAccessor(marker) + if err != nil { + return event.BadRequest(err, "unable to read marker object"), nil + } + event.Object.SetDeletionTimestamp(&now) + event.Object.SetUpdatedTimestamp(&now.Time) + event.Object.SetManagedFields(nil) + event.Object.SetFinalizers(nil) + event.Object.SetUpdatedBy(event.Requester.GetUID().String()) + marker.TypeMeta = metav1.TypeMeta{ + Kind: "DeletedMarker", + APIVersion: "storage.grafana.app/v0alpha1", // ?? or can we stick this in common? + } + marker.Annotations["RestoreResourceVersion"] = fmt.Sprintf("%d", event.PreviousRV) + event.Value, err = json.Marshal(marker) + if err != nil { + return nil, fmt.Errorf("unable creating deletion marker, %w", err) + } + return event, nil +}