Skip to content

Commit f158f82

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add fields to RegisterAgentRequest:
- supported_capabilities - os_long_name - os_short_name - os_version - os_architecture feat: Add field to PatchConfig message: - mig_instances_allowed fix: Add NONE Interpreter enum value that should be used over INTERPRETER_UNSPECIFIED in ExecStepConfig message PiperOrigin-RevId: 428781221
1 parent bbfb179 commit f158f82

6 files changed

Lines changed: 65 additions & 27 deletions

File tree

google/cloud/osconfig/agentendpoint/v1beta/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ proto_library(
2727
"tasks.proto",
2828
],
2929
deps = [
30+
"//google/api:annotations_proto",
3031
"//google/api:client_proto",
3132
"//google/api:field_behavior_proto",
3233
],

google/cloud/osconfig/agentendpoint/v1beta/agentendpoint.proto

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

1717
package google.cloud.osconfig.agentendpoint.v1beta;
1818

19+
import "google/api/annotations.proto";
1920
import "google/api/client.proto";
2021
import "google/api/field_behavior.proto";
2122
import "google/cloud/osconfig/agentendpoint/v1beta/guest_policies.proto";
@@ -32,8 +33,7 @@ service AgentEndpointService {
3233
option (google.api.default_host) = "osconfig.googleapis.com";
3334

3435
// Stream established by client to receive Task notifications.
35-
rpc ReceiveTaskNotification(ReceiveTaskNotificationRequest)
36-
returns (stream ReceiveTaskNotificationResponse) {
36+
rpc ReceiveTaskNotification(ReceiveTaskNotificationRequest) returns (stream ReceiveTaskNotificationResponse) {
3737
option (google.api.method_signature) = "instance_id_token,agent_version";
3838
}
3939

@@ -43,32 +43,25 @@ service AgentEndpointService {
4343
}
4444

4545
// Signals an intermediary progress checkpoint in task execution.
46-
rpc ReportTaskProgress(ReportTaskProgressRequest)
47-
returns (ReportTaskProgressResponse) {
48-
option (google.api.method_signature) =
49-
"instance_id_token,task_id,task_type";
46+
rpc ReportTaskProgress(ReportTaskProgressRequest) returns (ReportTaskProgressResponse) {
47+
option (google.api.method_signature) = "instance_id_token,task_id,task_type";
5048
}
5149

5250
// Signals that the task execution is complete and optionally returns the next
5351
// task.
54-
rpc ReportTaskComplete(ReportTaskCompleteRequest)
55-
returns (ReportTaskCompleteResponse) {
56-
option (google.api.method_signature) =
57-
"instance_id_token,task_id,task_type,error_message";
52+
rpc ReportTaskComplete(ReportTaskCompleteRequest) returns (ReportTaskCompleteResponse) {
53+
option (google.api.method_signature) = "instance_id_token,task_id,task_type,error_message";
5854
}
5955

6056
// Lookup the effective guest policy that applies to a VM instance. This
6157
// lookup merges all policies that are assigned to the instance ancestry.
62-
rpc LookupEffectiveGuestPolicy(LookupEffectiveGuestPolicyRequest)
63-
returns (EffectiveGuestPolicy) {
64-
option (google.api.method_signature) =
65-
"instance_id_token,os_short_name,os_version,os_architecture";
58+
rpc LookupEffectiveGuestPolicy(LookupEffectiveGuestPolicyRequest) returns (EffectiveGuestPolicy) {
59+
option (google.api.method_signature) = "instance_id_token,os_short_name,os_version,os_architecture";
6660
}
6761

6862
// Registers the agent running on the VM.
6963
rpc RegisterAgent(RegisterAgentRequest) returns (RegisterAgentResponse) {
70-
option (google.api.method_signature) =
71-
"instance_id_token,agent_version,supported_capabilities";
64+
option (google.api.method_signature) = "instance_id_token,agent_version,supported_capabilities";
7265
}
7366
}
7467

@@ -85,7 +78,9 @@ message ReceiveTaskNotificationRequest {
8578

8679
// The streaming rpc message that notifies the agent when it has a task
8780
// that it needs to perform on the VM instance.
88-
message ReceiveTaskNotificationResponse {}
81+
message ReceiveTaskNotificationResponse {
82+
83+
}
8984

9085
// A request message for signaling the start of a task execution.
9186
message StartNextTaskRequest {
@@ -118,6 +113,7 @@ message ReportTaskProgressRequest {
118113
// specified below:
119114
// APPLY_PATCHES = ApplyPatchesTaskProgress
120115
// EXEC_STEP = Progress not supported for this type.
116+
// APPLY_CONFIG_TASK = ApplyConfigTaskProgress
121117
TaskType task_type = 3 [(google.api.field_behavior) = REQUIRED];
122118

123119
// Intermediate progress of the current task.
@@ -152,6 +148,7 @@ message ReportTaskCompleteRequest {
152148
// enum values:
153149
// APPLY_PATCHES = ApplyPatchesTaskOutput
154150
// EXEC_STEP = ExecStepTaskOutput
151+
// APPLY_CONFIG_TASK = ApplyConfigTaskOutput
155152
TaskType task_type = 3 [(google.api.field_behavior) = REQUIRED];
156153

157154
// Descriptive error message if the task execution ended in error.
@@ -168,7 +165,9 @@ message ReportTaskCompleteRequest {
168165
}
169166

170167
// The response message after the agent signaled the current task complete.
171-
message ReportTaskCompleteResponse {}
168+
message ReportTaskCompleteResponse {
169+
170+
}
172171

173172
// The request message for registering the agent.
174173
message RegisterAgentRequest {
@@ -183,9 +182,26 @@ message RegisterAgentRequest {
183182
// Required. The capabilities supported by the agent. Supported values are:
184183
// PATCH_GA
185184
// GUEST_POLICY_BETA
186-
repeated string supported_capabilities = 3
187-
[(google.api.field_behavior) = REQUIRED];
185+
// CONFIG_V1
186+
repeated string supported_capabilities = 3 [(google.api.field_behavior) = REQUIRED];
187+
188+
// The operating system long name.
189+
// For example 'Debian GNU/Linux 9' or 'Microsoft Window Server 2019
190+
// Datacenter'.
191+
string os_long_name = 4;
192+
193+
// The operating system short name.
194+
// For example, 'windows' or 'debian'.
195+
string os_short_name = 5;
196+
197+
// The version of the operating system.
198+
string os_version = 6;
199+
200+
// The system architecture of the operating system.
201+
string os_architecture = 7;
188202
}
189203

190204
// The response message after the agent registered.
191-
message RegisterAgentResponse {}
205+
message RegisterAgentResponse {
206+
207+
}

google/cloud/osconfig/agentendpoint/v1beta/guest_policies.proto

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

1717
package google.cloud.osconfig.agentendpoint.v1beta;
1818

19+
import "google/api/annotations.proto";
1920
import "google/api/field_behavior.proto";
2021

2122
option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1beta;agentendpoint";

google/cloud/osconfig/agentendpoint/v1beta/osconfig_v1beta.yaml

Lines changed: 12 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.agentendpoint.v1beta.AgentEndpointService
@@ -17,3 +17,14 @@ backend:
1717
deadline: 30.0
1818
- selector: google.cloud.osconfig.agentendpoint.v1beta.AgentEndpointService.ReceiveTaskNotification
1919
deadline: 3600.0
20+
21+
authentication:
22+
rules:
23+
- selector: google.longrunning.Operations.CancelOperation
24+
oauth:
25+
canonical_scopes: |-
26+
https://www.googleapis.com/auth/cloud-platform
27+
- selector: google.longrunning.Operations.GetOperation
28+
oauth:
29+
canonical_scopes: |-
30+
https://www.googleapis.com/auth/cloud-platform

google/cloud/osconfig/agentendpoint/v1beta/patch_jobs.proto

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

1717
package google.cloud.osconfig.agentendpoint.v1beta;
1818

19+
import "google/api/annotations.proto";
20+
1921
option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1beta;agentendpoint";
2022
option java_outer_classname = "PatchJobs";
2123
option java_package = "com.google.cloud.osconfig.agentendpoint.v1beta";
@@ -70,6 +72,9 @@ message PatchConfig {
7072

7173
// The ExecStep to run after the patch update.
7274
ExecStep post_step = 9;
75+
76+
// Allows the patch job to run on Managed instance groups (MIGs).
77+
bool mig_instances_allowed = 10;
7378
}
7479

7580
// Apt patching will be performed by executing `apt-get update && apt-get
@@ -125,7 +130,9 @@ message YumSettings {
125130
}
126131

127132
// Googet patching is performed by running `googet update`.
128-
message GooSettings {}
133+
message GooSettings {
134+
135+
}
129136

130137
// Zypper patching is performed by running `zypper patch`.
131138
// See also https://en.opensuse.org/SDB:Zypper_manual.
@@ -240,10 +247,13 @@ message ExecStep {
240247
message ExecStepConfig {
241248
// The interpreter used to execute the a file.
242249
enum Interpreter {
250+
// Deprecated, defaults to NONE for compatibility reasons.
251+
INTERPRETER_UNSPECIFIED = 0;
252+
243253
// Invalid for a Windows ExecStepConfig. For a Linux ExecStepConfig, the
244254
// interpreter will be parsed from the shebang line of the script if
245255
// unspecified.
246-
INTERPRETER_UNSPECIFIED = 0;
256+
NONE = 3;
247257

248258
// Indicates that the script will be run with /bin/sh on Linux and cmd
249259
// on windows.

google/cloud/osconfig/agentendpoint/v1beta/tasks.proto

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ syntax = "proto3";
1616

1717
package google.cloud.osconfig.agentendpoint.v1beta;
1818

19+
import "google/api/annotations.proto";
1920
import "google/api/field_behavior.proto";
2021
import "google/cloud/osconfig/agentendpoint/v1beta/patch_jobs.proto";
2122

2223
option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1beta;agentendpoint";
23-
option java_multiple_files = true;
2424
option java_outer_classname = "Tasks";
2525
option java_package = "com.google.cloud.osconfig.agentendpoint.v1beta";
2626
option php_namespace = "Google\\Cloud\\OsConfig\\V1beta";
@@ -176,7 +176,6 @@ message ExecStepTaskOutput {
176176
// Required. The final state of the exec step.
177177
State state = 1 [(google.api.field_behavior) = REQUIRED];
178178

179-
// Required. The exit code received from the script which ran as part of the
180-
// exec step.
179+
// Required. The exit code received from the script which ran as part of the exec step.
181180
int32 exit_code = 2 [(google.api.field_behavior) = REQUIRED];
182181
}

0 commit comments

Comments
 (0)