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/local/controller/api/services/v1/group_service.proto

212 lines
7.3 KiB

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 "google/protobuf/wrappers.proto";
import "controller/api/resources/groups/v1/group.proto";
import "controller/api/resources/scopes/v1/scope.proto";
service GroupService {
// GetGroup returns a stored Group if present. The provided request must
// include the scope for the group being retrieved. If any of those ids are
// missing, malformed or reference a non existing resource an error is
// returned.
rpc GetGroup(GetGroupRequest) returns (GetGroupResponse) {
option (google.api.http) = {
get: "/v1/groups/{id}"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Gets a single Group"
};
}
// ListGroups returns a list of stored groups which exist inside the org
// referenced inside the request. The request must include the scope for
// the groups being retrieved. If the scope is missing, malformed, or
// references a non-existing scope, an error is returned.
rpc ListGroups(ListGroupsRequest) returns (ListGroupsResponse) {
option (google.api.http) = {
get: "/v1/groups"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Lists all Groups"
};
}
// CreateGroup creates and stores a group in boundary. The provided
// request must include the scope ID in which the group will be created.
// If the scope ID is missing, malformed or references a non existing
// org, an error is returned. If a name is provided that is in
// use in another group in the same scope, an error is returned.
rpc CreateGroup(CreateGroupRequest) returns (CreateGroupResponse) {
option (google.api.http) = {
post: "/v1/groups"
body: "item"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Creates a single Group"
};
}
// UpdateGroup updates an existing group in boundary. The provided group
// 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
// group. An error is returned if either the scope or group ids are 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 UpdateGroup(UpdateGroupRequest) returns (UpdateGroupResponse) {
option (google.api.http) = {
patch: "/v1/groups/{id}"
body: "item"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Updates a Group"
};
}
// DeleteGroup removes a group from Boundary. If the provided scope or group
// IDs are malformed or not provided an error is returned. No error is
// returned if either IDs reference resources that do not exist as the
// response itself specifies if the resource existed before the DeleteGroup
// request was received.
rpc DeleteGroup(DeleteGroupRequest) returns (DeleteGroupResponse) {
option (google.api.http) = {
delete: "/v1/groups/{id}"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Deletes a Group"
};
}
// AddGroupMembers adds users as members to a group. The provided
// request must include the scope id and the group id which the users
// will be set to. If the any of the ids are missing, malformed or references a non
// existing resource, an error is returned.
rpc AddGroupMembers(AddGroupMembersRequest) returns (AddGroupMembersResponse) {
option (google.api.http) = {
post: "/v1/groups/{id}:add-members"
body: "*"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Adds Users as members to a Group"
};
}
// SetGroupMembers sets the group's members. Any existing members on
// the group are deleted if they are not included in this request. The provided
// request must include the scope id and the group id which the users
// will be set to. If the any of the ids are missing, malformed or references a non
// existing resource, an error is returned.
rpc SetGroupMembers(SetGroupMembersRequest) returns (SetGroupMembersResponse) {
option (google.api.http) = {
post: "/v1/groups/{id}:set-members"
body: "*"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Set a Group's members to exactly the list of provided in the request, removing any members that are not specified."
};
}
// RemoveGroupMembers removes members from the specified group.
// The provided request must include the scope id and the group id which the users
// will be set to. If the any of the ids are missing, malformed or references a non
// existing resource, an error is returned.
rpc RemoveGroupMembers(RemoveGroupMembersRequest) returns (RemoveGroupMembersResponse) {
option (google.api.http) = {
post: "/v1/groups/{id}:remove-members"
body: "*"
response_body: "item"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Removes the specified members from a Group."
};
}
}
message GetGroupRequest {
string id = 1;
}
message GetGroupResponse {
resources.groups.v1.Group item = 1;
}
message ListGroupsRequest {
string scope_id = 1 [json_name="scope_id"];
}
message ListGroupsResponse {
repeated resources.groups.v1.Group items = 1;
}
message CreateGroupRequest {
resources.groups.v1.Group item = 1;
}
message CreateGroupResponse {
string uri = 1;
resources.groups.v1.Group item = 2;
}
message UpdateGroupRequest {
string id = 1;
resources.groups.v1.Group item = 2;
google.protobuf.FieldMask update_mask = 3 [json_name="update_mask"];
}
message UpdateGroupResponse {
resources.groups.v1.Group item = 1;
}
message DeleteGroupRequest {
string id = 1;
}
message DeleteGroupResponse {}
message AddGroupMembersRequest {
string id = 1;
// The version ensures the group hasn't changed since it was last retrieved and if it has the request will fail.
uint32 version = 2;
repeated string member_ids = 3 [json_name="member_ids"];
}
message AddGroupMembersResponse {
resources.groups.v1.Group item = 1;
}
message SetGroupMembersRequest {
string id = 1;
// The version ensures the group hasn't changed since it was last retrieved and if it has the request will fail.
uint32 version = 2;
repeated string member_ids = 3 [json_name="member_ids"];
}
message SetGroupMembersResponse {
resources.groups.v1.Group item = 1;
}
message RemoveGroupMembersRequest {
string id = 1;
// The version ensures the group hasn't changed since it was last retrieved and if it has the request will fail.
uint32 version = 2;
repeated string member_ids = 3 [json_name="member_ids"];
}
message RemoveGroupMembersResponse {
resources.groups.v1.Group item = 1;
}