Skip to content

Commit 10d3f7a

Browse files
feat: Update osconfig v1 protos (#602)
* feat: Update osconfig v1 protos PiperOrigin-RevId: 427050266 Source-Link: googleapis/googleapis@010716c Source-Link: googleapis/googleapis-gen@95161e2 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTUxNjFlMjFhMDMzMzQ1YzVmZTEzNTQyYmI4YTgyZDRiMWQwODY5MCJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 951163f commit 10d3f7a

7 files changed

Lines changed: 193 additions & 99 deletions

File tree

packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,9 @@ message Inventory {
264264
google.protobuf.Timestamp install_time = 5;
265265
}
266266

267-
// Contains information about a Windows application as retrieved from the
268-
// Windows Registry. For more information about these fields, see
269-
//
270-
// [Windows Installer Properties for the Uninstall
271-
// Registry](https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key){:
272-
// class="external" }
267+
// Contains information about a Windows application that is retrieved from the
268+
// Windows Registry. For more information about these fields, see:
269+
// https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key
273270
message WindowsApplication {
274271
// The name of the application or product.
275272
string display_name = 1;
@@ -305,7 +302,8 @@ message Inventory {
305302
map<string, Item> items = 2;
306303

307304
// Output only. Timestamp of the last reported inventory for the VM.
308-
google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
305+
google.protobuf.Timestamp update_time = 4
306+
[(google.api.field_behavior) = OUTPUT_ONLY];
309307
}
310308

311309
// A request message for getting inventory data for the specified VM.

packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy.proto

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ option ruby_package = "Google::Cloud::OsConfig::V1";
2828

2929
// An OS policy defines the desired state configuration for a VM.
3030
message OSPolicy {
31+
// Policy mode
32+
enum Mode {
33+
// Invalid mode
34+
MODE_UNSPECIFIED = 0;
35+
36+
// This mode checks if the configuration resources in the policy are in
37+
// their desired state. No actions are performed if they are not in the
38+
// desired state. This mode is used for reporting purposes.
39+
VALIDATION = 1;
40+
41+
// This mode checks if the configuration resources in the policy are in
42+
// their desired state, and if not, enforces the desired state.
43+
ENFORCEMENT = 2;
44+
}
45+
3146
// Filtering criteria to select VMs based on inventory details.
3247
message InventoryFilter {
3348
// Required. The OS short name
@@ -96,6 +111,19 @@ message OSPolicy {
96111

97112
// A resource that manages a system package.
98113
message PackageResource {
114+
// The desired state that the OS Config agent maintains on the VM.
115+
enum DesiredState {
116+
// Unspecified is invalid.
117+
DESIRED_STATE_UNSPECIFIED = 0;
118+
119+
// Ensure that the package is installed.
120+
INSTALLED = 1;
121+
122+
// The agent ensures that the package is not installed and
123+
// uninstalls it if detected.
124+
REMOVED = 2;
125+
}
126+
99127
// A deb package file. dpkg packages only support INSTALLED state.
100128
message Deb {
101129
// Required. A deb package.
@@ -164,19 +192,6 @@ message OSPolicy {
164192
repeated string properties = 2;
165193
}
166194

167-
// The desired state that the OS Config agent maintains on the VM.
168-
enum DesiredState {
169-
// Unspecified is invalid.
170-
DESIRED_STATE_UNSPECIFIED = 0;
171-
172-
// Ensure that the package is installed.
173-
INSTALLED = 1;
174-
175-
// The agent ensures that the package is not installed and
176-
// uninstalls it if detected.
177-
REMOVED = 2;
178-
}
179-
180195
// Required. The desired state the agent should maintain for this package.
181196
DesiredState desired_state = 1 [(google.api.field_behavior) = REQUIRED];
182197

@@ -498,21 +513,6 @@ message OSPolicy {
498513
repeated Resource resources = 2 [(google.api.field_behavior) = REQUIRED];
499514
}
500515

501-
// Policy mode
502-
enum Mode {
503-
// Invalid mode
504-
MODE_UNSPECIFIED = 0;
505-
506-
// This mode checks if the configuration resources in the policy are in
507-
// their desired state. No actions are performed if they are not in the
508-
// desired state. This mode is used for reporting purposes.
509-
VALIDATION = 1;
510-
511-
// This mode checks if the configuration resources in the policy are in
512-
// their desired state, and if not, enforces the desired state.
513-
ENFORCEMENT = 2;
514-
}
515-
516516
// Required. The id of the OS policy with the following restrictions:
517517
//
518518
// * Must contain only lowercase letters, numbers, and hyphens.

packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,27 @@ message OSPolicyAssignmentReport {
114114

115115
// Compliance data for an OS policy
116116
message OSPolicyCompliance {
117+
// Possible compliance states for an os policy.
118+
enum ComplianceState {
119+
// The policy is in an unknown compliance state.
120+
//
121+
// Refer to the field `compliance_state_reason` to learn the exact reason
122+
// for the policy to be in this compliance state.
123+
UNKNOWN = 0;
124+
125+
// Policy is compliant.
126+
//
127+
// The policy is compliant if all the underlying resources are also
128+
// compliant.
129+
COMPLIANT = 1;
130+
131+
// Policy is non-compliant.
132+
//
133+
// The policy is non-compliant if one or more underlying resources are
134+
// non-compliant.
135+
NON_COMPLIANT = 2;
136+
}
137+
117138
// Compliance data for an OS policy resource.
118139
message OSPolicyResourceCompliance {
119140
// Step performed by the OS Config agent for configuring an
@@ -152,13 +173,6 @@ message OSPolicyAssignmentReport {
152173
string error_message = 2;
153174
}
154175

155-
// ExecResource specific output.
156-
message ExecResourceOutput {
157-
// Output from enforcement phase output file (if run).
158-
// Output size is limited to 100K bytes.
159-
bytes enforcement_output = 2;
160-
}
161-
162176
// Possible compliance states for a resource.
163177
enum ComplianceState {
164178
// The resource is in an unknown compliance state.
@@ -174,6 +188,13 @@ message OSPolicyAssignmentReport {
174188
NON_COMPLIANT = 2;
175189
}
176190

191+
// ExecResource specific output.
192+
message ExecResourceOutput {
193+
// Output from enforcement phase output file (if run).
194+
// Output size is limited to 100K bytes.
195+
bytes enforcement_output = 2;
196+
}
197+
177198
// The ID of the OS policy resource.
178199
string os_policy_resource_id = 1;
179200

@@ -207,27 +228,6 @@ message OSPolicyAssignmentReport {
207228
}
208229
}
209230

210-
// Possible compliance states for an os policy.
211-
enum ComplianceState {
212-
// The policy is in an unknown compliance state.
213-
//
214-
// Refer to the field `compliance_state_reason` to learn the exact reason
215-
// for the policy to be in this compliance state.
216-
UNKNOWN = 0;
217-
218-
// Policy is compliant.
219-
//
220-
// The policy is compliant if all the underlying resources are also
221-
// compliant.
222-
COMPLIANT = 1;
223-
224-
// Policy is non-compliant.
225-
//
226-
// The policy is non-compliant if one or more underlying resources are
227-
// non-compliant.
228-
NON_COMPLIANT = 2;
229-
}
230-
231231
// The OS policy id
232232
string os_policy_id = 1;
233233

packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_common.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ syntax = "proto3";
1616

1717
package google.cloud.osconfig.v1;
1818

19-
import "google/api/annotations.proto";
2019
import "google/api/client.proto";
2120
import "google/api/resource.proto";
2221
import "google/cloud/osconfig/v1/patch_deployments.proto";
2322
import "google/cloud/osconfig/v1/patch_jobs.proto";
2423
import "google/protobuf/empty.proto";
24+
import "google/api/annotations.proto";
2525

2626
option csharp_namespace = "Google.Cloud.OsConfig.V1";
2727
option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig";
@@ -123,4 +123,36 @@ service OsConfigService {
123123
};
124124
option (google.api.method_signature) = "name";
125125
}
126+
127+
// Update an OS Config patch deployment.
128+
rpc UpdatePatchDeployment(UpdatePatchDeploymentRequest)
129+
returns (PatchDeployment) {
130+
option (google.api.http) = {
131+
patch: "/v1/{patch_deployment.name=projects/*/patchDeployments/*}"
132+
body: "patch_deployment"
133+
};
134+
option (google.api.method_signature) = "patch_deployment,update_mask";
135+
}
136+
137+
// Change state of patch deployment to "PAUSED".
138+
// Patch deployment in paused state doesn't generate patch jobs.
139+
rpc PausePatchDeployment(PausePatchDeploymentRequest)
140+
returns (PatchDeployment) {
141+
option (google.api.http) = {
142+
post: "/v1/{name=projects/*/patchDeployments/*}:pause"
143+
body: "*"
144+
};
145+
option (google.api.method_signature) = "name";
146+
}
147+
148+
// Change state of patch deployment back to "ACTIVE".
149+
// Patch deployment in active state continues to generate patch jobs.
150+
rpc ResumePatchDeployment(ResumePatchDeploymentRequest)
151+
returns (PatchDeployment) {
152+
option (google.api.http) = {
153+
post: "/v1/{name=projects/*/patchDeployments/*}:resume"
154+
body: "*"
155+
};
156+
option (google.api.method_signature) = "name";
157+
}
126158
}

packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto

Lines changed: 67 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import "google/api/field_behavior.proto";
2020
import "google/api/resource.proto";
2121
import "google/cloud/osconfig/v1/patch_jobs.proto";
2222
import "google/protobuf/duration.proto";
23+
import "google/protobuf/field_mask.proto";
2324
import "google/protobuf/timestamp.proto";
2425
import "google/type/datetime.proto";
2526
import "google/type/dayofweek.proto";
@@ -43,6 +44,19 @@ message PatchDeployment {
4344
pattern: "projects/{project}/patchDeployments/{patch_deployment}"
4445
};
4546

47+
// Represents state of patch peployment.
48+
enum State {
49+
// The default value. This value is used if the state is omitted.
50+
STATE_UNSPECIFIED = 0;
51+
52+
// Active value means that patch deployment generates Patch Jobs.
53+
ACTIVE = 1;
54+
55+
// Paused value means that patch deployment does not generate
56+
// Patch jobs. Requires user action to move in and out from this state.
57+
PAUSED = 2;
58+
}
59+
4660
// Unique name for the patch deployment resource in a project. The patch
4761
// deployment name is in the form:
4862
// `projects/{project_id}/patchDeployments/{patch_deployment_id}`.
@@ -94,6 +108,9 @@ message PatchDeployment {
94108

95109
// Optional. Rollout strategy of the patch job.
96110
PatchRollout rollout = 11 [(google.api.field_behavior) = OPTIONAL];
111+
112+
// Output only. Current state of the patch deployment.
113+
State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
97114
}
98115

99116
// Sets the time for a one time patch deployment. Timestamp is in
@@ -111,16 +128,16 @@ message RecurringSchedule {
111128
// Invalid. A frequency must be specified.
112129
FREQUENCY_UNSPECIFIED = 0;
113130

114-
// Indicates that the frequency should be expressed in terms of
115-
// weeks.
131+
// Indicates that the frequency of recurrence should be expressed in terms
132+
// of weeks.
116133
WEEKLY = 1;
117134

118-
// Indicates that the frequency should be expressed in terms of
119-
// months.
135+
// Indicates that the frequency of recurrence should be expressed in terms
136+
// of months.
120137
MONTHLY = 2;
121138

122-
// Indicates that the frequency should be expressed in terms of
123-
// days.
139+
// Indicates that the frequency of recurrence should be expressed in terms
140+
// of days.
124141
DAILY = 3;
125142
}
126143

@@ -197,6 +214,15 @@ message WeekDayOfMonth {
197214
// Required. A day of the week.
198215
google.type.DayOfWeek day_of_week = 2
199216
[(google.api.field_behavior) = REQUIRED];
217+
218+
// Optional. Represents the number of days before or after the given week day
219+
// of month that the patch deployment is scheduled for. For example if
220+
// `week_ordinal` and `day_of_week` values point to the second day of the
221+
// month and this `day_offset` value is set to `3`, the patch deployment takes
222+
// place three days after the second Tuesday of the month. If this value is
223+
// negative, for example -5, the patches are deployed five days before before
224+
// the second Tuesday of the month. Allowed values are in range [-30, 30].
225+
int32 day_offset = 3 [(google.api.field_behavior) = OPTIONAL];
200226
}
201227

202228
// A request message for creating a patch deployment.
@@ -276,3 +302,38 @@ message DeletePatchDeploymentRequest {
276302
}
277303
];
278304
}
305+
306+
// A request message for updating a patch deployment.
307+
message UpdatePatchDeploymentRequest {
308+
// Required. The patch deployment to Update.
309+
PatchDeployment patch_deployment = 1 [(google.api.field_behavior) = REQUIRED];
310+
311+
// Optional. Field mask that controls which fields of the patch deployment
312+
// should be updated.
313+
google.protobuf.FieldMask update_mask = 2
314+
[(google.api.field_behavior) = OPTIONAL];
315+
}
316+
317+
// A request message for pausing a patch deployment.
318+
message PausePatchDeploymentRequest {
319+
// Required. The resource name of the patch deployment in the form
320+
// `projects/*/patchDeployments/*`.
321+
string name = 1 [
322+
(google.api.field_behavior) = REQUIRED,
323+
(google.api.resource_reference) = {
324+
type: "osconfig.googleapis.com/PatchDeployment"
325+
}
326+
];
327+
}
328+
329+
// A request message for resuming a patch deployment.
330+
message ResumePatchDeploymentRequest {
331+
// Required. The resource name of the patch deployment in the form
332+
// `projects/*/patchDeployments/*`.
333+
string name = 1 [
334+
(google.api.field_behavior) = REQUIRED,
335+
(google.api.resource_reference) = {
336+
type: "osconfig.googleapis.com/PatchDeployment"
337+
}
338+
];
339+
}

0 commit comments

Comments
 (0)