ids.proto 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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.cloud.ids.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/longrunning/operations.proto";
  21. import "google/protobuf/timestamp.proto";
  22. option go_package = "google.golang.org/genproto/googleapis/cloud/ids/v1;ids";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "IdsProto";
  25. option java_package = "com.google.cloud.ids.v1";
  26. option ruby_package = "Google::Cloud::IDS::V1";
  27. // The IDS Service
  28. service IDS {
  29. option (google.api.default_host) = "ids.googleapis.com";
  30. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  31. // Lists Endpoints in a given project and location.
  32. rpc ListEndpoints(ListEndpointsRequest) returns (ListEndpointsResponse) {
  33. option (google.api.http) = {
  34. get: "/v1/{parent=projects/*/locations/*}/endpoints"
  35. };
  36. option (google.api.method_signature) = "parent";
  37. }
  38. // Gets details of a single Endpoint.
  39. rpc GetEndpoint(GetEndpointRequest) returns (Endpoint) {
  40. option (google.api.http) = {
  41. get: "/v1/{name=projects/*/locations/*/endpoints/*}"
  42. };
  43. option (google.api.method_signature) = "name";
  44. }
  45. // Creates a new Endpoint in a given project and location.
  46. rpc CreateEndpoint(CreateEndpointRequest) returns (google.longrunning.Operation) {
  47. option (google.api.http) = {
  48. post: "/v1/{parent=projects/*/locations/*}/endpoints"
  49. body: "endpoint"
  50. };
  51. option (google.api.method_signature) = "parent,endpoint,endpoint_id";
  52. option (google.longrunning.operation_info) = {
  53. response_type: "Endpoint"
  54. metadata_type: "OperationMetadata"
  55. };
  56. }
  57. // Deletes a single Endpoint.
  58. rpc DeleteEndpoint(DeleteEndpointRequest) returns (google.longrunning.Operation) {
  59. option (google.api.http) = {
  60. delete: "/v1/{name=projects/*/locations/*/endpoints/*}"
  61. };
  62. option (google.api.method_signature) = "name";
  63. option (google.longrunning.operation_info) = {
  64. response_type: "google.protobuf.Empty"
  65. metadata_type: "OperationMetadata"
  66. };
  67. }
  68. }
  69. // Endpoint describes a single IDS endpoint. It defines a forwarding rule to
  70. // which packets can be sent for IDS inspection.
  71. message Endpoint {
  72. option (google.api.resource) = {
  73. type: "ids.googleapis.com/Endpoint"
  74. pattern: "projects/{project}/locations/{location}/endpoints/{endpoint}"
  75. };
  76. // Threat severity levels.
  77. enum Severity {
  78. // Not set.
  79. SEVERITY_UNSPECIFIED = 0;
  80. // Informational alerts.
  81. INFORMATIONAL = 1;
  82. // Low severity alerts.
  83. LOW = 2;
  84. // Medium severity alerts.
  85. MEDIUM = 3;
  86. // High severity alerts.
  87. HIGH = 4;
  88. // Critical severity alerts.
  89. CRITICAL = 5;
  90. }
  91. // Endpoint state
  92. enum State {
  93. // Not set.
  94. STATE_UNSPECIFIED = 0;
  95. // Being created.
  96. CREATING = 1;
  97. // Active and ready for traffic.
  98. READY = 2;
  99. // Being deleted.
  100. DELETING = 3;
  101. }
  102. // Output only. The name of the endpoint.
  103. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  104. // Output only. The create time timestamp.
  105. google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  106. // Output only. The update time timestamp.
  107. google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  108. // The labels of the endpoint.
  109. map<string, string> labels = 4;
  110. // Required. The fully qualified URL of the network to which the IDS Endpoint is
  111. // attached.
  112. string network = 5 [(google.api.field_behavior) = REQUIRED];
  113. // Output only. The fully qualified URL of the endpoint's ILB Forwarding Rule.
  114. string endpoint_forwarding_rule = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  115. // Output only. The IP address of the IDS Endpoint's ILB.
  116. string endpoint_ip = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  117. // User-provided description of the endpoint
  118. string description = 8;
  119. // Required. Lowest threat severity that this endpoint will alert on.
  120. Severity severity = 9 [(google.api.field_behavior) = REQUIRED];
  121. // Output only. Current state of the endpoint.
  122. State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  123. // Whether the endpoint should report traffic logs in addition to threat logs.
  124. bool traffic_logs = 13;
  125. }
  126. message ListEndpointsRequest {
  127. // Required. The parent, which owns this collection of endpoints.
  128. string parent = 1 [
  129. (google.api.field_behavior) = REQUIRED,
  130. (google.api.resource_reference) = {
  131. child_type: "ids.googleapis.com/Endpoint"
  132. }
  133. ];
  134. // Optional. The maximum number of endpoints to return. The service may return fewer
  135. // than this value.
  136. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  137. // Optional. A page token, received from a previous `ListEndpoints` call.
  138. // Provide this to retrieve the subsequent page.
  139. //
  140. // When paginating, all other parameters provided to `ListEndpoints` must
  141. // match the call that provided the page token.
  142. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  143. // Optional. The filter expression, following the syntax outlined in
  144. // https://google.aip.dev/160.
  145. string filter = 4 [(google.api.field_behavior) = OPTIONAL];
  146. // Optional. One or more fields to compare and use to sort the output.
  147. // See https://google.aip.dev/132#ordering.
  148. string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
  149. }
  150. message ListEndpointsResponse {
  151. // The list of endpoints response.
  152. repeated Endpoint endpoints = 1;
  153. // A token, which can be sent as `page_token` to retrieve the next page.
  154. // If this field is omitted, there are no subsequent pages.
  155. string next_page_token = 2;
  156. // Locations that could not be reached.
  157. repeated string unreachable = 3;
  158. }
  159. message GetEndpointRequest {
  160. // Required. The name of the endpoint to retrieve.
  161. // Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`
  162. string name = 1 [
  163. (google.api.field_behavior) = REQUIRED,
  164. (google.api.resource_reference) = {
  165. type: "ids.googleapis.com/Endpoint"
  166. }
  167. ];
  168. }
  169. message CreateEndpointRequest {
  170. // Required. The endpoint's parent.
  171. string parent = 1 [
  172. (google.api.field_behavior) = REQUIRED,
  173. (google.api.resource_reference) = {
  174. child_type: "ids.googleapis.com/Endpoint"
  175. }
  176. ];
  177. // Required. The endpoint identifier. This will be part of the endpoint's
  178. // resource name.
  179. // This value must start with a lowercase letter followed by up to 62
  180. // lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
  181. // Values that do not match this pattern will trigger an INVALID_ARGUMENT
  182. // error.
  183. string endpoint_id = 2 [(google.api.field_behavior) = REQUIRED];
  184. // Required. The endpoint to create.
  185. Endpoint endpoint = 3 [(google.api.field_behavior) = REQUIRED];
  186. // An optional request ID to identify requests. Specify a unique request ID
  187. // so that if you must retry your request, the server will know to ignore
  188. // the request if it has already been completed. The server will guarantee
  189. // that for at least 60 minutes since the first request.
  190. //
  191. // For example, consider a situation where you make an initial request and t
  192. // he request times out. If you make the request again with the same request
  193. // ID, the server can check if original operation with the same request ID
  194. // was received, and if so, will ignore the second request. This prevents
  195. // clients from accidentally creating duplicate commitments.
  196. //
  197. // The request ID must be a valid UUID with the exception that zero UUID is
  198. // not supported (00000000-0000-0000-0000-000000000000).
  199. string request_id = 4;
  200. }
  201. message DeleteEndpointRequest {
  202. // Required. The name of the endpoint to delete.
  203. string name = 1 [
  204. (google.api.field_behavior) = REQUIRED,
  205. (google.api.resource_reference) = {
  206. type: "ids.googleapis.com/Endpoint"
  207. }
  208. ];
  209. // An optional request ID to identify requests. Specify a unique request ID
  210. // so that if you must retry your request, the server will know to ignore
  211. // the request if it has already been completed. The server will guarantee
  212. // that for at least 60 minutes after the first request.
  213. //
  214. // For example, consider a situation where you make an initial request and t
  215. // he request times out. If you make the request again with the same request
  216. // ID, the server can check if original operation with the same request ID
  217. // was received, and if so, will ignore the second request. This prevents
  218. // clients from accidentally creating duplicate commitments.
  219. //
  220. // The request ID must be a valid UUID with the exception that zero UUID is
  221. // not supported (00000000-0000-0000-0000-000000000000).
  222. string request_id = 2;
  223. }
  224. // Represents the metadata of the long-running operation.
  225. message OperationMetadata {
  226. // Output only. The time the operation was created.
  227. google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  228. // Output only. The time the operation finished running.
  229. google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  230. // Output only. Server-defined resource path for the target of the operation.
  231. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  232. // Output only. Name of the verb executed by the operation.
  233. string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  234. // Output only. Human-readable status of the operation, if any.
  235. string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  236. // Output only. Identifies whether the user has requested cancellation
  237. // of the operation. Operations that have successfully been cancelled
  238. // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
  239. // corresponding to `Code.CANCELLED`.
  240. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  241. // Output only. API version used to start the operation.
  242. string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  243. }