Skip to content

Commit

Permalink
feat: add OSConfigZonalService API Committer: @jaiminsh (#553)
Browse files Browse the repository at this point in the history
* feat: add OSConfigZonalService API Committer: @jaiminsh

PiperOrigin-RevId: 394704298

Source-Link: googleapis/googleapis@31d2d34

Source-Link: googleapis/googleapis-gen@aa3ce09

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Sep 7, 2021
1 parent e6bef54 commit a1a8225
Show file tree
Hide file tree
Showing 9 changed files with 2,616 additions and 761 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Google LLC
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -16,6 +16,8 @@ syntax = "proto3";

package google.cloud.osconfig.v1;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";
import "google/type/date.proto";

Expand All @@ -30,8 +32,19 @@ option ruby_package = "Google::Cloud::OsConfig::V1";
// OS Config Inventory is a service for collecting and reporting operating
// system and package information on VM instances.

// The inventory details of a VM.
// This API resource represents the available inventory data for a
// Compute Engine virtual machine (VM) instance at a given point in time.
//
// You can use this API resource to determine the inventory data of your VM.
//
// For more information, see [Information provided by OS inventory
// management](https://cloud.google.com/compute/docs/instances/os-inventory-management#data-collected).
message Inventory {
option (google.api.resource) = {
type: "osconfig.googleapis.com/Inventory"
pattern: "projects/{project}/locations/{location}/instances/{instance}/inventory"
};

// Operating system information for the VM.
message OsInfo {
// The VM hostname.
Expand Down Expand Up @@ -154,7 +167,7 @@ message Inventory {
// Details of a COS package.
VersionedPackage cos_package = 8;

// Details of a Windows Application
// Details of Windows Application.
WindowsApplication windows_application = 9;
}
}
Expand All @@ -172,6 +185,21 @@ message Inventory {
string version = 3;
}

// Details related to a Zypper Patch.
message ZypperPatch {
// The name of the patch.
string patch_name = 5;

// The category of the patch.
string category = 2;

// The severity specified for this patch
string severity = 3;

// Any summary information provided about this patch.
string summary = 4;
}

// Details related to a Windows Update package.
// Field data and names are taken from Windows Update API IUpdate Interface:
// https://docs.microsoft.com/en-us/windows/win32/api/_wua/
Expand Down Expand Up @@ -218,21 +246,6 @@ message Inventory {
google.protobuf.Timestamp last_deployment_change_time = 10;
}

// Details related to a Zypper Patch.
message ZypperPatch {
// The name of the patch.
string patch_name = 5;

// The category of the patch.
string category = 2;

// The severity specified for this patch
string severity = 3;

// Any summary information provided about this patch.
string summary = 4;
}

// Information related to a Quick Fix Engineering package.
// Fields are taken from Windows QuickFixEngineering Interface and match
// the source names:
Expand Down Expand Up @@ -276,6 +289,12 @@ message Inventory {
string help_link = 5;
}

// Output only. The `Inventory` API resource name.
//
// Format:
// `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory`
string name = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

// Base level operating system information for the VM.
OsInfo os_info = 1;

Expand All @@ -284,4 +303,84 @@ message Inventory {
// addressable inventory item and will change, when there is a new package
// version.
map<string, Item> items = 2;

// Output only. Timestamp of the last reported inventory for the VM.
google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// A request message for getting inventory data for the specified VM.
message GetInventoryRequest {
// Required. API resource name for inventory resource.
//
// Format:
// `projects/{project}/locations/{location}/instances/{instance}/inventory`
//
// For `{project}`, either `project-number` or `project-id` can be provided.
// For `{instance}`, either Compute Engine `instance-id` or `instance-name`
// can be provided.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "osconfig.googleapis.com/Inventory"
}
];

// Inventory view indicating what information should be included in the
// inventory resource. If unspecified, the default view is BASIC.
InventoryView view = 2;
}

// A request message for listing inventory data for all VMs in the specified
// location.
message ListInventoriesRequest {
// Required. The parent resource name.
//
// Format: `projects/{project}/locations/{location}/instances/-`
//
// For `{project}`, either `project-number` or `project-id` can be provided.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "compute.googleapis.com/Instance"
}
];

// Inventory view indicating what information should be included in the
// inventory resource. If unspecified, the default view is BASIC.
InventoryView view = 2;

// The maximum number of results to return.
int32 page_size = 3;

// A pagination token returned from a previous call to
// `ListInventories` that indicates where this listing
// should continue from.
string page_token = 4;

// If provided, this field specifies the criteria that must be met by a
// `Inventory` API resource to be included in the response.
string filter = 5;
}

// A response message for listing inventory data for all VMs in a specified
// location.
message ListInventoriesResponse {
// List of inventory objects.
repeated Inventory inventories = 1;

// The pagination token to retrieve the next page of inventory objects.
string next_page_token = 2;
}

// The view for inventory objects.
enum InventoryView {
// The default value.
// The API defaults to the BASIC view.
INVENTORY_VIEW_UNSPECIFIED = 0;

// Returns the basic inventory information that includes `os_info`.
BASIC = 1;

// Returns all fields.
FULL = 2;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ option ruby_package = "Google::Cloud::OsConfig::V1";
option (google.api.resource_definition) = {
type: "compute.googleapis.com/Instance"
pattern: "projects/{project}/zones/{zone}/instances/{instance}"
pattern: "projects/{project}/locations/{location}/instances/{instance}"
};

// OS Config API
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.osconfig.v1;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/resource.proto";
import "google/cloud/osconfig/v1/inventory.proto";
import "google/cloud/osconfig/v1/vulnerability.proto";

option csharp_namespace = "Google.Cloud.OsConfig.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig";
option java_multiple_files = true;
option java_outer_classname = "OsConfigZonalServiceProto";
option java_package = "com.google.cloud.osconfig.v1";
option php_namespace = "Google\\Cloud\\OsConfig\\V1";
option ruby_package = "Google::Cloud::OsConfig::V1";

// Zonal OS Config API
//
// The OS Config service is the server-side component that allows users to
// manage package installations and patch jobs for Compute Engine VM instances.
service OsConfigZonalService {
option (google.api.default_host) = "osconfig.googleapis.com";
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";

// Get inventory data for the specified VM instance. If the VM has no
// associated inventory, the message `NOT_FOUND` is returned.
rpc GetInventory(GetInventoryRequest) returns (Inventory) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/instances/*/inventory}"
};
option (google.api.method_signature) = "name";
}

// List inventory data for all VM instances in the specified zone.
rpc ListInventories(ListInventoriesRequest) returns (ListInventoriesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*/instances/*}/inventories"
};
option (google.api.method_signature) = "parent";
}

// Gets the vulnerability report for the specified VM instance. Only VMs with
// inventory data have vulnerability reports associated with them.
rpc GetVulnerabilityReport(GetVulnerabilityReportRequest) returns (VulnerabilityReport) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/instances/*/vulnerabilityReport}"
};
option (google.api.method_signature) = "name";
}

// List vulnerability reports for all VM instances in the specified zone.
rpc ListVulnerabilityReports(ListVulnerabilityReportsRequest) returns (ListVulnerabilityReportsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*/instances/*}/vulnerabilityReports"
};
option (google.api.method_signature) = "parent";
}
}
Loading

0 comments on commit a1a8225

Please sign in to comment.