service_service.proto 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  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.monitoring.v3;
  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/monitoring/v3/service.proto";
  21. import "google/protobuf/empty.proto";
  22. import "google/protobuf/field_mask.proto";
  23. option csharp_namespace = "Google.Cloud.Monitoring.V3";
  24. option go_package = "google.golang.org/genproto/googleapis/monitoring/v3;monitoring";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "ServiceMonitoringServiceProto";
  27. option java_package = "com.google.monitoring.v3";
  28. option php_namespace = "Google\\Cloud\\Monitoring\\V3";
  29. option ruby_package = "Google::Cloud::Monitoring::V3";
  30. // The Cloud Monitoring Service-Oriented Monitoring API has endpoints for
  31. // managing and querying aspects of a workspace's services. These include the
  32. // `Service`'s monitored resources, its Service-Level Objectives, and a taxonomy
  33. // of categorized Health Metrics.
  34. service ServiceMonitoringService {
  35. option (google.api.default_host) = "monitoring.googleapis.com";
  36. option (google.api.oauth_scopes) =
  37. "https://www.googleapis.com/auth/cloud-platform,"
  38. "https://www.googleapis.com/auth/monitoring,"
  39. "https://www.googleapis.com/auth/monitoring.read";
  40. // Create a `Service`.
  41. rpc CreateService(CreateServiceRequest) returns (Service) {
  42. option (google.api.http) = {
  43. post: "/v3/{parent=*/*}/services"
  44. body: "service"
  45. };
  46. option (google.api.method_signature) = "parent,service";
  47. }
  48. // Get the named `Service`.
  49. rpc GetService(GetServiceRequest) returns (Service) {
  50. option (google.api.http) = {
  51. get: "/v3/{name=*/*/services/*}"
  52. };
  53. option (google.api.method_signature) = "name";
  54. }
  55. // List `Service`s for this workspace.
  56. rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {
  57. option (google.api.http) = {
  58. get: "/v3/{parent=*/*}/services"
  59. };
  60. option (google.api.method_signature) = "parent";
  61. }
  62. // Update this `Service`.
  63. rpc UpdateService(UpdateServiceRequest) returns (Service) {
  64. option (google.api.http) = {
  65. patch: "/v3/{service.name=*/*/services/*}"
  66. body: "service"
  67. };
  68. option (google.api.method_signature) = "service";
  69. }
  70. // Soft delete this `Service`.
  71. rpc DeleteService(DeleteServiceRequest) returns (google.protobuf.Empty) {
  72. option (google.api.http) = {
  73. delete: "/v3/{name=*/*/services/*}"
  74. };
  75. option (google.api.method_signature) = "name";
  76. }
  77. // Create a `ServiceLevelObjective` for the given `Service`.
  78. rpc CreateServiceLevelObjective(CreateServiceLevelObjectiveRequest) returns (ServiceLevelObjective) {
  79. option (google.api.http) = {
  80. post: "/v3/{parent=*/*/services/*}/serviceLevelObjectives"
  81. body: "service_level_objective"
  82. };
  83. option (google.api.method_signature) = "parent,service_level_objective";
  84. }
  85. // Get a `ServiceLevelObjective` by name.
  86. rpc GetServiceLevelObjective(GetServiceLevelObjectiveRequest) returns (ServiceLevelObjective) {
  87. option (google.api.http) = {
  88. get: "/v3/{name=*/*/services/*/serviceLevelObjectives/*}"
  89. };
  90. option (google.api.method_signature) = "name";
  91. }
  92. // List the `ServiceLevelObjective`s for the given `Service`.
  93. rpc ListServiceLevelObjectives(ListServiceLevelObjectivesRequest) returns (ListServiceLevelObjectivesResponse) {
  94. option (google.api.http) = {
  95. get: "/v3/{parent=*/*/services/*}/serviceLevelObjectives"
  96. };
  97. option (google.api.method_signature) = "parent";
  98. }
  99. // Update the given `ServiceLevelObjective`.
  100. rpc UpdateServiceLevelObjective(UpdateServiceLevelObjectiveRequest) returns (ServiceLevelObjective) {
  101. option (google.api.http) = {
  102. patch: "/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}"
  103. body: "service_level_objective"
  104. };
  105. option (google.api.method_signature) = "service_level_objective";
  106. }
  107. // Delete the given `ServiceLevelObjective`.
  108. rpc DeleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest) returns (google.protobuf.Empty) {
  109. option (google.api.http) = {
  110. delete: "/v3/{name=*/*/services/*/serviceLevelObjectives/*}"
  111. };
  112. option (google.api.method_signature) = "name";
  113. }
  114. }
  115. // The `CreateService` request.
  116. message CreateServiceRequest {
  117. // Required. Resource [name](https://cloud.google.com/monitoring/api/v3#project_name) of
  118. // the parent workspace. The format is:
  119. //
  120. // projects/[PROJECT_ID_OR_NUMBER]
  121. string parent = 1 [
  122. (google.api.field_behavior) = REQUIRED,
  123. (google.api.resource_reference) = {
  124. child_type: "monitoring.googleapis.com/Service"
  125. }
  126. ];
  127. // Optional. The Service id to use for this Service. If omitted, an id will be
  128. // generated instead. Must match the pattern `[a-z0-9\-]+`
  129. string service_id = 3;
  130. // Required. The `Service` to create.
  131. Service service = 2 [(google.api.field_behavior) = REQUIRED];
  132. }
  133. // The `GetService` request.
  134. message GetServiceRequest {
  135. // Required. Resource name of the `Service`. The format is:
  136. //
  137. // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
  138. string name = 1 [
  139. (google.api.field_behavior) = REQUIRED,
  140. (google.api.resource_reference) = {
  141. type: "monitoring.googleapis.com/Service"
  142. }
  143. ];
  144. }
  145. // The `ListServices` request.
  146. message ListServicesRequest {
  147. // Required. Resource name of the parent containing the listed services, either a
  148. // [project](https://cloud.google.com/monitoring/api/v3#project_name) or a
  149. // Monitoring Workspace. The formats are:
  150. //
  151. // projects/[PROJECT_ID_OR_NUMBER]
  152. // workspaces/[HOST_PROJECT_ID_OR_NUMBER]
  153. string parent = 1 [
  154. (google.api.field_behavior) = REQUIRED,
  155. (google.api.resource_reference) = {
  156. child_type: "monitoring.googleapis.com/Service"
  157. }
  158. ];
  159. // A filter specifying what `Service`s to return. The filter currently
  160. // supports the following fields:
  161. //
  162. // - `identifier_case`
  163. // - `app_engine.module_id`
  164. // - `cloud_endpoints.service` (reserved for future use)
  165. // - `mesh_istio.mesh_uid`
  166. // - `mesh_istio.service_namespace`
  167. // - `mesh_istio.service_name`
  168. // - `cluster_istio.location` (deprecated)
  169. // - `cluster_istio.cluster_name` (deprecated)
  170. // - `cluster_istio.service_namespace` (deprecated)
  171. // - `cluster_istio.service_name` (deprecated)
  172. //
  173. // `identifier_case` refers to which option in the identifier oneof is
  174. // populated. For example, the filter `identifier_case = "CUSTOM"` would match
  175. // all services with a value for the `custom` field. Valid options are
  176. // "CUSTOM", "APP_ENGINE", "MESH_ISTIO", plus "CLUSTER_ISTIO" (deprecated)
  177. // and "CLOUD_ENDPOINTS" (reserved for future use).
  178. string filter = 2;
  179. // A non-negative number that is the maximum number of results to return.
  180. // When 0, use default page size.
  181. int32 page_size = 3;
  182. // If this field is not empty then it must contain the `nextPageToken` value
  183. // returned by a previous call to this method. Using this field causes the
  184. // method to return additional results from the previous method call.
  185. string page_token = 4;
  186. }
  187. // The `ListServices` response.
  188. message ListServicesResponse {
  189. // The `Service`s matching the specified filter.
  190. repeated Service services = 1;
  191. // If there are more results than have been returned, then this field is set
  192. // to a non-empty value. To see the additional results,
  193. // use that value as `page_token` in the next call to this method.
  194. string next_page_token = 2;
  195. }
  196. // The `UpdateService` request.
  197. message UpdateServiceRequest {
  198. // Required. The `Service` to draw updates from.
  199. // The given `name` specifies the resource to update.
  200. Service service = 1 [(google.api.field_behavior) = REQUIRED];
  201. // A set of field paths defining which fields to use for the update.
  202. google.protobuf.FieldMask update_mask = 2;
  203. }
  204. // The `DeleteService` request.
  205. message DeleteServiceRequest {
  206. // Required. Resource name of the `Service` to delete. The format is:
  207. //
  208. // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
  209. string name = 1 [
  210. (google.api.field_behavior) = REQUIRED,
  211. (google.api.resource_reference) = {
  212. type: "monitoring.googleapis.com/Service"
  213. }
  214. ];
  215. }
  216. // The `CreateServiceLevelObjective` request.
  217. message CreateServiceLevelObjectiveRequest {
  218. // Required. Resource name of the parent `Service`. The format is:
  219. //
  220. // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
  221. string parent = 1 [
  222. (google.api.field_behavior) = REQUIRED,
  223. (google.api.resource_reference) = {
  224. type: "monitoring.googleapis.com/Service"
  225. }
  226. ];
  227. // Optional. The ServiceLevelObjective id to use for this
  228. // ServiceLevelObjective. If omitted, an id will be generated instead. Must
  229. // match the pattern `[a-z0-9\-]+`
  230. string service_level_objective_id = 3;
  231. // Required. The `ServiceLevelObjective` to create.
  232. // The provided `name` will be respected if no `ServiceLevelObjective` exists
  233. // with this name.
  234. ServiceLevelObjective service_level_objective = 2 [(google.api.field_behavior) = REQUIRED];
  235. }
  236. // The `GetServiceLevelObjective` request.
  237. message GetServiceLevelObjectiveRequest {
  238. // Required. Resource name of the `ServiceLevelObjective` to get. The format is:
  239. //
  240. // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME]
  241. string name = 1 [
  242. (google.api.field_behavior) = REQUIRED,
  243. (google.api.resource_reference) = {
  244. type: "monitoring.googleapis.com/ServiceLevelObjective"
  245. }
  246. ];
  247. // View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the
  248. // `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
  249. // `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
  250. // `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
  251. ServiceLevelObjective.View view = 2;
  252. }
  253. // The `ListServiceLevelObjectives` request.
  254. message ListServiceLevelObjectivesRequest {
  255. // Required. Resource name of the parent containing the listed SLOs, either a
  256. // project or a Monitoring Workspace. The formats are:
  257. //
  258. // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
  259. // workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/-
  260. string parent = 1 [
  261. (google.api.field_behavior) = REQUIRED,
  262. (google.api.resource_reference) = {
  263. type: "monitoring.googleapis.com/Service"
  264. }
  265. ];
  266. // A filter specifying what `ServiceLevelObjective`s to return.
  267. string filter = 2;
  268. // A non-negative number that is the maximum number of results to return.
  269. // When 0, use default page size.
  270. int32 page_size = 3;
  271. // If this field is not empty then it must contain the `nextPageToken` value
  272. // returned by a previous call to this method. Using this field causes the
  273. // method to return additional results from the previous method call.
  274. string page_token = 4;
  275. // View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each
  276. // `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the
  277. // `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the
  278. // `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed.
  279. ServiceLevelObjective.View view = 5;
  280. }
  281. // The `ListServiceLevelObjectives` response.
  282. message ListServiceLevelObjectivesResponse {
  283. // The `ServiceLevelObjective`s matching the specified filter.
  284. repeated ServiceLevelObjective service_level_objectives = 1;
  285. // If there are more results than have been returned, then this field is set
  286. // to a non-empty value. To see the additional results,
  287. // use that value as `page_token` in the next call to this method.
  288. string next_page_token = 2;
  289. }
  290. // The `UpdateServiceLevelObjective` request.
  291. message UpdateServiceLevelObjectiveRequest {
  292. // Required. The `ServiceLevelObjective` to draw updates from.
  293. // The given `name` specifies the resource to update.
  294. ServiceLevelObjective service_level_objective = 1 [(google.api.field_behavior) = REQUIRED];
  295. // A set of field paths defining which fields to use for the update.
  296. google.protobuf.FieldMask update_mask = 2;
  297. }
  298. // The `DeleteServiceLevelObjective` request.
  299. message DeleteServiceLevelObjectiveRequest {
  300. // Required. Resource name of the `ServiceLevelObjective` to delete. The format is:
  301. //
  302. // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME]
  303. string name = 1 [
  304. (google.api.field_behavior) = REQUIRED,
  305. (google.api.resource_reference) = {
  306. type: "monitoring.googleapis.com/ServiceLevelObjective"
  307. }
  308. ];
  309. }