osconfig_zonal_service.proto 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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.osconfig.v1alpha;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/resource.proto";
  19. import "google/cloud/osconfig/v1alpha/instance_os_policies_compliance.proto";
  20. import "google/cloud/osconfig/v1alpha/inventory.proto";
  21. import "google/cloud/osconfig/v1alpha/os_policy_assignment_reports.proto";
  22. import "google/cloud/osconfig/v1alpha/os_policy_assignments.proto";
  23. import "google/cloud/osconfig/v1alpha/vulnerability.proto";
  24. import "google/longrunning/operations.proto";
  25. option csharp_namespace = "Google.Cloud.OsConfig.V1Alpha";
  26. option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1alpha;osconfig";
  27. option java_multiple_files = true;
  28. option java_outer_classname = "OsConfigZonalServiceProto";
  29. option java_package = "com.google.cloud.osconfig.v1alpha";
  30. option php_namespace = "Google\\Cloud\\OsConfig\\V1alpha";
  31. option ruby_package = "Google::Cloud::OsConfig::V1alpha";
  32. option (google.api.resource_definition) = {
  33. type: "compute.googleapis.com/Instance"
  34. pattern: "projects/{project}/locations/{location}/instances/{instance}"
  35. };
  36. // Zonal OS Config API
  37. //
  38. // The OS Config service is the server-side component that allows users to
  39. // manage package installations and patch jobs for Compute Engine VM instances.
  40. service OsConfigZonalService {
  41. option (google.api.default_host) = "osconfig.googleapis.com";
  42. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  43. // Create an OS policy assignment.
  44. //
  45. // This method also creates the first revision of the OS policy assignment.
  46. //
  47. // This method returns a long running operation (LRO) that contains the
  48. // rollout details. The rollout can be cancelled by cancelling the LRO.
  49. //
  50. // For more information, see [Method:
  51. // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1alpha/projects.locations.osPolicyAssignments.operations/cancel).
  52. rpc CreateOSPolicyAssignment(CreateOSPolicyAssignmentRequest) returns (google.longrunning.Operation) {
  53. option (google.api.http) = {
  54. post: "/v1alpha/{parent=projects/*/locations/*}/osPolicyAssignments"
  55. body: "os_policy_assignment"
  56. };
  57. option (google.api.method_signature) = "parent,os_policy_assignment,os_policy_assignment_id";
  58. option (google.longrunning.operation_info) = {
  59. response_type: "OSPolicyAssignment"
  60. metadata_type: "OSPolicyAssignmentOperationMetadata"
  61. };
  62. }
  63. // Update an existing OS policy assignment.
  64. //
  65. // This method creates a new revision of the OS policy assignment.
  66. //
  67. // This method returns a long running operation (LRO) that contains the
  68. // rollout details. The rollout can be cancelled by cancelling the LRO.
  69. //
  70. // For more information, see [Method:
  71. // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1alpha/projects.locations.osPolicyAssignments.operations/cancel).
  72. rpc UpdateOSPolicyAssignment(UpdateOSPolicyAssignmentRequest) returns (google.longrunning.Operation) {
  73. option (google.api.http) = {
  74. patch: "/v1alpha/{os_policy_assignment.name=projects/*/locations/*/osPolicyAssignments/*}"
  75. body: "os_policy_assignment"
  76. };
  77. option (google.api.method_signature) = "os_policy_assignment,update_mask";
  78. option (google.longrunning.operation_info) = {
  79. response_type: "OSPolicyAssignment"
  80. metadata_type: "OSPolicyAssignmentOperationMetadata"
  81. };
  82. }
  83. // Retrieve an existing OS policy assignment.
  84. //
  85. // This method always returns the latest revision. In order to retrieve a
  86. // previous revision of the assignment, also provide the revision ID in the
  87. // `name` parameter.
  88. rpc GetOSPolicyAssignment(GetOSPolicyAssignmentRequest) returns (OSPolicyAssignment) {
  89. option (google.api.http) = {
  90. get: "/v1alpha/{name=projects/*/locations/*/osPolicyAssignments/*}"
  91. };
  92. option (google.api.method_signature) = "name";
  93. }
  94. // List the OS policy assignments under the parent resource.
  95. //
  96. // For each OS policy assignment, the latest revision is returned.
  97. rpc ListOSPolicyAssignments(ListOSPolicyAssignmentsRequest) returns (ListOSPolicyAssignmentsResponse) {
  98. option (google.api.http) = {
  99. get: "/v1alpha/{parent=projects/*/locations/*}/osPolicyAssignments"
  100. };
  101. option (google.api.method_signature) = "parent";
  102. }
  103. // List the OS policy assignment revisions for a given OS policy assignment.
  104. rpc ListOSPolicyAssignmentRevisions(ListOSPolicyAssignmentRevisionsRequest) returns (ListOSPolicyAssignmentRevisionsResponse) {
  105. option (google.api.http) = {
  106. get: "/v1alpha/{name=projects/*/locations/*/osPolicyAssignments/*}:listRevisions"
  107. };
  108. option (google.api.method_signature) = "name";
  109. }
  110. // Delete the OS policy assignment.
  111. //
  112. // This method creates a new revision of the OS policy assignment.
  113. //
  114. // This method returns a long running operation (LRO) that contains the
  115. // rollout details. The rollout can be cancelled by cancelling the LRO.
  116. //
  117. // If the LRO completes and is not cancelled, all revisions associated with
  118. // the OS policy assignment are deleted.
  119. //
  120. // For more information, see [Method:
  121. // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1alpha/projects.locations.osPolicyAssignments.operations/cancel).
  122. rpc DeleteOSPolicyAssignment(DeleteOSPolicyAssignmentRequest) returns (google.longrunning.Operation) {
  123. option (google.api.http) = {
  124. delete: "/v1alpha/{name=projects/*/locations/*/osPolicyAssignments/*}"
  125. };
  126. option (google.api.method_signature) = "name";
  127. option (google.longrunning.operation_info) = {
  128. response_type: "google.protobuf.Empty"
  129. metadata_type: "OSPolicyAssignmentOperationMetadata"
  130. };
  131. }
  132. // Get OS policies compliance data for the specified Compute Engine VM
  133. // instance.
  134. rpc GetInstanceOSPoliciesCompliance(GetInstanceOSPoliciesComplianceRequest) returns (InstanceOSPoliciesCompliance) {
  135. option deprecated = true;
  136. option (google.api.http) = {
  137. get: "/v1alpha/{name=projects/*/locations/*/instanceOSPoliciesCompliances/*}"
  138. };
  139. option (google.api.method_signature) = "name";
  140. }
  141. // List OS policies compliance data for all Compute Engine VM instances in the
  142. // specified zone.
  143. rpc ListInstanceOSPoliciesCompliances(ListInstanceOSPoliciesCompliancesRequest) returns (ListInstanceOSPoliciesCompliancesResponse) {
  144. option deprecated = true;
  145. option (google.api.http) = {
  146. get: "/v1alpha/{parent=projects/*/locations/*}/instanceOSPoliciesCompliances"
  147. };
  148. option (google.api.method_signature) = "parent";
  149. }
  150. // Get the OS policy asssignment report for the specified Compute Engine VM
  151. // instance.
  152. rpc GetOSPolicyAssignmentReport(GetOSPolicyAssignmentReportRequest) returns (OSPolicyAssignmentReport) {
  153. option (google.api.http) = {
  154. get: "/v1alpha/{name=projects/*/locations/*/instances/*/osPolicyAssignments/*/report}"
  155. };
  156. option (google.api.method_signature) = "name";
  157. }
  158. // List OS policy asssignment reports for all Compute Engine VM instances in
  159. // the specified zone.
  160. rpc ListOSPolicyAssignmentReports(ListOSPolicyAssignmentReportsRequest) returns (ListOSPolicyAssignmentReportsResponse) {
  161. option (google.api.http) = {
  162. get: "/v1alpha/{parent=projects/*/locations/*/instances/*/osPolicyAssignments/*}/reports"
  163. };
  164. option (google.api.method_signature) = "parent";
  165. }
  166. // Get inventory data for the specified VM instance. If the VM has no
  167. // associated inventory, the message `NOT_FOUND` is returned.
  168. rpc GetInventory(GetInventoryRequest) returns (Inventory) {
  169. option (google.api.http) = {
  170. get: "/v1alpha/{name=projects/*/locations/*/instances/*/inventory}"
  171. };
  172. option (google.api.method_signature) = "name";
  173. }
  174. // List inventory data for all VM instances in the specified zone.
  175. rpc ListInventories(ListInventoriesRequest) returns (ListInventoriesResponse) {
  176. option (google.api.http) = {
  177. get: "/v1alpha/{parent=projects/*/locations/*/instances/*}/inventories"
  178. };
  179. option (google.api.method_signature) = "parent";
  180. }
  181. // Gets the vulnerability report for the specified VM instance. Only VMs with
  182. // inventory data have vulnerability reports associated with them.
  183. rpc GetVulnerabilityReport(GetVulnerabilityReportRequest) returns (VulnerabilityReport) {
  184. option (google.api.http) = {
  185. get: "/v1alpha/{name=projects/*/locations/*/instances/*/vulnerabilityReport}"
  186. };
  187. option (google.api.method_signature) = "name";
  188. }
  189. // List vulnerability reports for all VM instances in the specified zone.
  190. rpc ListVulnerabilityReports(ListVulnerabilityReportsRequest) returns (ListVulnerabilityReportsResponse) {
  191. option (google.api.http) = {
  192. get: "/v1alpha/{parent=projects/*/locations/*/instances/*}/vulnerabilityReports"
  193. };
  194. option (google.api.method_signature) = "parent";
  195. }
  196. }