github.com/mre-fog/trillianxx@v1.1.2-0.20180615153820-ae375a99d36a/trillian_admin_api.proto (about)

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