Proto API and grpc bindings for action management
action-api provides Proto API and grpc bindings for action management
The action resource implements the following API:
Start the action
Stop the action
Returns boolean declaring if the action is currently underway
Get current status for the action. Different action models will define their response differently.
Because this module uses a custom protobuf-based API, you must include this project in your client code. One way to do this is to include it in your requirements.txt as follows:
action_api @ git+https://github.com/viam-labs/action-api.git@main
You can now import and use it in your code as follows:
from action_python import Action
api = Action.from_robot(robot, name="actionModel")
api.start()
See client.py for an example.
Because this module uses a custom protobuf-based API, you must import and use in your client code as follows:
import action "github.com/viam-labs/action-api/src/action_go"
api, err := dock.FromRobot(robot, "action-model")
fmt.Println("err", err)
api.Start(context.Background())
See client.go for an example.
To rebuild the GRPC bindings, run:
make generate
Then, in `src/dock_python/grpc/action_grpc.py change:
import action_pb2
to:
from . import action_pb2
Then, update the version in pyproject.toml