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