v1

package
v0.79.7 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: Apache-2.0 Imports: 20 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 (

	// The services needed for ArangoGraphML are being installed.
	MLServicesPhaseInitialising = "Initialising"
	// ArangoDB Deployment is being bootstrapped with the required databases, schemas and data.
	MLServicesPhaseBootstrapping = "Bootstrapping"
	// ArangoGraphML is setup and running correctly.
	MLServicesPhaseRunning = "Running"
	// Indicates that there was an error with setting up ArangoGraphML. Check `message` field for additional info.
	MLServicesPhaseError = "Error"
)
View Source
const (

	// ServiceTypePrediction indicates that the service is a prediction API service.
	ServiceTypePrediction = "prediction"
	// ServiceTypeTraining indicates that the service is a training API service.
	ServiceTypeTraining = "training"
	// ServiceTypeProjects indicates that the service is a projects API service.
	ServiceTypeProjects = "projects"
)
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 = 1
	// APIPatchVersion contains patch version of this API
	APIPatchVersion = 2
)
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"
)
View Source
const (

	// UsageItemResourceKindMLServices is the kind used inside the UsageItem.Resource to refer to a MLServices resource.
	UsageItemResourceKindMLServices = "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 Equals added in v0.79.2

func Equals(source, other []*ServiceStatus) bool

Equals returns true when source and other have the same values.

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"`
	// Status of the MLServices.
	// This is a read-only value.
	Status               *Status  `protobuf:"bytes,100,opt,name=status,proto3" json:"status,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) GetStatus added in v0.79.0

func (m *MLServices) GetStatus() *Status

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 ServiceStatus added in v0.79.1

type ServiceStatus struct {
	// Type of service.
	// Should be one of: [training|prediction|projects]
	Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	// Set to true if the service is available.
	// Every service is always in ONLY ONE of the following states: (available|failed)
	Available bool `protobuf:"varint,2,opt,name=available,proto3" json:"available,omitempty"`
	// Set to true if the service is in a failed state.
	// Every service is always in ONLY ONE of the following states: (available|failed)
	Failed bool `protobuf:"varint,3,opt,name=failed,proto3" json:"failed,omitempty"`
	// Resource usage information for this service.
	Usage *ServiceStatus_Usage `protobuf:"bytes,4,opt,name=usage,proto3" json:"usage,omitempty"`
	// Number of replicas running for this service.
	Replicas             int32    `protobuf:"varint,5,opt,name=replicas,proto3" json:"replicas,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Status of a single ArangoGraphML component.

func (*ServiceStatus) Descriptor added in v0.79.1

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

func (*ServiceStatus) Equals added in v0.79.2

func (source *ServiceStatus) Equals(other *ServiceStatus) bool

Equals returns true when source and other have the same values.

func (*ServiceStatus) GetAvailable added in v0.79.1

func (m *ServiceStatus) GetAvailable() bool

func (*ServiceStatus) GetFailed added in v0.79.1

func (m *ServiceStatus) GetFailed() bool

func (*ServiceStatus) GetReplicas added in v0.79.5

func (m *ServiceStatus) GetReplicas() int32

func (*ServiceStatus) GetType added in v0.79.1

func (m *ServiceStatus) GetType() string

func (*ServiceStatus) GetUsage added in v0.79.1

func (m *ServiceStatus) GetUsage() *ServiceStatus_Usage

func (*ServiceStatus) Marshal added in v0.79.1

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

func (*ServiceStatus) MarshalTo added in v0.79.1

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

func (*ServiceStatus) MarshalToSizedBuffer added in v0.79.1

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

func (*ServiceStatus) ProtoMessage added in v0.79.1

func (*ServiceStatus) ProtoMessage()

func (*ServiceStatus) Reset added in v0.79.1

func (m *ServiceStatus) Reset()

func (*ServiceStatus) Size added in v0.79.1

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

func (*ServiceStatus) String added in v0.79.1

func (m *ServiceStatus) String() string

func (*ServiceStatus) Unmarshal added in v0.79.1

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

func (*ServiceStatus) XXX_DiscardUnknown added in v0.79.1

func (m *ServiceStatus) XXX_DiscardUnknown()

func (*ServiceStatus) XXX_Marshal added in v0.79.1

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

func (*ServiceStatus) XXX_Merge added in v0.79.1

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

func (*ServiceStatus) XXX_Size added in v0.79.1

func (m *ServiceStatus) XXX_Size() int

func (*ServiceStatus) XXX_Unmarshal added in v0.79.1

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

type ServiceStatus_Usage added in v0.79.1

type ServiceStatus_Usage struct {
	// Last known memory usage in bytes
	LastMemoryUsage int64 `protobuf:"varint,1,opt,name=last_memory_usage,json=lastMemoryUsage,proto3" json:"last_memory_usage,omitempty"`
	// Last known CPU usage in vCPU units
	LastCpuUsage float32 `protobuf:"fixed32,2,opt,name=last_cpu_usage,json=lastCpuUsage,proto3" json:"last_cpu_usage,omitempty"`
	// Last known memory limit in bytes
	LastMemoryLimit int64 `protobuf:"varint,3,opt,name=last_memory_limit,json=lastMemoryLimit,proto3" json:"last_memory_limit,omitempty"`
	// Last known CPU limit in vCPU units
	LastCpuLimit         float32  `protobuf:"fixed32,4,opt,name=last_cpu_limit,json=lastCpuLimit,proto3" json:"last_cpu_limit,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Resource usage for this service.

func (*ServiceStatus_Usage) Descriptor added in v0.79.1

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

func (*ServiceStatus_Usage) Equals added in v0.79.2

func (source *ServiceStatus_Usage) Equals(other *ServiceStatus_Usage) bool

Equals returns true when source and other have the same values.

func (*ServiceStatus_Usage) GetLastCpuLimit added in v0.79.1

func (m *ServiceStatus_Usage) GetLastCpuLimit() float32

func (*ServiceStatus_Usage) GetLastCpuUsage added in v0.79.1

func (m *ServiceStatus_Usage) GetLastCpuUsage() float32

func (*ServiceStatus_Usage) GetLastMemoryLimit added in v0.79.1

func (m *ServiceStatus_Usage) GetLastMemoryLimit() int64

func (*ServiceStatus_Usage) GetLastMemoryUsage added in v0.79.1

func (m *ServiceStatus_Usage) GetLastMemoryUsage() int64

func (*ServiceStatus_Usage) Marshal added in v0.79.1

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

func (*ServiceStatus_Usage) MarshalTo added in v0.79.1

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

func (*ServiceStatus_Usage) MarshalToSizedBuffer added in v0.79.1

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

func (*ServiceStatus_Usage) ProtoMessage added in v0.79.1

func (*ServiceStatus_Usage) ProtoMessage()

func (*ServiceStatus_Usage) Reset added in v0.79.1

func (m *ServiceStatus_Usage) Reset()

func (*ServiceStatus_Usage) Size added in v0.79.1

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

func (*ServiceStatus_Usage) String added in v0.79.1

func (m *ServiceStatus_Usage) String() string

func (*ServiceStatus_Usage) Unmarshal added in v0.79.1

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

func (*ServiceStatus_Usage) XXX_DiscardUnknown added in v0.79.1

func (m *ServiceStatus_Usage) XXX_DiscardUnknown()

func (*ServiceStatus_Usage) XXX_Marshal added in v0.79.1

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

func (*ServiceStatus_Usage) XXX_Merge added in v0.79.1

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

func (*ServiceStatus_Usage) XXX_Size added in v0.79.1

func (m *ServiceStatus_Usage) XXX_Size() int

func (*ServiceStatus_Usage) XXX_Unmarshal added in v0.79.1

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

type Status added in v0.79.0

type Status struct {
	// Overall status of where the MLServices resource is in its lifecycle at a given time.
	// It will contain only one of the following values:
	// "Bootstrapping"  - ArangoDB Deployment is being bootstrapped with the required databases, schemas and data.
	// "Initialising"   - The services needed for ArangoGraphML are being installed.
	// "Running"        - ArangoGraphML is setup and running correctly.
	// "Error"          - Indicates that there was an error with setting up ArangoGraphML. Check `message` field for additional info.
	Phase string `protobuf:"bytes,1,opt,name=phase,proto3" json:"phase,omitempty"`
	// Supporting information about the phase of MLServices (such as error messages in case of failures).
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// The timestamp of when this status was last updated.
	LastUpdatedAt *types.Timestamp `protobuf:"bytes,3,opt,name=last_updated_at,json=lastUpdatedAt,proto3" json:"last_updated_at,omitempty"`
	// Status of each ArangoGraphML components/services.
	Services             []*ServiceStatus `protobuf:"bytes,4,rep,name=services,proto3" json:"services,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

Status of the MLServices. Note: All fields are read-only.

func (*Status) Descriptor added in v0.79.0

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

func (*Status) EnsureServiceStatus added in v0.79.2

func (status *Status) EnsureServiceStatus(svcStatus *ServiceStatus)

EnsureServiceStatus sets the status of a ML service.

func (*Status) Equals added in v0.79.2

func (source *Status) Equals(other *Status) bool

Equals returns true when source and other have the same values.

func (*Status) GetLastUpdatedAt added in v0.79.0

func (m *Status) GetLastUpdatedAt() *types.Timestamp

func (*Status) GetMessage added in v0.79.0

func (m *Status) GetMessage() string

func (*Status) GetPhase added in v0.79.0

func (m *Status) GetPhase() string

func (*Status) GetServices added in v0.79.0

func (m *Status) GetServices() []*ServiceStatus

func (*Status) Marshal added in v0.79.0

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

func (*Status) MarshalTo added in v0.79.0

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

func (*Status) MarshalToSizedBuffer added in v0.79.0

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

func (*Status) ProtoMessage added in v0.79.0

func (*Status) ProtoMessage()

func (*Status) Reset added in v0.79.0

func (m *Status) Reset()

func (*Status) Size added in v0.79.0

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

func (*Status) String added in v0.79.0

func (m *Status) String() string

func (*Status) Unmarshal added in v0.79.0

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

func (*Status) XXX_DiscardUnknown added in v0.79.0

func (m *Status) XXX_DiscardUnknown()

func (*Status) XXX_Marshal added in v0.79.0

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

func (*Status) XXX_Merge added in v0.79.0

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

func (*Status) XXX_Size added in v0.79.0

func (m *Status) XXX_Size() int

func (*Status) XXX_Unmarshal added in v0.79.0

func (m *Status) 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