Skip to content

Commit d894629

Browse files
Google APIscopybara-github
authored andcommitted
feat: expose the new vpcflowlogs api proto
PiperOrigin-RevId: 660275659
1 parent 1f17bca commit d894629

4 files changed

Lines changed: 391 additions & 0 deletions

File tree

google/cloud/networkmanagement/v1beta1/BUILD.bazel

Lines changed: 6 additions & 0 deletions
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.v1beta1.ReachabilityServiceClientHttpJsonTest",
106108
"com.google.cloud.networkmanagement.v1beta1.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.v1beta1.VpcFlowLogsServiceClientHttpJsonTest",
112+
"com.google.cloud.networkmanagement.v1beta1.VpcFlowLogsServiceClientTest",
107113
],
108114
runtime_deps = [":networkmanagement_java_gapic_test"],
109115
)

google/cloud/networkmanagement/v1beta1/networkmanagement_v1beta1.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.v1beta1.ReachabilityService
9+
- name: google.cloud.networkmanagement.v1beta1.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.v1beta1.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: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
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.v1beta1;
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/v1beta1/reachability.proto";
24+
import "google/cloud/networkmanagement/v1beta1/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.V1Beta1";
30+
option go_package = "cloud.google.com/go/networkmanagement/apiv1beta1/networkmanagementpb;networkmanagementpb";
31+
option java_multiple_files = true;
32+
option java_outer_classname = "VpcFlowLogsProto";
33+
option java_package = "com.google.cloud.networkmanagement.v1beta1";
34+
option php_namespace = "Google\\Cloud\\NetworkManagement\\V1beta1";
35+
option ruby_package = "Google::Cloud::NetworkManagement::V1beta1";
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: "/v1beta1/{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: "/v1beta1/{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+
// 1. Creating a configuration with state=DISABLED will fail.
68+
// 2. The following fields are not considrered as `settings` for the purpose
69+
// of the check mentioned above, therefore - creating another configuration
70+
// with the same fields but different values for the following fields will
71+
// fail as well:
72+
// - name
73+
// - create_time
74+
// - update_time
75+
// - labels
76+
// - description
77+
rpc CreateVpcFlowLogsConfig(CreateVpcFlowLogsConfigRequest)
78+
returns (google.longrunning.Operation) {
79+
option (google.api.http) = {
80+
post: "/v1beta1/{parent=projects/*/locations/*}/vpcFlowLogsConfigs"
81+
body: "vpc_flow_logs_config"
82+
};
83+
option (google.api.method_signature) =
84+
"parent,vpc_flow_logs_config,vpc_flow_logs_config_id";
85+
option (google.longrunning.operation_info) = {
86+
response_type: "VpcFlowLogsConfig"
87+
metadata_type: "google.cloud.networkmanagement.v1beta1.OperationMetadata"
88+
};
89+
}
90+
91+
// Updates an existing `VpcFlowLogsConfig`.
92+
// If a configuration with the exact same settings already exists (even if the
93+
// ID is different), the creation fails.
94+
// Notes:
95+
// 1. The following fields are not considrered as `settings` for the purpose
96+
// of the check mentioned above, therefore - updating another configuration
97+
// with the same fields but different values for the following fields will
98+
// fail as well:
99+
// - name
100+
// - create_time
101+
// - update_time
102+
// - labels
103+
// - description
104+
rpc UpdateVpcFlowLogsConfig(UpdateVpcFlowLogsConfigRequest)
105+
returns (google.longrunning.Operation) {
106+
option (google.api.http) = {
107+
patch: "/v1beta1/{vpc_flow_logs_config.name=projects/*/locations/*/vpcFlowLogsConfigs/*}"
108+
body: "vpc_flow_logs_config"
109+
};
110+
option (google.api.method_signature) = "vpc_flow_logs_config,update_mask";
111+
option (google.longrunning.operation_info) = {
112+
response_type: "VpcFlowLogsConfig"
113+
metadata_type: "google.cloud.networkmanagement.v1beta1.OperationMetadata"
114+
};
115+
}
116+
117+
// Deletes a specific `VpcFlowLogsConfig`.
118+
rpc DeleteVpcFlowLogsConfig(DeleteVpcFlowLogsConfigRequest)
119+
returns (google.longrunning.Operation) {
120+
option (google.api.http) = {
121+
delete: "/v1beta1/{name=projects/*/locations/*/vpcFlowLogsConfigs/*}"
122+
};
123+
option (google.api.method_signature) = "name";
124+
option (google.longrunning.operation_info) = {
125+
response_type: "google.protobuf.Empty"
126+
metadata_type: "google.cloud.networkmanagement.v1beta1.OperationMetadata"
127+
};
128+
}
129+
}
130+
131+
// Request for the `ListVpcFlowLogsConfigs` method.
132+
message ListVpcFlowLogsConfigsRequest {
133+
// Required. The parent resource of the VpcFlowLogsConfig:
134+
// `projects/{project_id}/locations/global`
135+
string parent = 1 [
136+
(google.api.field_behavior) = REQUIRED,
137+
(google.api.resource_reference) = {
138+
child_type: "networkmanagement.googleapis.com/VpcFlowLogsConfig"
139+
}
140+
];
141+
142+
// Optional. Number of `VpcFlowLogsConfigs` to return.
143+
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
144+
145+
// Optional. Page token from an earlier query, as returned in
146+
// `next_page_token`.
147+
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
148+
149+
// Optional. Lists the `VpcFlowLogsConfigs` that match the filter expression.
150+
// A filter expression must use the supported [CEL logic operators]
151+
// (https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators).
152+
string filter = 4 [(google.api.field_behavior) = OPTIONAL];
153+
154+
// Optional. Field to use to sort the list.
155+
string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
156+
}
157+
158+
// Response for the `ListVpcFlowLogsConfigs` method.
159+
message ListVpcFlowLogsConfigsResponse {
160+
// List of VPC Flow Log configurations.
161+
repeated VpcFlowLogsConfig vpc_flow_logs_configs = 1;
162+
163+
// Page token to fetch the next set of configurations.
164+
string next_page_token = 2;
165+
166+
// Locations that could not be reached (when querying all locations with `-`).
167+
repeated string unreachable = 3;
168+
}
169+
170+
// Request for the `GetVpcFlowLogsConfig` method.
171+
message GetVpcFlowLogsConfigRequest {
172+
// Required. `VpcFlowLogsConfig` resource name using the form:
173+
// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config}`
174+
string name = 1 [
175+
(google.api.field_behavior) = REQUIRED,
176+
(google.api.resource_reference) = {
177+
type: "networkmanagement.googleapis.com/VpcFlowLogsConfig"
178+
}
179+
];
180+
}
181+
182+
// Request for the `CreateVpcFlowLogsConfig` method.
183+
message CreateVpcFlowLogsConfigRequest {
184+
// Required. The parent resource of the VPC Flow Logs configuration to create:
185+
// `projects/{project_id}/locations/global`
186+
string parent = 1 [
187+
(google.api.field_behavior) = REQUIRED,
188+
(google.api.resource_reference) = {
189+
child_type: "networkmanagement.googleapis.com/VpcFlowLogsConfig"
190+
}
191+
];
192+
193+
// Required. ID of the `VpcFlowLogsConfig`.
194+
string vpc_flow_logs_config_id = 2 [
195+
(google.api.field_behavior) = REQUIRED,
196+
(google.api.resource_reference) = {
197+
type: "networkmanagement.googleapis.com/VpcFlowLogsConfig"
198+
}
199+
];
200+
201+
// Required. A `VpcFlowLogsConfig` resource
202+
VpcFlowLogsConfig vpc_flow_logs_config = 3
203+
[(google.api.field_behavior) = REQUIRED];
204+
}
205+
206+
// Request for the `UpdateVpcFlowLogsConfig` method.
207+
message UpdateVpcFlowLogsConfigRequest {
208+
// Required. Mask of fields to update. At least one path must be supplied in
209+
// this field.
210+
google.protobuf.FieldMask update_mask = 1
211+
[(google.api.field_behavior) = REQUIRED];
212+
213+
// Required. Only fields specified in update_mask are updated.
214+
VpcFlowLogsConfig vpc_flow_logs_config = 2
215+
[(google.api.field_behavior) = REQUIRED];
216+
}
217+
218+
// Request for the `DeleteVpcFlowLogsConfig` method.
219+
message DeleteVpcFlowLogsConfigRequest {
220+
// Required. `VpcFlowLogsConfig` resource name using the form:
221+
// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config}`
222+
string name = 1 [
223+
(google.api.field_behavior) = REQUIRED,
224+
(google.api.resource_reference) = {
225+
type: "networkmanagement.googleapis.com/VpcFlowLogsConfig"
226+
}
227+
];
228+
}

0 commit comments

Comments
 (0)