133 lines
4.2 KiB
Protocol Buffer
133 lines
4.2 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/users/v1/user.proto";
|
|
|
|
service UserService {
|
|
|
|
// GetUser returns a stored User if present. The provided request
|
|
// must include the scope and user ID for the user being retrieved. If
|
|
// any of those IDs are missing, malformed or reference a non existing
|
|
// resource an error is returned.
|
|
rpc GetUser(GetUserRequest) returns (GetUserResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v1/users/{id}"
|
|
response_body: "item"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Gets a single User"
|
|
};
|
|
}
|
|
|
|
// ListUsers returns a list of stored users which exist inside the org
|
|
// referenced inside the request. The request must include the scope ID for
|
|
// the users being retrieved. If the scope ID is missing, malformed, or
|
|
// reference a non existing scope, an error is returned.
|
|
rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v1/users"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Lists all Users"
|
|
};
|
|
}
|
|
|
|
// CreateUser creates and stores a user in boundary. The provided
|
|
// request must include the scope id in which the user will be created.
|
|
// If the scope id is missing, malformed or references a non existing
|
|
// scope, an error is returned. If a name is provided that is in
|
|
// use in another user in the same scope, an error is returned.
|
|
rpc CreateUser(CreateUserRequest) returns (CreateUserResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v1/users"
|
|
body: "item"
|
|
response_body: "item"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Creates a single User"
|
|
};
|
|
}
|
|
|
|
// UpdateUser updates an existing user in boundary. The provided
|
|
// user 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 user. An error is returned if either the scope
|
|
// or user 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 UpdateUser(UpdateUserRequest) returns (UpdateUserResponse) {
|
|
option (google.api.http) = {
|
|
patch: "/v1/users/{id}"
|
|
body: "item"
|
|
response_body: "item"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Updates a User"
|
|
};
|
|
}
|
|
|
|
// DeleteUser removes a user from Boundary. If the provided scope or user 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 DeleteUser request was
|
|
// received.
|
|
rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse) {
|
|
option (google.api.http) = {
|
|
delete: "/v1/users/{id}"
|
|
};
|
|
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
|
|
summary: "Deletes a User"
|
|
};
|
|
}
|
|
}
|
|
|
|
message GetUserRequest {
|
|
string id = 1;
|
|
string view = 2;
|
|
}
|
|
|
|
message GetUserResponse {
|
|
resources.users.v1.User item = 1;
|
|
}
|
|
|
|
message ListUsersRequest {
|
|
string scope_id = 1;
|
|
string view = 2;
|
|
}
|
|
|
|
message ListUsersResponse {
|
|
repeated resources.users.v1.User items = 1;
|
|
}
|
|
|
|
message CreateUserRequest {
|
|
resources.users.v1.User item = 1;
|
|
}
|
|
|
|
message CreateUserResponse {
|
|
string uri = 1;
|
|
resources.users.v1.User item = 2;
|
|
}
|
|
|
|
message UpdateUserRequest {
|
|
string id = 1;
|
|
resources.users.v1.User item = 2;
|
|
google.protobuf.FieldMask update_mask = 3;
|
|
}
|
|
|
|
message UpdateUserResponse {
|
|
resources.users.v1.User item = 1;
|
|
}
|
|
|
|
message DeleteUserRequest {
|
|
string id = 1;
|
|
}
|
|
|
|
message DeleteUserResponse {}
|