v1

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DiscoveryService_GetWorkload_FullMethodName   = "/agntcy.dir.runtime.v1.DiscoveryService/GetWorkload"
	DiscoveryService_ListWorkloads_FullMethodName = "/agntcy.dir.runtime.v1.DiscoveryService/ListWorkloads"
)
View Source
const DefaultOASFSchemaURL = "https://schema.oasf.outshift.com"

DefaultOASFSchemaURL is the OASF schema server whose extensions are accepted when no other schema servers are configured.

View Source
const DiscoveryInstanceAnnotation = "org.agntcy/discovery-instance"

DiscoveryInstanceAnnotation is the annotation in which a discovery instance records its ID on every workload it writes.

Variables

View Source
var (
	RuntimeType_name = map[int32]string{
		0: "RUNTIME_TYPE_UNSPECIFIED",
		1: "RUNTIME_TYPE_DOCKER",
		2: "RUNTIME_TYPE_KUBERNETES",
	}
	RuntimeType_value = map[string]int32{
		"RUNTIME_TYPE_UNSPECIFIED": 0,
		"RUNTIME_TYPE_DOCKER":      1,
		"RUNTIME_TYPE_KUBERNETES":  2,
	}
)

Enum value maps for RuntimeType.

View Source
var (
	WorkloadType_name = map[int32]string{
		0: "WORKLOAD_TYPE_UNSPECIFIED",
		1: "WORKLOAD_TYPE_PROCESS",
		2: "WORKLOAD_TYPE_CONTAINER",
		3: "WORKLOAD_TYPE_POD",
	}
	WorkloadType_value = map[string]int32{
		"WORKLOAD_TYPE_UNSPECIFIED": 0,
		"WORKLOAD_TYPE_PROCESS":     1,
		"WORKLOAD_TYPE_CONTAINER":   2,
		"WORKLOAD_TYPE_POD":         3,
	}
)

Enum value maps for WorkloadType.

View Source
var DiscoveryService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "agntcy.dir.runtime.v1.DiscoveryService",
	HandlerType: (*DiscoveryServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetWorkload",
			Handler:    _DiscoveryService_GetWorkload_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ListWorkloads",
			Handler:       _DiscoveryService_ListWorkloads_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "agntcy/dir/runtime/v1/discovery_service.proto",
}

DiscoveryService_ServiceDesc is the grpc.ServiceDesc for DiscoveryService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_agntcy_dir_runtime_v1_discovery_service_proto protoreflect.FileDescriptor
View Source
var File_agntcy_dir_runtime_v1_workload_proto protoreflect.FileDescriptor

Functions

func RegisterDiscoveryServiceServer

func RegisterDiscoveryServiceServer(s grpc.ServiceRegistrar, srv DiscoveryServiceServer)

Types

type AgentInfo added in v1.8.0

type AgentInfo struct {
	// Name is the agent's name.
	Name string
	// SchemaVersion is the OASF schema version of Skills and Domains.
	SchemaVersion string
	// Skills are the agent's OASF skills.
	Skills []OASFClass
	// Domains are the agent's OASF domains.
	Domains []OASFClass
	// Authors are the agent's authors, e.g. the DID of the human vouching for it.
	Authors []string
}

AgentInfo is what a workload says about the agent it runs.

It is read from the workload's A2A card (services.a2a): the card's name, and the OASF discovery and identity extensions served by an accepted schema server. Whatever the card does not provide is read from the OASF record the workload references (services.oasf). The values are claims made by whoever deployed the workload; nothing here is verified.

type DiscoveryServiceClient

type DiscoveryServiceClient interface {
	// Get a workload by its identifier.
	GetWorkload(ctx context.Context, in *GetWorkloadRequest, opts ...grpc.CallOption) (*Workload, error)
	// List all workloads based on filters.
	ListWorkloads(ctx context.Context, in *ListWorkloadsRequest, opts ...grpc.CallOption) (DiscoveryService_ListWorkloadsClient, error)
}

DiscoveryServiceClient is the client API for DiscoveryService 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.

DiscoveryService defines the gRPC service for discovering workloads. The service itself does not actually perform discovery, but rather queries the underlying store for existing workloads. It supports filtering workloads based on provided criteria.

type DiscoveryServiceServer

type DiscoveryServiceServer interface {
	// Get a workload by its identifier.
	GetWorkload(context.Context, *GetWorkloadRequest) (*Workload, error)
	// List all workloads based on filters.
	ListWorkloads(*ListWorkloadsRequest, DiscoveryService_ListWorkloadsServer) error
}

DiscoveryServiceServer is the server API for DiscoveryService service. All implementations should embed UnimplementedDiscoveryServiceServer for forward compatibility.

DiscoveryService defines the gRPC service for discovering workloads. The service itself does not actually perform discovery, but rather queries the underlying store for existing workloads. It supports filtering workloads based on provided criteria.

type DiscoveryService_ListWorkloadsClient

type DiscoveryService_ListWorkloadsClient interface {
	Recv() (*Workload, error)
	grpc.ClientStream
}

type DiscoveryService_ListWorkloadsServer

type DiscoveryService_ListWorkloadsServer interface {
	Send(*Workload) error
	grpc.ServerStream
}

type FilterOptions added in v1.8.0

type FilterOptions struct {
	// AcceptedSchemaURLs is passed to AgentInfo.
	AcceptedSchemaURLs []string
	// ReachableFrom is the workload named by the request's reachable_from_workload_id,
	// looked up by the caller. When the request sets that field and ReachableFrom is nil
	// or has another ID, no workload matches.
	ReachableFrom *Workload
}

FilterOptions holds what MatchesFilters needs besides the request itself.

type GetWorkloadRequest

type GetWorkloadRequest struct {

	// The unique identifier of the workload to retrieve.
	// Supports either hostname or workload ID.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

GetWorkloadRequest is the request message for retrieving a specific workload.

func (*GetWorkloadRequest) Descriptor deprecated

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

Deprecated: Use GetWorkloadRequest.ProtoReflect.Descriptor instead.

func (*GetWorkloadRequest) GetId

func (x *GetWorkloadRequest) GetId() string

func (*GetWorkloadRequest) ProtoMessage

func (*GetWorkloadRequest) ProtoMessage()

func (*GetWorkloadRequest) ProtoReflect

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

func (*GetWorkloadRequest) Reset

func (x *GetWorkloadRequest) Reset()

func (*GetWorkloadRequest) String

func (x *GetWorkloadRequest) String() string

type ListWorkloadsRequest

type ListWorkloadsRequest struct {

	// Optional labels to filter workloads.
	// Labels are applied in an AND fashion; only workloads matching all labels are returned.
	// Label values are regular expressions, matched anywhere in the value (anchor them with ^ and $
	// to match the whole value); a value that isn't a valid regular expression matches exactly.
	Labels map[string]string `` /* 139-byte string literal not displayed */
	// Optional runtime types to filter workloads (e.g., docker, kubernetes, process).
	// A workload matches if its runtime is one of the given types, compared exactly (case-insensitive).
	RuntimeTypes []string `protobuf:"bytes,2,rep,name=runtime_types,json=runtimeTypes,proto3" json:"runtime_types,omitempty"`
	// Optional reachability filter. If set, only workloads reachable from the workload
	// with this ID are returned: those sharing at least one isolation group with it
	// (a Docker network, a Kubernetes namespace, or the host for processes). Isolation
	// groups only count within the same runtime and discovery instance (the
	// org.agntcy/discovery-instance annotation), since their names repeat across hosts
	// and clusters. The workload itself is not returned. If no workload has this ID,
	// nothing matches.
	ReachableFromWorkloadId *string `` /* 140-byte string literal not displayed */
	// Optional OASF skill names to filter workloads.
	// A workload matches if it has at least one of the given skills.
	Skills []string `protobuf:"bytes,4,rep,name=skills,proto3" json:"skills,omitempty"`
	// Optional OASF domain names to filter workloads.
	// A workload matches if it has at least one of the given domains.
	Domains []string `protobuf:"bytes,5,rep,name=domains,proto3" json:"domains,omitempty"`
	// Optional locator protocols to filter workloads (e.g., slim, grpc, http, tcp).
	// A workload matches if it has at least one locator with one of the given protocols,
	// compared exactly (case-insensitive). Docker and Kubernetes locators are "tcp".
	LocatorProtocols []string `protobuf:"bytes,6,rep,name=locator_protocols,json=locatorProtocols,proto3" json:"locator_protocols,omitempty"`
	// Optional agent names to filter workloads: the name in the workload's A2A card,
	// or else in its OASF record. This is not the runtime's workload name.
	// A workload matches if its agent name matches one of the given names.
	Names []string `protobuf:"bytes,7,rep,name=names,proto3" json:"names,omitempty"`
	// Optional authors to filter workloads, e.g. the DID of the human vouching for the agent
	// (from the card's OASF identity extension), or else the OASF record's authors.
	// A workload matches if one of its authors matches one of the given values.
	Authors []string `protobuf:"bytes,8,rep,name=authors,proto3" json:"authors,omitempty"`
	// Optional OASF schema versions to filter workloads, e.g. "1.2.0" or "1.*".
	// A workload matches if the schema version of its skills and domains matches one of them.
	SchemaVersions []string `protobuf:"bytes,9,rep,name=schema_versions,json=schemaVersions,proto3" json:"schema_versions,omitempty"`
	// contains filtered or unexported fields
}

ListWorkloadsRequest is the request message for listing workloads with optional filters. Filters of different kinds are combined with AND; an unset filter matches every workload.

The agent filters (names, skills, domains, authors, schema_versions) are evaluated against what the workload says about the agent it runs: its A2A card (services.a2a), whose OASF discovery and identity extensions carry the skills, domains, schema version and author, and otherwise the OASF record it references (services.oasf). When both are present, the card wins. A workload without that information does not match an agent filter.

Names, skills, domains, authors and schema versions match as in record search: exactly (case-insensitive), or with `*` and `?` wildcards, e.g. "natural_language_processing/*".

func (*ListWorkloadsRequest) Descriptor deprecated

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

Deprecated: Use ListWorkloadsRequest.ProtoReflect.Descriptor instead.

func (*ListWorkloadsRequest) GetAuthors added in v1.8.0

func (x *ListWorkloadsRequest) GetAuthors() []string

func (*ListWorkloadsRequest) GetDomains added in v1.8.0

func (x *ListWorkloadsRequest) GetDomains() []string

func (*ListWorkloadsRequest) GetLabels

func (x *ListWorkloadsRequest) GetLabels() map[string]string

func (*ListWorkloadsRequest) GetLocatorProtocols added in v1.8.0

func (x *ListWorkloadsRequest) GetLocatorProtocols() []string

func (*ListWorkloadsRequest) GetNames added in v1.8.0

func (x *ListWorkloadsRequest) GetNames() []string

func (*ListWorkloadsRequest) GetReachableFromWorkloadId added in v1.8.0

func (x *ListWorkloadsRequest) GetReachableFromWorkloadId() string

func (*ListWorkloadsRequest) GetRuntimeTypes added in v1.8.0

func (x *ListWorkloadsRequest) GetRuntimeTypes() []string

func (*ListWorkloadsRequest) GetSchemaVersions added in v1.8.0

func (x *ListWorkloadsRequest) GetSchemaVersions() []string

func (*ListWorkloadsRequest) GetSkills added in v1.8.0

func (x *ListWorkloadsRequest) GetSkills() []string

func (*ListWorkloadsRequest) ProtoMessage

func (*ListWorkloadsRequest) ProtoMessage()

func (*ListWorkloadsRequest) ProtoReflect

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

func (*ListWorkloadsRequest) Reset

func (x *ListWorkloadsRequest) Reset()

func (*ListWorkloadsRequest) String

func (x *ListWorkloadsRequest) String() string

type OASFClass added in v1.8.0

type OASFClass struct {
	Name string
	ID   uint32
}

OASFClass is an OASF skill or domain reference.

type RuntimeType

type RuntimeType int32

RuntimeType represents the type of runtime.

const (
	RuntimeType_RUNTIME_TYPE_UNSPECIFIED RuntimeType = 0 // Unknown runtime type
	RuntimeType_RUNTIME_TYPE_DOCKER      RuntimeType = 1 // Docker runtime
	RuntimeType_RUNTIME_TYPE_KUBERNETES  RuntimeType = 2 // Kubernetes runtime
)

func (RuntimeType) Descriptor

func (RuntimeType) Enum

func (x RuntimeType) Enum() *RuntimeType

func (RuntimeType) EnumDescriptor deprecated

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

Deprecated: Use RuntimeType.Descriptor instead.

func (RuntimeType) GetName

func (x RuntimeType) GetName() string

GetName returns a short lowercased name of the RuntimeType enum value. For example, RUNTIME_TYPE_DOCKER becomes "docker".

func (RuntimeType) Number

func (x RuntimeType) Number() protoreflect.EnumNumber

func (RuntimeType) String

func (x RuntimeType) String() string

func (RuntimeType) Type

type UnimplementedDiscoveryServiceServer

type UnimplementedDiscoveryServiceServer struct{}

UnimplementedDiscoveryServiceServer should be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedDiscoveryServiceServer) GetWorkload

func (UnimplementedDiscoveryServiceServer) ListWorkloads

type UnsafeDiscoveryServiceServer

type UnsafeDiscoveryServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeDiscoveryServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DiscoveryServiceServer will result in compilation errors.

type Workload

type Workload struct {

	// ID is the unique identifier for the workload.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Name is the human-readable name of the workload.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// Hostname is the hostname of the workload.
	Hostname string `protobuf:"bytes,3,opt,name=hostname,proto3" json:"hostname,omitempty"`
	// Runtime is the type of the runtime (e.g., docker, containerd).
	Runtime string `protobuf:"bytes,4,opt,name=runtime,proto3" json:"runtime,omitempty"`
	// Type is the type of workload (e.g., process, container, pod).
	Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"`
	// Labels are key-value pairs for filtering.
	Labels map[string]string `` /* 139-byte string literal not displayed */
	// Annotations are additional metadata.
	Annotations map[string]string `` /* 149-byte string literal not displayed */
	// Addresses are the network addresses of the workload.
	// Deprecated: use locators, which embed the address in each endpoint URL.
	//
	// Deprecated: Marked as deprecated in agntcy/dir/runtime/v1/workload.proto.
	Addresses []string `protobuf:"bytes,8,rep,name=addresses,proto3" json:"addresses,omitempty"`
	// Ports are the exposed ports.
	// Specified as strings to accommodate various formats (e.g., "80/tcp", "443").
	// Deprecated: use locators, which embed the port in each endpoint URL.
	//
	// Deprecated: Marked as deprecated in agntcy/dir/runtime/v1/workload.proto.
	Ports []string `protobuf:"bytes,9,rep,name=ports,proto3" json:"ports,omitempty"`
	// IsolationGroups are the network/namespace isolation groups.
	IsolationGroups []string `protobuf:"bytes,10,rep,name=isolation_groups,json=isolationGroups,proto3" json:"isolation_groups,omitempty"`
	// Services holds service/protocol-specific metadata.
	// These values can be used by discovery resolvers
	// to enrich the discovery information about the workload.
	Services *WorkloadServices `protobuf:"bytes,11,opt,name=services,proto3" json:"services,omitempty"`
	// Locators are the endpoints the workload can be reached at,
	// one per protocol endpoint (e.g., an HTTP URL per network address, a SLIM name).
	Locators []*WorkloadLocator `protobuf:"bytes,12,rep,name=locators,proto3" json:"locators,omitempty"`
	// contains filtered or unexported fields
}

Information about a discovered workload in a runtime.

func (*Workload) AgentInfo added in v1.8.0

func (x *Workload) AgentInfo(acceptedSchemaURLs []string) AgentInfo

AgentInfo returns what the workload says about the agent it runs. acceptedSchemaURLs lists the OASF schema servers whose extensions are read from the card; when empty, only DefaultOASFSchemaURL is accepted.

func (*Workload) DeepCopy

func (x *Workload) DeepCopy() *Workload

func (*Workload) Descriptor deprecated

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

Deprecated: Use Workload.ProtoReflect.Descriptor instead.

func (*Workload) GetAddresses deprecated

func (x *Workload) GetAddresses() []string

Deprecated: Marked as deprecated in agntcy/dir/runtime/v1/workload.proto.

func (*Workload) GetAnnotations

func (x *Workload) GetAnnotations() map[string]string

func (*Workload) GetHostname

func (x *Workload) GetHostname() string

func (*Workload) GetId

func (x *Workload) GetId() string

func (*Workload) GetIsolationGroups

func (x *Workload) GetIsolationGroups() []string

func (*Workload) GetLabels

func (x *Workload) GetLabels() map[string]string

func (*Workload) GetLocators added in v1.8.0

func (x *Workload) GetLocators() []*WorkloadLocator

func (*Workload) GetName

func (x *Workload) GetName() string

func (*Workload) GetPorts deprecated

func (x *Workload) GetPorts() []string

Deprecated: Marked as deprecated in agntcy/dir/runtime/v1/workload.proto.

func (*Workload) GetRuntime

func (x *Workload) GetRuntime() string

func (*Workload) GetServices

func (x *Workload) GetServices() *WorkloadServices

func (*Workload) GetType

func (x *Workload) GetType() string

func (*Workload) MatchesFilters added in v1.8.0

func (x *Workload) MatchesFilters(req *ListWorkloadsRequest, opts FilterOptions) bool

MatchesFilters reports whether the workload matches every filter of req, as documented on ListWorkloadsRequest. A nil request matches every workload.

func (*Workload) ProtoMessage

func (*Workload) ProtoMessage()

func (*Workload) ProtoReflect

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

func (*Workload) Reset

func (x *Workload) Reset()

func (*Workload) String

func (x *Workload) String() string

type WorkloadLocator added in v1.8.0

type WorkloadLocator struct {

	// Protocol is the transport or protocol of the endpoint (e.g., http, grpc, slim).
	Protocol string `protobuf:"bytes,1,opt,name=protocol,proto3" json:"protocol,omitempty"`
	// URL is the full endpoint, including scheme
	// (e.g., "http://10.244.0.9:9999", "slim://org/namespace/agent").
	Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
	// contains filtered or unexported fields
}

WorkloadLocator is an endpoint a workload can be reached at.

func (*WorkloadLocator) Descriptor deprecated added in v1.8.0

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

Deprecated: Use WorkloadLocator.ProtoReflect.Descriptor instead.

func (*WorkloadLocator) GetProtocol added in v1.8.0

func (x *WorkloadLocator) GetProtocol() string

func (*WorkloadLocator) GetUrl added in v1.8.0

func (x *WorkloadLocator) GetUrl() string

func (*WorkloadLocator) ProtoMessage added in v1.8.0

func (*WorkloadLocator) ProtoMessage()

func (*WorkloadLocator) ProtoReflect added in v1.8.0

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

func (*WorkloadLocator) Reset added in v1.8.0

func (x *WorkloadLocator) Reset()

func (*WorkloadLocator) String added in v1.8.0

func (x *WorkloadLocator) String() string

type WorkloadServices

type WorkloadServices struct {

	// A2A holds metadata about the A2A service running inside the workload.
	// +optional
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	A2A *structpb.Struct `protobuf:"bytes,1,opt,name=a2a,proto3,oneof" json:"a2a,omitempty"`
	// OASF holds metadata about the OASF record that a workload references.
	// +optional
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	Oasf *structpb.Struct `protobuf:"bytes,2,opt,name=oasf,proto3,oneof" json:"oasf,omitempty"`
	// contains filtered or unexported fields
}

WorkloadServices holds service-specific metadata that a given workload may have. For example, a workload may have A2A server running inside it, that can be discovered and exposed via discovery.

func (*WorkloadServices) Descriptor deprecated

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

Deprecated: Use WorkloadServices.ProtoReflect.Descriptor instead.

func (*WorkloadServices) GetA2A

func (x *WorkloadServices) GetA2A() *structpb.Struct

func (*WorkloadServices) GetOasf

func (x *WorkloadServices) GetOasf() *structpb.Struct

func (*WorkloadServices) ProtoMessage

func (*WorkloadServices) ProtoMessage()

func (*WorkloadServices) ProtoReflect

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

func (*WorkloadServices) Reset

func (x *WorkloadServices) Reset()

func (*WorkloadServices) String

func (x *WorkloadServices) String() string

type WorkloadType

type WorkloadType int32

WorkloadType represents the type of workload.

const (
	WorkloadType_WORKLOAD_TYPE_UNSPECIFIED WorkloadType = 0 // Unknown workload type
	WorkloadType_WORKLOAD_TYPE_PROCESS     WorkloadType = 1 // Process workload
	WorkloadType_WORKLOAD_TYPE_CONTAINER   WorkloadType = 2 // Container workload
	WorkloadType_WORKLOAD_TYPE_POD         WorkloadType = 3 // Pod workload
)

func (WorkloadType) Descriptor

func (WorkloadType) Enum

func (x WorkloadType) Enum() *WorkloadType

func (WorkloadType) EnumDescriptor deprecated

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

Deprecated: Use WorkloadType.Descriptor instead.

func (WorkloadType) GetName

func (x WorkloadType) GetName() string

GetName returns a short lowercased name of the WorkloadType enum value. For example, WORKLOAD_TYPE_PROCESS becomes "process".

func (WorkloadType) Number

func (WorkloadType) String

func (x WorkloadType) String() string

func (WorkloadType) Type

Jump to

Keyboard shortcuts

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