Python#

Basic API#

yr.init

The openYuanRong client initialization interface is used to configure the running mode and other parameters.

yr.is_initialized

Check initialize state.

yr.finalize

Terminate the system and release the relevant resources.

yr.Config

YR API config.

yr.config.ClientInfo

Use to store yr client info.

Stateful & Stateless Function API#

yr.invoke

Decorator for creating stateless remote functions on the openYuanrong system.

yr.StatelessFunction

alias of FunctionProxy

yr.FunctionProxy

Use to decorate user function.

yr.instance

Used to decorate classes that need to be remotely invoked on the openYuanRong system.

yr.StatefulInstanceCreator

alias of InstanceCreator

yr.StatefulInstance

alias of InstanceProxy

yr.InstanceProxy

Use to decorate a user class.

yr.method

Used to decorate class member methods.

yr.MethodProxy

Use to decorate a user class method.

yr.get_instance

Get an instance handle based on the name and namespace of the named instance.

yr.InstanceCreator

User instance creator.

yr.cancel

Cancel a specified stateless request.

yr.exit

The function for exiting the program.

yr.save_state

Used to save the instance status.

yr.load_state

Used to load the saved instance state.

yr.InvokeOptions

Use to set the invoke options.

yr.list_named_instances

List named instances.

Data Object API#

yr.put

Put an object to datasystem.

yr.get

Retrieve the value of an object stored in the backend based on the object's key.

yr.wait

Wait for the value of the object in the data system to be ready based on the object's key.

yr.object_ref.ObjectRef

Initialize the ObjectRef.

Stream API#

yr.ProducerConfig

The configuration class created by the producer.

yr.SubscriptionConfig

The configuration class subscribed by consumers.

yr.Element

Element class containing an element ID and data buffer.

yr.create_stream_producer

Create a producer.

yr.create_stream_consumer

Create a consumer.

yr.delete_stream

Delete the data stream.

yr.fnruntime.Producer

Producer interface class.

yr.fnruntime.Consumer

Consumer interface class.

Function Interoperation API#

yr.cpp_function

A proxy for constructing cpp functions and remotely calling cpp functions.

yr.cpp_instance_class

Constructs a proxy for a C++ class to enable remote invocation.

yr.java_function

A proxy used to construct java functions and remotely call java functions.

yr.java_instance_class

A proxy used to construct Java classes and invoke them remotely.

Function Group API#

yr.create_function_group

Create function group instance.

yr.get_function_group_context

Get the function group context of the current function instance.

yr.FunctionGroupOptions

Function group options.

yr.FunctionGroupContext

A context class for managing function group information.

yr.FunctionGroupHandler

Use to decorate a list of instance proxy.

yr.FunctionGroupMethodProxy

Use to invoke instance proxy.

yr.device.DataInfo

The DataInfo class is used to store the basic information of data.

Resource Group API#

yr.create_resource_group

Asynchronously create a ResourceGroup.

yr.remove_resource_group

Asynchronously delete a ResourceGroup.

yr.ResourceGroup

The handle returned after creating a ResourceGroup.

yr.config.ResourceGroupOptions

Resource group options.

yr.config.SchedulingAffinityType

Bundle affinity type.

yr.config.UserTLSConfig

The SSL/TLS configuration used by users when communicating with external clusters.

yr.config.DeploymentConfig

AutoDeploymentConfig

Group API#

yr.Group

A class for managing the lifecycle of grouped instances.

yr.config.GroupOptions

Configuration options for grouped instance scheduling.

KV Cache API#

yr.kv_write

Provides the Redis class's set storage interface, which supports saving binary data to the data system.

yr.kv_write_with_param

Provide a storage interface that supports custom parameter configuration, enabling binary data to be written to the data system in a more flexible manner.

yr.kv_m_write_tx

Provide a Redis-like set storage interface that supports persisting a collection of binary data into the data system.

yr.kv_read

Provides a Redis-like interface to retrieve data, supporting the retrieval of multiple data items simultaneously.

yr.kv_del

Provides a Redis-like interface to delete data, supporting the deletion of multiple data items simultaneously.

yr.kv_set

Provide a set storage interface similar to Redis, supporting the saving of binary data to the data system.

yr.kv_get

Provides a Redis-like interface to retrieve data, supporting the retrieval of multiple data items simultaneously.

yr.kv_get_with_param

Provides the kv_get_with_param interface, which supports offset reading of data.

yr.ExistenceOpt

Kv option.

yr.WriteMode

Object write mode.

yr.CacheType

Cache type.

yr.ConsistencyType

Consistency type.

yr.GetParam

Get the parameter configuration class.

yr.GetParams

Interface class for obtaining parameters.

yr.SetParam

Set parameters.

yr.MSetParam

Represents the parameter configuration class for the mset operation.

yr.CreateParam

Create param.

Observability API#

yr.Gauge

Used for reporting metrics data.

yr.Alarm

Used to set and manage alarm information.

yr.AlarmInfo

Alarm info.

yr.AlarmSeverity

Object alarm severity.

yr.DoubleCounter

Initialize the double counter.

yr.UInt64Counter

A class representing a 64-bit unsigned integer counter for metrics.

yr.resources

Get the resource information of nodes in the cluster.

Affinity Scheduling#

yr.affinity.AffinityType

Enum for affinity type.

yr.affinity.AffinityKind

Enum for affinity kind.

yr.affinity.OperatorType

Enum for the types of label operators.

yr.affinity.LabelOperator

Label operator for affinity.

yr.affinity.Affinity

Represents an affinity.

Exceptions#

yr.exception.YRError

Base class for all custom exceptions in the YR module.

yr.exception.CancelError

Stateless request cancel error.

yr.exception.YRInvokeError

Represents an error that occurred during an invocation.

yr.exception.YRequestError

Request failed error.