Registration
After deploying an endpoint, you need to register it with Restate. That way Restate knows where it runs and can invoke it.
Registering deployments
You can register deployments via the UI, via the CLI or via curl
(via the Restate Admin API).
- CLI
- curl
restate deployments register localhost:9080
Or you can use the shorthand restate dp add
.
curl localhost:9070/deployments -H 'content-type: application/json' \-d '{"uri": "http://localhost:9080"}'
To register a Lambda handler, replace http://localhost:9080
by the ARN of the Lambda function, for example arn:aws:lambda:my-region:123456789101:function:my-function:my-version
.
When running Restate in a Docker, replace localhost
with host.docker.internal
.
A service can be registered only once. Subsequent registration requests to the same deployment will fail. For more details on how to update services, check the versioning docs.
When developing locally, you can forcefully overwrite an existing deployment:
- CLI
- curl
restate deployments register --force localhost:9080
curl localhost:9070/deployments -H 'content-type: application/json' \-d '{"uri": "localhost:9080", "force": true}'
This will forcefully overwrite the existing service deployment with the same URI, forcing the discovery process again. It will also remove services that were served by that deployment and are not available anymore.
Forcing a deployment registration is a feature designed to simplify local Restate service development, and should never be used in a production Restate deployment, as it potentially breaks all the in-flight invocations to that deployment.
After registration, services can also be marked as 'private' to prevent them from being invoked through the ingress. See the Security docs for more information.