resultstore_file_download.proto 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. // Copyright 2021 Google LLC
  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. syntax = "proto3";
  15. package google.devtools.resultstore.v2;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "ResultStoreFileDownloadProto";
  21. option java_package = "com.google.devtools.resultstore.v2";
  22. // This API allows download of File messages referenced in
  23. // ResultStore resources.
  24. service ResultStoreFileDownload {
  25. option (google.api.default_host) = "resultstore.googleapis.com";
  26. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  27. // Retrieves the File with the given uri.
  28. // returns a stream of bytes to be stitched together in order.
  29. //
  30. // An error will be reported in the following cases:
  31. // - If the File is not found.
  32. // - If the given File uri is badly formatted.
  33. rpc GetFile(GetFileRequest) returns (stream GetFileResponse) {
  34. option (google.api.http) = {
  35. get: "/v2/{uri=file/*}"
  36. };
  37. }
  38. // Retrieves the tail of a File with the given uri.
  39. //
  40. // An error will be reported in the following cases:
  41. // - If the File is not found.
  42. // - If the given File uri is badly formatted.
  43. rpc GetFileTail(GetFileTailRequest) returns (GetFileTailResponse) {
  44. option (google.api.http) = {
  45. get: "/v2/{uri=file/tail/*}"
  46. };
  47. }
  48. }
  49. // Request object for GetFile
  50. message GetFileRequest {
  51. // This corresponds to the uri field in the File message.
  52. string uri = 1;
  53. // The offset for the first byte to return in the read, relative to the start
  54. // of the resource.
  55. //
  56. // A `read_offset` that is negative or greater than the size of the resource
  57. // will cause an `OUT_OF_RANGE` error.
  58. int64 read_offset = 2;
  59. // The maximum number of `data` bytes the server is allowed to return in the
  60. // sum of all `ReadResponse` messages. A `read_limit` of zero indicates that
  61. // there is no limit, and a negative `read_limit` will cause an error.
  62. //
  63. // If the stream returns fewer bytes than allowed by the `read_limit` and no
  64. // error occurred, the stream includes all data from the `read_offset` to the
  65. // end of the resource.
  66. int64 read_limit = 3;
  67. // Only applies if the referenced file is a known archive type (ar, jar, zip)
  68. // The above read_offset and read_limit fields are applied to this entry.
  69. // If this file is not an archive, INVALID_ARGUMENT is thrown.
  70. string archive_entry = 4;
  71. }
  72. // Response object for GetFile
  73. message GetFileResponse {
  74. // The file data.
  75. bytes data = 1;
  76. }
  77. // Request object for GetFileTail
  78. message GetFileTailRequest {
  79. // This corresponds to the uri field in the File message.
  80. string uri = 1;
  81. // The offset for the first byte to return in the read, relative to the end
  82. // of the resource.
  83. //
  84. // A `read_offset` that is negative or greater than the size of the resource
  85. // will cause an `OUT_OF_RANGE` error.
  86. int64 read_offset = 2;
  87. // The maximum number of `data` bytes the server is allowed to return. The
  88. // server will return bytes starting from the tail of the file.
  89. //
  90. // A `read_limit` of zero indicates that there is no limit, and a negative
  91. // `read_limit` will cause an error.
  92. int64 read_limit = 3;
  93. // Only applies if the referenced file is a known archive type (ar, jar, zip)
  94. // The above read_offset and read_limit fields are applied to this entry.
  95. // If this file is not an archive, INVALID_ARGUMENT is thrown.
  96. string archive_entry = 4;
  97. }
  98. // Response object for GetFileTail
  99. message GetFileTailResponse {
  100. // The file data, encoded with UTF-8.
  101. bytes data = 1;
  102. }