v1

package
v0.78.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package ml/v1 contains the API of ML services.

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (

	// PermissionGetMLServices is needed for getting MLServices.
	PermissionGetMLServices = "ml.mlservices.get"
	// PermissionUpdateMLServices is needed for updating MLServices.
	PermissionUpdateMLServices = "ml.mlservices.update"
)
View Source
const (
	// APIID contains identifier of this API
	APIID = "ml/v1"
	// APIMajorVersion contains major version of this API
	APIMajorVersion = 1
	// APIMinorVersion contains minor version of this API
	APIMinorVersion = 0
	// APIPatchVersion contains patch version of this API
	APIPatchVersion = 0
)
View Source
const (

	// EventTypeMLServicesUpdated is fired after MLServices for a deployment has been updated.
	// SubjectID contains the Deployment ID.
	EventTypeMLServicesUpdated = "ml.mlservices.updated"
)
View Source
const (
	// KindMLServices is a constant for MLServices resources.
	KindMLServices = "MLServices"
)

Variables

View Source
var (
	ErrInvalidLengthMl        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMl          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMl = fmt.Errorf("proto: unexpected end of group")
)

Functions

func MLServicesURL

func MLServicesURL(deplURL string) string

MLServicesURL creates a resource URL for the MLServices resources from the given deployment URL.

func RegisterMLServiceHandler

func RegisterMLServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterMLServiceHandler registers the http handlers for service MLService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterMLServiceHandlerClient

func RegisterMLServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MLServiceClient) error

RegisterMLServiceHandlerClient registers the http handlers for service MLService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MLServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MLServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MLServiceClient" to call the correct interceptors.

func RegisterMLServiceHandlerFromEndpoint

func RegisterMLServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterMLServiceHandlerFromEndpoint is same as RegisterMLServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterMLServiceHandlerServer

func RegisterMLServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MLServiceServer) error

RegisterMLServiceHandlerServer registers the http handlers for service MLService to "mux". UnaryRPC :call MLServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterMLServiceServer

func RegisterMLServiceServer(s *grpc.Server, srv MLServiceServer)

Types

type MLServiceClient

type MLServiceClient interface {
	// Get the current API version of this service.
	// Required permissions:
	// - None
	GetAPIVersion(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Version, error)
	// Get an existing MLServices resource for a given deployment (specified by the id).
	// Required permissions:
	// - ml.mlservices.get
	GetMLServices(ctx context.Context, in *v1.IDOptions, opts ...grpc.CallOption) (*MLServices, error)
	// Update an existing MLServices resource. If it does not exist, this will create a new one.
	// Pass the desired updated state of MLServices to this call.
	// Required permissions:
	// - ml.mlservices.update
	UpdateMLServices(ctx context.Context, in *MLServices, opts ...grpc.CallOption) (*MLServices, error)
}

MLServiceClient is the client API for MLService service.

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

func NewMLServiceClient

func NewMLServiceClient(cc *grpc.ClientConn) MLServiceClient

type MLServiceServer

type MLServiceServer interface {
	// Get the current API version of this service.
	// Required permissions:
	// - None
	GetAPIVersion(context.Context, *v1.Empty) (*v1.Version, error)
	// Get an existing MLServices resource for a given deployment (specified by the id).
	// Required permissions:
	// - ml.mlservices.get
	GetMLServices(context.Context, *v1.IDOptions) (*MLServices, error)
	// Update an existing MLServices resource. If it does not exist, this will create a new one.
	// Pass the desired updated state of MLServices to this call.
	// Required permissions:
	// - ml.mlservices.update
	UpdateMLServices(context.Context, *MLServices) (*MLServices, error)
}

MLServiceServer is the server API for MLService service.

type MLServices

type MLServices struct {
	// Identifier of the deployment for this MLServices resource.
	// This is a ready-only value.
	DeploymentId string `protobuf:"bytes,1,opt,name=deployment_id,json=deploymentId,proto3" json:"deployment_id,omitempty"`
	// Set to true if ML services are enabled for this deployment.
	Enabled              bool     `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MLServices is a single resource which represents the state and configuration of ML Services (ArangoGraphML) for a deployment specified by deployment_id.

func (*MLServices) Descriptor

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

func (*MLServices) GetDeploymentId

func (m *MLServices) GetDeploymentId() string

func (*MLServices) GetEnabled

func (m *MLServices) GetEnabled() bool

func (*MLServices) Marshal

func (m *MLServices) Marshal() (dAtA []byte, err error)

func (*MLServices) MarshalTo

func (m *MLServices) MarshalTo(dAtA []byte) (int, error)

func (*MLServices) MarshalToSizedBuffer

func (m *MLServices) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MLServices) ProtoMessage

func (*MLServices) ProtoMessage()

func (*MLServices) Reset

func (m *MLServices) Reset()

func (*MLServices) Size

func (m *MLServices) Size() (n int)

func (*MLServices) String

func (m *MLServices) String() string

func (*MLServices) Unmarshal

func (m *MLServices) Unmarshal(dAtA []byte) error

func (*MLServices) XXX_DiscardUnknown

func (m *MLServices) XXX_DiscardUnknown()

func (*MLServices) XXX_Marshal

func (m *MLServices) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MLServices) XXX_Merge

func (m *MLServices) XXX_Merge(src proto.Message)

func (*MLServices) XXX_Size

func (m *MLServices) XXX_Size() int

func (*MLServices) XXX_Unmarshal

func (m *MLServices) XXX_Unmarshal(b []byte) error

type UnimplementedMLServiceServer

type UnimplementedMLServiceServer struct {
}

UnimplementedMLServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedMLServiceServer) GetAPIVersion

func (*UnimplementedMLServiceServer) GetAPIVersion(ctx context.Context, req *v1.Empty) (*v1.Version, error)

func (*UnimplementedMLServiceServer) GetMLServices

func (*UnimplementedMLServiceServer) UpdateMLServices

func (*UnimplementedMLServiceServer) UpdateMLServices(ctx context.Context, req *MLServices) (*MLServices, error)

Jump to

Keyboard shortcuts

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