You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
boundary/internal/proto/controller/api/services/v1/host_set_service.proto

205 lines
8.4 KiB

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
syntax = "proto3";
package controller.api.services.v1;
import "controller/api/resources/hostsets/v1/host_set.proto";
import "controller/custom_options/v1/options.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";
option (custom_options.v1.domain) = "host";
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; // @gotags: `class:"public"`
}
message GetHostSetResponse {
api.resources.hostsets.v1.HostSet item = 1;
}
message ListHostSetsRequest {
string host_catalog_id = 1 [json_name = "host_catalog_id"]; // @gotags: `class:"public"`
string filter = 30 [json_name = "filter"]; // @gotags: `class:"public"`
}
message ListHostSetsResponse {
repeated api.resources.hostsets.v1.HostSet items = 1;
}
message CreateHostSetRequest {
api.resources.hostsets.v1.HostSet item = 1;
}
message CreateHostSetResponse {
string uri = 1; // @gotags: `class:"public"`
api.resources.hostsets.v1.HostSet item = 2;
}
message UpdateHostSetRequest {
string id = 1; // @gotags: `class:"public"`
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; // @gotags: `class:"public"`
}
message DeleteHostSetResponse {}
message AddHostSetHostsRequest {
string id = 1; // @gotags: `class:"public"`
// 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; // @gotags: `class:"public"`
// 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"]; // @gotags: `class:"public"`
}
message AddHostSetHostsResponse {
api.resources.hostsets.v1.HostSet item = 1;
}
message SetHostSetHostsRequest {
string id = 1; // @gotags: `class:"public"`
// 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; // @gotags: `class:"public"`
// 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"]; // @gotags: `class:"public"`
}
message SetHostSetHostsResponse {
api.resources.hostsets.v1.HostSet item = 1;
}
message RemoveHostSetHostsRequest {
string id = 1; // @gotags: `class:"public"`
// 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; // @gotags: `class:"public"`
// A list of Host IDs which will be removed from this Host Set.
repeated string host_ids = 3 [json_name = "host_ids"]; // @gotags: `class:"public"`
}
message RemoveHostSetHostsResponse {
api.resources.hostsets.v1.HostSet item = 1;
}