async_model.proto 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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.optimization.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/protobuf/timestamp.proto";
  18. option go_package = "google.golang.org/genproto/googleapis/cloud/optimization/v1;optimization";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "AsyncModelProto";
  21. option java_package = "com.google.cloud.optimization.v1";
  22. // The desired input location information.
  23. message InputConfig {
  24. // The location of the input model in cloud storage.
  25. // Required.
  26. oneof source {
  27. // The Google Cloud Storage location to read the input from. This must be a
  28. // single file.
  29. GcsSource gcs_source = 1;
  30. }
  31. // The input data format that used to store the model in Cloud Storage.
  32. DataFormat data_format = 2;
  33. }
  34. // The desired output location.
  35. message OutputConfig {
  36. // The location of the output result in cloud storage.
  37. // Required.
  38. oneof destination {
  39. // The Google Cloud Storage location to write the output to.
  40. GcsDestination gcs_destination = 1;
  41. }
  42. // The output data format that used to store the results in Cloud Storage.
  43. DataFormat data_format = 2;
  44. }
  45. // The Google Cloud Storage location where the input file will be read from.
  46. message GcsSource {
  47. // Required. URI of the Google Cloud Storage location.
  48. string uri = 1 [(google.api.field_behavior) = REQUIRED];
  49. }
  50. // The Google Cloud Storage location where the output file will be written to.
  51. message GcsDestination {
  52. // Required. URI of the Google Cloud Storage location.
  53. string uri = 1 [(google.api.field_behavior) = REQUIRED];
  54. }
  55. // The long running operation metadata for async model related methods.
  56. message AsyncModelMetadata {
  57. // Possible states of the operation.
  58. enum State {
  59. // The default value. This value is used if the state is omitted.
  60. STATE_UNSPECIFIED = 0;
  61. // Request is being processed.
  62. RUNNING = 1;
  63. // The operation completed successfully.
  64. SUCCEEDED = 2;
  65. // The operation was cancelled.
  66. CANCELLED = 3;
  67. // The operation has failed.
  68. FAILED = 4;
  69. }
  70. // The state of the current operation.
  71. State state = 1;
  72. // A message providing more details about the current state of the operation.
  73. // For example, the error message if the operation is failed.
  74. string state_message = 2;
  75. // The creation time of the operation.
  76. google.protobuf.Timestamp create_time = 3;
  77. // The last update time of the operation.
  78. google.protobuf.Timestamp update_time = 4;
  79. }
  80. // Data formats for input and output files.
  81. enum DataFormat {
  82. // Default value.
  83. DATA_FORMAT_UNSPECIFIED = 0;
  84. // Input data in json format.
  85. JSON = 1;
  86. // Input data in string format.
  87. STRING = 2;
  88. }