osconfig_zonal_service.proto 8.5 KB

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