agentendpoint.proto 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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.v1beta;
  16. import "google/api/client.proto";
  17. import "google/api/field_behavior.proto";
  18. import "google/cloud/osconfig/agentendpoint/v1beta/guest_policies.proto";
  19. import "google/cloud/osconfig/agentendpoint/v1beta/tasks.proto";
  20. option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/agentendpoint/v1beta;agentendpoint";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "AgentEndpointProto";
  23. option java_package = "com.google.cloud.osconfig.agentendpoint.v1beta";
  24. option php_namespace = "Google\\Cloud\\OsConfig\\V1beta";
  25. // OS Config agent endpoint API.
  26. service AgentEndpointService {
  27. option (google.api.default_host) = "osconfig.googleapis.com";
  28. // Stream established by client to receive Task notifications.
  29. rpc ReceiveTaskNotification(ReceiveTaskNotificationRequest)
  30. returns (stream ReceiveTaskNotificationResponse) {
  31. option (google.api.method_signature) = "instance_id_token,agent_version";
  32. }
  33. // Signals the start of a task execution and returns the task info.
  34. rpc StartNextTask(StartNextTaskRequest) returns (StartNextTaskResponse) {
  35. option (google.api.method_signature) = "instance_id_token";
  36. }
  37. // Signals an intermediary progress checkpoint in task execution.
  38. rpc ReportTaskProgress(ReportTaskProgressRequest)
  39. returns (ReportTaskProgressResponse) {
  40. option (google.api.method_signature) =
  41. "instance_id_token,task_id,task_type";
  42. }
  43. // Signals that the task execution is complete and optionally returns the next
  44. // task.
  45. rpc ReportTaskComplete(ReportTaskCompleteRequest)
  46. returns (ReportTaskCompleteResponse) {
  47. option (google.api.method_signature) =
  48. "instance_id_token,task_id,task_type,error_message";
  49. }
  50. // Lookup the effective guest policy that applies to a VM instance. This
  51. // lookup merges all policies that are assigned to the instance ancestry.
  52. rpc LookupEffectiveGuestPolicy(LookupEffectiveGuestPolicyRequest)
  53. returns (EffectiveGuestPolicy) {
  54. option (google.api.method_signature) =
  55. "instance_id_token,os_short_name,os_version,os_architecture";
  56. }
  57. // Registers the agent running on the VM.
  58. rpc RegisterAgent(RegisterAgentRequest) returns (RegisterAgentResponse) {
  59. option (google.api.method_signature) =
  60. "instance_id_token,agent_version,supported_capabilities";
  61. }
  62. }
  63. // A request message to receive task notifications.
  64. message ReceiveTaskNotificationRequest {
  65. // Required. This is the Compute Engine instance identity token described in
  66. // https://cloud.google.com/compute/docs/instances/verifying-instance-identity
  67. // where the audience is 'osconfig.googleapis.com' and the format is 'full'.
  68. string instance_id_token = 1 [(google.api.field_behavior) = REQUIRED];
  69. // Required. The version of the agent making the request.
  70. string agent_version = 2 [(google.api.field_behavior) = REQUIRED];
  71. }
  72. // The streaming rpc message that notifies the agent when it has a task
  73. // that it needs to perform on the VM instance.
  74. message ReceiveTaskNotificationResponse {}
  75. // A request message for signaling the start of a task execution.
  76. message StartNextTaskRequest {
  77. // Required. This is the Compute Engine instance identity token described in
  78. // https://cloud.google.com/compute/docs/instances/verifying-instance-identity
  79. // where the audience is 'osconfig.googleapis.com' and the format is 'full'.
  80. string instance_id_token = 1 [(google.api.field_behavior) = REQUIRED];
  81. }
  82. // A response message that contains the details of the task to work on.
  83. message StartNextTaskResponse {
  84. // The details of the task that should be worked on. Can be empty if there
  85. // is no new task to work on.
  86. Task task = 1;
  87. }
  88. // A request message for reporting the progress of current task.
  89. message ReportTaskProgressRequest {
  90. // Required. This is the Compute Engine instance identity token described in
  91. // https://cloud.google.com/compute/docs/instances/verifying-instance-identity
  92. // where the audience is 'osconfig.googleapis.com' and the format is 'full'.
  93. string instance_id_token = 1 [(google.api.field_behavior) = REQUIRED];
  94. // Required. Unique identifier of the task this applies to.
  95. string task_id = 2 [(google.api.field_behavior) = REQUIRED];
  96. // Required. The type of task to report progress on.
  97. //
  98. // Progress must include the appropriate message based on this enum as
  99. // specified below:
  100. // APPLY_PATCHES = ApplyPatchesTaskProgress
  101. // EXEC_STEP = Progress not supported for this type.
  102. TaskType task_type = 3 [(google.api.field_behavior) = REQUIRED];
  103. // Intermediate progress of the current task.
  104. oneof progress {
  105. // Details about the progress of the apply patches task.
  106. ApplyPatchesTaskProgress apply_patches_task_progress = 4;
  107. // Details about the progress of the exec step task.
  108. ExecStepTaskProgress exec_step_task_progress = 5;
  109. }
  110. }
  111. // The response message after the agent reported the current task progress.
  112. message ReportTaskProgressResponse {
  113. // Instructs agent to continue or not.
  114. TaskDirective task_directive = 1;
  115. }
  116. // A request message for signaling the completion of a task execution.
  117. message ReportTaskCompleteRequest {
  118. // Required. This is the Compute Engine instance identity token described in
  119. // https://cloud.google.com/compute/docs/instances/verifying-instance-identity
  120. // where the audience is 'osconfig.googleapis.com' and the format is 'full'.
  121. string instance_id_token = 1 [(google.api.field_behavior) = REQUIRED];
  122. // Required. Unique identifier of the task this applies to.
  123. string task_id = 2 [(google.api.field_behavior) = REQUIRED];
  124. // Required. The type of task to report completed.
  125. //
  126. // The output must include the appropriate message based on the following
  127. // enum values:
  128. // APPLY_PATCHES = ApplyPatchesTaskOutput
  129. // EXEC_STEP = ExecStepTaskOutput
  130. TaskType task_type = 3 [(google.api.field_behavior) = REQUIRED];
  131. // Descriptive error message if the task execution ended in error.
  132. string error_message = 4;
  133. // Final output details of the current task.
  134. oneof output {
  135. // Final output details of the apply patches task;
  136. ApplyPatchesTaskOutput apply_patches_task_output = 5;
  137. // Final output details of the exec step task;
  138. ExecStepTaskOutput exec_step_task_output = 6;
  139. }
  140. }
  141. // The response message after the agent signaled the current task complete.
  142. message ReportTaskCompleteResponse {}
  143. // The request message for registering the agent.
  144. message RegisterAgentRequest {
  145. // Required. This is the Compute Engine instance identity token described in
  146. // https://cloud.google.com/compute/docs/instances/verifying-instance-identity
  147. // where the audience is 'osconfig.googleapis.com' and the format is 'full'.
  148. string instance_id_token = 1 [(google.api.field_behavior) = REQUIRED];
  149. // Required. The version of the agent.
  150. string agent_version = 2 [(google.api.field_behavior) = REQUIRED];
  151. // Required. The capabilities supported by the agent. Supported values are:
  152. // PATCH_GA
  153. // GUEST_POLICY_BETA
  154. repeated string supported_capabilities = 3
  155. [(google.api.field_behavior) = REQUIRED];
  156. }
  157. // The response message after the agent registered.
  158. message RegisterAgentResponse {}