xref: /aosp_15_r20/external/googleapis/google/cloud/osconfig/v1beta/osconfig_service.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2020 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.v1beta;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/cloud/osconfig/v1beta/guest_policies.proto";
22import "google/cloud/osconfig/v1beta/patch_deployments.proto";
23import "google/cloud/osconfig/v1beta/patch_jobs.proto";
24import "google/protobuf/empty.proto";
25
26option go_package = "cloud.google.com/go/osconfig/apiv1beta/osconfigpb;osconfigpb";
27option java_outer_classname = "OsConfigProto";
28option java_package = "com.google.cloud.osconfig.v1beta";
29
30// OS Config API
31//
32// The OS Config service is a server-side component that you can use to
33// manage package installations and patch jobs for virtual machine instances.
34service OsConfigService {
35  option (google.api.default_host) = "osconfig.googleapis.com";
36  option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
37
38  // Patch VM instances by creating and running a patch job.
39  rpc ExecutePatchJob(ExecutePatchJobRequest) returns (PatchJob) {
40    option (google.api.http) = {
41      post: "/v1beta/{parent=projects/*}/patchJobs:execute"
42      body: "*"
43    };
44  }
45
46  // Get the patch job. This can be used to track the progress of an
47  // ongoing patch job or review the details of completed jobs.
48  rpc GetPatchJob(GetPatchJobRequest) returns (PatchJob) {
49    option (google.api.http) = {
50      get: "/v1beta/{name=projects/*/patchJobs/*}"
51    };
52  }
53
54  // Cancel a patch job. The patch job must be active. Canceled patch jobs
55  // cannot be restarted.
56  rpc CancelPatchJob(CancelPatchJobRequest) returns (PatchJob) {
57    option (google.api.http) = {
58      post: "/v1beta/{name=projects/*/patchJobs/*}:cancel"
59      body: "*"
60    };
61  }
62
63  // Get a list of patch jobs.
64  rpc ListPatchJobs(ListPatchJobsRequest) returns (ListPatchJobsResponse) {
65    option (google.api.http) = {
66      get: "/v1beta/{parent=projects/*}/patchJobs"
67    };
68  }
69
70  // Get a list of instance details for a given patch job.
71  rpc ListPatchJobInstanceDetails(ListPatchJobInstanceDetailsRequest) returns (ListPatchJobInstanceDetailsResponse) {
72    option (google.api.http) = {
73      get: "/v1beta/{parent=projects/*/patchJobs/*}/instanceDetails"
74    };
75    option (google.api.method_signature) = "parent";
76  }
77
78  // Create an OS Config patch deployment.
79  rpc CreatePatchDeployment(CreatePatchDeploymentRequest) returns (PatchDeployment) {
80    option (google.api.http) = {
81      post: "/v1beta/{parent=projects/*}/patchDeployments"
82      body: "patch_deployment"
83    };
84  }
85
86  // Get an OS Config patch deployment.
87  rpc GetPatchDeployment(GetPatchDeploymentRequest) returns (PatchDeployment) {
88    option (google.api.http) = {
89      get: "/v1beta/{name=projects/*/patchDeployments/*}"
90    };
91  }
92
93  // Get a page of OS Config patch deployments.
94  rpc ListPatchDeployments(ListPatchDeploymentsRequest) returns (ListPatchDeploymentsResponse) {
95    option (google.api.http) = {
96      get: "/v1beta/{parent=projects/*}/patchDeployments"
97    };
98  }
99
100  // Delete an OS Config patch deployment.
101  rpc DeletePatchDeployment(DeletePatchDeploymentRequest) returns (google.protobuf.Empty) {
102    option (google.api.http) = {
103      delete: "/v1beta/{name=projects/*/patchDeployments/*}"
104    };
105  }
106
107  // Update an OS Config patch deployment.
108  rpc UpdatePatchDeployment(UpdatePatchDeploymentRequest) returns (PatchDeployment) {
109    option (google.api.http) = {
110      patch: "/v1beta/{patch_deployment.name=projects/*/patchDeployments/*}"
111      body: "patch_deployment"
112    };
113    option (google.api.method_signature) = "patch_deployment,update_mask";
114  }
115
116  // Change state of patch deployment to "PAUSED".
117  // Patch deployment in paused state doesn't generate patch jobs.
118  rpc PausePatchDeployment(PausePatchDeploymentRequest) returns (PatchDeployment) {
119    option (google.api.http) = {
120      post: "/v1beta/{name=projects/*/patchDeployments/*}:pause"
121      body: "*"
122    };
123    option (google.api.method_signature) = "name";
124  }
125
126  // Change state of patch deployment back to "ACTIVE".
127  // Patch deployment in active state continues to generate patch jobs.
128  rpc ResumePatchDeployment(ResumePatchDeploymentRequest) returns (PatchDeployment) {
129    option (google.api.http) = {
130      post: "/v1beta/{name=projects/*/patchDeployments/*}:resume"
131      body: "*"
132    };
133    option (google.api.method_signature) = "name";
134  }
135
136  // Create an OS Config guest policy.
137  rpc CreateGuestPolicy(CreateGuestPolicyRequest) returns (GuestPolicy) {
138    option (google.api.http) = {
139      post: "/v1beta/{parent=projects/*}/guestPolicies"
140      body: "guest_policy"
141    };
142    option (google.api.method_signature) = "parent, guest_policy";
143  }
144
145  // Get an OS Config guest policy.
146  rpc GetGuestPolicy(GetGuestPolicyRequest) returns (GuestPolicy) {
147    option (google.api.http) = {
148      get: "/v1beta/{name=projects/*/guestPolicies/*}"
149    };
150    option (google.api.method_signature) = "name";
151  }
152
153  // Get a page of OS Config guest policies.
154  rpc ListGuestPolicies(ListGuestPoliciesRequest) returns (ListGuestPoliciesResponse) {
155    option (google.api.http) = {
156      get: "/v1beta/{parent=projects/*}/guestPolicies"
157    };
158    option (google.api.method_signature) = "parent";
159  }
160
161  // Update an OS Config guest policy.
162  rpc UpdateGuestPolicy(UpdateGuestPolicyRequest) returns (GuestPolicy) {
163    option (google.api.http) = {
164      patch: "/v1beta/{guest_policy.name=projects/*/guestPolicies/*}"
165      body: "guest_policy"
166    };
167    option (google.api.method_signature) = "guest_policy,update_mask";
168  }
169
170  // Delete an OS Config guest policy.
171  rpc DeleteGuestPolicy(DeleteGuestPolicyRequest) returns (google.protobuf.Empty) {
172    option (google.api.http) = {
173      delete: "/v1beta/{name=projects/*/guestPolicies/*}"
174    };
175    option (google.api.method_signature) = "name";
176  }
177
178  // Lookup the effective guest policy that applies to a VM instance. This
179  // lookup merges all policies that are assigned to the instance ancestry.
180  rpc LookupEffectiveGuestPolicy(LookupEffectiveGuestPolicyRequest) returns (EffectiveGuestPolicy) {
181    option (google.api.http) = {
182      post: "/v1beta/{instance=projects/*/zones/*/instances/*}:lookupEffectiveGuestPolicy"
183      body: "*"
184    };
185  }
186}
187