sharedlibraries/protos/guestactions/guestactions.proto (100 lines of code) (raw):
/*
Copyright 2024 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
syntax = "proto3";
package workloadagentplatform.sharedlibraries.protos.guestactions;
import "google/protobuf/any.proto";
option java_multiple_files = true;
option java_package = "workloadagentplatform.sharedlibraries.protos.guestactions";
option go_package = "github.com/GoogleCloudPlatform/workloadagentplatform/sharedlibraries/protos/guestactions";
/**
* A GuestActionRequest is contained in the body of an UAP message that is sent
* to the agent by the WorkloadActions service.
*/
message GuestActionRequest {
WorkloadAction workload_action = 1;
repeated Command commands = 2;
}
/**
* A GuestActionResponse is contained in the body of an Agent Communication
* message that is sent from the agent to the WorkloadActions service.
*/
message GuestActionResponse {
repeated CommandResult command_results = 1;
GuestActionError error = 2;
}
/**
* A WorkloadAction encodes the intended purpose of a guest action request.
* It is intended to be used as metadata for informational purposes.
*/
message WorkloadAction {
oneof workload_type {
SapWorkloadAction sap_workload_action = 1;
}
}
/**
* SapWorkloadAction specifies the type of SAP workload action to perform.
*/
enum SapWorkloadAction {
SAP_WORKLOAD_ACTION_UNSPECIFIED = 0;
SAP_WLM_EVALUATION_FIX = 1;
SAP_START = 2;
SAP_STOP = 3;
SAP_SNOOZE = 4;
}
/**
* Command specifies the type of command to execute.
*/
message Command {
oneof command_type {
AgentCommand agent_command = 1;
ShellCommand shell_command = 2;
}
}
/**
* An AgentCommand specifies a one-time executable program for the agent to run.
*/
message AgentCommand {
// command is the name of the agent one-time executable that will be invoked.
string command = 1;
// parameters is a map of key/value pairs that can be used to specify
// additional one-time executable settings.
map<string, string> parameters = 2;
}
/**
* A ShellCommand is invoked via the agent's command line executor
*/
message ShellCommand {
// command is the name of the command to be executed.
string command = 1;
// args is a string of arguments to be passed to the command.
string args = 2;
// Optional. If not specified, the default timeout is 60 seconds.
int32 timeout_seconds = 3;
}
/**
* CommandResult contains the result of a single command execution.
*/
message CommandResult {
Command command = 1;
string stdout = 2;
string stderr = 3;
int32 exit_code = 4;
google.protobuf.Any payload = 5;
}
/**
* GuestActionError contains details about an error that occurred while
* processing a GuestActionRequest.
*/
message GuestActionError {
string error_message = 1;
}