forked from google/trillian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
trillian_admin_api.proto
132 lines (113 loc) · 3.77 KB
/
trillian_admin_api.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// Copyright 2016 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
option java_multiple_files = true;
option java_package = "com.google.trillian.proto";
option java_outer_classname = "TrillianAdminApiProto";
option go_package = "github.com/google/trillian";
package trillian;
import "trillian.proto";
import "crypto/keyspb/keyspb.proto";
import "google/api/annotations.proto";
import "google/protobuf/field_mask.proto";
// ListTrees request.
// No filters or pagination options are provided.
message ListTreesRequest {
// If true, deleted trees are included in the response.
bool show_deleted = 1;
}
// ListTrees response.
// No pagination is provided, all trees the requester has access to are
// returned.
message ListTreesResponse {
// Trees matching the list request filters.
repeated Tree tree = 1;
}
// GetTree request.
message GetTreeRequest {
// ID of the tree to retrieve.
int64 tree_id = 1;
}
// CreateTree request.
message CreateTreeRequest {
// Tree to be created. See Tree and CreateTree for more details.
Tree tree = 1;
// Describes how the tree's private key should be generated.
// Only needs to be set if tree.private_key is not set.
keyspb.Specification key_spec = 2;
}
// UpdateTree request.
message UpdateTreeRequest {
// Tree to be updated.
Tree tree = 1;
// Fields modified by the update request.
// For example: "tree_state", "display_name", "description".
google.protobuf.FieldMask update_mask = 2;
}
// DeleteTree request.
message DeleteTreeRequest {
// ID of the tree to delete.
int64 tree_id = 1;
}
// UndeleteTree request.
message UndeleteTreeRequest {
// ID of the tree to undelete.
int64 tree_id = 1;
}
// Trillian Administrative interface.
// Allows creation and management of Trillian trees (both log and map trees).
service TrillianAdmin {
// Lists all trees the requester has access to.
rpc ListTrees(ListTreesRequest) returns (ListTreesResponse) {}
// Retrieves a tree by ID.
rpc GetTree(GetTreeRequest) returns (Tree) {
option (google.api.http) = {
get: "/v1beta1/trees/{tree_id=*}"
};
}
// Creates a new tree.
// System-generated fields are not required and will be ignored if present,
// e.g.: tree_id, create_time and update_time.
// Returns the created tree, with all system-generated fields assigned.
rpc CreateTree(CreateTreeRequest) returns (Tree) {
option (google.api.http) = {
post: "/v1beta1/trees"
body: "*"
};
}
// Updates a tree.
// See Tree for details. Readonly fields cannot be updated.
rpc UpdateTree(UpdateTreeRequest) returns (Tree) {
option (google.api.http) = {
patch: "/v1beta1/trees/{tree.tree_id=*}"
body: "*"
};
}
// Soft-deletes a tree.
// A soft-deleted tree may be undeleted for a certain period, after which
// it'll be permanently deleted.
rpc DeleteTree(DeleteTreeRequest) returns (Tree) {
option (google.api.http) = {
delete: "/v1beta1/trees/{tree_id=*}"
};
}
// Undeletes a soft-deleted a tree.
// A soft-deleted tree may be undeleted for a certain period, after which
// it'll be permanently deleted.
rpc UndeleteTree(UndeleteTreeRequest) returns (Tree) {
option (google.api.http) = {
delete: "/v1beta1/trees/{tree_id=*}:undelete"
};
}
}