Skip to content

Commit

Permalink
feat: Add fields to RegisterAgentRequest:
Browse files Browse the repository at this point in the history
  - 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
  • Loading branch information
Google APIs authored and Copybara-Service committed Feb 15, 2022
1 parent bbfb179 commit f158f82
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 27 deletions.
1 change: 1 addition & 0 deletions google/cloud/osconfig/agentendpoint/v1beta/BUILD.bazel
Expand Up @@ -27,6 +27,7 @@ proto_library(
"tasks.proto",
],
deps = [
"//google/api:annotations_proto",
"//google/api:client_proto",
"//google/api:field_behavior_proto",
],
Expand Down
58 changes: 37 additions & 21 deletions google/cloud/osconfig/agentendpoint/v1beta/agentendpoint.proto
Expand Up @@ -16,6 +16,7 @@ syntax = "proto3";

package google.cloud.osconfig.agentendpoint.v1beta;

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

// Stream established by client to receive Task notifications.
rpc ReceiveTaskNotification(ReceiveTaskNotificationRequest)
returns (stream ReceiveTaskNotificationResponse) {
rpc ReceiveTaskNotification(ReceiveTaskNotificationRequest) returns (stream ReceiveTaskNotificationResponse) {
option (google.api.method_signature) = "instance_id_token,agent_version";
}

Expand All @@ -43,32 +43,25 @@ service AgentEndpointService {
}

// Signals an intermediary progress checkpoint in task execution.
rpc ReportTaskProgress(ReportTaskProgressRequest)
returns (ReportTaskProgressResponse) {
option (google.api.method_signature) =
"instance_id_token,task_id,task_type";
rpc ReportTaskProgress(ReportTaskProgressRequest) returns (ReportTaskProgressResponse) {
option (google.api.method_signature) = "instance_id_token,task_id,task_type";
}

// Signals that the task execution is complete and optionally returns the next
// task.
rpc ReportTaskComplete(ReportTaskCompleteRequest)
returns (ReportTaskCompleteResponse) {
option (google.api.method_signature) =
"instance_id_token,task_id,task_type,error_message";
rpc ReportTaskComplete(ReportTaskCompleteRequest) returns (ReportTaskCompleteResponse) {
option (google.api.method_signature) = "instance_id_token,task_id,task_type,error_message";
}

// Lookup the effective guest policy that applies to a VM instance. This
// lookup merges all policies that are assigned to the instance ancestry.
rpc LookupEffectiveGuestPolicy(LookupEffectiveGuestPolicyRequest)
returns (EffectiveGuestPolicy) {
option (google.api.method_signature) =
"instance_id_token,os_short_name,os_version,os_architecture";
rpc LookupEffectiveGuestPolicy(LookupEffectiveGuestPolicyRequest) returns (EffectiveGuestPolicy) {
option (google.api.method_signature) = "instance_id_token,os_short_name,os_version,os_architecture";
}

// Registers the agent running on the VM.
rpc RegisterAgent(RegisterAgentRequest) returns (RegisterAgentResponse) {
option (google.api.method_signature) =
"instance_id_token,agent_version,supported_capabilities";
option (google.api.method_signature) = "instance_id_token,agent_version,supported_capabilities";
}
}

Expand All @@ -85,7 +78,9 @@ message ReceiveTaskNotificationRequest {

// The streaming rpc message that notifies the agent when it has a task
// that it needs to perform on the VM instance.
message ReceiveTaskNotificationResponse {}
message ReceiveTaskNotificationResponse {

}

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

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

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

// The response message after the agent signaled the current task complete.
message ReportTaskCompleteResponse {}
message ReportTaskCompleteResponse {

}

// The request message for registering the agent.
message RegisterAgentRequest {
Expand All @@ -183,9 +182,26 @@ message RegisterAgentRequest {
// Required. The capabilities supported by the agent. Supported values are:
// PATCH_GA
// GUEST_POLICY_BETA
repeated string supported_capabilities = 3
[(google.api.field_behavior) = REQUIRED];
// CONFIG_V1
repeated string supported_capabilities = 3 [(google.api.field_behavior) = REQUIRED];

// The operating system long name.
// For example 'Debian GNU/Linux 9' or 'Microsoft Window Server 2019
// Datacenter'.
string os_long_name = 4;

// The operating system short name.
// For example, 'windows' or 'debian'.
string os_short_name = 5;

// The version of the operating system.
string os_version = 6;

// The system architecture of the operating system.
string os_architecture = 7;
}

// The response message after the agent registered.
message RegisterAgentResponse {}
message RegisterAgentResponse {

}
Expand Up @@ -16,6 +16,7 @@ syntax = "proto3";

package google.cloud.osconfig.agentendpoint.v1beta;

import "google/api/annotations.proto";
import "google/api/field_behavior.proto";

option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1beta;agentendpoint";
Expand Down
13 changes: 12 additions & 1 deletion google/cloud/osconfig/agentendpoint/v1beta/osconfig_v1beta.yaml
@@ -1,7 +1,7 @@
type: google.api.Service
config_version: 3
name: osconfig.googleapis.com
title: Cloud OS Config API
title: OS Config API

apis:
- name: google.cloud.osconfig.agentendpoint.v1beta.AgentEndpointService
Expand All @@ -17,3 +17,14 @@ backend:
deadline: 30.0
- selector: google.cloud.osconfig.agentendpoint.v1beta.AgentEndpointService.ReceiveTaskNotification
deadline: 3600.0

authentication:
rules:
- selector: google.longrunning.Operations.CancelOperation
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.longrunning.Operations.GetOperation
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
14 changes: 12 additions & 2 deletions google/cloud/osconfig/agentendpoint/v1beta/patch_jobs.proto
Expand Up @@ -16,6 +16,8 @@ syntax = "proto3";

package google.cloud.osconfig.agentendpoint.v1beta;

import "google/api/annotations.proto";

option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1beta;agentendpoint";
option java_outer_classname = "PatchJobs";
option java_package = "com.google.cloud.osconfig.agentendpoint.v1beta";
Expand Down Expand Up @@ -70,6 +72,9 @@ message PatchConfig {

// The ExecStep to run after the patch update.
ExecStep post_step = 9;

// Allows the patch job to run on Managed instance groups (MIGs).
bool mig_instances_allowed = 10;
}

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

// Googet patching is performed by running `googet update`.
message GooSettings {}
message GooSettings {

}

// Zypper patching is performed by running `zypper patch`.
// See also https://en.opensuse.org/SDB:Zypper_manual.
Expand Down Expand Up @@ -240,10 +247,13 @@ message ExecStep {
message ExecStepConfig {
// The interpreter used to execute the a file.
enum Interpreter {
// Deprecated, defaults to NONE for compatibility reasons.
INTERPRETER_UNSPECIFIED = 0;

// Invalid for a Windows ExecStepConfig. For a Linux ExecStepConfig, the
// interpreter will be parsed from the shebang line of the script if
// unspecified.
INTERPRETER_UNSPECIFIED = 0;
NONE = 3;

// Indicates that the script will be run with /bin/sh on Linux and cmd
// on windows.
Expand Down
5 changes: 2 additions & 3 deletions google/cloud/osconfig/agentendpoint/v1beta/tasks.proto
Expand Up @@ -16,11 +16,11 @@ syntax = "proto3";

package google.cloud.osconfig.agentendpoint.v1beta;

import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "google/cloud/osconfig/agentendpoint/v1beta/patch_jobs.proto";

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

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

0 comments on commit f158f82

Please sign in to comment.