agentendpoint.proto 9.3 KB

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