feature (worker): add CreateWorker(...) service (aka API) (#2143)
This commit is contained in:
14 files changed
+773
-233
No files matched your search
@@ -90,7 +90,11 @@ message Worker {
|
||||
// itself.
|
||||
WorkerConfig worker_config = 140 [json_name = "worker_config"];
|
||||
|
||||
// TODO: Add worker auth related fields.
|
||||
// worker_auth_token is input only. Supports the worker led node
|
||||
// enrollment flow where this credentials token is produced by a worker. This
|
||||
// token is a base58 encoded types.FetchNodeCredentialsRequest from
|
||||
// https://github.com/hashicorp/nodeenrollment
|
||||
google.protobuf.StringValue worker_auth_token = 150 [json_name = "worker_auth_token"]; // @gotags: `class:"public"`
|
||||
|
||||
// Output only. The available actions on this resource for the requester.
|
||||
repeated string authorized_actions = 300 [json_name = "authorized_actions"]; // @gotags: `class:"public"`
|
||||
|
||||
@@ -37,14 +37,14 @@ service WorkerService {
|
||||
};
|
||||
}
|
||||
|
||||
// CreateWorker creates and stores a Worker in boundary. The provided
|
||||
// CreateWorkerLed creates and stores a Worker in boundary. The provided
|
||||
// request must include the Scope id in which the Worker will be created.
|
||||
// If the Scope id is missing, malformed or references a non existing
|
||||
// resource, an error is returned. If a name is provided that is in
|
||||
// use in another Worker in the same scope, an error is returned.
|
||||
rpc CreateWorker(CreateWorkerRequest) returns (CreateWorkerResponse) {
|
||||
rpc CreateWorkerLed(CreateWorkerLedRequest) returns (CreateWorkerLedResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/workers"
|
||||
post: "/v1/workers:create:worker-led"
|
||||
body: "item"
|
||||
response_body: "item"
|
||||
};
|
||||
@@ -102,11 +102,11 @@ message ListWorkersResponse {
|
||||
repeated resources.workers.v1.Worker items = 1;
|
||||
}
|
||||
|
||||
message CreateWorkerRequest {
|
||||
message CreateWorkerLedRequest {
|
||||
resources.workers.v1.Worker item = 1;
|
||||
}
|
||||
|
||||
message CreateWorkerResponse {
|
||||
message CreateWorkerLedResponse {
|
||||
string uri = 1; // @gotags: `class:"public"`
|
||||
resources.workers.v1.Worker item = 2;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user