Files
threshold/internal/proto/controller/api/services/v1/host_set_service.proto
T
Johan Brandhorst-Satzkorn b1d6a1da9a Switch to buf for protobuf generation (#1944)
* Install buf with go install

This reduces the impact of using buf on our dependency
closure, which was significant. It also avoids potential
issues with building buf given our own internal dependency
constraints. This has caused issues (including crashes!)
in the past.

See https://github.com/cockroachdb/cockroach/issues/67216#issuecomment-874176186
for more discussion on using tool dependencies generally, and
https://github.com/bufbuild/buf/issues/52
for an example of where this sort of thing caused an issue for a user.

* Upgrade buf version

We should migrate to v1 sooner rather than later, as it has some
breaking changes from v0.

* Change buf lint/breaking commands

These commands were moved up one level for v1

* Migrate to buf.yaml to v1

* Remove unused imports

These were uncovered by using "buf lint".

* Use buf v1.3.1

* Depend on googleapis and grpc-gateway via BSR

* Switch to buf for proto generation

* Remove third party dependency

* Remove unused tools and scripts

* Move local protos up one level

* Temporarily don't fail on breaking changes

* Generate CI config

* Fix generation of controller.json

* Replace use of deprecated flag

* Remove unused import, regenerate files

* Remove temporary skipping over breaking check
2022-04-04 13:55:42 -04:00

220 lines
7.9 KiB
Protocol Buffer

syntax = "proto3";
package controller.api.services.v1;
option go_package = "github.com/hashicorp/boundary/internal/gen/controller/api/services;services";
import "protoc-gen-openapiv2/options/annotations.proto";
import "google/api/annotations.proto";
import "google/protobuf/field_mask.proto";
import "controller/api/resources/hostsets/v1/host_set.proto";
service HostSetService {
// GetHostSet returns a stored Host Set if present. The provided request
// must include the Host Set ID for the resource being retrieved. If missing,
// malformed or reference a non existing resource an error is returned.
rpc GetHostSet(GetHostSetRequest) returns (GetHostSetResponse) {
option (google.api.http) = {
get: "/v1/host-sets/{id}"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Get a single Host Set."
};
}
// ListHostSets returns a list of stored Host Sets which exist inside the
// Host Catalog provided. The request must include a properly formatted
// Host Catalog id or an error is returned.
rpc ListHostSets(ListHostSetsRequest) returns (ListHostSetsResponse) {
option (google.api.http) = {
get: "/v1/host-sets"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "List all Host Sets under the specific Catalog."
};
}
// CreateHostSet creates and stores a Host Set in boundary. The provided
// request must include the Host Catalog id in which the Host Set
// will be created. If the Host Catalog id is missing, malformed or
// references a non existing resource, an error is returned. If a name is
// provided that is in use by another Host Set in the same Host Catalog, an
// error is returned.
rpc CreateHostSet(CreateHostSetRequest) returns (CreateHostSetResponse) {
option (google.api.http) = {
post: "/v1/host-sets"
body: "item"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Create a Host Set."
};
}
// UpdateHostSet updates an existing Host Set in boundary. The provided
// Host Set 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 Host Set. An error is returned if the Host Set 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 Host Catalog.
rpc UpdateHostSet(UpdateHostSetRequest) returns (UpdateHostSetResponse) {
option (google.api.http) = {
patch: "/v1/host-sets/{id}"
body: "item"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Update a Host Set."
};
}
// DeleteHostSet removes a Host Set from Boundary. If the provided
// Host Set id is malformed or not provided an error is returned.
rpc DeleteHostSet(DeleteHostSetRequest) returns (DeleteHostSetResponse) {
option (google.api.http) = {
delete: "/v1/host-sets/{id}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Delete a Host Set."
};
}
// AddHostSetHosts adds a Host to a Host Set. The provided request must
// include the Host Set ID to which the Host will be added.
// All hosts added to the provided Host Set must be a child of the same
// Catalog that this Host Set is a child of. If the Host Set IDs is
// missing, malformed, or reference non-existing resources, an error is
// returned. It is an error to add a Host which already exists in the
// Host Set.
rpc AddHostSetHosts(AddHostSetHostsRequest) returns (AddHostSetHostsResponse) {
option (google.api.http) = {
post: "/v1/host-sets/{id}:add-hosts"
body: "*"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Adds existing Hosts to a Host Set."
};
}
// SetHostSetHosts sets the Host Set's hosts. Any existing hosts on the
// Host Set are deleted if they are not included in this request. The
// provided request must include the Host Set ID on which the hosts will be
// set. All Hosts in the request must be a child of the same Catalog that
// the provided Host Set is. An error is returned if any of the provided
// ids are malformed or references a non-existing resource.
rpc SetHostSetHosts(SetHostSetHostsRequest) returns (SetHostSetHostsResponse) {
option (google.api.http) = {
post: "/v1/host-sets/{id}:set-hosts"
body: "*"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Sets the Hosts on the Host Set."
};
}
// RemoveHostSetHosts removes the Hosts from the specified Host Set. The
// provided request must include the Host Set ID which the Host will be
// removed. An error is a returned if any of the provided IDs are malformed,
// or references a non-existing scope or catalog, or if a Host id is included
// which is not in the provided Host Set.
rpc RemoveHostSetHosts(RemoveHostSetHostsRequest) returns (RemoveHostSetHostsResponse) {
option (google.api.http) = {
post: "/v1/host-sets/{id}:remove-hosts"
body: "*"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Removes Hosts from the Host Set."
};
}
}
message GetHostSetRequest {
string id = 1;
}
message GetHostSetResponse {
api.resources.hostsets.v1.HostSet item = 1;
}
message ListHostSetsRequest {
string host_catalog_id = 1 [json_name="host_catalog_id"];
string filter = 30 [json_name="filter"];
}
message ListHostSetsResponse {
repeated api.resources.hostsets.v1.HostSet items = 1;
}
message CreateHostSetRequest {
api.resources.hostsets.v1.HostSet item = 1;
}
message CreateHostSetResponse {
string uri = 1;
api.resources.hostsets.v1.HostSet item = 2;
}
message UpdateHostSetRequest {
string id = 1;
api.resources.hostsets.v1.HostSet item = 2;
google.protobuf.FieldMask update_mask = 3 [json_name="update_mask"];
}
message UpdateHostSetResponse {
api.resources.hostsets.v1.HostSet item = 1;
}
message DeleteHostSetRequest {
string id = 1;
}
message DeleteHostSetResponse {}
message AddHostSetHostsRequest {
string id = 1;
// Version is used to ensure this resource has not changed.
// The mutation will fail if the version does not match the latest known good version.
uint32 version = 2;
// A list of Host IDs which will be added to this Host Set. Each Host referenced here must be a child of the same Host Catalog of which this Host Set is a child.
repeated string host_ids = 3 [json_name="host_ids"];
}
message AddHostSetHostsResponse {
api.resources.hostsets.v1.HostSet item = 1;
}
message SetHostSetHostsRequest {
string id = 1;
// Version is used to ensure this resource has not changed.
// The mutation will fail if the version does not match the latest known good version.
uint32 version = 2;
// A list of Host IDs which will be set on this Host Set. Each Host referenced here must be a child of the same Host Catalog of which this Host Set is a child.
repeated string host_ids = 3 [json_name="host_ids"];
}
message SetHostSetHostsResponse {
api.resources.hostsets.v1.HostSet item = 1;
}
message RemoveHostSetHostsRequest {
string id = 1;
// Version is used to ensure this resource has not changed.
// The mutation will fail if the version does not match the latest known good version.
uint32 version = 2;
// A list of Host IDs which will be removed from this Host Set.
repeated string host_ids = 3 [json_name="host_ids"];
}
message RemoveHostSetHostsResponse {
api.resources.hostsets.v1.HostSet item = 1;
}