agentendpoint.proto 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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. syntax = "proto3";
  15. package google.cloud.osconfig.agentendpoint.v1;
  16. import "google/api/client.proto";
  17. import "google/api/field_behavior.proto";
  18. import "google/cloud/osconfig/agentendpoint/v1/inventory.proto";
  19. import "google/cloud/osconfig/agentendpoint/v1/tasks.proto";
  20. option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1;agentendpoint";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "AgentEndpointProto";
  23. option java_package = "com.google.cloud.osconfig.agentendpoint.v1";
  24. // OS Config agent endpoint API.
  25. service AgentEndpointService {
  26. option (google.api.default_host) = "osconfig.googleapis.com";
  27. // Stream established by client to receive Task notifications.
  28. rpc ReceiveTaskNotification(ReceiveTaskNotificationRequest) returns (stream ReceiveTaskNotificationResponse) {
  29. option (google.api.method_signature) = "instance_id_token,agent_version";
  30. }
  31. // Signals the start of a task execution and returns the task info.
  32. rpc StartNextTask(StartNextTaskRequest) returns (StartNextTaskResponse) {
  33. option (google.api.method_signature) = "instance_id_token";
  34. }
  35. // Signals an intermediary progress checkpoint in task execution.
  36. rpc ReportTaskProgress(ReportTaskProgressRequest) returns (ReportTaskProgressResponse) {
  37. option (google.api.method_signature) = "instance_id_token,task_id,task_type";
  38. }
  39. // Signals that the task execution is complete and optionally returns the next
  40. // task.
  41. rpc ReportTaskComplete(ReportTaskCompleteRequest) returns (ReportTaskCompleteResponse) {
  42. option (google.api.method_signature) = "instance_id_token,task_id,task_type,error_message";
  43. }
  44. // Registers the agent running on the VM.
  45. rpc RegisterAgent(RegisterAgentRequest) returns (RegisterAgentResponse) {
  46. option (google.api.method_signature) = "instance_id_token,agent_version,supported_capabilities";
  47. }
  48. // Reports the VMs current inventory.
  49. rpc ReportInventory(ReportInventoryRequest) returns (ReportInventoryResponse) {
  50. option (google.api.method_signature) = "instance_id_token,inventory_checksum,inventory";
  51. }
  52. }
  53. // A request message to receive task notifications.
  54. message ReceiveTaskNotificationRequest {
  55. // Required. This is the Compute Engine instance identity token described in
  56. // https://cloud.google.com/compute/docs/instances/verifying-instance-identity
  57. // where the audience is 'osconfig.googleapis.com' and the format is 'full'.
  58. string instance_id_token = 1 [(google.api.field_behavior) = REQUIRED];
  59. // Required. The version of the agent making the request.
  60. string agent_version = 2 [(google.api.field_behavior) = REQUIRED];
  61. }
  62. // The streaming rpc message that will notify the agent when it has a task
  63. // it needs to perform on the instance.
  64. message ReceiveTaskNotificationResponse {
  65. }
  66. // A request message for signaling the start of a task execution.
  67. message StartNextTaskRequest {
  68. // Required. This is the Compute Engine instance identity token described in
  69. // https://cloud.google.com/compute/docs/instances/verifying-instance-identity
  70. // where the audience is 'osconfig.googleapis.com' and the format is 'full'.
  71. string instance_id_token = 1 [(google.api.field_behavior) = REQUIRED];
  72. }
  73. // A response message that contains the details of the task to work on.
  74. message StartNextTaskResponse {
  75. // The details of the task that should be worked on. Can be empty if there
  76. // is no new task to work on.
  77. Task task = 1;
  78. }
  79. // A request message for reporting the progress of current task.
  80. message ReportTaskProgressRequest {
  81. // Required. This is the Compute Engine instance identity token described in
  82. // https://cloud.google.com/compute/docs/instances/verifying-instance-identity
  83. // where the audience is 'osconfig.googleapis.com' and the format is 'full'.
  84. string instance_id_token = 1 [(google.api.field_behavior) = REQUIRED];
  85. // Required. Unique identifier of the task this applies to.
  86. string task_id = 2 [(google.api.field_behavior) = REQUIRED];
  87. // Required. The type of task to report progress on.
  88. //
  89. // Progress must include the appropriate message based on this enum as
  90. // specified below:
  91. // APPLY_PATCHES = ApplyPatchesTaskProgress
  92. // EXEC_STEP = Progress not supported for this type.
  93. // APPLY_CONFIG_TASK = ApplyConfigTaskProgress
  94. TaskType task_type = 3 [(google.api.field_behavior) = REQUIRED];
  95. // Intermediate progress of the current task.
  96. oneof progress {
  97. // Details about the progress of the apply patches task.
  98. ApplyPatchesTaskProgress apply_patches_task_progress = 4;
  99. // Details about the progress of the exec step task.
  100. ExecStepTaskProgress exec_step_task_progress = 5;
  101. // Details about the progress of the apply config task.
  102. ApplyConfigTaskProgress apply_config_task_progress = 6;
  103. }
  104. }
  105. // The response message after the agent reported the current task progress.
  106. message ReportTaskProgressResponse {
  107. // Instructs agent to continue or not.
  108. TaskDirective task_directive = 1;
  109. }
  110. // A request message for signaling the completion of a task execution.
  111. message ReportTaskCompleteRequest {
  112. // Required. This is the Compute Engine instance identity token described in
  113. // https://cloud.google.com/compute/docs/instances/verifying-instance-identity
  114. // where the audience is 'osconfig.googleapis.com' and the format is 'full'.
  115. string instance_id_token = 1 [(google.api.field_behavior) = REQUIRED];
  116. // Required. Unique identifier of the task this applies to.
  117. string task_id = 2 [(google.api.field_behavior) = REQUIRED];
  118. // Required. The type of task to report completed.
  119. //
  120. // Output must include the appropriate message based on this enum as
  121. // specified below:
  122. // APPLY_PATCHES = ApplyPatchesTaskOutput
  123. // EXEC_STEP = ExecStepTaskOutput
  124. // APPLY_CONFIG_TASK = ApplyConfigTaskOutput
  125. TaskType task_type = 3 [(google.api.field_behavior) = REQUIRED];
  126. // Descriptive error message if the task execution ended in error.
  127. string error_message = 4;
  128. // Final output details of the current task.
  129. oneof output {
  130. // Final output details of the apply patches task;
  131. ApplyPatchesTaskOutput apply_patches_task_output = 5;
  132. // Final output details of the exec step task;
  133. ExecStepTaskOutput exec_step_task_output = 6;
  134. // Final output details of the apply config task;
  135. ApplyConfigTaskOutput apply_config_task_output = 7;
  136. }
  137. }
  138. // The response message after the agent signaled the current task complete.
  139. message ReportTaskCompleteResponse {
  140. }
  141. // The request message for registering the agent.
  142. message RegisterAgentRequest {
  143. // Required. This is the Compute Engine instance identity token described in
  144. // https://cloud.google.com/compute/docs/instances/verifying-instance-identity
  145. // where the audience is 'osconfig.googleapis.com' and the format is 'full'.
  146. string instance_id_token = 1 [(google.api.field_behavior) = REQUIRED];
  147. // Required. The version of the agent.
  148. string agent_version = 2 [(google.api.field_behavior) = REQUIRED];
  149. // Required. The capabilities supported by the agent. Supported values are:
  150. // PATCH_GA
  151. // GUEST_POLICY_BETA
  152. // CONFIG_V1
  153. repeated string supported_capabilities = 3 [(google.api.field_behavior) = REQUIRED];
  154. // The operating system long name.
  155. // For example 'Debian GNU/Linux 9' or 'Microsoft Window Server 2019
  156. // Datacenter'.
  157. string os_long_name = 4;
  158. // The operating system short name.
  159. // For example, 'windows' or 'debian'.
  160. string os_short_name = 5;
  161. // The version of the operating system.
  162. string os_version = 6;
  163. // The system architecture of the operating system.
  164. string os_architecture = 7;
  165. }
  166. // The response message after the agent registered.
  167. message RegisterAgentResponse {
  168. }
  169. // The request message for having the agent report inventory.
  170. message ReportInventoryRequest {
  171. // Required. This is the Compute Engine instance identity token described in
  172. // https://cloud.google.com/compute/docs/instances/verifying-instance-identity
  173. // where the audience is 'osconfig.googleapis.com' and the format is 'full'.
  174. string instance_id_token = 1 [(google.api.field_behavior) = REQUIRED];
  175. // Required. This is a client created checksum that should be generated based on the
  176. // contents of the reported inventory. This will be used by the service to
  177. // determine if it has the latest version of inventory.
  178. string inventory_checksum = 2 [(google.api.field_behavior) = REQUIRED];
  179. // Optional. This is the details of the inventory. Should only be provided if the
  180. // inventory has changed since the last report, or if instructed by the
  181. // service to provide full inventory.
  182. Inventory inventory = 3 [(google.api.field_behavior) = OPTIONAL];
  183. }
  184. // The response message after the agent has reported inventory.
  185. message ReportInventoryResponse {
  186. // If true, the full inventory should be reported back to the server.
  187. bool report_full_inventory = 1;
  188. }