feat: Adding retry policy for OS Config V1Beta OsConfigService

PiperOrigin-RevId: 306471195
pull/602/head
Google APIs 5 years ago committed by Copybara-Service
parent 3028060618
commit b5aa7d668d
  1. 91
      google/cloud/osconfig/v1beta/guest_policies.proto
  2. 22
      google/cloud/osconfig/v1beta/osconfig_grpc_service_config.json
  3. 28
      google/cloud/osconfig/v1beta/osconfig_service.proto
  4. 3
      google/cloud/osconfig/v1beta/osconfig_v1beta.yaml
  5. 93
      google/cloud/osconfig/v1beta/patch_deployments.proto
  6. 54
      google/cloud/osconfig/v1beta/patch_jobs.proto

@ -1,4 +1,4 @@
// Copyright 2019 Google LLC. // Copyright 2020 Google LLC
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//
syntax = "proto3"; syntax = "proto3";
@ -36,8 +35,8 @@ message GuestPolicy {
pattern: "projects/{project}/guestPolicies/{guest_policy}" pattern: "projects/{project}/guestPolicies/{guest_policy}"
}; };
// Required. Unique name of the resource in this project using one of the // Required. Unique name of the resource in this project using one of the following
// following forms: // forms:
// `projects/{project_number}/guestPolicies/{guest_policy_id}`. // `projects/{project_number}/guestPolicies/{guest_policy_id}`.
string name = 1 [(google.api.field_behavior) = REQUIRED]; string name = 1 [(google.api.field_behavior) = REQUIRED];
@ -46,40 +45,21 @@ message GuestPolicy {
string description = 2; string description = 2;
// Output only. Time this guest policy was created. // Output only. Time this guest policy was created.
google.protobuf.Timestamp create_time = 3 google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Last time this guest policy was updated. // Output only. Last time this guest policy was updated.
google.protobuf.Timestamp update_time = 4 google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
[(google.api.field_behavior) = OUTPUT_ONLY];
// Required. Specifies the VM instances that are assigned to this policy. This // Required. Specifies the VM instances that are assigned to this policy. This allows
// allows you to target sets or groups of VM instances by different parameters // you to target sets or groups of VM instances by different parameters such
// such as labels, names, OS, or zones. // as labels, names, OS, or zones.
// //
// If left empty, all VM instances underneath this policy are targeted. // If left empty, all VM instances underneath this policy are targeted.
// //
//
// Conflict Management
//
// At the same level in the resource hierarchy (that is within a project), the // At the same level in the resource hierarchy (that is within a project), the
// service prevents the creation of multiple policies that conflict with // service prevents the creation of multiple policies that conflict with
// each other. If there are multiple policies that specify the same config // each other. For more information, see how the service [handles assignment
// (eg. package, software recipe, repository, etc.), the service ensures // conflicts](/compute/docs/os-config-management/create-guest-policy#handle-conflicts).
// that no VM instance could potentially receive instructions from both
// policies. To create multiple policies that specify different versions of a
// package or different configs for different operating systems, each policy
// must be mutually exclusive in their targeting according to labels, OS, or
// other criteria.
//
// Different configs are identified for conflicts in different ways. Packages
// are identified by their name and the package manager(s) they target.
// Package repositories are identified by their unique id where applicable.
// Some package managers don't have a unique identifier for repositories and
// where that's the case, no uniqueness is validated by the service.
//
// Note that if OS Inventory is disabled, a VM instance cannot assign a policy
// that targets by OS because the service sees the OS as unknown.
Assignment assignment = 6 [(google.api.field_behavior) = REQUIRED]; Assignment assignment = 6 [(google.api.field_behavior) = REQUIRED];
// The software packages to be managed by this policy. // The software packages to be managed by this policy.
@ -110,8 +90,8 @@ message Assignment {
// Represents a group of VM intances that can be identified as having all // Represents a group of VM intances that can be identified as having all
// these labels, for example "env=prod and app=web". // these labels, for example "env=prod and app=web".
message GroupLabel { message GroupLabel {
// GCE instance labels that must be present for an instance to be included // Google Compute Engine instance labels that must be present for an
// in this assignment group. // instance to be included in this assignment group.
map<string, string> labels = 1; map<string, string> labels = 1;
} }
@ -156,7 +136,7 @@ message Assignment {
// Targets VM instances whose name starts with one of these prefixes. // Targets VM instances whose name starts with one of these prefixes.
// //
// Like labels, this is another way to group VM instances when targeting // Like labels, this is another way to group VM instances when targeting
// configs, for example prefix=prod-. // configs, for example prefix="prod-".
// //
// Only supported for project-level policies. // Only supported for project-level policies.
repeated string instance_name_prefixes = 4; repeated string instance_name_prefixes = 4;
@ -213,9 +193,9 @@ message Package {
GOO = 5; GOO = 5;
} }
// Required. The name of the package. A package is uniquely identified for // Required. The name of the package. A package is uniquely identified for conflict
// conflict validation by checking the package name and the manager(s) that // validation by checking the package name and the manager(s) that the
// the package targets. // package targets.
string name = 1 [(google.api.field_behavior) = REQUIRED]; string name = 1 [(google.api.field_behavior) = REQUIRED];
// The desired_state the agent should maintain for this package. The // The desired_state the agent should maintain for this package. The
@ -259,8 +239,7 @@ message AptRepository {
// Required. Distribution of this repository. // Required. Distribution of this repository.
string distribution = 3 [(google.api.field_behavior) = REQUIRED]; string distribution = 3 [(google.api.field_behavior) = REQUIRED];
// Required. List of components for this repository. Must contain at least one // Required. List of components for this repository. Must contain at least one item.
// item.
repeated string components = 4 [(google.api.field_behavior) = REQUIRED]; repeated string components = 4 [(google.api.field_behavior) = REQUIRED];
// URI of the key file for this repository. The agent maintains // URI of the key file for this repository. The agent maintains
@ -392,15 +371,15 @@ message SoftwareRecipe {
string checksum = 2; string checksum = 2;
} }
// Specifies an artifact available as a Cloud Storage object. // Specifies an artifact available as a Google Cloud Storage object.
message Gcs { message Gcs {
// Bucket of the Cloud Storage object. // Bucket of the Google Cloud Storage object.
// Given an example URL: // Given an example URL:
// `https://storage.googleapis.com/my-bucket/foo/bar#1234567` // `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
// this value would be `my-bucket`. // this value would be `my-bucket`.
string bucket = 1; string bucket = 1;
// Name of the Cloud Storage object. // Name of the Google Cloud Storage object.
// As specified [here] // As specified [here]
// (https://cloud.google.com/storage/docs/naming#objectnames) // (https://cloud.google.com/storage/docs/naming#objectnames)
// Given an example URL: // Given an example URL:
@ -409,14 +388,14 @@ message SoftwareRecipe {
string object = 2; string object = 2;
// Must be provided if allow_insecure is false. // Must be provided if allow_insecure is false.
// Generation number of the Cloud Storage object. // Generation number of the Google Cloud Storage object.
// `https://storage.googleapis.com/my-bucket/foo/bar#1234567` // `https://storage.googleapis.com/my-bucket/foo/bar#1234567`
// this value would be `1234567`. // this value would be `1234567`.
int64 generation = 3; int64 generation = 3;
} }
// Required. Id of the artifact, which the installation and update steps of // Required. Id of the artifact, which the installation and update steps of this
// this recipe can reference. Artifacts in a recipe cannot have the same id. // recipe can reference. Artifacts in a recipe cannot have the same id.
string id = 1 [(google.api.field_behavior) = REQUIRED]; string id = 1 [(google.api.field_behavior) = REQUIRED];
// A specific type of artifact. // A specific type of artifact.
@ -424,7 +403,7 @@ message SoftwareRecipe {
// A generic remote artifact. // A generic remote artifact.
Remote remote = 2; Remote remote = 2;
// A Cloud Storage artifact. // A Google Cloud Storage artifact.
Gcs gcs = 3; Gcs gcs = 3;
} }
@ -432,7 +411,7 @@ message SoftwareRecipe {
// based on the artifact type: // based on the artifact type:
// //
// Remote: A checksum must be specified, and only protocols with // Remote: A checksum must be specified, and only protocols with
// transport-layer security are permitted. // transport-layer security are permitted.
// GCS: An object generation number must be specified. // GCS: An object generation number must be specified.
bool allow_insecure = 4; bool allow_insecure = 4;
} }
@ -575,7 +554,7 @@ message SoftwareRecipe {
// The script interpreter to use to run the script. If no interpreter is // The script interpreter to use to run the script. If no interpreter is
// specified the script is executed directly, which likely // specified the script is executed directly, which likely
// only succeed for scripts with // only succeed for scripts with
// [shebang lines](https://en.wikipedia.org/wiki/Shebang_(Unix)). // [shebang lines](https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
Interpreter interpreter = 3; Interpreter interpreter = 3;
} }
@ -604,8 +583,8 @@ message SoftwareRecipe {
} }
} }
// Required. Unique identifier for the recipe. Only one recipe with a given // Required. Unique identifier for the recipe. Only one recipe with a given name is
// name is installed on an instance. // installed on an instance.
// //
// Names are also used to identify resources which helps to determine whether // Names are also used to identify resources which helps to determine whether
// guest policies have conflicts. This means that requests to create multiple // guest policies have conflicts. This means that requests to create multiple
@ -671,8 +650,8 @@ message CreateGuestPolicyRequest {
// A request message for retrieving a guest policy. // A request message for retrieving a guest policy.
message GetGuestPolicyRequest { message GetGuestPolicyRequest {
// Required. The resource name of the guest policy using one of the following // Required. The resource name of the guest policy using one of the following forms:
// forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`. // `projects/{project_number}/guestPolicies/{guest_policy_id}`.
string name = 1 [ string name = 1 [
(google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { (google.api.resource_reference) = {
@ -722,8 +701,8 @@ message UpdateGuestPolicyRequest {
// A request message for deleting a guest policy. // A request message for deleting a guest policy.
message DeleteGuestPolicyRequest { message DeleteGuestPolicyRequest {
// Required. The resource name of the guest policy using one of the following // Required. The resource name of the guest policy using one of the following forms:
// forms: `projects/{project_number}/guestPolicies/{guest_policy_id}`. // `projects/{project_number}/guestPolicies/{guest_policy_id}`.
string name = 1 [ string name = 1 [
(google.api.field_behavior) = REQUIRED, (google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { (google.api.resource_reference) = {
@ -739,17 +718,17 @@ message LookupEffectiveGuestPolicyRequest {
string instance = 1 [(google.api.field_behavior) = REQUIRED]; string instance = 1 [(google.api.field_behavior) = REQUIRED];
// Short name of the OS running on the instance. The OS Config agent only // Short name of the OS running on the instance. The OS Config agent only
// provideS this field for targeting if OS Inventory is enabled for that // provides this field for targeting if OS Inventory is enabled for that
// instance. // instance.
string os_short_name = 2; string os_short_name = 2;
// Version of the OS running on the instance. The OS Config agent only // Version of the OS running on the instance. The OS Config agent only
// provide this field for targeting if OS Inventory is enabled for that // provides this field for targeting if OS Inventory is enabled for that
// VM instance. // VM instance.
string os_version = 3; string os_version = 3;
// Architecture of OS running on the instance. The OS Config agent only // Architecture of OS running on the instance. The OS Config agent only
// provide this field for targeting if OS Inventory is enabled for that // provides this field for targeting if OS Inventory is enabled for that
// instance. // instance.
string os_architecture = 4; string os_architecture = 4;
} }

@ -7,27 +7,7 @@
"initialBackoff": "1s", "initialBackoff": "1s",
"maxBackoff": "60s", "maxBackoff": "60s",
"backoffMultiplier": 1.3, "backoffMultiplier": 1.3,
"retryableStatusCodes": ["UNAVAILABLE", "DEADLINE_EXCEEDED"] "retryableStatusCodes": ["UNAVAILABLE"]
} }
},
{
"name": [
{ "service": "google.cloud.osconfig.v1beta.OsConfigService", "method": "ExecutePatchJob" },
{ "service": "google.cloud.osconfig.v1beta.OsConfigService", "method": "GetPatchJob" },
{ "service": "google.cloud.osconfig.v1beta.OsConfigService", "method": "CancelPatchJob" },
{ "service": "google.cloud.osconfig.v1beta.OsConfigService", "method": "ListPatchJobs" },
{ "service": "google.cloud.osconfig.v1beta.OsConfigService", "method": "ListPatchJobInstanceDetails" },
{ "service": "google.cloud.osconfig.v1beta.OsConfigService", "method": "CreatePatchDeployment" },
{ "service": "google.cloud.osconfig.v1beta.OsConfigService", "method": "GetPatchDeployment" },
{ "service": "google.cloud.osconfig.v1beta.OsConfigService", "method": "ListPatchDeployments" },
{ "service": "google.cloud.osconfig.v1beta.OsConfigService", "method": "DeletePatchDeployment" },
{ "service": "google.cloud.osconfig.v1beta.OsConfigService", "method": "CreateGuestPolicy" },
{ "service": "google.cloud.osconfig.v1beta.OsConfigService", "method": "GetGuestPolicy" },
{ "service": "google.cloud.osconfig.v1beta.OsConfigService", "method": "ListGuestPolicies" },
{ "service": "google.cloud.osconfig.v1beta.OsConfigService", "method": "UpdateGuestPolicy" },
{ "service": "google.cloud.osconfig.v1beta.OsConfigService", "method": "DeleteGuestPolicy" },
{ "service": "google.cloud.osconfig.v1beta.OsConfigService", "method": "LookupEffectiveGuestPolicy" }
],
"timeout": "60s"
}] }]
} }

@ -1,4 +1,4 @@
// Copyright 2019 Google LLC. // Copyright 2020 Google LLC
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//
syntax = "proto3"; syntax = "proto3";
@ -34,9 +33,7 @@ option java_package = "com.google.cloud.osconfig.v1beta";
// manage package installations and patch jobs for virtual machine instances. // manage package installations and patch jobs for virtual machine instances.
service OsConfigService { service OsConfigService {
option (google.api.default_host) = "osconfig.googleapis.com"; option (google.api.default_host) = "osconfig.googleapis.com";
option (google.api.oauth_scopes) = option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
"https://www.googleapis.com/auth/cloud-platform,"
"https://www.googleapis.com/auth/compute";
// Patch VM instances by creating and running a patch job. // Patch VM instances by creating and running a patch job.
rpc ExecutePatchJob(ExecutePatchJobRequest) returns (PatchJob) { rpc ExecutePatchJob(ExecutePatchJobRequest) returns (PatchJob) {
@ -71,8 +68,7 @@ service OsConfigService {
} }
// Get a list of instance details for a given patch job. // Get a list of instance details for a given patch job.
rpc ListPatchJobInstanceDetails(ListPatchJobInstanceDetailsRequest) rpc ListPatchJobInstanceDetails(ListPatchJobInstanceDetailsRequest) returns (ListPatchJobInstanceDetailsResponse) {
returns (ListPatchJobInstanceDetailsResponse) {
option (google.api.http) = { option (google.api.http) = {
get: "/v1beta/{parent=projects/*/patchJobs/*}/instanceDetails" get: "/v1beta/{parent=projects/*/patchJobs/*}/instanceDetails"
}; };
@ -80,8 +76,7 @@ service OsConfigService {
} }
// Create an OS Config patch deployment. // Create an OS Config patch deployment.
rpc CreatePatchDeployment(CreatePatchDeploymentRequest) rpc CreatePatchDeployment(CreatePatchDeploymentRequest) returns (PatchDeployment) {
returns (PatchDeployment) {
option (google.api.http) = { option (google.api.http) = {
post: "/v1beta/{parent=projects/*}/patchDeployments" post: "/v1beta/{parent=projects/*}/patchDeployments"
body: "patch_deployment" body: "patch_deployment"
@ -96,16 +91,14 @@ service OsConfigService {
} }
// Get a page of OS Config patch deployments. // Get a page of OS Config patch deployments.
rpc ListPatchDeployments(ListPatchDeploymentsRequest) rpc ListPatchDeployments(ListPatchDeploymentsRequest) returns (ListPatchDeploymentsResponse) {
returns (ListPatchDeploymentsResponse) {
option (google.api.http) = { option (google.api.http) = {
get: "/v1beta/{parent=projects/*}/patchDeployments" get: "/v1beta/{parent=projects/*}/patchDeployments"
}; };
} }
// Delete an OS Config patch deployment. // Delete an OS Config patch deployment.
rpc DeletePatchDeployment(DeletePatchDeploymentRequest) rpc DeletePatchDeployment(DeletePatchDeploymentRequest) returns (google.protobuf.Empty) {
returns (google.protobuf.Empty) {
option (google.api.http) = { option (google.api.http) = {
delete: "/v1beta/{name=projects/*/patchDeployments/*}" delete: "/v1beta/{name=projects/*/patchDeployments/*}"
}; };
@ -129,8 +122,7 @@ service OsConfigService {
} }
// Get a page of OS Config guest policies. // Get a page of OS Config guest policies.
rpc ListGuestPolicies(ListGuestPoliciesRequest) rpc ListGuestPolicies(ListGuestPoliciesRequest) returns (ListGuestPoliciesResponse) {
returns (ListGuestPoliciesResponse) {
option (google.api.http) = { option (google.api.http) = {
get: "/v1beta/{parent=projects/*}/guestPolicies" get: "/v1beta/{parent=projects/*}/guestPolicies"
}; };
@ -147,8 +139,7 @@ service OsConfigService {
} }
// Delete an OS Config guest policy. // Delete an OS Config guest policy.
rpc DeleteGuestPolicy(DeleteGuestPolicyRequest) rpc DeleteGuestPolicy(DeleteGuestPolicyRequest) returns (google.protobuf.Empty) {
returns (google.protobuf.Empty) {
option (google.api.http) = { option (google.api.http) = {
delete: "/v1beta/{name=projects/*/guestPolicies/*}" delete: "/v1beta/{name=projects/*/guestPolicies/*}"
}; };
@ -157,8 +148,7 @@ service OsConfigService {
// Lookup the effective guest policy that applies to a VM instance. This // Lookup the effective guest policy that applies to a VM instance. This
// lookup merges all policies that are assigned to the instance ancestry. // lookup merges all policies that are assigned to the instance ancestry.
rpc LookupEffectiveGuestPolicy(LookupEffectiveGuestPolicyRequest) rpc LookupEffectiveGuestPolicy(LookupEffectiveGuestPolicyRequest) returns (EffectiveGuestPolicy) {
returns (EffectiveGuestPolicy) {
option (google.api.http) = { option (google.api.http) = {
post: "/v1beta/{instance=projects/*/zones/*/instances/*}:lookupEffectiveGuestPolicy" post: "/v1beta/{instance=projects/*/zones/*/instances/*}:lookupEffectiveGuestPolicy"
body: "*" body: "*"

@ -21,5 +21,4 @@ authentication:
- selector: 'google.cloud.osconfig.v1beta.OsConfigService.*' - selector: 'google.cloud.osconfig.v1beta.OsConfigService.*'
oauth: oauth:
canonical_scopes: |- canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform, https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/compute

@ -1,4 +1,4 @@
// Copyright 2019 Google LLC. // Copyright 2020 Google LLC
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//
syntax = "proto3"; syntax = "proto3";
@ -32,7 +31,9 @@ option java_package = "com.google.cloud.osconfig.v1beta";
// Patch deployments are configurations that individual patch jobs use to // Patch deployments are configurations that individual patch jobs use to
// complete a patch. These configurations include instance filter, package // complete a patch. These configurations include instance filter, package
// repository settings, and a schedule. // repository settings, and a schedule. For more information about creating and
// managing patch deployments, see [Scheduling patch
// jobs](/compute/docs/os-patch-management/schedule-patch-jobs).
message PatchDeployment { message PatchDeployment {
// Unique name for the patch deployment resource in a project. The patch // Unique name for the patch deployment resource in a project. The patch
// deployment name is in the form: // deployment name is in the form:
@ -40,51 +41,43 @@ message PatchDeployment {
// This field is ignored when you create a new patch deployment. // This field is ignored when you create a new patch deployment.
string name = 1; string name = 1;
// Optional. Description of the patch deployment. Length of the description is // Optional. Description of the patch deployment. Length of the description is limited
// limited to 1024 characters. // to 1024 characters.
string description = 2 [(google.api.field_behavior) = OPTIONAL]; string description = 2 [(google.api.field_behavior) = OPTIONAL];
// Required. VM instances to patch. // Required. VM instances to patch.
PatchInstanceFilter instance_filter = 3 PatchInstanceFilter instance_filter = 3 [(google.api.field_behavior) = REQUIRED];
[(google.api.field_behavior) = REQUIRED];
// Optional. Patch configuration that is applied. // Optional. Patch configuration that is applied.
PatchConfig patch_config = 4 [(google.api.field_behavior) = OPTIONAL]; PatchConfig patch_config = 4 [(google.api.field_behavior) = OPTIONAL];
// Optional. Duration of the patch. After the duration ends, the patch times // Optional. Duration of the patch. After the duration ends, the patch times out.
// out. google.protobuf.Duration duration = 5 [(google.api.field_behavior) = OPTIONAL];
google.protobuf.Duration duration = 5
[(google.api.field_behavior) = OPTIONAL];
// Schedule for the patch. // Schedule for the patch.
oneof schedule { oneof schedule {
// Required. Schedule a one-time execution. // Required. Schedule a one-time execution.
OneTimeSchedule one_time_schedule = 6 OneTimeSchedule one_time_schedule = 6 [(google.api.field_behavior) = REQUIRED];
[(google.api.field_behavior) = REQUIRED];
// Required. Schedule recurring executions. // Required. Schedule recurring executions.
RecurringSchedule recurring_schedule = 7 RecurringSchedule recurring_schedule = 7 [(google.api.field_behavior) = REQUIRED];
[(google.api.field_behavior) = REQUIRED];
} }
// Output only. Time the patch deployment was created. Timestamp is in // Output only. Time the patch deployment was created. Timestamp is in
// <a href="https://www.ietf.org/rfc/rfc3339.txt" target="_blank">RFC3339</a> // <a href="https://www.ietf.org/rfc/rfc3339.txt" target="_blank">RFC3339</a>
// text format. // text format.
google.protobuf.Timestamp create_time = 8 google.protobuf.Timestamp create_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Time the patch deployment was last updated. Timestamp is in // Output only. Time the patch deployment was last updated. Timestamp is in
// <a href="https://www.ietf.org/rfc/rfc3339.txt" target="_blank">RFC3339</a> // <a href="https://www.ietf.org/rfc/rfc3339.txt" target="_blank">RFC3339</a>
// text format. // text format.
google.protobuf.Timestamp update_time = 9 google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The last time a patch job was started by this deployment. // Output only. The last time a patch job was started by this deployment.
// Timestamp is in // Timestamp is in
// <a href="https://www.ietf.org/rfc/rfc3339.txt" target="_blank">RFC3339</a> // <a href="https://www.ietf.org/rfc/rfc3339.txt" target="_blank">RFC3339</a>
// text format. // text format.
google.protobuf.Timestamp last_execute_time = 10 google.protobuf.Timestamp last_execute_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
[(google.api.field_behavior) = OUTPUT_ONLY];
} }
// Sets the time for a one time patch deployment. Timestamp is in // Sets the time for a one time patch deployment. Timestamp is in
@ -92,8 +85,7 @@ message PatchDeployment {
// text format. // text format.
message OneTimeSchedule { message OneTimeSchedule {
// Required. The desired patch job execution time. // Required. The desired patch job execution time.
google.protobuf.Timestamp execute_time = 1 google.protobuf.Timestamp execute_time = 1 [(google.api.field_behavior) = REQUIRED];
[(google.api.field_behavior) = REQUIRED];
} }
// Sets the time for recurring patch deployments. // Sets the time for recurring patch deployments.
@ -118,17 +110,14 @@ message RecurringSchedule {
// Optional. The time that the recurring schedule becomes effective. // Optional. The time that the recurring schedule becomes effective.
// Defaults to `create_time` of the patch deployment. // Defaults to `create_time` of the patch deployment.
google.protobuf.Timestamp start_time = 2 google.protobuf.Timestamp start_time = 2 [(google.api.field_behavior) = OPTIONAL];
[(google.api.field_behavior) = OPTIONAL];
// Optional. The end time at which a recurring patch deployment schedule is no // Optional. The end time at which a recurring patch deployment schedule is no longer
// longer active. // active.
google.protobuf.Timestamp end_time = 3 google.protobuf.Timestamp end_time = 3 [(google.api.field_behavior) = OPTIONAL];
[(google.api.field_behavior) = OPTIONAL];
// Required. Time of the day to run a recurring deployment. // Required. Time of the day to run a recurring deployment.
google.type.TimeOfDay time_of_day = 4 google.type.TimeOfDay time_of_day = 4 [(google.api.field_behavior) = REQUIRED];
[(google.api.field_behavior) = REQUIRED];
// Required. The frequency unit of this recurring schedule. // Required. The frequency unit of this recurring schedule.
Frequency frequency = 5 [(google.api.field_behavior) = REQUIRED]; Frequency frequency = 5 [(google.api.field_behavior) = REQUIRED];
@ -144,19 +133,16 @@ message RecurringSchedule {
} }
// Output only. The time the last patch job ran successfully. // Output only. The time the last patch job ran successfully.
google.protobuf.Timestamp last_execute_time = 9 google.protobuf.Timestamp last_execute_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The time the next patch job is scheduled to run. // Output only. The time the next patch job is scheduled to run.
google.protobuf.Timestamp next_execute_time = 10 google.protobuf.Timestamp next_execute_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
[(google.api.field_behavior) = OUTPUT_ONLY];
} }
// Represents a weekly schedule. // Represents a weekly schedule.
message WeeklySchedule { message WeeklySchedule {
// Required. Day of the week. // Required. Day of the week.
google.type.DayOfWeek day_of_week = 1 google.type.DayOfWeek day_of_week = 1 [(google.api.field_behavior) = REQUIRED];
[(google.api.field_behavior) = REQUIRED];
} }
// Represents a monthly schedule. An example of a valid monthly schedule is // Represents a monthly schedule. An example of a valid monthly schedule is
@ -165,36 +151,33 @@ message MonthlySchedule {
// One day in a month. // One day in a month.
oneof day_of_month { oneof day_of_month {
// Required. Week day in a month. // Required. Week day in a month.
WeekDayOfMonth week_day_of_month = 1 WeekDayOfMonth week_day_of_month = 1 [(google.api.field_behavior) = REQUIRED];
[(google.api.field_behavior) = REQUIRED];
// Required. One day of the month. 1-31 indicates the 1st to the 31st day. // Required. One day of the month. 1-31 indicates the 1st to the 31st day. -1
// -1 indicates the last day of the month. Months without the target day // indicates the last day of the month.
// will be skipped. For example, a schedule to run "every month on the 31st" // Months without the target day will be skipped. For example, a schedule to
// will not run in February, April, June, etc. // run "every month on the 31st" will not run in February, April, June, etc.
int32 month_day = 2 [(google.api.field_behavior) = REQUIRED]; int32 month_day = 2 [(google.api.field_behavior) = REQUIRED];
} }
} }
// Represents one week day in a month. An example is "the 4th Sunday". // Represents one week day in a month. An example is "the 4th Sunday".
message WeekDayOfMonth { message WeekDayOfMonth {
// Required. Week number in a month. 1-4 indicates the 1st to 4th week of the // Required. Week number in a month. 1-4 indicates the 1st to 4th week of the month. -1
// month. -1 indicates the last week of the month. // indicates the last week of the month.
int32 week_ordinal = 1 [(google.api.field_behavior) = REQUIRED]; int32 week_ordinal = 1 [(google.api.field_behavior) = REQUIRED];
// Required. A day of the week. // Required. A day of the week.
google.type.DayOfWeek day_of_week = 2 google.type.DayOfWeek day_of_week = 2 [(google.api.field_behavior) = REQUIRED];
[(google.api.field_behavior) = REQUIRED];
} }
// A request message for creating a patch deployment. // A request message for creating a patch deployment.
message CreatePatchDeploymentRequest { message CreatePatchDeploymentRequest {
// Required. The project to apply this patch deployment to in the form // Required. The project to apply this patch deployment to in the form `projects/*`.
// `projects/*`.
string parent = 1 [(google.api.field_behavior) = REQUIRED]; string parent = 1 [(google.api.field_behavior) = REQUIRED];
// Required. A name for the patch deployment in the project. When creating a // Required. A name for the patch deployment in the project. When creating a name
// name the following rules apply: // the following rules apply:
// * Must contain only lowercase letters, numbers, and hyphens. // * Must contain only lowercase letters, numbers, and hyphens.
// * Must start with a letter. // * Must start with a letter.
// * Must be between 1-63 characters. // * Must be between 1-63 characters.
@ -218,13 +201,11 @@ message ListPatchDeploymentsRequest {
// Required. The resource name of the parent in the form `projects/*`. // Required. The resource name of the parent in the form `projects/*`.
string parent = 1 [(google.api.field_behavior) = REQUIRED]; string parent = 1 [(google.api.field_behavior) = REQUIRED];
// Optional. The maximum number of patch deployments to return. Default is // Optional. The maximum number of patch deployments to return. Default is 100.
// 100.
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
// Optional. A pagination token returned from a previous call to // Optional. A pagination token returned from a previous call to ListPatchDeployments
// ListPatchDeployments that indicates where this listing should continue // that indicates where this listing should continue from.
// from.
string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
} }

@ -1,4 +1,4 @@
// Copyright 2019 Google LLC. // Copyright 2020 Google LLC
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//
syntax = "proto3"; syntax = "proto3";
@ -26,7 +25,8 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1beta
option java_outer_classname = "PatchJobs"; option java_outer_classname = "PatchJobs";
option java_package = "com.google.cloud.osconfig.v1beta"; option java_package = "com.google.cloud.osconfig.v1beta";
// A request message to initiate patching across GCE instances. // A request message to initiate patching across Google Compute Engine
// instances.
message ExecutePatchJobRequest { message ExecutePatchJobRequest {
// Required. The project in which to run this patch in the form `projects/*` // Required. The project in which to run this patch in the form `projects/*`
string parent = 1 [(google.api.field_behavior) = REQUIRED]; string parent = 1 [(google.api.field_behavior) = REQUIRED];
@ -35,10 +35,9 @@ message ExecutePatchJobRequest {
// to 1024 characters. // to 1024 characters.
string description = 2; string description = 2;
// Required. Instances to patch, either explicitly or filtered by some // Required. Instances to patch, either explicitly or filtered by some criteria such
// criteria such as zone or labels. // as zone or labels.
PatchInstanceFilter instance_filter = 7 PatchInstanceFilter instance_filter = 7 [(google.api.field_behavior) = REQUIRED];
[(google.api.field_behavior) = REQUIRED];
// Patch configuration being applied. If omitted, instances are // Patch configuration being applied. If omitted, instances are
// patched using the default configurations. // patched using the default configurations.
@ -64,8 +63,7 @@ message GetPatchJobRequest {
// Request to list details for all instances that are part of a patch job. // Request to list details for all instances that are part of a patch job.
message ListPatchJobInstanceDetailsRequest { message ListPatchJobInstanceDetailsRequest {
// Required. The parent for the instances are in the form of // Required. The parent for the instances are in the form of `projects/*/patchJobs/*`.
// `projects/*/patchJobs/*`.
string parent = 1 [(google.api.field_behavior) = REQUIRED]; string parent = 1 [(google.api.field_behavior) = REQUIRED];
// The maximum number of instance details records to return. Default is 100. // The maximum number of instance details records to return. Default is 100.
@ -90,7 +88,10 @@ message ListPatchJobInstanceDetailsResponse {
string next_page_token = 2; string next_page_token = 2;
} }
// Patch details for a VM instance. // Patch details for a VM instance. For more information about reviewing VM
// instance details, see
// [Listing all VM instance details for a specific patch
// job](/compute/docs/os-patch-management/manage-patch-jobs#list-instance-details).
message PatchJobInstanceDetails { message PatchJobInstanceDetails {
// The instance name in the form `projects/*/zones/*/instances/*` // The instance name in the form `projects/*/zones/*/instances/*`
string name = 1; string name = 1;
@ -141,6 +142,9 @@ message ListPatchJobsResponse {
// //
// Instances details are not included in the job. To paginate through instance // Instances details are not included in the job. To paginate through instance
// details, use ListPatchJobInstanceDetails. // details, use ListPatchJobInstanceDetails.
//
// For more information about patch jobs, see
// [Creating patch jobs](/compute/docs/os-patch-management/create-patch-job).
message PatchJob { message PatchJob {
// A summary of the current patch state across all instances that this patch // A summary of the current patch state across all instances that this patch
// job affects. Contains counts of instances in different states. These states // job affects. Contains counts of instances in different states. These states
@ -376,6 +380,8 @@ message Instance {
// service. // service.
NO_AGENT_DETECTED = 15; NO_AGENT_DETECTED = 15;
} }
} }
// Message for canceling a patch job. // Message for canceling a patch job.
@ -437,7 +443,9 @@ message YumSettings {
} }
// Googet patching is performed by running `googet update`. // Googet patching is performed by running `googet update`.
message GooSettings {} message GooSettings {
}
// Zypper patching is performed by running `zypper patch`. // Zypper patching is performed by running `zypper patch`.
// See also https://en.opensuse.org/SDB:Zypper_manual. // See also https://en.opensuse.org/SDB:Zypper_manual.
@ -485,7 +493,7 @@ message WindowsUpdateSettings {
SECURITY = 2; SECURITY = 2;
// "A widely released and frequent software update that contains additions // "A widely released and frequent software update that contains additions
// to a products definition database. Definition databases are often used // to a product's definition database. Definition databases are often used
// to detect objects that have specific attributes, such as malicious code, // to detect objects that have specific attributes, such as malicious code,
// phishing websites, or junk mail." [1] // phishing websites, or junk mail." [1]
DEFINITION = 3; DEFINITION = 3;
@ -564,7 +572,7 @@ message ExecStepConfig {
// An absolute path to the executable on the VM. // An absolute path to the executable on the VM.
string local_path = 1; string local_path = 1;
// A GCS object containing the executable. // A Google Cloud Storage object containing the executable.
GcsObject gcs_object = 2; GcsObject gcs_object = 2;
} }
@ -574,21 +582,21 @@ message ExecStepConfig {
// The script interpreter to use to run the script. If no interpreter is // The script interpreter to use to run the script. If no interpreter is
// specified the script will be executed directly, which will likely // specified the script will be executed directly, which will likely
// only succeed for scripts with shebang lines. // only succeed for scripts with [shebang lines]
// [Wikipedia shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)). // (https://en.wikipedia.org/wiki/Shebang_\(Unix\)).
Interpreter interpreter = 4; Interpreter interpreter = 4;
} }
// GCS object representation. // Google Cloud Storage object representation.
message GcsObject { message GcsObject {
// Required. Bucket of the GCS object. // Required. Bucket of the Google Cloud Storage object.
string bucket = 1 [(google.api.field_behavior) = REQUIRED]; string bucket = 1 [(google.api.field_behavior) = REQUIRED];
// Required. Name of the GCS object. // Required. Name of the Google Cloud Storage object.
string object = 2 [(google.api.field_behavior) = REQUIRED]; string object = 2 [(google.api.field_behavior) = REQUIRED];
// Required. Generation number of the GCS object. This is used to ensure that // Required. Generation number of the Google Cloud Storage object. This is used to
// the ExecStep specified by this PatchJob does not change. // ensure that the ExecStep specified by this PatchJob does not change.
int64 generation_number = 3 [(google.api.field_behavior) = REQUIRED]; int64 generation_number = 3 [(google.api.field_behavior) = REQUIRED];
} }
@ -600,8 +608,8 @@ message PatchInstanceFilter {
// Represents a group of VMs that can be identified as having all these // Represents a group of VMs that can be identified as having all these
// labels, for example "env=prod and app=web". // labels, for example "env=prod and app=web".
message GroupLabel { message GroupLabel {
// GCE instance labels that must be present for a VM instance to be targeted // Google Compute Engine instance labels that must be present for a VM
// by this filter. // instance to be targeted by this filter.
map<string, string> labels = 1; map<string, string> labels = 1;
} }
@ -625,6 +633,6 @@ message PatchInstanceFilter {
// Targets VMs whose name starts with one of these prefixes. Similar to // Targets VMs whose name starts with one of these prefixes. Similar to
// labels, this is another way to group VMs when targeting configs, for // labels, this is another way to group VMs when targeting configs, for
// example prefix=prod-. // example prefix="prod-".
repeated string instance_name_prefixes = 5; repeated string instance_name_prefixes = 5;
} }

Loading…
Cancel
Save