patch_deployments.proto 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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.v1beta;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/osconfig/v1beta/patch_jobs.proto";
  19. import "google/protobuf/duration.proto";
  20. import "google/protobuf/timestamp.proto";
  21. import "google/type/datetime.proto";
  22. import "google/type/dayofweek.proto";
  23. import "google/type/timeofday.proto";
  24. option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta;osconfig";
  25. option java_outer_classname = "PatchDeployments";
  26. option java_package = "com.google.cloud.osconfig.v1beta";
  27. // Patch deployments are configurations that individual patch jobs use to
  28. // complete a patch. These configurations include instance filter, package
  29. // repository settings, and a schedule. For more information about creating and
  30. // managing patch deployments, see [Scheduling patch
  31. // jobs](/compute/docs/os-patch-management/schedule-patch-jobs).
  32. message PatchDeployment {
  33. // Unique name for the patch deployment resource in a project. The patch
  34. // deployment name is in the form:
  35. // `projects/{project_id}/patchDeployments/{patch_deployment_id}`.
  36. // This field is ignored when you create a new patch deployment.
  37. string name = 1;
  38. // Optional. Description of the patch deployment. Length of the description is limited
  39. // to 1024 characters.
  40. string description = 2 [(google.api.field_behavior) = OPTIONAL];
  41. // Required. VM instances to patch.
  42. PatchInstanceFilter instance_filter = 3 [(google.api.field_behavior) = REQUIRED];
  43. // Optional. Patch configuration that is applied.
  44. PatchConfig patch_config = 4 [(google.api.field_behavior) = OPTIONAL];
  45. // Optional. Duration of the patch. After the duration ends, the patch times out.
  46. google.protobuf.Duration duration = 5 [(google.api.field_behavior) = OPTIONAL];
  47. // Schedule for the patch.
  48. oneof schedule {
  49. // Required. Schedule a one-time execution.
  50. OneTimeSchedule one_time_schedule = 6 [(google.api.field_behavior) = REQUIRED];
  51. // Required. Schedule recurring executions.
  52. RecurringSchedule recurring_schedule = 7 [(google.api.field_behavior) = REQUIRED];
  53. }
  54. // Output only. Time the patch deployment was created. Timestamp is in
  55. // <a href="https://www.ietf.org/rfc/rfc3339.txt" target="_blank">RFC3339</a>
  56. // text format.
  57. google.protobuf.Timestamp create_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  58. // Output only. Time the patch deployment was last updated. Timestamp is in
  59. // <a href="https://www.ietf.org/rfc/rfc3339.txt" target="_blank">RFC3339</a>
  60. // text format.
  61. google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  62. // Output only. The last time a patch job was started by this deployment.
  63. // Timestamp is in
  64. // <a href="https://www.ietf.org/rfc/rfc3339.txt" target="_blank">RFC3339</a>
  65. // text format.
  66. google.protobuf.Timestamp last_execute_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  67. }
  68. // Sets the time for a one time patch deployment. Timestamp is in
  69. // <a href="https://www.ietf.org/rfc/rfc3339.txt" target="_blank">RFC3339</a>
  70. // text format.
  71. message OneTimeSchedule {
  72. // Required. The desired patch job execution time.
  73. google.protobuf.Timestamp execute_time = 1 [(google.api.field_behavior) = REQUIRED];
  74. }
  75. // Sets the time for recurring patch deployments.
  76. message RecurringSchedule {
  77. // Specifies the frequency of the recurring patch deployments.
  78. enum Frequency {
  79. // Invalid. A frequency must be specified.
  80. FREQUENCY_UNSPECIFIED = 0;
  81. // Indicates that the frequency should be expressed in terms of
  82. // weeks.
  83. WEEKLY = 1;
  84. // Indicates that the frequency should be expressed in terms of
  85. // months.
  86. MONTHLY = 2;
  87. }
  88. // Required. Defines the time zone that `time_of_day` is relative to.
  89. // The rules for daylight saving time are determined by the chosen time zone.
  90. google.type.TimeZone time_zone = 1 [(google.api.field_behavior) = REQUIRED];
  91. // Optional. The time that the recurring schedule becomes effective.
  92. // Defaults to `create_time` of the patch deployment.
  93. google.protobuf.Timestamp start_time = 2 [(google.api.field_behavior) = OPTIONAL];
  94. // Optional. The end time at which a recurring patch deployment schedule is no longer
  95. // active.
  96. google.protobuf.Timestamp end_time = 3 [(google.api.field_behavior) = OPTIONAL];
  97. // Required. Time of the day to run a recurring deployment.
  98. google.type.TimeOfDay time_of_day = 4 [(google.api.field_behavior) = REQUIRED];
  99. // Required. The frequency unit of this recurring schedule.
  100. Frequency frequency = 5 [(google.api.field_behavior) = REQUIRED];
  101. // Configurations for this recurring schedule.
  102. // Configurations must match frequency.
  103. oneof schedule_config {
  104. // Required. Schedule with weekly executions.
  105. WeeklySchedule weekly = 6 [(google.api.field_behavior) = REQUIRED];
  106. // Required. Schedule with monthly executions.
  107. MonthlySchedule monthly = 7 [(google.api.field_behavior) = REQUIRED];
  108. }
  109. // Output only. The time the last patch job ran successfully.
  110. google.protobuf.Timestamp last_execute_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  111. // Output only. The time the next patch job is scheduled to run.
  112. google.protobuf.Timestamp next_execute_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  113. }
  114. // Represents a weekly schedule.
  115. message WeeklySchedule {
  116. // Required. Day of the week.
  117. google.type.DayOfWeek day_of_week = 1 [(google.api.field_behavior) = REQUIRED];
  118. }
  119. // Represents a monthly schedule. An example of a valid monthly schedule is
  120. // "on the third Tuesday of the month" or "on the 15th of the month".
  121. message MonthlySchedule {
  122. // One day in a month.
  123. oneof day_of_month {
  124. // Required. Week day in a month.
  125. WeekDayOfMonth week_day_of_month = 1 [(google.api.field_behavior) = REQUIRED];
  126. // Required. One day of the month. 1-31 indicates the 1st to the 31st day. -1
  127. // indicates the last day of the month.
  128. // Months without the target day will be skipped. For example, a schedule to
  129. // run "every month on the 31st" will not run in February, April, June, etc.
  130. int32 month_day = 2 [(google.api.field_behavior) = REQUIRED];
  131. }
  132. }
  133. // Represents one week day in a month. An example is "the 4th Sunday".
  134. message WeekDayOfMonth {
  135. // Required. Week number in a month. 1-4 indicates the 1st to 4th week of the month. -1
  136. // indicates the last week of the month.
  137. int32 week_ordinal = 1 [(google.api.field_behavior) = REQUIRED];
  138. // Required. A day of the week.
  139. google.type.DayOfWeek day_of_week = 2 [(google.api.field_behavior) = REQUIRED];
  140. }
  141. // A request message for creating a patch deployment.
  142. message CreatePatchDeploymentRequest {
  143. // Required. The project to apply this patch deployment to in the form `projects/*`.
  144. string parent = 1 [(google.api.field_behavior) = REQUIRED];
  145. // Required. A name for the patch deployment in the project. When creating a name
  146. // the following rules apply:
  147. // * Must contain only lowercase letters, numbers, and hyphens.
  148. // * Must start with a letter.
  149. // * Must be between 1-63 characters.
  150. // * Must end with a number or a letter.
  151. // * Must be unique within the project.
  152. string patch_deployment_id = 2 [(google.api.field_behavior) = REQUIRED];
  153. // Required. The patch deployment to create.
  154. PatchDeployment patch_deployment = 3 [(google.api.field_behavior) = REQUIRED];
  155. }
  156. // A request message for retrieving a patch deployment.
  157. message GetPatchDeploymentRequest {
  158. // Required. The resource name of the patch deployment in the form
  159. // `projects/*/patchDeployments/*`.
  160. string name = 1 [(google.api.field_behavior) = REQUIRED];
  161. }
  162. // A request message for listing patch deployments.
  163. message ListPatchDeploymentsRequest {
  164. // Required. The resource name of the parent in the form `projects/*`.
  165. string parent = 1 [(google.api.field_behavior) = REQUIRED];
  166. // Optional. The maximum number of patch deployments to return. Default is 100.
  167. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  168. // Optional. A pagination token returned from a previous call to ListPatchDeployments
  169. // that indicates where this listing should continue from.
  170. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  171. }
  172. // A response message for listing patch deployments.
  173. message ListPatchDeploymentsResponse {
  174. // The list of patch deployments.
  175. repeated PatchDeployment patch_deployments = 1;
  176. // A pagination token that can be used to get the next page of patch
  177. // deployments.
  178. string next_page_token = 2;
  179. }
  180. // A request message for deleting a patch deployment.
  181. message DeletePatchDeploymentRequest {
  182. // Required. The resource name of the patch deployment in the form
  183. // `projects/*/patchDeployments/*`.
  184. string name = 1 [(google.api.field_behavior) = REQUIRED];
  185. }