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.monitoring.dashboard.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/monitoring/dashboard/v1/dashboard.proto"; 24import "google/protobuf/empty.proto"; 25 26option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; 27option go_package = "cloud.google.com/go/monitoring/dashboard/apiv1/dashboardpb;dashboardpb"; 28option java_multiple_files = true; 29option java_outer_classname = "DashboardsServiceProto"; 30option java_package = "com.google.monitoring.dashboard.v1"; 31option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; 32option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; 33 34// Manages Stackdriver dashboards. A dashboard is an arrangement of data display 35// widgets in a specific layout. 36service DashboardsService { 37 option (google.api.default_host) = "monitoring.googleapis.com"; 38 option (google.api.oauth_scopes) = 39 "https://www.googleapis.com/auth/cloud-platform," 40 "https://www.googleapis.com/auth/monitoring," 41 "https://www.googleapis.com/auth/monitoring.read," 42 "https://www.googleapis.com/auth/monitoring.write"; 43 44 // Creates a new custom dashboard. For examples on how you can use this API to 45 // create dashboards, see [Managing dashboards by 46 // API](https://cloud.google.com/monitoring/dashboards/api-dashboard). This 47 // method requires the `monitoring.dashboards.create` permission on the 48 // specified project. For more information about permissions, see [Cloud 49 // Identity and Access Management](https://cloud.google.com/iam). 50 rpc CreateDashboard(CreateDashboardRequest) returns (Dashboard) { 51 option (google.api.http) = { 52 post: "/v1/{parent=projects/*}/dashboards" 53 body: "dashboard" 54 }; 55 option (google.api.method_signature) = "parent,dashboard"; 56 } 57 58 // Lists the existing dashboards. 59 // 60 // This method requires the `monitoring.dashboards.list` permission 61 // on the specified project. For more information, see 62 // [Cloud Identity and Access Management](https://cloud.google.com/iam). 63 rpc ListDashboards(ListDashboardsRequest) returns (ListDashboardsResponse) { 64 option (google.api.http) = { 65 get: "/v1/{parent=projects/*}/dashboards" 66 }; 67 option (google.api.method_signature) = "parent"; 68 } 69 70 // Fetches a specific dashboard. 71 // 72 // This method requires the `monitoring.dashboards.get` permission 73 // on the specified dashboard. For more information, see 74 // [Cloud Identity and Access Management](https://cloud.google.com/iam). 75 rpc GetDashboard(GetDashboardRequest) returns (Dashboard) { 76 option (google.api.http) = { 77 get: "/v1/{name=projects/*/dashboards/*}" 78 }; 79 option (google.api.method_signature) = "name"; 80 } 81 82 // Deletes an existing custom dashboard. 83 // 84 // This method requires the `monitoring.dashboards.delete` permission 85 // on the specified dashboard. For more information, see 86 // [Cloud Identity and Access Management](https://cloud.google.com/iam). 87 rpc DeleteDashboard(DeleteDashboardRequest) returns (google.protobuf.Empty) { 88 option (google.api.http) = { 89 delete: "/v1/{name=projects/*/dashboards/*}" 90 }; 91 option (google.api.method_signature) = "name"; 92 } 93 94 // Replaces an existing custom dashboard with a new definition. 95 // 96 // This method requires the `monitoring.dashboards.update` permission 97 // on the specified dashboard. For more information, see 98 // [Cloud Identity and Access Management](https://cloud.google.com/iam). 99 rpc UpdateDashboard(UpdateDashboardRequest) returns (Dashboard) { 100 option (google.api.http) = { 101 patch: "/v1/{dashboard.name=projects/*/dashboards/*}" 102 body: "dashboard" 103 }; 104 } 105} 106 107// The `CreateDashboard` request. 108message CreateDashboardRequest { 109 // Required. The project on which to execute the request. The format is: 110 // 111 // projects/[PROJECT_ID_OR_NUMBER] 112 // 113 // The `[PROJECT_ID_OR_NUMBER]` must match the dashboard resource name. 114 string parent = 1 [ 115 (google.api.field_behavior) = REQUIRED, 116 (google.api.resource_reference) = { 117 type: "cloudresourcemanager.googleapis.com/Project" 118 } 119 ]; 120 121 // Required. The initial dashboard specification. 122 Dashboard dashboard = 2 [(google.api.field_behavior) = REQUIRED]; 123 124 // If set, validate the request and preview the review, but do not actually 125 // save it. 126 bool validate_only = 3; 127} 128 129// The `ListDashboards` request. 130message ListDashboardsRequest { 131 // Required. The scope of the dashboards to list. The format is: 132 // 133 // projects/[PROJECT_ID_OR_NUMBER] 134 string parent = 1 [ 135 (google.api.field_behavior) = REQUIRED, 136 (google.api.resource_reference) = { 137 type: "cloudresourcemanager.googleapis.com/Project" 138 } 139 ]; 140 141 // A positive number that is the maximum number of results to return. 142 // If unspecified, a default of 1000 is used. 143 int32 page_size = 2; 144 145 // Optional. If this field is not empty then it must contain the 146 // `nextPageToken` value returned by a previous call to this method. Using 147 // this field causes the method to return additional results from the previous 148 // method call. 149 string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; 150} 151 152// The `ListDashboards` request. 153message ListDashboardsResponse { 154 // The list of requested dashboards. 155 repeated Dashboard dashboards = 1; 156 157 // If there are more results than have been returned, then this field is set 158 // to a non-empty value. To see the additional results, 159 // use that value as `page_token` in the next call to this method. 160 string next_page_token = 2; 161} 162 163// The `GetDashboard` request. 164message GetDashboardRequest { 165 // Required. The resource name of the Dashboard. The format is one of: 166 // 167 // - `dashboards/[DASHBOARD_ID]` (for system dashboards) 168 // - `projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID]` 169 // (for custom dashboards). 170 string name = 1 [ 171 (google.api.field_behavior) = REQUIRED, 172 (google.api.resource_reference) = { 173 type: "monitoring.googleapis.com/Dashboard" 174 } 175 ]; 176} 177 178// The `DeleteDashboard` request. 179message DeleteDashboardRequest { 180 // Required. The resource name of the Dashboard. The format is: 181 // 182 // projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID] 183 string name = 1 [ 184 (google.api.field_behavior) = REQUIRED, 185 (google.api.resource_reference) = { 186 type: "monitoring.googleapis.com/Dashboard" 187 } 188 ]; 189} 190 191// The `UpdateDashboard` request. 192message UpdateDashboardRequest { 193 // Required. The dashboard that will replace the existing dashboard. 194 Dashboard dashboard = 1 [(google.api.field_behavior) = REQUIRED]; 195 196 // If set, validate the request and preview the review, but do not actually 197 // save it. 198 bool validate_only = 3; 199} 200