Skip to content

Commit 250797d

Browse files
Google APIscopybara-github
authored andcommitted
feat: Update v1beta protos with recently added features. PatchRollout proto, mig_instances_allowed field to PatchConfig, UpdatePatchDeployment RPC,PausePatchDeployment and ResumePatchDeployment pair of RPCs
PiperOrigin-RevId: 427579992
1 parent d450beb commit 250797d

7 files changed

Lines changed: 310 additions & 83 deletions

File tree

google/cloud/osconfig/v1beta/BUILD.bazel

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file was automatically generated by BuildFileGenerator
2-
# https://github.com/googleapis/gapic-generator/tree/master/rules_gapic/bazel
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
33

44
# Most of the manual changes to this file will be overwritten.
55
# It's **only** allowed to change the following rule attribute values:
@@ -22,6 +22,7 @@ proto_library(
2222
name = "osconfig_proto",
2323
srcs = [
2424
"guest_policies.proto",
25+
"osconfig_common.proto",
2526
"osconfig_service.proto",
2627
"patch_deployments.proto",
2728
"patch_jobs.proto",
@@ -75,12 +76,15 @@ java_grpc_library(
7576
java_gapic_library(
7677
name = "osconfig_java_gapic",
7778
srcs = [":osconfig_proto_with_info"],
79+
gapic_yaml = "osconfig_gapic.yaml",
7880
grpc_service_config = "osconfig_grpc_service_config.json",
81+
service_yaml = "osconfig_v1beta.yaml",
7982
test_deps = [
8083
":osconfig_java_grpc",
8184
],
8285
deps = [
8386
":osconfig_java_proto",
87+
"//google/api:api_java_proto",
8488
],
8589
)
8690

@@ -132,6 +136,7 @@ go_gapic_library(
132136
srcs = [":osconfig_proto_with_info"],
133137
grpc_service_config = "osconfig_grpc_service_config.json",
134138
importpath = "cloud.google.com/go/osconfig/apiv1beta;osconfig",
139+
metadata = True,
135140
service_yaml = "osconfig_v1beta.yaml",
136141
deps = [
137142
":osconfig_go_proto",
@@ -151,6 +156,7 @@ go_gapic_assembly_pkg(
151156
name = "gapi-cloud-osconfig-v1beta-go",
152157
deps = [
153158
":osconfig_go_gapic",
159+
":osconfig_go_gapic_srcjar-metadata.srcjar",
154160
":osconfig_go_gapic_srcjar-test.srcjar",
155161
":osconfig_go_proto",
156162
],
@@ -169,9 +175,7 @@ py_gapic_library(
169175
name = "osconfig_py_gapic",
170176
srcs = [":osconfig_proto"],
171177
grpc_service_config = "osconfig_grpc_service_config.json",
172-
opt_args = [
173-
"warehouse-package-name=google-cloud-os-config",
174-
],
178+
opt_args = ["warehouse-package-name=google-cloud-os-config"],
175179
)
176180

177181
# Open Source Packages
@@ -208,6 +212,7 @@ php_gapic_library(
208212
name = "osconfig_php_gapic",
209213
srcs = [":osconfig_proto_with_info"],
210214
grpc_service_config = "osconfig_grpc_service_config.json",
215+
service_yaml = "osconfig_v1beta.yaml",
211216
deps = [
212217
":osconfig_php_grpc",
213218
":osconfig_php_proto",
@@ -235,6 +240,7 @@ load(
235240

236241
nodejs_gapic_library(
237242
name = "osconfig_nodejs_gapic",
243+
package_name = "@google-cloud/osconfig",
238244
src = ":osconfig_proto_with_info",
239245
extra_protoc_parameters = ["metadata"],
240246
grpc_service_config = "osconfig_grpc_service_config.json",
@@ -256,8 +262,8 @@ nodejs_gapic_assembly_pkg(
256262
##############################################################################
257263
load(
258264
"@com_google_googleapis_imports//:imports.bzl",
259-
"ruby_gapic_assembly_pkg",
260265
"ruby_cloud_gapic_library",
266+
"ruby_gapic_assembly_pkg",
261267
"ruby_grpc_library",
262268
"ruby_proto_library",
263269
)
@@ -275,8 +281,9 @@ ruby_grpc_library(
275281

276282
ruby_cloud_gapic_library(
277283
name = "osconfig_ruby_gapic",
278-
srcs = [":osconfig_proto_with_info",],
284+
srcs = [":osconfig_proto_with_info"],
279285
extra_protoc_parameters = ["ruby-cloud-gem-name=google-cloud-osconfig-v1beta"],
286+
grpc_service_config = "osconfig_grpc_service_config.json",
280287
deps = [
281288
":osconfig_ruby_grpc",
282289
":osconfig_ruby_proto",
@@ -339,4 +346,20 @@ csharp_gapic_assembly_pkg(
339346
##############################################################################
340347
# C++
341348
##############################################################################
342-
# Put your C++ rules here
349+
load(
350+
"@com_google_googleapis_imports//:imports.bzl",
351+
"cc_grpc_library",
352+
"cc_proto_library",
353+
)
354+
355+
cc_proto_library(
356+
name = "osconfig_cc_proto",
357+
deps = [":osconfig_proto"],
358+
)
359+
360+
cc_grpc_library(
361+
name = "osconfig_cc_grpc",
362+
srcs = [":osconfig_proto"],
363+
grpc_only = True,
364+
deps = [":osconfig_cc_proto"],
365+
)

google/cloud/osconfig/v1beta/guest_policies.proto

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ syntax = "proto3";
1616

1717
package google.cloud.osconfig.v1beta;
1818

19+
import "google/api/annotations.proto";
1920
import "google/api/field_behavior.proto";
2021
import "google/api/resource.proto";
2122
import "google/protobuf/field_mask.proto";
@@ -148,6 +149,23 @@ message Assignment {
148149
repeated OsType os_types = 5;
149150
}
150151

152+
// The desired state that the OS Config agent maintains on the VM instance.
153+
enum DesiredState {
154+
// The default is to ensure the package is installed.
155+
DESIRED_STATE_UNSPECIFIED = 0;
156+
157+
// The agent ensures that the package is installed.
158+
INSTALLED = 1;
159+
160+
// The agent ensures that the package is installed and
161+
// periodically checks for and install any updates.
162+
UPDATED = 2;
163+
164+
// The agent ensures that the package is not installed and uninstall it
165+
// if detected.
166+
REMOVED = 3;
167+
}
168+
151169
// Package is a reference to the software package to be installed or removed.
152170
// The agent on the VM instance uses the system package manager to apply the
153171
// config.
@@ -296,23 +314,6 @@ message GooRepository {
296314
string url = 2 [(google.api.field_behavior) = REQUIRED];
297315
}
298316

299-
// The desired state that the OS Config agent maintains on the VM instance.
300-
enum DesiredState {
301-
// The default is to ensure the package is installed.
302-
DESIRED_STATE_UNSPECIFIED = 0;
303-
304-
// The agent ensures that the package is installed.
305-
INSTALLED = 1;
306-
307-
// The agent ensures that the package is installed and
308-
// periodically checks for and install any updates.
309-
UPDATED = 2;
310-
311-
// The agent ensures that the package is not installed and uninstall it
312-
// if detected.
313-
REMOVED = 3;
314-
}
315-
316317
// A package repository.
317318
message PackageRepository {
318319
// A specific type of repository.
@@ -347,7 +348,7 @@ message PackageRepository {
347348
//
348349
// If a recipe is assigned to an instance and there is a recipe with the same
349350
// name but a lower version already installed and the assigned state
350-
// of the recipe is `INSTALLED_KEEP_UPDATED`, then the recipe is updated to
351+
// of the recipe is `UPDATED`, then the recipe is updated to
351352
// the new version.
352353
//
353354
// Script Working Directories
@@ -614,10 +615,9 @@ message SoftwareRecipe {
614615
//
615616
// INSTALLED: The software recipe is installed on the instance but
616617
// won't be updated to new versions.
617-
// INSTALLED_KEEP_UPDATED: The software recipe is installed on the
618-
// instance. The recipe is updated to a higher
619-
// version, if a higher version of the recipe is
620-
// assigned to this instance.
618+
// UPDATED: The software recipe is installed on the instance. The recipe is
619+
// updated to a higher version, if a higher version of the recipe is
620+
// assigned to this instance.
621621
// REMOVE: Remove is unsupported for software recipes and attempts to
622622
// create or update a recipe to the REMOVE state is rejected.
623623
DesiredState desired_state = 6;
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
15+
syntax = "proto3";
16+
17+
package google.cloud.osconfig.v1beta;
18+
19+
import "google/api/annotations.proto";
20+
21+
option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta;osconfig";
22+
option java_outer_classname = "Common";
23+
option java_package = "com.google.cloud.osconfig.v1beta";
24+
25+
// Message encapsulating a value that can be either absolute ("fixed") or
26+
// relative ("percent") to a value.
27+
message FixedOrPercent {
28+
// Type of the value.
29+
oneof mode {
30+
// Specifies a fixed value.
31+
int32 fixed = 1;
32+
33+
// Specifies the relative value defined as a percentage, which will be
34+
// multiplied by a reference value.
35+
int32 percent = 2;
36+
}
37+
}

google/cloud/osconfig/v1beta/osconfig_service.proto

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,35 @@ service OsConfigService {
104104
};
105105
}
106106

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+
107136
// Create an OS Config guest policy.
108137
rpc CreateGuestPolicy(CreateGuestPolicyRequest) returns (GuestPolicy) {
109138
option (google.api.http) = {

google/cloud/osconfig/v1beta/osconfig_v1beta.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
type: google.api.Service
22
config_version: 3
33
name: osconfig.googleapis.com
4-
title: Cloud OS Config API
4+
title: OS Config API
55

66
apis:
77
- name: google.cloud.osconfig.v1beta.OsConfigService
@@ -22,3 +22,11 @@ authentication:
2222
oauth:
2323
canonical_scopes: |-
2424
https://www.googleapis.com/auth/cloud-platform
25+
- selector: google.longrunning.Operations.CancelOperation
26+
oauth:
27+
canonical_scopes: |-
28+
https://www.googleapis.com/auth/cloud-platform
29+
- selector: google.longrunning.Operations.GetOperation
30+
oauth:
31+
canonical_scopes: |-
32+
https://www.googleapis.com/auth/cloud-platform

0 commit comments

Comments
 (0)