Create the Worker API resource and the CRUDL operation definitions for a worker. (#2114)
This commit is contained in:
7 files changed
+2790
No files matched your search
@@ -0,0 +1,128 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package controller.api.services.v1;
|
||||
|
||||
import "controller/api/resources/workers/v1/worker.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
import "protoc-gen-openapiv2/options/annotations.proto";
|
||||
|
||||
option go_package = "github.com/hashicorp/boundary/internal/gen/controller/api/services;services";
|
||||
|
||||
service WorkerService {
|
||||
// GetWorker returns a stored Worker if present. The provided request
|
||||
// must include the Worker ID for the Worker being retrieved. If
|
||||
// that ID is missing, malformed or reference a non existing
|
||||
// resource an error is returned.
|
||||
rpc GetWorker(GetWorkerRequest) returns (GetWorkerResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/v1/workers/{id}"
|
||||
response_body: "item"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||
summary: "Gets a single Worker."
|
||||
};
|
||||
}
|
||||
|
||||
// ListWorkers returns a list of stored Workers which exist inside the provided
|
||||
// scope. The request must include the scope ID for the Workers being listed.
|
||||
// If the scope ID is missing, malformed, or reference a non existing scope,
|
||||
// an error is returned.
|
||||
rpc ListWorkers(ListWorkersRequest) returns (ListWorkersResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/v1/workers"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||
summary: "Lists all Workers."
|
||||
};
|
||||
}
|
||||
|
||||
// CreateWorker 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) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/workers"
|
||||
body: "item"
|
||||
response_body: "item"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||
summary: "Creates a single Worker."
|
||||
};
|
||||
}
|
||||
|
||||
// UpdateWorker updates an existing Worker in boundary. The provided
|
||||
// Worker must not have any read only fields set. The update mask must be
|
||||
// included in the request and contain at least 1 mutable field. To unset
|
||||
// a field's value, include the field in the update mask and don't set it
|
||||
// in the provided Worker. An error is returned if either the Worker id is
|
||||
// missing or reference a non existing resource. An error is also returned
|
||||
// if the request attempts to update the name to one that is already in use
|
||||
// in this Scope.
|
||||
rpc UpdateWorker(UpdateWorkerRequest) returns (UpdateWorkerResponse) {
|
||||
option (google.api.http) = {
|
||||
patch: "/v1/workers/{id}"
|
||||
body: "item"
|
||||
response_body: "item"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||
summary: "Updates a Worker."
|
||||
};
|
||||
}
|
||||
|
||||
// DeleteWorker removes a Worker from Boundary. If the provided Worker ID
|
||||
// is malformed or not provided an error is returned.
|
||||
rpc DeleteWorker(DeleteWorkerRequest) returns (DeleteWorkerResponse) {
|
||||
option (google.api.http) = {
|
||||
delete: "/v1/workers/{id}"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
||||
summary: "Deletes a Worker."
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message GetWorkerRequest {
|
||||
string id = 1; // @gotags: `class:"public"`
|
||||
}
|
||||
|
||||
message GetWorkerResponse {
|
||||
resources.workers.v1.Worker item = 1;
|
||||
}
|
||||
|
||||
message ListWorkersRequest {
|
||||
string scope_id = 1; // @gotags: `class:"public"`
|
||||
bool recursive = 20 [json_name = "recursive"]; // @gotags: `class:"public"`
|
||||
string filter = 30 [json_name = "filter"]; // @gotags: `class:"sensitive"`
|
||||
}
|
||||
|
||||
message ListWorkersResponse {
|
||||
repeated resources.workers.v1.Worker items = 1;
|
||||
}
|
||||
|
||||
message CreateWorkerRequest {
|
||||
resources.workers.v1.Worker item = 1;
|
||||
}
|
||||
|
||||
message CreateWorkerResponse {
|
||||
string uri = 1; // @gotags: `class:"public"`
|
||||
resources.workers.v1.Worker item = 2;
|
||||
}
|
||||
|
||||
message UpdateWorkerRequest {
|
||||
string id = 1; // @gotags: `class:"public"`
|
||||
resources.workers.v1.Worker item = 2;
|
||||
google.protobuf.FieldMask update_mask = 3 [json_name = "update_mask"];
|
||||
}
|
||||
|
||||
message UpdateWorkerResponse {
|
||||
resources.workers.v1.Worker item = 1;
|
||||
}
|
||||
|
||||
message DeleteWorkerRequest {
|
||||
string id = 1; // @gotags: `class:"public"`
|
||||
}
|
||||
|
||||
message DeleteWorkerResponse {}
|
||||
Reference in new issue
Block a user