v1

package
v0.89.6 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: Apache-2.0 Imports: 18 Imported by: 7

Documentation

Overview

Package v1 contains the API used to fetch provider & region information.

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	// APIID contains identifier of this API
	APIID = "platform/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 = 0
)

Variables

View Source
var File_platform_proto protoreflect.FileDescriptor

Functions

func ForEachProvider

func ForEachProvider(ctx context.Context, listFunc func(ctx context.Context, req *ListProvidersRequest) (*ProviderList, error),
	req *ListProvidersRequest, cb ProviderCallback) error

ForEachProvider iterates over all providers that match the given request, invoking the given callback for each item.

func ForEachRegion

func ForEachRegion(ctx context.Context, listFunc func(ctx context.Context, req *ListRegionsRequest) (*RegionList, error),
	req *ListRegionsRequest, cb RegionCallback) error

ForEachRegion iterates over all regions that match the given request, invoking the given callback for each item.

func RegisterPlatformServiceHandler

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

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

func RegisterPlatformServiceHandlerClient

func RegisterPlatformServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PlatformServiceClient) error

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

func RegisterPlatformServiceHandlerFromEndpoint

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

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

func RegisterPlatformServiceHandlerServer

func RegisterPlatformServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PlatformServiceServer) error

RegisterPlatformServiceHandlerServer registers the http handlers for service PlatformService to "mux". UnaryRPC :call PlatformServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPlatformServiceHandlerFromEndpoint instead.

func RegisterPlatformServiceServer

func RegisterPlatformServiceServer(s *grpc.Server, srv PlatformServiceServer)

Types

type ListProvidersRequest

type ListProvidersRequest struct {

	// Common list options
	Options *v1.ListOptions `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"`
	// If set, the result includes all providers for that are available for the
	// organization identified by this ID.
	// If not set, only providers are returned that are available to all organizations.
	OrganizationId string `protobuf:"bytes,2,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"`
	// contains filtered or unexported fields
}

Request arguments for ListProviders

func (*ListProvidersRequest) Descriptor deprecated

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

Deprecated: Use ListProvidersRequest.ProtoReflect.Descriptor instead.

func (*ListProvidersRequest) GetOptions

func (x *ListProvidersRequest) GetOptions() *v1.ListOptions

func (*ListProvidersRequest) GetOrganizationId

func (x *ListProvidersRequest) GetOrganizationId() string

func (*ListProvidersRequest) ProtoMessage

func (*ListProvidersRequest) ProtoMessage()

func (*ListProvidersRequest) ProtoReflect added in v0.89.0

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

func (*ListProvidersRequest) Reset

func (x *ListProvidersRequest) Reset()

func (*ListProvidersRequest) String

func (x *ListProvidersRequest) String() string

type ListRegionsRequest

type ListRegionsRequest struct {

	// Common list options
	Options *v1.ListOptions `protobuf:"bytes,1,opt,name=options,proto3" json:"options,omitempty"`
	// Required identifier of the provider to list regions for.
	ProviderId string `protobuf:"bytes,2,opt,name=provider_id,json=providerId,proto3" json:"provider_id,omitempty"`
	// If set, the result includes all regions for that are available for the
	// organization identified by this ID.
	// If not set, only regions are returned that are available to all organizations.
	OrganizationId string `protobuf:"bytes,3,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"`
	// If set, the result includes only those regions where the specified deployment model
	// is supported.
	// This is an optional field.
	ModelId string `protobuf:"bytes,4,opt,name=model_id,json=modelId,proto3" json:"model_id,omitempty"`
	// contains filtered or unexported fields
}

Request arguments for ListRegions

func (*ListRegionsRequest) Descriptor deprecated

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

Deprecated: Use ListRegionsRequest.ProtoReflect.Descriptor instead.

func (*ListRegionsRequest) GetModelId added in v0.81.5

func (x *ListRegionsRequest) GetModelId() string

func (*ListRegionsRequest) GetOptions

func (x *ListRegionsRequest) GetOptions() *v1.ListOptions

func (*ListRegionsRequest) GetOrganizationId

func (x *ListRegionsRequest) GetOrganizationId() string

func (*ListRegionsRequest) GetProviderId

func (x *ListRegionsRequest) GetProviderId() string

func (*ListRegionsRequest) ProtoMessage

func (*ListRegionsRequest) ProtoMessage()

func (*ListRegionsRequest) ProtoReflect added in v0.89.0

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

func (*ListRegionsRequest) Reset

func (x *ListRegionsRequest) Reset()

func (*ListRegionsRequest) String

func (x *ListRegionsRequest) String() string

type PlatformServiceClient

type PlatformServiceClient 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)
	// Fetch all providers that are supported by the ArangoDB cloud.
	// Required permissions:
	// - None
	ListProviders(ctx context.Context, in *ListProvidersRequest, opts ...grpc.CallOption) (*ProviderList, error)
	// Fetch a provider by its id.
	// Required permissions:
	// - None
	GetProvider(ctx context.Context, in *v1.IDOptions, opts ...grpc.CallOption) (*Provider, error)
	// Fetch all regions provided by the provided identified by the given context ID.
	// If the given context identifier contains a valid organization ID,
	// the result includes all regions for that organization.
	// Otherwise only regions are returned that are available to all organizations.
	// Required permissions:
	// - None
	ListRegions(ctx context.Context, in *ListRegionsRequest, opts ...grpc.CallOption) (*RegionList, error)
	// Fetch a region by its id.
	// Required permissions:
	// - None
	GetRegion(ctx context.Context, in *v1.IDOptions, opts ...grpc.CallOption) (*Region, error)
}

PlatformServiceClient is the client API for PlatformService service.

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

type PlatformServiceServer

type PlatformServiceServer interface {
	// Get the current API version of this service.
	// Required permissions:
	// - None
	GetAPIVersion(context.Context, *v1.Empty) (*v1.Version, error)
	// Fetch all providers that are supported by the ArangoDB cloud.
	// Required permissions:
	// - None
	ListProviders(context.Context, *ListProvidersRequest) (*ProviderList, error)
	// Fetch a provider by its id.
	// Required permissions:
	// - None
	GetProvider(context.Context, *v1.IDOptions) (*Provider, error)
	// Fetch all regions provided by the provided identified by the given context ID.
	// If the given context identifier contains a valid organization ID,
	// the result includes all regions for that organization.
	// Otherwise only regions are returned that are available to all organizations.
	// Required permissions:
	// - None
	ListRegions(context.Context, *ListRegionsRequest) (*RegionList, error)
	// Fetch a region by its id.
	// Required permissions:
	// - None
	GetRegion(context.Context, *v1.IDOptions) (*Region, error)
}

PlatformServiceServer is the server API for PlatformService service.

type Provider

type Provider struct {

	// System identifier of the provider.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Name of the provider
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// If set, this provider has not be released as generally available.
	Prerelease bool `protobuf:"varint,3,opt,name=prerelease,proto3" json:"prerelease,omitempty"`
	// contains filtered or unexported fields
}

Provider represents a specific cloud provider such as AWS or GCP.

func (*Provider) Descriptor deprecated

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

Deprecated: Use Provider.ProtoReflect.Descriptor instead.

func (*Provider) GetId

func (x *Provider) GetId() string

func (*Provider) GetName

func (x *Provider) GetName() string

func (*Provider) GetPrerelease

func (x *Provider) GetPrerelease() bool

func (*Provider) ProtoMessage

func (*Provider) ProtoMessage()

func (*Provider) ProtoReflect added in v0.89.0

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

func (*Provider) Reset

func (x *Provider) Reset()

func (*Provider) String

func (x *Provider) String() string

type ProviderCallback

type ProviderCallback func(context.Context, *Provider) error

ProviderCallback is a callback for individual (cloud) provider.

type ProviderList

type ProviderList struct {
	Items []*Provider `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

List of providers.

func (*ProviderList) Descriptor deprecated

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

Deprecated: Use ProviderList.ProtoReflect.Descriptor instead.

func (*ProviderList) GetItems

func (x *ProviderList) GetItems() []*Provider

func (*ProviderList) ProtoMessage

func (*ProviderList) ProtoMessage()

func (*ProviderList) ProtoReflect added in v0.89.0

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

func (*ProviderList) Reset

func (x *ProviderList) Reset()

func (*ProviderList) String

func (x *ProviderList) String() string

type Region

type Region struct {

	// System identifier of the region.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Identifier of the provider that hosts this region.
	ProviderId string `protobuf:"bytes,2,opt,name=provider_id,json=providerId,proto3" json:"provider_id,omitempty"`
	// Location of the region
	Location string `protobuf:"bytes,3,opt,name=location,proto3" json:"location,omitempty"`
	// Is this region available for creating new deployments?
	Available bool `protobuf:"varint,4,opt,name=available,proto3" json:"available,omitempty"`
	// If set, this region is low on stock.
	// Creating a deployment may not be possible.
	LowStock bool `protobuf:"varint,5,opt,name=low_stock,json=lowStock,proto3" json:"low_stock,omitempty"`
	// If set, this region is out of stock.
	// Creating a deployment is currently not possible.
	OutOfStock bool `protobuf:"varint,6,opt,name=out_of_stock,json=outOfStock,proto3" json:"out_of_stock,omitempty"`
	// If set, this region has not be released as generally available.
	Prerelease bool `protobuf:"varint,7,opt,name=prerelease,proto3" json:"prerelease,omitempty"`
	// If set, this region support ML services.
	MlSupported bool `protobuf:"varint,8,opt,name=ml_supported,json=mlSupported,proto3" json:"ml_supported,omitempty"`
	// sets the sales priority of this region higher number is higher priority
	Priority int32 `protobuf:"varint,9,opt,name=priority,proto3" json:"priority,omitempty"`
	// contains filtered or unexported fields
}

Region represents a geographical region in which deployments are run.

func (*Region) Descriptor deprecated

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

Deprecated: Use Region.ProtoReflect.Descriptor instead.

func (*Region) GetAvailable

func (x *Region) GetAvailable() bool

func (*Region) GetId

func (x *Region) GetId() string

func (*Region) GetLocation

func (x *Region) GetLocation() string

func (*Region) GetLowStock

func (x *Region) GetLowStock() bool

func (*Region) GetMlSupported added in v0.79.16

func (x *Region) GetMlSupported() bool

func (*Region) GetOutOfStock

func (x *Region) GetOutOfStock() bool

func (*Region) GetPrerelease

func (x *Region) GetPrerelease() bool

func (*Region) GetPriority added in v0.88.13

func (x *Region) GetPriority() int32

func (*Region) GetProviderId

func (x *Region) GetProviderId() string

func (*Region) ProtoMessage

func (*Region) ProtoMessage()

func (*Region) ProtoReflect added in v0.89.0

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

func (*Region) Reset

func (x *Region) Reset()

func (*Region) String

func (x *Region) String() string

type RegionCallback

type RegionCallback func(context.Context, *Region) error

RegionCallback is a callback for individual (cloud) region.

type RegionList

type RegionList struct {
	Items []*Region `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

List of regions.

func (*RegionList) Descriptor deprecated

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

Deprecated: Use RegionList.ProtoReflect.Descriptor instead.

func (*RegionList) GetItems

func (x *RegionList) GetItems() []*Region

func (*RegionList) ProtoMessage

func (*RegionList) ProtoMessage()

func (*RegionList) ProtoReflect added in v0.89.0

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

func (*RegionList) Reset

func (x *RegionList) Reset()

func (*RegionList) String

func (x *RegionList) String() string

type UnimplementedPlatformServiceServer

type UnimplementedPlatformServiceServer struct {
}

UnimplementedPlatformServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedPlatformServiceServer) GetAPIVersion

func (*UnimplementedPlatformServiceServer) GetProvider

func (*UnimplementedPlatformServiceServer) GetRegion

func (*UnimplementedPlatformServiceServer) ListProviders

func (*UnimplementedPlatformServiceServer) ListRegions

Jump to

Keyboard shortcuts

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