kartepb

package
v0.0.0-...-fb8c843 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package kartepb is the RPC interface of Karte.

- CreateAction - CreateObservation - PersistAction - PersistActionRange - ListActions - ListObservations - UpdateAction

Karte also has a cron interface.

- PersistToBigquery

Index

Constants

This section is empty.

Variables

View Source
var (
	Action_Status_name = map[int32]string{
		0: "STATUS_UNSPECIFIED",
		1: "SUCCESS",
		2: "FAIL",
		3: "SKIP",
	}
	Action_Status_value = map[string]int32{
		"STATUS_UNSPECIFIED": 0,
		"SUCCESS":            1,
		"FAIL":               2,
		"SKIP":               3,
	}
)

Enum value maps for Action_Status.

View Source
var (
	Action_AllowFail_name = map[int32]string{
		0: "ALLOW_FAIL_UNSPECIFIED",
		1: "ALLOW_FAIL",
		2: "NO_ALLOW_FAIL",
	}
	Action_AllowFail_value = map[string]int32{
		"ALLOW_FAIL_UNSPECIFIED": 0,
		"ALLOW_FAIL":             1,
		"NO_ALLOW_FAIL":          2,
	}
)

Enum value maps for Action_AllowFail.

View Source
var (
	Action_ActionType_name = map[int32]string{
		0: "ACTION_TYPE_UNSPECIFIED",
		1: "ACTION_TYPE_VERIFIER",
		2: "ACTION_TYPE_CONDITION",
		3: "ACTION_TYPE_RECOVERY",
	}
	Action_ActionType_value = map[string]int32{
		"ACTION_TYPE_UNSPECIFIED": 0,
		"ACTION_TYPE_VERIFIER":    1,
		"ACTION_TYPE_CONDITION":   2,
		"ACTION_TYPE_RECOVERY":    3,
	}
)

Enum value maps for Action_ActionType.

View Source
var (
	StoragePolicy_StoragePolicy_name = map[int32]string{
		0: "UNSPECIFIED",
		1: "STORE",
		2: "SKIP",
	}
	StoragePolicy_StoragePolicy_value = map[string]int32{
		"UNSPECIFIED": 0,
		"STORE":       1,
		"SKIP":        2,
	}
)

Enum value maps for StoragePolicy_StoragePolicy.

View Source
var File_go_chromium_org_infra_cros_karte_api_action_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_infra_cros_karte_api_cron_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_infra_cros_karte_api_observation_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_infra_cros_karte_api_service_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_infra_cros_karte_api_storage_policy_proto protoreflect.FileDescriptor

Functions

func FileDescriptorSet

func FileDescriptorSet() *descriptorpb.FileDescriptorSet

FileDescriptorSet returns a descriptor set for this proto package, which includes all defined services, and all transitive dependencies.

Will not return nil.

Do NOT modify the returned descriptor.

func RegisterKarteCronServer

func RegisterKarteCronServer(s prpc.Registrar, srv KarteCronServer)

func RegisterKarteServer

func RegisterKarteServer(s prpc.Registrar, srv KarteServer)

Types

type Action

type Action struct {

	// The resource name of the action. Names are generated
	// automatically when a new action is created.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// A kind is a coarse-grained type of an action, such as
	// ssh-attempt. New action_kinds will be created frequently so this field
	// is a string; see https://google.aip.dev/126 for details.
	Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"`
	// A swarming task ID is the ID of a single swarming task.
	// The swarming task of an action is the swarming task that invoked the
	// action.
	// For example, "4f6c0ba2ef3fc610" is a swarming task ID.
	SwarmingTaskId string `protobuf:"bytes,4,opt,name=swarming_task_id,json=swarmingTaskId,proto3" json:"swarming_task_id,omitempty"`
	// An asset tag is the tag of a given asset in UFS.
	// An asset tag may be a short number such as C444444 printed on a device,
	// or it may be a UUID in some circumstances.
	AssetTag string `protobuf:"bytes,5,opt,name=asset_tag,json=assetTag,proto3" json:"asset_tag,omitempty"`
	// The start time is the time that an action started.
	StartTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	// The stop time is the time that an action finished.
	StopTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=stop_time,json=stopTime,proto3" json:"stop_time,omitempty"`
	// The create time is the time that an action was created by Karte.
	// This is the time that the event was first received, since events are
	// immutable outside of rare cases.
	// This field is managed by Karte itself.
	CreateTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	Status     Action_Status          `protobuf:"varint,9,opt,name=status,proto3,enum=chromeos.karte.Action_Status" json:"status,omitempty"`
	// The fail reason of an event is a diagnostic message that is emitted when
	// the action in question has failed.
	FailReason string `protobuf:"bytes,10,opt,name=fail_reason,json=failReason,proto3" json:"fail_reason,omitempty"`
	// The seal time is when the particular Karte record is sealed and no further
	// changes can be made.
	SealTime *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=seal_time,json=sealTime,proto3" json:"seal_time,omitempty"`
	// The client is the name of the entity creating the Action entry, e.g.
	// "paris".
	ClientName string `protobuf:"bytes,12,opt,name=client_name,json=clientName,proto3" json:"client_name,omitempty"`
	// The client version is the version of the entity creating the Action entry,
	// e.g. "0.0.1".
	ClientVersion string `protobuf:"bytes,13,opt,name=client_version,json=clientVersion,proto3" json:"client_version,omitempty"`
	// The buildbucket ID is the ID of the buildbucket build associated with the
	// event in question.
	BuildbucketId string `protobuf:"bytes,14,opt,name=buildbucket_id,json=buildbucketId,proto3" json:"buildbucket_id,omitempty"`
	// The hostname is the hostname of the DUT in question.
	Hostname string `protobuf:"bytes,15,opt,name=hostname,proto3" json:"hostname,omitempty"`
	// Modification_count returns the number of times that the Karte record has
	// been modified. This field is managed by Karte.
	ModificationCount int32 `protobuf:"varint,16,opt,name=modification_count,json=modificationCount,proto3" json:"modification_count,omitempty"`
	// model is the model of the DUT this event applies to.
	Model string `protobuf:"bytes,17,opt,name=model,proto3" json:"model,omitempty"`
	// board is the board of the DUT this event applies to.
	Board string `protobuf:"bytes,18,opt,name=board,proto3" json:"board,omitempty"`
	// recovered by is the name of the task that recovered the current action, if
	// one exists.
	RecoveredBy string `protobuf:"bytes,19,opt,name=recovered_by,json=recoveredBy,proto3" json:"recovered_by,omitempty"`
	// restarts is the number of times that the current plan was restarted.
	Restarts int32 `protobuf:"varint,20,opt,name=restarts,proto3" json:"restarts,omitempty"`
	// plan_name is the name of the plan that we're currently executing.
	PlanName   string            `protobuf:"bytes,21,opt,name=plan_name,json=planName,proto3" json:"plan_name,omitempty"`
	AllowFail  Action_AllowFail  `` /* 127-byte string literal not displayed */
	ActionType Action_ActionType `` /* 131-byte string literal not displayed */
	// Storage policy describes how to store this record in Datastore and Bigquery.
	//
	// This is a control field and is NOT persisted to the storage layer.
	StoragePolicy *StoragePolicy `protobuf:"bytes,24,opt,name=storage_policy,json=storagePolicy,proto3" json:"storage_policy,omitempty"`
	// contains filtered or unexported fields
}

An action represents an event that was intentionally performed on a DUT. Examples include running a command on a DUT or resetting the servo attached to a DUT.

func (*Action) Descriptor deprecated

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

Deprecated: Use Action.ProtoReflect.Descriptor instead.

func (*Action) GetActionType

func (x *Action) GetActionType() Action_ActionType

func (*Action) GetAllowFail

func (x *Action) GetAllowFail() Action_AllowFail

func (*Action) GetAssetTag

func (x *Action) GetAssetTag() string

func (*Action) GetBoard

func (x *Action) GetBoard() string

func (*Action) GetBuildbucketId

func (x *Action) GetBuildbucketId() string

func (*Action) GetClientName

func (x *Action) GetClientName() string

func (*Action) GetClientVersion

func (x *Action) GetClientVersion() string

func (*Action) GetCreateTime

func (x *Action) GetCreateTime() *timestamppb.Timestamp

func (*Action) GetFailReason

func (x *Action) GetFailReason() string

func (*Action) GetHostname

func (x *Action) GetHostname() string

func (*Action) GetKind

func (x *Action) GetKind() string

func (*Action) GetModel

func (x *Action) GetModel() string

func (*Action) GetModificationCount

func (x *Action) GetModificationCount() int32

func (*Action) GetName

func (x *Action) GetName() string

func (*Action) GetPlanName

func (x *Action) GetPlanName() string

func (*Action) GetRecoveredBy

func (x *Action) GetRecoveredBy() string

func (*Action) GetRestarts

func (x *Action) GetRestarts() int32

func (*Action) GetSealTime

func (x *Action) GetSealTime() *timestamppb.Timestamp

func (*Action) GetStartTime

func (x *Action) GetStartTime() *timestamppb.Timestamp

func (*Action) GetStatus

func (x *Action) GetStatus() Action_Status

func (*Action) GetStopTime

func (x *Action) GetStopTime() *timestamppb.Timestamp

func (*Action) GetStoragePolicy

func (x *Action) GetStoragePolicy() *StoragePolicy

func (*Action) GetSwarmingTaskId

func (x *Action) GetSwarmingTaskId() string

func (*Action) ProtoMessage

func (*Action) ProtoMessage()

func (*Action) ProtoReflect

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

func (*Action) Reset

func (x *Action) Reset()

func (*Action) String

func (x *Action) String() string

type Action_ActionType

type Action_ActionType int32

ActionType is the type of the action: verifier, condition, or recovery.

const (
	// ACTION_TYPE_UNSPECIFIED is the default action type.
	Action_ACTION_TYPE_UNSPECIFIED Action_ActionType = 0
	// ACTION_TYPE_VERIFIER actions are critical actions and their dependencies.
	Action_ACTION_TYPE_VERIFIER Action_ActionType = 1
	// ACTION_TYPE_CONDITION actions are condition actions and their
	// dependencies.
	Action_ACTION_TYPE_CONDITION Action_ActionType = 2
	// ACTION_TYPE_RECOVERY actions are recovery actions and their dependencies.
	Action_ACTION_TYPE_RECOVERY Action_ActionType = 3
)

func (Action_ActionType) Descriptor

func (Action_ActionType) Enum

func (Action_ActionType) EnumDescriptor deprecated

func (Action_ActionType) EnumDescriptor() ([]byte, []int)

Deprecated: Use Action_ActionType.Descriptor instead.

func (Action_ActionType) Number

func (Action_ActionType) String

func (x Action_ActionType) String() string

func (Action_ActionType) Type

type Action_AllowFail

type Action_AllowFail int32

AllowFail records whether failure is allowed or not for the action in question. There are two features of actions commonly referred to as "criticality". The first is whether the action is a "critical action" or not. A critical action is one that is considered an entrypoint from the perspective of the Paris engine. The second is one where failures are NOT forgiven. This captures the second notion.

const (
	Action_ALLOW_FAIL_UNSPECIFIED Action_AllowFail = 0
	Action_ALLOW_FAIL             Action_AllowFail = 1
	Action_NO_ALLOW_FAIL          Action_AllowFail = 2
)

func (Action_AllowFail) Descriptor

func (Action_AllowFail) Enum

func (Action_AllowFail) EnumDescriptor deprecated

func (Action_AllowFail) EnumDescriptor() ([]byte, []int)

Deprecated: Use Action_AllowFail.Descriptor instead.

func (Action_AllowFail) Number

func (Action_AllowFail) String

func (x Action_AllowFail) String() string

func (Action_AllowFail) Type

type Action_Status

type Action_Status int32

The status of an action is whether the action succeeded or failed.

const (
	Action_STATUS_UNSPECIFIED Action_Status = 0
	Action_SUCCESS            Action_Status = 1
	Action_FAIL               Action_Status = 2
	Action_SKIP               Action_Status = 3
)

func (Action_Status) Descriptor

func (Action_Status) Enum

func (x Action_Status) Enum() *Action_Status

func (Action_Status) EnumDescriptor deprecated

func (Action_Status) EnumDescriptor() ([]byte, []int)

Deprecated: Use Action_Status.Descriptor instead.

func (Action_Status) Number

func (Action_Status) String

func (x Action_Status) String() string

func (Action_Status) Type

type CreateActionRequest

type CreateActionRequest struct {
	Action *Action `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"`
	// contains filtered or unexported fields
}

CreateActionRequest creates a single action.

func (*CreateActionRequest) Descriptor deprecated

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

Deprecated: Use CreateActionRequest.ProtoReflect.Descriptor instead.

func (*CreateActionRequest) GetAction

func (x *CreateActionRequest) GetAction() *Action

func (*CreateActionRequest) ProtoMessage

func (*CreateActionRequest) ProtoMessage()

func (*CreateActionRequest) ProtoReflect

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

func (*CreateActionRequest) Reset

func (x *CreateActionRequest) Reset()

func (*CreateActionRequest) String

func (x *CreateActionRequest) String() string

type CreateObservationRequest

type CreateObservationRequest struct {

	// An observation is the observation record being created.
	Observation *Observation `protobuf:"bytes,1,opt,name=observation,proto3" json:"observation,omitempty"`
	// contains filtered or unexported fields
}

CreateObservationRequest creates a single action.

func (*CreateObservationRequest) Descriptor deprecated

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

Deprecated: Use CreateObservationRequest.ProtoReflect.Descriptor instead.

func (*CreateObservationRequest) GetObservation

func (x *CreateObservationRequest) GetObservation() *Observation

func (*CreateObservationRequest) ProtoMessage

func (*CreateObservationRequest) ProtoMessage()

func (*CreateObservationRequest) ProtoReflect

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

func (*CreateObservationRequest) Reset

func (x *CreateObservationRequest) Reset()

func (*CreateObservationRequest) String

func (x *CreateObservationRequest) String() string

type KarteClient

type KarteClient interface {
	// CreateAction creates an action and returns the action just created.
	CreateAction(ctx context.Context, in *CreateActionRequest, opts ...grpc.CallOption) (*Action, error)
	// CreateObservation creates an observation and returns the observation
	// that was just created.
	// This API is based on https://google.aip.dev/133.
	CreateObservation(ctx context.Context, in *CreateObservationRequest, opts ...grpc.CallOption) (*Observation, error)
	// PersistAction persists a single action to bigquery directly.
	PersistAction(ctx context.Context, in *PersistActionRequest, opts ...grpc.CallOption) (*PersistActionResponse, error)
	// PersistActionRange persists a range of actions organized by their creation time.
	// Since the seal time is typically what we are interested in, not the creation time, this RPC
	// also takes a seal time as a parameter.
	PersistActionRange(ctx context.Context, in *PersistActionRangeRequest, opts ...grpc.CallOption) (*PersistActionRangeResponse, error)
	// ListActions lists all the actions that Karte knows about.
	// The order in which the actions are returned is undefined.
	ListActions(ctx context.Context, in *ListActionsRequest, opts ...grpc.CallOption) (*ListActionsResponse, error)
	// ListObservations lists all the observations that Karte knows about.
	// The order in which the observations are returned is undefined.
	ListObservations(ctx context.Context, in *ListObservationsRequest, opts ...grpc.CallOption) (*ListObservationsResponse, error)
}

KarteClient is the client API for Karte service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewKarteClient

func NewKarteClient(cc grpc.ClientConnInterface) KarteClient

func NewKartePRPCClient

func NewKartePRPCClient(client *prpc.Client) KarteClient

type KarteCronClient

type KarteCronClient interface {
	PersistToBigquery(ctx context.Context, in *PersistToBigqueryRequest, opts ...grpc.CallOption) (*PersistToBigqueryResponse, error)
}

KarteCronClient is the client API for KarteCron service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewKarteCronClient

func NewKarteCronClient(cc grpc.ClientConnInterface) KarteCronClient

func NewKarteCronPRPCClient

func NewKarteCronPRPCClient(client *prpc.Client) KarteCronClient

type KarteCronServer

type KarteCronServer interface {
	PersistToBigquery(context.Context, *PersistToBigqueryRequest) (*PersistToBigqueryResponse, error)
}

KarteCronServer is the server API for KarteCron service.

type KarteServer

type KarteServer interface {
	// CreateAction creates an action and returns the action just created.
	CreateAction(context.Context, *CreateActionRequest) (*Action, error)
	// CreateObservation creates an observation and returns the observation
	// that was just created.
	// This API is based on https://google.aip.dev/133.
	CreateObservation(context.Context, *CreateObservationRequest) (*Observation, error)
	// PersistAction persists a single action to bigquery directly.
	PersistAction(context.Context, *PersistActionRequest) (*PersistActionResponse, error)
	// PersistActionRange persists a range of actions organized by their creation time.
	// Since the seal time is typically what we are interested in, not the creation time, this RPC
	// also takes a seal time as a parameter.
	PersistActionRange(context.Context, *PersistActionRangeRequest) (*PersistActionRangeResponse, error)
	// ListActions lists all the actions that Karte knows about.
	// The order in which the actions are returned is undefined.
	ListActions(context.Context, *ListActionsRequest) (*ListActionsResponse, error)
	// ListObservations lists all the observations that Karte knows about.
	// The order in which the observations are returned is undefined.
	ListObservations(context.Context, *ListObservationsRequest) (*ListObservationsResponse, error)
}

KarteServer is the server API for Karte service.

type ListActionsRequest

type ListActionsRequest struct {

	// The maximum number of actions to return. The service may return fewer than
	// this value.
	// If unspecified, at most 50 actions will be returned.
	// The maximum value is 1000; values above 1000 will be coerced to 1000.
	PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// A page token, received from a previous `ListActions` call.
	// Provide this to retrieve the subsequent page.
	//
	// When paginating, all other parameters provided to `ListActions` must match
	// the call that provided the page token.
	PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	// Filter is a query using an expression syntax described in
	// filter_syntax.md.
	//
	// Currently, every field is filterable.
	Filter string `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"`
	// contains filtered or unexported fields
}

ListActionsRequest takes a page size and a token indicating where to start.

func (*ListActionsRequest) Descriptor deprecated

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

Deprecated: Use ListActionsRequest.ProtoReflect.Descriptor instead.

func (*ListActionsRequest) GetFilter

func (x *ListActionsRequest) GetFilter() string

func (*ListActionsRequest) GetPageSize

func (x *ListActionsRequest) GetPageSize() int32

func (*ListActionsRequest) GetPageToken

func (x *ListActionsRequest) GetPageToken() string

func (*ListActionsRequest) ProtoMessage

func (*ListActionsRequest) ProtoMessage()

func (*ListActionsRequest) ProtoReflect

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

func (*ListActionsRequest) Reset

func (x *ListActionsRequest) Reset()

func (*ListActionsRequest) String

func (x *ListActionsRequest) String() string

type ListActionsResponse

type ListActionsResponse struct {

	// These are all the actions fitting the criteria specified. Currently, no
	// criteria can be provided, so every action matches.
	Actions []*Action `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"`
	// This is the page token that is needed for pagination. This token
	// must be supplied verbatim to subsequent calls to ListActions.
	NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
	// contains filtered or unexported fields
}

ListActionsResponse returns the actions in question and returns a page token indicating where to start looking in the next search. The page token will be empty if and only if we have reached the end of the results.

func (*ListActionsResponse) Descriptor deprecated

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

Deprecated: Use ListActionsResponse.ProtoReflect.Descriptor instead.

func (*ListActionsResponse) GetActions

func (x *ListActionsResponse) GetActions() []*Action

func (*ListActionsResponse) GetNextPageToken

func (x *ListActionsResponse) GetNextPageToken() string

func (*ListActionsResponse) ProtoMessage

func (*ListActionsResponse) ProtoMessage()

func (*ListActionsResponse) ProtoReflect

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

func (*ListActionsResponse) Reset

func (x *ListActionsResponse) Reset()

func (*ListActionsResponse) String

func (x *ListActionsResponse) String() string

type ListObservationsRequest

type ListObservationsRequest struct {

	// The maximum number of observations to return. The service may return fewer
	// than this value. If unspecified, at most 50 observations will be returned.
	// The maximum value is 1000; values above 1000 will be coerced to 1000.
	PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// A page token, received from a previous `ListObservations` call.
	// Provide this to retrieve the subsequent page.
	//
	// When paginating, all other parameters provided to `ListObservations` must
	// match the call that provided the page token.
	PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	// Filter is a query using an expression syntax described in
	// filter_syntax.md.
	//
	// Currently supported filterable values for actions are:
	// - metric_kind
	Filter string `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"`
	// contains filtered or unexported fields
}

ListObservationsRequest take a page size and a token indicating where to start.

func (*ListObservationsRequest) Descriptor deprecated

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

Deprecated: Use ListObservationsRequest.ProtoReflect.Descriptor instead.

func (*ListObservationsRequest) GetFilter

func (x *ListObservationsRequest) GetFilter() string

func (*ListObservationsRequest) GetPageSize

func (x *ListObservationsRequest) GetPageSize() int32

func (*ListObservationsRequest) GetPageToken

func (x *ListObservationsRequest) GetPageToken() string

func (*ListObservationsRequest) ProtoMessage

func (*ListObservationsRequest) ProtoMessage()

func (*ListObservationsRequest) ProtoReflect

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

func (*ListObservationsRequest) Reset

func (x *ListObservationsRequest) Reset()

func (*ListObservationsRequest) String

func (x *ListObservationsRequest) String() string

type ListObservationsResponse

type ListObservationsResponse struct {

	// These are all the actions fitting the criteria specified. Currently, no
	// criteria can be provided, so every action matches.
	Observations []*Observation `protobuf:"bytes,1,rep,name=observations,proto3" json:"observations,omitempty"`
	// This is the page token that is needed for pagination. This token
	// must be supplied verbatim to subsequent calls to ListActions.
	NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
	// contains filtered or unexported fields
}

ListObservationsResponse returns the observations in quetoin and returns a page token indicating where to start looking in the next search. The page token will be empty if and only if we have reached the end of the results.

func (*ListObservationsResponse) Descriptor deprecated

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

Deprecated: Use ListObservationsResponse.ProtoReflect.Descriptor instead.

func (*ListObservationsResponse) GetNextPageToken

func (x *ListObservationsResponse) GetNextPageToken() string

func (*ListObservationsResponse) GetObservations

func (x *ListObservationsResponse) GetObservations() []*Observation

func (*ListObservationsResponse) ProtoMessage

func (*ListObservationsResponse) ProtoMessage()

func (*ListObservationsResponse) ProtoReflect

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

func (*ListObservationsResponse) Reset

func (x *ListObservationsResponse) Reset()

func (*ListObservationsResponse) String

func (x *ListObservationsResponse) String() string

type Observation

type Observation struct {

	// The resource name of the observation. Names are generated
	// automatically when a new observation is created.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// A reference to a Karte action.
	ActionName string `protobuf:"bytes,2,opt,name=action_name,json=actionName,proto3" json:"action_name,omitempty"`
	// The metric kind records what measurement is being performed, e.g.
	// "battery_level" or "disk_usage"
	MetricKind string `protobuf:"bytes,3,opt,name=metric_kind,json=metricKind,proto3" json:"metric_kind,omitempty"`
	// Value records the concrete measurement that was made. It can be a string or
	// a number.
	//
	// Types that are valid to be assigned to Value:
	//
	//	*Observation_ValueString
	//	*Observation_ValueNumber
	Value isObservation_Value `protobuf_oneof:"value"`
	// Storage policy describes how to store this record in Datastore and Bigquery.
	//
	// This is a control field and is NOT persisted to the storage layer.
	StoragePolicy *StoragePolicy `protobuf:"bytes,6,opt,name=storage_policy,json=storagePolicy,proto3" json:"storage_policy,omitempty"`
	// contains filtered or unexported fields
}

An Observation describes a measurement during an action.

Examples:

battery_level:70 - battery level on device is 70%
rrd:present      - rrd metric is present on device
disk_usage:35    - 35% internal storage used

func (*Observation) Descriptor deprecated

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

Deprecated: Use Observation.ProtoReflect.Descriptor instead.

func (*Observation) GetActionName

func (x *Observation) GetActionName() string

func (*Observation) GetMetricKind

func (x *Observation) GetMetricKind() string

func (*Observation) GetName

func (x *Observation) GetName() string

func (*Observation) GetStoragePolicy

func (x *Observation) GetStoragePolicy() *StoragePolicy

func (*Observation) GetValue

func (x *Observation) GetValue() isObservation_Value

func (*Observation) GetValueNumber

func (x *Observation) GetValueNumber() float64

func (*Observation) GetValueString

func (x *Observation) GetValueString() string

func (*Observation) ProtoMessage

func (*Observation) ProtoMessage()

func (*Observation) ProtoReflect

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

func (*Observation) Reset

func (x *Observation) Reset()

func (*Observation) String

func (x *Observation) String() string

type Observation_ValueNumber

type Observation_ValueNumber struct {
	ValueNumber float64 `protobuf:"fixed64,5,opt,name=value_number,json=valueNumber,proto3,oneof"`
}

type Observation_ValueString

type Observation_ValueString struct {
	ValueString string `protobuf:"bytes,4,opt,name=value_string,json=valueString,proto3,oneof"`
}

type PersistActionRangeRequest

type PersistActionRangeRequest struct {

	// Start_time is the nominal start time. Defaults to one hour before the present.
	StartTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	// Start_version is the Karte record version corresponding to the start, for example "zzzz".
	StartVersion string `protobuf:"bytes,4,opt,name=start_version,json=startVersion,proto3" json:"start_version,omitempty"`
	// Stop_time is the nominal stop time. Defaults to the present.
	StopTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=stop_time,json=stopTime,proto3" json:"stop_time,omitempty"`
	// Stop_version is the Karte record version corresponding to the stop, for example "zzzz".
	StopVersion string `protobuf:"bytes,5,opt,name=stop_version,json=stopVersion,proto3" json:"stop_version,omitempty"`
	// Seal_time_seconds defaults to the current seal time, expressed in seconds.
	// The seal time is the maximum amount of time that an event can be modifiable for.
	SealTimeSeconds int32 `protobuf:"varint,3,opt,name=seal_time_seconds,json=sealTimeSeconds,proto3" json:"seal_time_seconds,omitempty"`
	// contains filtered or unexported fields
}

PersistActionRangeRequest describes what range of actions to persist.

The semantics of this request are a little bit tricky.

In Karte, the name is a combination of the Karte name version identifier (originally "zzzz" and counting down) and the creation time.

If the user passes in no version (really an empty version, but logically no version), then we compare based on the creation time only. Specifying neither the start version nor the end version is always semantically correct, but might be inefficient.

If both the start_version and stop_version are non-empty, then we will use them to construct a range on the names as well. This range will be intersected with the range based on the creation time.

In short, passing in the start version and stop version is an optimization.

func (*PersistActionRangeRequest) Descriptor deprecated

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

Deprecated: Use PersistActionRangeRequest.ProtoReflect.Descriptor instead.

func (*PersistActionRangeRequest) GetSealTimeSeconds

func (x *PersistActionRangeRequest) GetSealTimeSeconds() int32

func (*PersistActionRangeRequest) GetStartTime

func (x *PersistActionRangeRequest) GetStartTime() *timestamppb.Timestamp

func (*PersistActionRangeRequest) GetStartVersion

func (x *PersistActionRangeRequest) GetStartVersion() string

func (*PersistActionRangeRequest) GetStopTime

func (*PersistActionRangeRequest) GetStopVersion

func (x *PersistActionRangeRequest) GetStopVersion() string

func (*PersistActionRangeRequest) ProtoMessage

func (*PersistActionRangeRequest) ProtoMessage()

func (*PersistActionRangeRequest) ProtoReflect

func (*PersistActionRangeRequest) Reset

func (x *PersistActionRangeRequest) Reset()

func (*PersistActionRangeRequest) String

func (x *PersistActionRangeRequest) String() string

type PersistActionRangeResponse

type PersistActionRangeResponse struct {

	// Created_records is the number of created records.
	CreatedRecords int32 `protobuf:"varint,1,opt,name=created_records,json=createdRecords,proto3" json:"created_records,omitempty"`
	// Succeeded is true if and only if no errors at all were encountered during persistence.
	Succeeded bool `protobuf:"varint,2,opt,name=succeeded,proto3" json:"succeeded,omitempty"`
	// contains filtered or unexported fields
}

PersistActionRangeResponse is the response to a persist actions request.

func (*PersistActionRangeResponse) Descriptor deprecated

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

Deprecated: Use PersistActionRangeResponse.ProtoReflect.Descriptor instead.

func (*PersistActionRangeResponse) GetCreatedRecords

func (x *PersistActionRangeResponse) GetCreatedRecords() int32

func (*PersistActionRangeResponse) GetSucceeded

func (x *PersistActionRangeResponse) GetSucceeded() bool

func (*PersistActionRangeResponse) ProtoMessage

func (*PersistActionRangeResponse) ProtoMessage()

func (*PersistActionRangeResponse) ProtoReflect

func (*PersistActionRangeResponse) Reset

func (x *PersistActionRangeResponse) Reset()

func (*PersistActionRangeResponse) String

func (x *PersistActionRangeResponse) String() string

type PersistActionRequest

type PersistActionRequest struct {

	// The ID of the single action to persist.
	ActionId string `protobuf:"bytes,1,opt,name=action_id,json=actionId,proto3" json:"action_id,omitempty"`
	// If true, check for the presence of a BigQuery record with the appropriate ID before
	// persisting. If false, add the record anyway.
	CheckForDuplicate bool `protobuf:"varint,2,opt,name=check_for_duplicate,json=checkForDuplicate,proto3" json:"check_for_duplicate,omitempty"`
	// contains filtered or unexported fields
}

PersistActionRequest describes the single action to persist.

func (*PersistActionRequest) Descriptor deprecated

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

Deprecated: Use PersistActionRequest.ProtoReflect.Descriptor instead.

func (*PersistActionRequest) GetActionId

func (x *PersistActionRequest) GetActionId() string

func (*PersistActionRequest) GetCheckForDuplicate

func (x *PersistActionRequest) GetCheckForDuplicate() bool

func (*PersistActionRequest) ProtoMessage

func (*PersistActionRequest) ProtoMessage()

func (*PersistActionRequest) ProtoReflect

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

func (*PersistActionRequest) Reset

func (x *PersistActionRequest) Reset()

func (*PersistActionRequest) String

func (x *PersistActionRequest) String() string

type PersistActionResponse

type PersistActionResponse struct {

	// Created record is true if and only if a new record was created as a result of
	// this API call.
	CreatedRecord bool `protobuf:"varint,1,opt,name=created_record,json=createdRecord,proto3" json:"created_record,omitempty"`
	// Succeeded is true if and only if the call was successful. It is possible for a
	// call to be successful without producing a new record.
	Succeeded bool `protobuf:"varint,2,opt,name=succeeded,proto3" json:"succeeded,omitempty"`
	// contains filtered or unexported fields
}

PersistActionResponse is the response to a persist actions request.

func (*PersistActionResponse) Descriptor deprecated

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

Deprecated: Use PersistActionResponse.ProtoReflect.Descriptor instead.

func (*PersistActionResponse) GetCreatedRecord

func (x *PersistActionResponse) GetCreatedRecord() bool

func (*PersistActionResponse) GetSucceeded

func (x *PersistActionResponse) GetSucceeded() bool

func (*PersistActionResponse) ProtoMessage

func (*PersistActionResponse) ProtoMessage()

func (*PersistActionResponse) ProtoReflect

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

func (*PersistActionResponse) Reset

func (x *PersistActionResponse) Reset()

func (*PersistActionResponse) String

func (x *PersistActionResponse) String() string

type PersistToBigqueryRequest

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

PersistToBigqueryRequest does not contain any info, since PersistToBigquery is intended to be called as a cron job.

func (*PersistToBigqueryRequest) Descriptor deprecated

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

Deprecated: Use PersistToBigqueryRequest.ProtoReflect.Descriptor instead.

func (*PersistToBigqueryRequest) ProtoMessage

func (*PersistToBigqueryRequest) ProtoMessage()

func (*PersistToBigqueryRequest) ProtoReflect

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

func (*PersistToBigqueryRequest) Reset

func (x *PersistToBigqueryRequest) Reset()

func (*PersistToBigqueryRequest) String

func (x *PersistToBigqueryRequest) String() string

type PersistToBigqueryResponse

type PersistToBigqueryResponse struct {

	// Created actions is a count of the actions that were created.
	CreatedActions int32 `protobuf:"varint,1,opt,name=created_actions,json=createdActions,proto3" json:"created_actions,omitempty"`
	// Created observations is a count of the observations that were created.
	CreatedObservations int32 `protobuf:"varint,2,opt,name=created_observations,json=createdObservations,proto3" json:"created_observations,omitempty"`
	// Succeeded is true if and only if no errors at all were encountered during persistence.
	Succeeded bool `protobuf:"varint,3,opt,name=succeeded,proto3" json:"succeeded,omitempty"`
	// contains filtered or unexported fields
}

func (*PersistToBigqueryResponse) Descriptor deprecated

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

Deprecated: Use PersistToBigqueryResponse.ProtoReflect.Descriptor instead.

func (*PersistToBigqueryResponse) GetCreatedActions

func (x *PersistToBigqueryResponse) GetCreatedActions() int32

func (*PersistToBigqueryResponse) GetCreatedObservations

func (x *PersistToBigqueryResponse) GetCreatedObservations() int32

func (*PersistToBigqueryResponse) GetSucceeded

func (x *PersistToBigqueryResponse) GetSucceeded() bool

func (*PersistToBigqueryResponse) ProtoMessage

func (*PersistToBigqueryResponse) ProtoMessage()

func (*PersistToBigqueryResponse) ProtoReflect

func (*PersistToBigqueryResponse) Reset

func (x *PersistToBigqueryResponse) Reset()

func (*PersistToBigqueryResponse) String

func (x *PersistToBigqueryResponse) String() string

type StoragePolicy

type StoragePolicy struct {
	StoragePolicy StoragePolicy_StoragePolicy `` /* 149-byte string literal not displayed */
	// contains filtered or unexported fields
}

StoragePolicy controls where and how the Karte records will be stored. For example, will we skip BigQuery.

func (*StoragePolicy) Descriptor deprecated

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

Deprecated: Use StoragePolicy.ProtoReflect.Descriptor instead.

func (*StoragePolicy) GetStoragePolicy

func (x *StoragePolicy) GetStoragePolicy() StoragePolicy_StoragePolicy

func (*StoragePolicy) ProtoMessage

func (*StoragePolicy) ProtoMessage()

func (*StoragePolicy) ProtoReflect

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

func (*StoragePolicy) Reset

func (x *StoragePolicy) Reset()

func (*StoragePolicy) String

func (x *StoragePolicy) String() string

type StoragePolicy_StoragePolicy

type StoragePolicy_StoragePolicy int32
const (
	// UNSPECIFIED is treated as store.
	StoragePolicy_UNSPECIFIED StoragePolicy_StoragePolicy = 0
	StoragePolicy_STORE       StoragePolicy_StoragePolicy = 1
	StoragePolicy_SKIP        StoragePolicy_StoragePolicy = 2
)

func (StoragePolicy_StoragePolicy) Descriptor

func (StoragePolicy_StoragePolicy) Enum

func (StoragePolicy_StoragePolicy) EnumDescriptor deprecated

func (StoragePolicy_StoragePolicy) EnumDescriptor() ([]byte, []int)

Deprecated: Use StoragePolicy_StoragePolicy.Descriptor instead.

func (StoragePolicy_StoragePolicy) Number

func (StoragePolicy_StoragePolicy) String

func (StoragePolicy_StoragePolicy) Type

type UnimplementedKarteCronServer

type UnimplementedKarteCronServer struct {
}

UnimplementedKarteCronServer can be embedded to have forward compatible implementations.

func (*UnimplementedKarteCronServer) PersistToBigquery

type UnimplementedKarteServer

type UnimplementedKarteServer struct {
}

UnimplementedKarteServer can be embedded to have forward compatible implementations.

func (*UnimplementedKarteServer) CreateAction

func (*UnimplementedKarteServer) CreateObservation

func (*UnimplementedKarteServer) ListActions

func (*UnimplementedKarteServer) ListObservations

func (*UnimplementedKarteServer) PersistAction

func (*UnimplementedKarteServer) PersistActionRange

Directories

Path Synopsis
Package kbqpb is the bigquery proto API of karte.
Package kbqpb is the bigquery proto API of karte.

Jump to

Keyboard shortcuts

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