1// Copyright 2023 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 15syntax = "proto3"; 16 17package google.cloud.kms.inventory.v1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/cloud/kms/v1/resources.proto"; 24 25option cc_enable_arenas = true; 26option csharp_namespace = "Google.Cloud.Kms.Inventory.V1"; 27option go_package = "cloud.google.com/go/kms/inventory/apiv1/inventorypb;inventorypb"; 28option java_multiple_files = true; 29option java_outer_classname = "KeyDashboardServiceProto"; 30option java_package = "com.google.cloud.kms.inventory.v1"; 31option php_namespace = "Google\\Cloud\\Kms\\Inventory\\V1"; 32 33// Provides a cross-region view of all Cloud KMS keys in a given Cloud project. 34service KeyDashboardService { 35 option (google.api.default_host) = "kmsinventory.googleapis.com"; 36 option (google.api.oauth_scopes) = 37 "https://www.googleapis.com/auth/cloud-platform"; 38 39 // Returns cryptographic keys managed by Cloud KMS in a given Cloud project. 40 // Note that this data is sourced from snapshots, meaning it may not 41 // completely reflect the actual state of key metadata at call time. 42 rpc ListCryptoKeys(ListCryptoKeysRequest) returns (ListCryptoKeysResponse) { 43 option (google.api.http) = { 44 get: "/v1/{parent=projects/*}/cryptoKeys" 45 }; 46 option (google.api.method_signature) = "parent"; 47 } 48} 49 50// Request message for 51// [KeyDashboardService.ListCryptoKeys][google.cloud.kms.inventory.v1.KeyDashboardService.ListCryptoKeys]. 52message ListCryptoKeysRequest { 53 // Required. The Google Cloud project for which to retrieve key metadata, in 54 // the format `projects/*` 55 string parent = 1 [ 56 (google.api.field_behavior) = REQUIRED, 57 (google.api.resource_reference) = { 58 type: "cloudresourcemanager.googleapis.com/Project" 59 } 60 ]; 61 62 // Optional. The maximum number of keys to return. The service may return 63 // fewer than this value. If unspecified, at most 1000 keys will be returned. 64 // The maximum value is 1000; values above 1000 will be coerced to 1000. 65 int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; 66 67 // Optional. Pass this into a subsequent request in order to receive the next 68 // page of results. 69 string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; 70} 71 72// Response message for 73// [KeyDashboardService.ListCryptoKeys][google.cloud.kms.inventory.v1.KeyDashboardService.ListCryptoKeys]. 74message ListCryptoKeysResponse { 75 // The list of [CryptoKeys][google.cloud.kms.v1.CryptoKey]. 76 repeated google.cloud.kms.v1.CryptoKey crypto_keys = 1; 77 78 // The page token returned from the previous response if the next page is 79 // desired. 80 string next_page_token = 2; 81} 82