Skip to content

Commit d5cc1cd

Browse files
Google APIscopybara-github
authored andcommitted
feat: expose the new v1 vpcflowlogs api proto
PiperOrigin-RevId: 714651625
1 parent 276b372 commit d5cc1cd

File tree

4 files changed

+412
-1
lines changed

4 files changed

+412
-1
lines changed

google/cloud/networkmanagement/v1/BUILD.bazel

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ proto_library(
2727
"connectivity_test.proto",
2828
"reachability.proto",
2929
"trace.proto",
30+
"vpc_flow_logs.proto",
31+
"vpc_flow_logs_config.proto",
3032
],
3133
deps = [
3234
"//google/api:annotations_proto",
@@ -104,6 +106,10 @@ java_gapic_test(
104106
# https://github.com/googleapis/sdk-platform-java/issues/1839
105107
# "com.google.cloud.networkmanagement.v1.ReachabilityServiceClientHttpJsonTest",
106108
"com.google.cloud.networkmanagement.v1.ReachabilityServiceClientTest",
109+
# This test is temporarily disabled due to the issue:
110+
# https://github.com/googleapis/sdk-platform-java/issues/1839
111+
# "com.google.cloud.networkmanagement.v1.VpcFlowLogsServiceClientHttpJsonTest",
112+
"com.google.cloud.networkmanagement.v1.VpcFlowLogsServiceClientTest",
107113
],
108114
runtime_deps = [":networkmanagement_java_gapic_test"],
109115
)
@@ -359,7 +365,6 @@ load(
359365

360366
csharp_proto_library(
361367
name = "networkmanagement_csharp_proto",
362-
extra_opts = [],
363368
deps = [":networkmanagement_proto"],
364369
)
365370

google/cloud/networkmanagement/v1/networkmanagement_v1.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ title: Network Management API
66
apis:
77
- name: google.cloud.location.Locations
88
- name: google.cloud.networkmanagement.v1.ReachabilityService
9+
- name: google.cloud.networkmanagement.v1.VpcFlowLogsService
910
- name: google.iam.v1.IAMPolicy
1011
- name: google.longrunning.Operations
1112

@@ -84,6 +85,10 @@ authentication:
8485
oauth:
8586
canonical_scopes: |-
8687
https://www.googleapis.com/auth/cloud-platform
88+
- selector: 'google.cloud.networkmanagement.v1.VpcFlowLogsService.*'
89+
oauth:
90+
canonical_scopes: |-
91+
https://www.googleapis.com/auth/cloud-platform
8792
- selector: 'google.iam.v1.IAMPolicy.*'
8893
oauth:
8994
canonical_scopes: |-
Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
// Copyright 2024 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+
15+
syntax = "proto3";
16+
17+
package google.cloud.networkmanagement.v1;
18+
19+
import "google/api/annotations.proto";
20+
import "google/api/client.proto";
21+
import "google/api/field_behavior.proto";
22+
import "google/api/resource.proto";
23+
import "google/cloud/networkmanagement/v1/reachability.proto";
24+
import "google/cloud/networkmanagement/v1/vpc_flow_logs_config.proto";
25+
import "google/longrunning/operations.proto";
26+
import "google/protobuf/empty.proto";
27+
import "google/protobuf/field_mask.proto";
28+
29+
option csharp_namespace = "Google.Cloud.NetworkManagement.V1";
30+
option go_package = "cloud.google.com/go/networkmanagement/apiv1/networkmanagementpb;networkmanagementpb";
31+
option java_multiple_files = true;
32+
option java_outer_classname = "VpcFlowLogsProto";
33+
option java_package = "com.google.cloud.networkmanagement.v1";
34+
option php_namespace = "Google\\Cloud\\NetworkManagement\\V1";
35+
option ruby_package = "Google::Cloud::NetworkManagement::V1";
36+
37+
// The VPC Flow Logs service in the Google Cloud Network Management API provides
38+
// configurations that generate Flow Logs. The service and the configuration
39+
// resources created using this service are global.
40+
service VpcFlowLogsService {
41+
option (google.api.default_host) = "networkmanagement.googleapis.com";
42+
option (google.api.oauth_scopes) =
43+
"https://www.googleapis.com/auth/cloud-platform";
44+
45+
// Lists all `VpcFlowLogsConfigs` in a given project.
46+
rpc ListVpcFlowLogsConfigs(ListVpcFlowLogsConfigsRequest)
47+
returns (ListVpcFlowLogsConfigsResponse) {
48+
option (google.api.http) = {
49+
get: "/v1/{parent=projects/*/locations/*}/vpcFlowLogsConfigs"
50+
};
51+
option (google.api.method_signature) = "parent";
52+
}
53+
54+
// Gets the details of a specific `VpcFlowLogsConfig`.
55+
rpc GetVpcFlowLogsConfig(GetVpcFlowLogsConfigRequest)
56+
returns (VpcFlowLogsConfig) {
57+
option (google.api.http) = {
58+
get: "/v1/{name=projects/*/locations/*/vpcFlowLogsConfigs/*}"
59+
};
60+
option (google.api.method_signature) = "name";
61+
}
62+
63+
// Creates a new `VpcFlowLogsConfig`.
64+
// If a configuration with the exact same settings already exists (even if the
65+
// ID is different), the creation fails.
66+
// Notes:
67+
//
68+
// 1. Creating a configuration with state=DISABLED will fail
69+
// 2. The following fields are not considered as `settings` for the purpose
70+
// of the check mentioned above, therefore - creating another configuration
71+
// with the same fields but different values for the following fields will
72+
// fail as well:
73+
// * name
74+
// * create_time
75+
// * update_time
76+
// * labels
77+
// * description
78+
rpc CreateVpcFlowLogsConfig(CreateVpcFlowLogsConfigRequest)
79+
returns (google.longrunning.Operation) {
80+
option (google.api.http) = {
81+
post: "/v1/{parent=projects/*/locations/*}/vpcFlowLogsConfigs"
82+
body: "vpc_flow_logs_config"
83+
};
84+
option (google.api.method_signature) =
85+
"parent,vpc_flow_logs_config,vpc_flow_logs_config_id";
86+
option (google.longrunning.operation_info) = {
87+
response_type: "VpcFlowLogsConfig"
88+
metadata_type: "google.cloud.networkmanagement.v1.OperationMetadata"
89+
};
90+
}
91+
92+
// Updates an existing `VpcFlowLogsConfig`.
93+
// If a configuration with the exact same settings already exists (even if the
94+
// ID is different), the creation fails.
95+
// Notes:
96+
//
97+
// 1. Updating a configuration with state=DISABLED will fail.
98+
// 2. The following fields are not considered as `settings` for the purpose
99+
// of the check mentioned above, therefore - updating another configuration
100+
// with the same fields but different values for the following fields will
101+
// fail as well:
102+
// * name
103+
// * create_time
104+
// * update_time
105+
// * labels
106+
// * description
107+
rpc UpdateVpcFlowLogsConfig(UpdateVpcFlowLogsConfigRequest)
108+
returns (google.longrunning.Operation) {
109+
option (google.api.http) = {
110+
patch: "/v1/{vpc_flow_logs_config.name=projects/*/locations/*/vpcFlowLogsConfigs/*}"
111+
body: "vpc_flow_logs_config"
112+
};
113+
option (google.api.method_signature) = "vpc_flow_logs_config,update_mask";
114+
option (google.longrunning.operation_info) = {
115+
response_type: "VpcFlowLogsConfig"
116+
metadata_type: "google.cloud.networkmanagement.v1.OperationMetadata"
117+
};
118+
}
119+
120+
// Deletes a specific `VpcFlowLogsConfig`.
121+
rpc DeleteVpcFlowLogsConfig(DeleteVpcFlowLogsConfigRequest)
122+
returns (google.longrunning.Operation) {
123+
option (google.api.http) = {
124+
delete: "/v1/{name=projects/*/locations/*/vpcFlowLogsConfigs/*}"
125+
};
126+
option (google.api.method_signature) = "name";
127+
option (google.longrunning.operation_info) = {
128+
response_type: "google.protobuf.Empty"
129+
metadata_type: "google.cloud.networkmanagement.v1.OperationMetadata"
130+
};
131+
}
132+
}
133+
134+
// Request for the `ListVpcFlowLogsConfigs` method.
135+
message ListVpcFlowLogsConfigsRequest {
136+
// Required. The parent resource of the VpcFlowLogsConfig:
137+
// `projects/{project_id}/locations/global`
138+
string parent = 1 [
139+
(google.api.field_behavior) = REQUIRED,
140+
(google.api.resource_reference) = {
141+
child_type: "networkmanagement.googleapis.com/VpcFlowLogsConfig"
142+
}
143+
];
144+
145+
// Optional. Number of `VpcFlowLogsConfigs` to return.
146+
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
147+
148+
// Optional. Page token from an earlier query, as returned in
149+
// `next_page_token`.
150+
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
151+
152+
// Optional. Lists the `VpcFlowLogsConfigs` that match the filter expression.
153+
// A filter expression must use the supported [CEL logic operators]
154+
// (https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators).
155+
string filter = 4 [(google.api.field_behavior) = OPTIONAL];
156+
157+
// Optional. Field to use to sort the list.
158+
string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
159+
}
160+
161+
// Response for the `ListVpcFlowLogsConfigs` method.
162+
message ListVpcFlowLogsConfigsResponse {
163+
// List of VPC Flow Log configurations.
164+
repeated VpcFlowLogsConfig vpc_flow_logs_configs = 1;
165+
166+
// Page token to fetch the next set of configurations.
167+
string next_page_token = 2;
168+
169+
// Locations that could not be reached (when querying all locations with `-`).
170+
repeated string unreachable = 3;
171+
}
172+
173+
// Request for the `GetVpcFlowLogsConfig` method.
174+
message GetVpcFlowLogsConfigRequest {
175+
// Required. `VpcFlowLogsConfig` resource name using the form:
176+
// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config}`
177+
string name = 1 [
178+
(google.api.field_behavior) = REQUIRED,
179+
(google.api.resource_reference) = {
180+
type: "networkmanagement.googleapis.com/VpcFlowLogsConfig"
181+
}
182+
];
183+
}
184+
185+
// Request for the `CreateVpcFlowLogsConfig` method.
186+
message CreateVpcFlowLogsConfigRequest {
187+
// Required. The parent resource of the VPC Flow Logs configuration to create:
188+
// `projects/{project_id}/locations/global`
189+
string parent = 1 [
190+
(google.api.field_behavior) = REQUIRED,
191+
(google.api.resource_reference) = {
192+
child_type: "networkmanagement.googleapis.com/VpcFlowLogsConfig"
193+
}
194+
];
195+
196+
// Required. ID of the `VpcFlowLogsConfig`.
197+
string vpc_flow_logs_config_id = 2 [
198+
(google.api.field_behavior) = REQUIRED,
199+
(google.api.resource_reference) = {
200+
type: "networkmanagement.googleapis.com/VpcFlowLogsConfig"
201+
}
202+
];
203+
204+
// Required. A `VpcFlowLogsConfig` resource
205+
VpcFlowLogsConfig vpc_flow_logs_config = 3
206+
[(google.api.field_behavior) = REQUIRED];
207+
}
208+
209+
// Request for the `UpdateVpcFlowLogsConfig` method.
210+
message UpdateVpcFlowLogsConfigRequest {
211+
// Required. Mask of fields to update. At least one path must be supplied in
212+
// this field.
213+
google.protobuf.FieldMask update_mask = 1
214+
[(google.api.field_behavior) = REQUIRED];
215+
216+
// Required. Only fields specified in update_mask are updated.
217+
VpcFlowLogsConfig vpc_flow_logs_config = 2
218+
[(google.api.field_behavior) = REQUIRED];
219+
}
220+
221+
// Request for the `DeleteVpcFlowLogsConfig` method.
222+
message DeleteVpcFlowLogsConfigRequest {
223+
// Required. `VpcFlowLogsConfig` resource name using the form:
224+
// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config}`
225+
string name = 1 [
226+
(google.api.field_behavior) = REQUIRED,
227+
(google.api.resource_reference) = {
228+
type: "networkmanagement.googleapis.com/VpcFlowLogsConfig"
229+
}
230+
];
231+
}

0 commit comments

Comments
 (0)