Skip to content

Commit

Permalink
feat: [kmsinventory] add resource_types to SearchAllResources, to all…
Browse files Browse the repository at this point in the history
…ow filtering by resource type (#4420)

* feat: add resource_types to SearchAllResources, to allow filtering by resource type

PiperOrigin-RevId: 547834040

Source-Link: googleapis/googleapis@ecb3e47

Source-Link: googleapis/googleapis-gen@6869315
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWttcy1pbnZlbnRvcnkvLk93bEJvdC55YW1sIiwiaCI6IjY4NjkzMTVmNjBmMWEyMDI5NjhmNjZmYjExYjA3NDgzYjExMTQ4ZmMifQ==

* 🦉 Updates from OwlBot post-processor

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 Jul 15, 2023
1 parent 3f99064 commit 90d9a44
Show file tree
Hide file tree
Showing 11 changed files with 144 additions and 30 deletions.
13 changes: 6 additions & 7 deletions packages/google-cloud-kms-inventory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[//]: # "To regenerate it, use `python -m synthtool`."
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>

# [KMS Inventory API: Node.js Client](https://github.com/googleapis/google-cloud-node)
# [KMS Inventory API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-kms-inventory)

[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
[![npm version](https://img.shields.io/npm/v/@google-cloud/kms-inventory.svg)](https://www.npmjs.org/package/@google-cloud/kms-inventory)
Expand Down Expand Up @@ -108,15 +108,14 @@ callListCryptoKeys();

## Samples

Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample.
Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-kms-inventory/samples) directory. Each sample's `README.md` has instructions for running its sample.

| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| Key_dashboard_service.list_crypto_keys | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms-inventory/samples/generated/v1/key_dashboard_service.list_crypto_keys.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms-inventory/samples/generated/v1/key_dashboard_service.list_crypto_keys.js,samples/README.md) |
| Key_tracking_service.get_protected_resources_summary | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms-inventory/samples/generated/v1/key_tracking_service.get_protected_resources_summary.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms-inventory/samples/generated/v1/key_tracking_service.get_protected_resources_summary.js,samples/README.md) |
| Key_tracking_service.search_protected_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms-inventory/samples/generated/v1/key_tracking_service.search_protected_resources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms-inventory/samples/generated/v1/key_tracking_service.search_protected_resources.js,samples/README.md) |
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms-inventory/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms-inventory/samples/quickstart.js,samples/README.md) |
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms-inventory/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms-inventory/samples/test/quickstart.js,samples/README.md) |
| Key_dashboard_service.list_crypto_keys | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms-inventory/samples/generated/v1/key_dashboard_service.list_crypto_keys.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms-inventory/samples/generated/v1/key_dashboard_service.list_crypto_keys.js,packages/google-cloud-kms-inventory/samples/README.md) |
| Key_tracking_service.get_protected_resources_summary | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms-inventory/samples/generated/v1/key_tracking_service.get_protected_resources_summary.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms-inventory/samples/generated/v1/key_tracking_service.get_protected_resources_summary.js,packages/google-cloud-kms-inventory/samples/README.md) |
| Key_tracking_service.search_protected_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms-inventory/samples/generated/v1/key_tracking_service.search_protected_resources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms-inventory/samples/generated/v1/key_tracking_service.search_protected_resources.js,packages/google-cloud-kms-inventory/samples/README.md) |
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms-inventory/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms-inventory/samples/quickstart.js,packages/google-cloud-kms-inventory/samples/README.md) |



Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 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 Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 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 Down Expand Up @@ -139,6 +139,22 @@ message SearchProtectedResourcesRequest {
// [KeyTrackingService.SearchProtectedResources][google.cloud.kms.inventory.v1.KeyTrackingService.SearchProtectedResources]
// must match the call that provided the page token.
string page_token = 4;

// Optional. A list of resource types that this request searches for. If
// empty, it will search all the [trackable resource
// types](https://cloud.google.com/kms/docs/view-key-usage#tracked-resource-types).
//
// Regular expressions are also supported. For example:
//
// * `compute.googleapis.com.*` snapshots resources whose type starts
// with `compute.googleapis.com`.
// * `.*Image` snapshots resources whose type ends with `Image`.
// * `.*Image.*` snapshots resources whose type contains `Image`.
//
// See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
// regular expression syntax. If the regular expression does not match any
// supported resource type, an INVALID_ARGUMENT error will be returned.
repeated string resource_types = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Response message for
Expand Down
6 changes: 6 additions & 0 deletions packages/google-cloud-kms-inventory/protos/protos.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions packages/google-cloud-kms-inventory/protos/protos.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions packages/google-cloud-kms-inventory/protos/protos.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions packages/google-cloud-kms-inventory/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* [Key_tracking_service.get_protected_resources_summary](#key_tracking_service.get_protected_resources_summary)
* [Key_tracking_service.search_protected_resources](#key_tracking_service.search_protected_resources)
* [Quickstart](#quickstart)
* [Quickstart](#quickstart)

## Before you begin

Expand Down Expand Up @@ -96,23 +95,6 @@ __Usage:__
`node packages/google-cloud-kms-inventory/samples/quickstart.js`


-----




### Quickstart

View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-kms-inventory/samples/test/quickstart.js).

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-kms-inventory/samples/test/quickstart.js,samples/README.md)

__Usage:__


`node packages/google-cloud-kms-inventory/samples/test/quickstart.js`





Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@ function main(scope, cryptoKey) {
* must match the call that provided the page token.
*/
// const pageToken = 'abc123'
/**
* Optional. A list of resource types that this request searches for. If
* empty, it will search all the trackable resource
* types (https://cloud.google.com/kms/docs/view-key-usage#tracked-resource-types).
* Regular expressions are also supported. For example:
* * `compute.googleapis.com.*` snapshots resources whose type starts
* with `compute.googleapis.com`.
* * `.*Image` snapshots resources whose type ends with `Image`.
* * `.*Image.*` snapshots resources whose type contains `Image`.
* See RE2 (https://github.com/google/re2/wiki/Syntax) for all supported
* regular expression syntax. If the regular expression does not match any
* supported resource type, an INVALID_ARGUMENT error will be returned.
*/
// const resourceTypes = 'abc123'

// Imports the Inventory library
const {KeyTrackingServiceClient} = require('@google-cloud/kms-inventory').v1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"clientLibrary": {
"name": "nodejs-inventory",
"version": "0.1.0",
"version": "0.1.1",
"language": "TYPESCRIPT",
"apis": [
{
Expand Down Expand Up @@ -110,7 +110,7 @@
"segments": [
{
"start": 25,
"end": 78,
"end": 92,
"type": "FULL"
}
],
Expand All @@ -134,6 +134,10 @@
{
"name": "page_token",
"type": "TYPE_STRING"
},
{
"name": "resource_types",
"type": "TYPE_STRING[]"
}
],
"resultType": ".google.cloud.kms.inventory.v1.SearchProtectedResourcesResponse",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"clientLibrary": {
"name": "nodejs-inventory",
"version": "0.1.0",
"version": "0.1.1",
"language": "TYPESCRIPT",
"apis": [
{
Expand Down
Loading

0 comments on commit 90d9a44

Please sign in to comment.