storageinsights.proto 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. // Copyright 2022 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.cloud.storageinsights.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/protobuf/empty.proto";
  21. import "google/protobuf/field_mask.proto";
  22. import "google/protobuf/timestamp.proto";
  23. import "google/rpc/status.proto";
  24. import "google/type/date.proto";
  25. import "google/type/datetime.proto";
  26. option csharp_namespace = "Google.Cloud.StorageInsights.V1";
  27. option go_package = "google.golang.org/genproto/googleapis/cloud/storageinsights/v1;storageinsights";
  28. option java_multiple_files = true;
  29. option java_outer_classname = "V1Proto";
  30. option java_package = "com.google.cloud.storageinsights.v1";
  31. option php_namespace = "Google\\Cloud\\StorageInsights\\V1";
  32. option ruby_package = "Google::Cloud::StorageInsights::V1";
  33. // Service describing handlers for resources
  34. service StorageInsights {
  35. option (google.api.default_host) = "storageinsights.googleapis.com";
  36. option (google.api.oauth_scopes) =
  37. "https://www.googleapis.com/auth/cloud-platform";
  38. // Lists ReportConfigs in a given project and location.
  39. rpc ListReportConfigs(ListReportConfigsRequest)
  40. returns (ListReportConfigsResponse) {
  41. option (google.api.http) = {
  42. get: "/v1/{parent=projects/*/locations/*}/reportConfigs"
  43. };
  44. option (google.api.method_signature) = "parent";
  45. }
  46. // Gets details of a single ReportConfig.
  47. rpc GetReportConfig(GetReportConfigRequest) returns (ReportConfig) {
  48. option (google.api.http) = {
  49. get: "/v1/{name=projects/*/locations/*/reportConfigs/*}"
  50. };
  51. option (google.api.method_signature) = "name";
  52. }
  53. // Creates a new ReportConfig in a given project and location.
  54. rpc CreateReportConfig(CreateReportConfigRequest) returns (ReportConfig) {
  55. option (google.api.http) = {
  56. post: "/v1/{parent=projects/*/locations/*}/reportConfigs"
  57. body: "report_config"
  58. };
  59. option (google.api.method_signature) = "parent,report_config";
  60. }
  61. // Updates the parameters of a single ReportConfig.
  62. rpc UpdateReportConfig(UpdateReportConfigRequest) returns (ReportConfig) {
  63. option (google.api.http) = {
  64. patch: "/v1/{report_config.name=projects/*/locations/*/reportConfigs/*}"
  65. body: "report_config"
  66. };
  67. option (google.api.method_signature) = "report_config,update_mask";
  68. }
  69. // Deletes a single ReportConfig.
  70. rpc DeleteReportConfig(DeleteReportConfigRequest)
  71. returns (google.protobuf.Empty) {
  72. option (google.api.http) = {
  73. delete: "/v1/{name=projects/*/locations/*/reportConfigs/*}"
  74. };
  75. option (google.api.method_signature) = "name";
  76. }
  77. // Lists ReportDetails in a given project and location.
  78. rpc ListReportDetails(ListReportDetailsRequest)
  79. returns (ListReportDetailsResponse) {
  80. option (google.api.http) = {
  81. get: "/v1/{parent=projects/*/locations/*/reportConfigs/*}/reportDetails"
  82. };
  83. option (google.api.method_signature) = "parent";
  84. }
  85. // Gets details of a single ReportDetail.
  86. rpc GetReportDetail(GetReportDetailRequest) returns (ReportDetail) {
  87. option (google.api.http) = {
  88. get: "/v1/{name=projects/*/locations/*/reportConfigs/*/reportDetails/*}"
  89. };
  90. option (google.api.method_signature) = "name";
  91. }
  92. }
  93. // Message for requesting list of ReportConfigs
  94. message ListReportConfigsRequest {
  95. // Required. Parent value for ListReportConfigsRequest
  96. string parent = 1 [
  97. (google.api.field_behavior) = REQUIRED,
  98. (google.api.resource_reference) = {
  99. child_type: "storageinsights.googleapis.com/ReportConfig"
  100. }
  101. ];
  102. // Requested page size. Server may return fewer items than requested.
  103. // If unspecified, server will pick an appropriate default.
  104. int32 page_size = 2;
  105. // A token identifying a page of results the server should return.
  106. string page_token = 3;
  107. // Filtering results
  108. string filter = 4;
  109. // Hint for how to order the results
  110. string order_by = 5;
  111. }
  112. // Message for response to listing ReportConfigs
  113. message ListReportConfigsResponse {
  114. // The list of ReportConfig
  115. repeated ReportConfig report_configs = 1;
  116. // A token identifying a page of results the server should return.
  117. string next_page_token = 2;
  118. // Locations that could not be reached.
  119. repeated string unreachable = 3;
  120. }
  121. // Message for getting a ReportConfig
  122. message GetReportConfigRequest {
  123. // Required. Name of the resource
  124. string name = 1 [
  125. (google.api.field_behavior) = REQUIRED,
  126. (google.api.resource_reference) = {
  127. type: "storageinsights.googleapis.com/ReportConfig"
  128. }
  129. ];
  130. }
  131. // Message for creating a ReportConfig
  132. message CreateReportConfigRequest {
  133. // Required. Value for parent.
  134. string parent = 1 [
  135. (google.api.field_behavior) = REQUIRED,
  136. (google.api.resource_reference) = {
  137. child_type: "storageinsights.googleapis.com/ReportConfig"
  138. }
  139. ];
  140. // Required. The resource being created
  141. ReportConfig report_config = 3 [(google.api.field_behavior) = REQUIRED];
  142. // Optional. An optional request ID to identify requests. Specify a unique
  143. // request ID so that if you must retry your request, the server will know to
  144. // ignore the request if it has already been completed. The server will
  145. // guarantee that for at least 60 minutes since the first request.
  146. //
  147. // For example, consider a situation where you make an initial request and t
  148. // he request times out. If you make the request again with the same request
  149. // ID, the server can check if original operation with the same request ID
  150. // was received, and if so, will ignore the second request. This prevents
  151. // clients from accidentally creating duplicate commitments.
  152. //
  153. // The request ID must be a valid UUID with the exception that zero UUID is
  154. // not supported (00000000-0000-0000-0000-000000000000).
  155. string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
  156. }
  157. // Message for updating a ReportConfig
  158. message UpdateReportConfigRequest {
  159. // Required. Field mask is used to specify the fields to be overwritten in the
  160. // ReportConfig resource by the update.
  161. // The fields specified in the update_mask are relative to the resource, not
  162. // the full request. A field will be overwritten if it is in the mask. If the
  163. // user does not provide a mask then all fields will be overwritten.
  164. google.protobuf.FieldMask update_mask = 1
  165. [(google.api.field_behavior) = REQUIRED];
  166. // Required. The resource being updated
  167. ReportConfig report_config = 2 [(google.api.field_behavior) = REQUIRED];
  168. // Optional. An optional request ID to identify requests. Specify a unique
  169. // request ID so that if you must retry your request, the server will know to
  170. // ignore the request if it has already been completed. The server will
  171. // guarantee that for at least 60 minutes since the first request.
  172. //
  173. // For example, consider a situation where you make an initial request and t
  174. // he request times out. If you make the request again with the same request
  175. // ID, the server can check if original operation with the same request ID
  176. // was received, and if so, will ignore the second request. This prevents
  177. // clients from accidentally creating duplicate commitments.
  178. //
  179. // The request ID must be a valid UUID with the exception that zero UUID is
  180. // not supported (00000000-0000-0000-0000-000000000000).
  181. string request_id = 3 [(google.api.field_behavior) = OPTIONAL];
  182. }
  183. // Message for deleting a ReportConfig
  184. message DeleteReportConfigRequest {
  185. // Required. Name of the resource
  186. string name = 1 [
  187. (google.api.field_behavior) = REQUIRED,
  188. (google.api.resource_reference) = {
  189. type: "storageinsights.googleapis.com/ReportConfig"
  190. }
  191. ];
  192. // Optional. If set, all ReportDetails for this ReportConfig will be deleted.
  193. bool force = 2 [(google.api.field_behavior) = OPTIONAL];
  194. // Optional. An optional request ID to identify requests. Specify a unique
  195. // request ID so that if you must retry your request, the server will know to
  196. // ignore the request if it has already been completed. The server will
  197. // guarantee that for at least 60 minutes after the first request.
  198. //
  199. // For example, consider a situation where you make an initial request and t
  200. // he request times out. If you make the request again with the same request
  201. // ID, the server can check if original operation with the same request ID
  202. // was received, and if so, will ignore the second request. This prevents
  203. // clients from accidentally creating duplicate commitments.
  204. //
  205. // The request ID must be a valid UUID with the exception that zero UUID is
  206. // not supported (00000000-0000-0000-0000-000000000000).
  207. string request_id = 3 [(google.api.field_behavior) = OPTIONAL];
  208. }
  209. // Message describing ReportDetail object. ReportDetail represents metadata of
  210. // generated reports for a ReportConfig.
  211. // Next ID: 8
  212. message ReportDetail {
  213. option (google.api.resource) = {
  214. type: "storageinsights.googleapis.com/ReportDetail"
  215. pattern: "projects/{project}/locations/{location}/reportConfigs/{report_config}/reportDetails/{report_detail}"
  216. };
  217. // Different metrics associated with the generated report.
  218. message Metrics {
  219. // Count of Cloud Storage objects which are part of the report.
  220. int64 processed_records_count = 1;
  221. }
  222. // Name of resource. It will be of form
  223. // projects/<project>/locations/<location>/reportConfigs/<report-config-id>/reportDetails/<report-detail-id>.
  224. string name = 1;
  225. // The snapshot time.
  226. // All the report data is referenced at this point of time.
  227. google.protobuf.Timestamp snapshot_time = 2;
  228. // Generated report's full path with name. It will be of the form
  229. // destination_bucket/<destination_path>/<report>.
  230. repeated string report_names = 3;
  231. // Status of the ReportDetail.
  232. google.rpc.Status status = 4;
  233. // Labels as key value pairs
  234. map<string, string> labels = 5;
  235. // The date for which report is generated. The time part of target_datetime
  236. // will be zero till we support multiple reports per day.
  237. google.type.DateTime target_datetime = 6;
  238. // Metrics of the report.
  239. Metrics report_metrics = 7;
  240. }
  241. // Message for requesting list of ReportDetails
  242. message ListReportDetailsRequest {
  243. // Required. Parent value for ListReportDetailsRequest
  244. string parent = 1 [
  245. (google.api.field_behavior) = REQUIRED,
  246. (google.api.resource_reference) = {
  247. child_type: "storageinsights.googleapis.com/ReportDetail"
  248. }
  249. ];
  250. // Requested page size. Server may return fewer items than requested.
  251. // If unspecified, server will pick an appropriate default.
  252. int32 page_size = 2;
  253. // A token identifying a page of results the server should return.
  254. string page_token = 3;
  255. // Filtering results
  256. string filter = 4;
  257. // Hint for how to order the results
  258. string order_by = 5;
  259. }
  260. // Message for response to listing ReportDetails
  261. message ListReportDetailsResponse {
  262. // The list of ReportDetail
  263. repeated ReportDetail report_details = 1;
  264. // A token identifying a page of results the server should return.
  265. string next_page_token = 2;
  266. // Locations that could not be reached.
  267. repeated string unreachable = 3;
  268. }
  269. // Message for getting a ReportDetail
  270. message GetReportDetailRequest {
  271. // Required. Name of the resource
  272. string name = 1 [
  273. (google.api.field_behavior) = REQUIRED,
  274. (google.api.resource_reference) = {
  275. type: "storageinsights.googleapis.com/ReportDetail"
  276. }
  277. ];
  278. }
  279. // Represents the metadata of the long-running operation.
  280. message OperationMetadata {
  281. // Output only. The time the operation was created.
  282. google.protobuf.Timestamp create_time = 1
  283. [(google.api.field_behavior) = OUTPUT_ONLY];
  284. // Output only. The time the operation finished running.
  285. google.protobuf.Timestamp end_time = 2
  286. [(google.api.field_behavior) = OUTPUT_ONLY];
  287. // Output only. Server-defined resource path for the target of the operation.
  288. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  289. // Output only. Name of the verb executed by the operation.
  290. string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  291. // Output only. Human-readable status of the operation, if any.
  292. string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  293. // Output only. Identifies whether the user has requested cancellation
  294. // of the operation. Operations that have been cancelled successfully
  295. // have [Operation.error][] value with a
  296. // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
  297. // `Code.CANCELLED`.
  298. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  299. // Output only. API version used to start the operation.
  300. string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  301. }
  302. // ReportConfig Resource:
  303. //
  304. // Options to setup frequency of report generation.
  305. message FrequencyOptions {
  306. // This ENUM specifies possible frequencies of report generation.
  307. enum Frequency {
  308. // Unspecified.
  309. FREQUENCY_UNSPECIFIED = 0;
  310. // Report will be generated daily.
  311. DAILY = 1;
  312. // Report will be generated weekly.
  313. WEEKLY = 2;
  314. }
  315. // Frequency of report generation.
  316. Frequency frequency = 1;
  317. // The date from which report generation should start.
  318. // UTC time zone.
  319. google.type.Date start_date = 2;
  320. // The date on which report generation should stop (Inclusive).
  321. // UTC time zone.
  322. google.type.Date end_date = 3;
  323. }
  324. // Options to configure CSV formatted reports.
  325. message CSVOptions {
  326. // Record separator characters in CSV.
  327. string record_separator = 1;
  328. // Delimiter characters in CSV.
  329. string delimiter = 2;
  330. // If set, will include a header row in the CSV report.
  331. bool header_required = 3;
  332. }
  333. // Options to filter data on storage systems.
  334. // Next ID: 2
  335. message CloudStorageFilters {
  336. // Bucket for which the report will be generated.
  337. string bucket = 1;
  338. }
  339. // Options to store reports in storage systems.
  340. // Next ID: 3
  341. message CloudStorageDestinationOptions {
  342. // Destination bucket.
  343. string bucket = 1;
  344. // Destination path is the path in the bucket where the report should be
  345. // generated.
  346. string destination_path = 2;
  347. }
  348. // Report specification for exporting object metadata.
  349. // Next ID: 4
  350. message ObjectMetadataReportOptions {
  351. // Metadata fields to be included in the report.
  352. repeated string metadata_fields = 1;
  353. // Filter options for storage systems.
  354. oneof filter {
  355. // Cloud Storage as the storage system.
  356. CloudStorageFilters storage_filters = 2;
  357. }
  358. // Options on destination for storage systems.
  359. oneof destination_options {
  360. // Cloud Storage as the storage system.
  361. CloudStorageDestinationOptions storage_destination_options = 3;
  362. }
  363. }
  364. // Message describing ReportConfig object. ReportConfig is the configuration to
  365. // generate reports.
  366. // Next ID: 12
  367. message ReportConfig {
  368. option (google.api.resource) = {
  369. type: "storageinsights.googleapis.com/ReportConfig"
  370. pattern: "projects/{project}/locations/{location}/reportConfigs/{report_config}"
  371. };
  372. // name of resource. It will be of form
  373. // projects/<project>/locations/<location>/reportConfigs/<report-config-id>.
  374. string name = 1;
  375. // Output only. [Output only] Create time stamp
  376. google.protobuf.Timestamp create_time = 2
  377. [(google.api.field_behavior) = OUTPUT_ONLY];
  378. // Output only. [Output only] Update time stamp
  379. google.protobuf.Timestamp update_time = 3
  380. [(google.api.field_behavior) = OUTPUT_ONLY];
  381. // The frequency of report generation.
  382. FrequencyOptions frequency_options = 5;
  383. // Format in which report will be published.
  384. oneof report_format {
  385. // Options for CSV formatted reports.
  386. CSVOptions csv_options = 6;
  387. }
  388. // Configuration options for report contents.
  389. oneof report_kind {
  390. // Report for exporting object metadata.
  391. ObjectMetadataReportOptions object_metadata_report_options = 8;
  392. }
  393. // Labels as key value pairs
  394. map<string, string> labels = 10;
  395. // User provided display name which can be empty and limited to 256 characters
  396. // that is editable.
  397. string display_name = 11;
  398. }