Skip to content

Commit

Permalink
feat: [networkmanagement] expose the new vpcflowlogs api proto (#5606)
Browse files Browse the repository at this point in the history
* feat: expose the new vpcflowlogs api proto

PiperOrigin-RevId: 660275659

Source-Link: googleapis/googleapis@d894629

Source-Link: googleapis/googleapis-gen@688b56a
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5ldHdvcmttYW5hZ2VtZW50Ly5Pd2xCb3QueWFtbCIsImgiOiI2ODhiNTZhN2ExZTRlNmY3M2UzZTA2MTc3OTQxNTMwOGNiODc5NTVhIn0=

* 🦉 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>
Co-authored-by: Daniel Bankhead <danielbankhead@google.com>
  • Loading branch information
3 people committed Aug 14, 2024
1 parent 700a937 commit c18942b
Show file tree
Hide file tree
Showing 22 changed files with 9,634 additions and 2 deletions.
5 changes: 5 additions & 0 deletions packages/google-cloud-networkmanagement/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
| Reachability_service.list_connectivity_tests | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkmanagement/samples/generated/v1beta1/reachability_service.list_connectivity_tests.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-networkmanagement/samples/generated/v1beta1/reachability_service.list_connectivity_tests.js,packages/google-cloud-networkmanagement/samples/README.md) |
| Reachability_service.rerun_connectivity_test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkmanagement/samples/generated/v1beta1/reachability_service.rerun_connectivity_test.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-networkmanagement/samples/generated/v1beta1/reachability_service.rerun_connectivity_test.js,packages/google-cloud-networkmanagement/samples/README.md) |
| Reachability_service.update_connectivity_test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkmanagement/samples/generated/v1beta1/reachability_service.update_connectivity_test.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-networkmanagement/samples/generated/v1beta1/reachability_service.update_connectivity_test.js,packages/google-cloud-networkmanagement/samples/README.md) |
| Vpc_flow_logs_service.create_vpc_flow_logs_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkmanagement/samples/generated/v1beta1/vpc_flow_logs_service.create_vpc_flow_logs_config.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-networkmanagement/samples/generated/v1beta1/vpc_flow_logs_service.create_vpc_flow_logs_config.js,packages/google-cloud-networkmanagement/samples/README.md) |
| Vpc_flow_logs_service.delete_vpc_flow_logs_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkmanagement/samples/generated/v1beta1/vpc_flow_logs_service.delete_vpc_flow_logs_config.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-networkmanagement/samples/generated/v1beta1/vpc_flow_logs_service.delete_vpc_flow_logs_config.js,packages/google-cloud-networkmanagement/samples/README.md) |
| Vpc_flow_logs_service.get_vpc_flow_logs_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkmanagement/samples/generated/v1beta1/vpc_flow_logs_service.get_vpc_flow_logs_config.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-networkmanagement/samples/generated/v1beta1/vpc_flow_logs_service.get_vpc_flow_logs_config.js,packages/google-cloud-networkmanagement/samples/README.md) |
| Vpc_flow_logs_service.list_vpc_flow_logs_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkmanagement/samples/generated/v1beta1/vpc_flow_logs_service.list_vpc_flow_logs_configs.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-networkmanagement/samples/generated/v1beta1/vpc_flow_logs_service.list_vpc_flow_logs_configs.js,packages/google-cloud-networkmanagement/samples/README.md) |
| Vpc_flow_logs_service.update_vpc_flow_logs_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkmanagement/samples/generated/v1beta1/vpc_flow_logs_service.update_vpc_flow_logs_config.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-networkmanagement/samples/generated/v1beta1/vpc_flow_logs_service.update_vpc_flow_logs_config.js,packages/google-cloud-networkmanagement/samples/README.md) |
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkmanagement/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-networkmanagement/samples/quickstart.js,packages/google-cloud-networkmanagement/samples/README.md) |


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.networkmanagement.v1beta1;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/networkmanagement/v1beta1/reachability.proto";
import "google/cloud/networkmanagement/v1beta1/vpc_flow_logs_config.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";

option csharp_namespace = "Google.Cloud.NetworkManagement.V1Beta1";
option go_package = "cloud.google.com/go/networkmanagement/apiv1beta1/networkmanagementpb;networkmanagementpb";
option java_multiple_files = true;
option java_outer_classname = "VpcFlowLogsProto";
option java_package = "com.google.cloud.networkmanagement.v1beta1";
option php_namespace = "Google\\Cloud\\NetworkManagement\\V1beta1";
option ruby_package = "Google::Cloud::NetworkManagement::V1beta1";

// The VPC Flow Logs service in the Google Cloud Network Management API provides
// configurations that generate Flow Logs. The service and the configuration
// resources created using this service are global.
service VpcFlowLogsService {
option (google.api.default_host) = "networkmanagement.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";

// Lists all `VpcFlowLogsConfigs` in a given project.
rpc ListVpcFlowLogsConfigs(ListVpcFlowLogsConfigsRequest)
returns (ListVpcFlowLogsConfigsResponse) {
option (google.api.http) = {
get: "/v1beta1/{parent=projects/*/locations/*}/vpcFlowLogsConfigs"
};
option (google.api.method_signature) = "parent";
}

// Gets the details of a specific `VpcFlowLogsConfig`.
rpc GetVpcFlowLogsConfig(GetVpcFlowLogsConfigRequest)
returns (VpcFlowLogsConfig) {
option (google.api.http) = {
get: "/v1beta1/{name=projects/*/locations/*/vpcFlowLogsConfigs/*}"
};
option (google.api.method_signature) = "name";
}

// Creates a new `VpcFlowLogsConfig`.
// If a configuration with the exact same settings already exists (even if the
// ID is different), the creation fails.
// Notes:
// 1. Creating a configuration with state=DISABLED will fail.
// 2. The following fields are not considrered as `settings` for the purpose
// of the check mentioned above, therefore - creating another configuration
// with the same fields but different values for the following fields will
// fail as well:
// - name
// - create_time
// - update_time
// - labels
// - description
rpc CreateVpcFlowLogsConfig(CreateVpcFlowLogsConfigRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1beta1/{parent=projects/*/locations/*}/vpcFlowLogsConfigs"
body: "vpc_flow_logs_config"
};
option (google.api.method_signature) =
"parent,vpc_flow_logs_config,vpc_flow_logs_config_id";
option (google.longrunning.operation_info) = {
response_type: "VpcFlowLogsConfig"
metadata_type: "google.cloud.networkmanagement.v1beta1.OperationMetadata"
};
}

// Updates an existing `VpcFlowLogsConfig`.
// If a configuration with the exact same settings already exists (even if the
// ID is different), the creation fails.
// Notes:
// 1. The following fields are not considrered as `settings` for the purpose
// of the check mentioned above, therefore - updating another configuration
// with the same fields but different values for the following fields will
// fail as well:
// - name
// - create_time
// - update_time
// - labels
// - description
rpc UpdateVpcFlowLogsConfig(UpdateVpcFlowLogsConfigRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1beta1/{vpc_flow_logs_config.name=projects/*/locations/*/vpcFlowLogsConfigs/*}"
body: "vpc_flow_logs_config"
};
option (google.api.method_signature) = "vpc_flow_logs_config,update_mask";
option (google.longrunning.operation_info) = {
response_type: "VpcFlowLogsConfig"
metadata_type: "google.cloud.networkmanagement.v1beta1.OperationMetadata"
};
}

// Deletes a specific `VpcFlowLogsConfig`.
rpc DeleteVpcFlowLogsConfig(DeleteVpcFlowLogsConfigRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1beta1/{name=projects/*/locations/*/vpcFlowLogsConfigs/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "google.cloud.networkmanagement.v1beta1.OperationMetadata"
};
}
}

// Request for the `ListVpcFlowLogsConfigs` method.
message ListVpcFlowLogsConfigsRequest {
// Required. The parent resource of the VpcFlowLogsConfig:
// `projects/{project_id}/locations/global`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "networkmanagement.googleapis.com/VpcFlowLogsConfig"
}
];

// Optional. Number of `VpcFlowLogsConfigs` to return.
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

// Optional. Page token from an earlier query, as returned in
// `next_page_token`.
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];

// Optional. Lists the `VpcFlowLogsConfigs` that match the filter expression.
// A filter expression must use the supported [CEL logic operators]
// (https://cloud.google.com/vpc/docs/about-flow-logs-records#supported_cel_logic_operators).
string filter = 4 [(google.api.field_behavior) = OPTIONAL];

// Optional. Field to use to sort the list.
string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Response for the `ListVpcFlowLogsConfigs` method.
message ListVpcFlowLogsConfigsResponse {
// List of VPC Flow Log configurations.
repeated VpcFlowLogsConfig vpc_flow_logs_configs = 1;

// Page token to fetch the next set of configurations.
string next_page_token = 2;

// Locations that could not be reached (when querying all locations with `-`).
repeated string unreachable = 3;
}

// Request for the `GetVpcFlowLogsConfig` method.
message GetVpcFlowLogsConfigRequest {
// Required. `VpcFlowLogsConfig` resource name using the form:
// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "networkmanagement.googleapis.com/VpcFlowLogsConfig"
}
];
}

// Request for the `CreateVpcFlowLogsConfig` method.
message CreateVpcFlowLogsConfigRequest {
// Required. The parent resource of the VPC Flow Logs configuration to create:
// `projects/{project_id}/locations/global`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "networkmanagement.googleapis.com/VpcFlowLogsConfig"
}
];

// Required. ID of the `VpcFlowLogsConfig`.
string vpc_flow_logs_config_id = 2 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "networkmanagement.googleapis.com/VpcFlowLogsConfig"
}
];

// Required. A `VpcFlowLogsConfig` resource
VpcFlowLogsConfig vpc_flow_logs_config = 3
[(google.api.field_behavior) = REQUIRED];
}

// Request for the `UpdateVpcFlowLogsConfig` method.
message UpdateVpcFlowLogsConfigRequest {
// Required. Mask of fields to update. At least one path must be supplied in
// this field.
google.protobuf.FieldMask update_mask = 1
[(google.api.field_behavior) = REQUIRED];

// Required. Only fields specified in update_mask are updated.
VpcFlowLogsConfig vpc_flow_logs_config = 2
[(google.api.field_behavior) = REQUIRED];
}

// Request for the `DeleteVpcFlowLogsConfig` method.
message DeleteVpcFlowLogsConfigRequest {
// Required. `VpcFlowLogsConfig` resource name using the form:
// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "networkmanagement.googleapis.com/VpcFlowLogsConfig"
}
];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.networkmanagement.v1beta1;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";

option csharp_namespace = "Google.Cloud.NetworkManagement.V1Beta1";
option go_package = "cloud.google.com/go/networkmanagement/apiv1beta1/networkmanagementpb;networkmanagementpb";
option java_multiple_files = true;
option java_outer_classname = "VpcFlowLogsConfigProto";
option java_package = "com.google.cloud.networkmanagement.v1beta1";
option php_namespace = "Google\\Cloud\\NetworkManagement\\V1beta1";
option ruby_package = "Google::Cloud::NetworkManagement::V1beta1";

// A configuration to generate VPC Flow Logs.
message VpcFlowLogsConfig {
option (google.api.resource) = {
type: "networkmanagement.googleapis.com/VpcFlowLogsConfig"
pattern: "projects/{project}/locations/{location}/vpcFlowLogsConfigs/{vpc_flow_logs_config}"
plural: "vpcFlowLogsConfigs"
singular: "vpcFlowLogsConfig"
};

// Determines whether this configuration will be generating logs.
// Setting state=DISABLED will pause the log generation for this config.
enum State {
// If not specified, will default to ENABLED.
STATE_UNSPECIFIED = 0;

// When ENABLED, this configuration will generate logs.
ENABLED = 1;

// When DISABLED, this configuration will not generate logs.
DISABLED = 2;
}

// Toggles the aggregation interval for collecting flow logs by 5-tuple.
enum AggregationInterval {
// If not specified, will default to INTERVAL_5_SEC.
AGGREGATION_INTERVAL_UNSPECIFIED = 0;

// Aggregate logs in 5s intervals.
INTERVAL_5_SEC = 1;

// Aggregate logs in 30s intervals.
INTERVAL_30_SEC = 2;

// Aggregate logs in 1m intervals.
INTERVAL_1_MIN = 3;

// Aggregate logs in 5m intervals.
INTERVAL_5_MIN = 4;

// Aggregate logs in 10m intervals.
INTERVAL_10_MIN = 5;

// Aggregate logs in 15m intervals.
INTERVAL_15_MIN = 6;
}

// Configures which log fields would be included.
enum Metadata {
// If not specified, will default to INCLUDE_ALL_METADATA.
METADATA_UNSPECIFIED = 0;

// Include all metadata fields.
INCLUDE_ALL_METADATA = 1;

// Exclude all metadata fields.
EXCLUDE_ALL_METADATA = 2;

// Include only custom fields (specified in metadata_fields).
CUSTOM_METADATA = 3;
}

// Identifier. Unique name of the configuration using the form:
// `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
string name = 1 [(google.api.field_behavior) = IDENTIFIER];

// Optional. The user-supplied description of the VPC Flow Logs configuration.
// Maximum of 512 characters.
optional string description = 2 [(google.api.field_behavior) = OPTIONAL];

// Optional. The state of the VPC Flow Log configuration. Default value is
// ENABLED. When creating a new configuration, it must be enabled.
optional State state = 3 [(google.api.field_behavior) = OPTIONAL];

// Optional. The aggregation interval for the logs. Default value is
// INTERVAL_5_SEC.
optional AggregationInterval aggregation_interval = 4
[(google.api.field_behavior) = OPTIONAL];

// Optional. The value of the field must be in (0, 1]. The sampling rate of
// VPC Flow Logs where 1.0 means all collected logs are reported. Setting the
// sampling rate to 0.0 is not allowed. If you want to disable VPC Flow Logs,
// use the state field instead. Default value is 1.0.
optional float flow_sampling = 5 [(google.api.field_behavior) = OPTIONAL];

// Optional. Configures whether all, none or a subset of metadata fields
// should be added to the reported VPC flow logs. Default value is
// INCLUDE_ALL_METADATA.
optional Metadata metadata = 6 [(google.api.field_behavior) = OPTIONAL];

// Optional. Custom metadata fields to include in the reported VPC flow logs.
// Can only be specified if "metadata" was set to CUSTOM_METADATA.
repeated string metadata_fields = 7 [(google.api.field_behavior) = OPTIONAL];

// Optional. Export filter used to define which VPC Flow Logs should be
// logged.
optional string filter_expr = 8 [(google.api.field_behavior) = OPTIONAL];

// Reference to the resource of the config scope. That is, the scope from
// which traffic is logged. The target resource must belong to the same
// project as the configuration.
oneof target_resource {
// Traffic will be logged from the Interconnect Attachment.
// Format:
// projects/{project_id}/regions/{region}/interconnectAttachments/{name}
string interconnect_attachment = 102;

// Traffic will be logged from the VPN Tunnel.
// Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
string vpn_tunnel = 103;
}

// Optional. Resource labels to represent user-provided metadata.
map<string, string> labels = 11 [(google.api.field_behavior) = OPTIONAL];

// Output only. The time the config was created.
google.protobuf.Timestamp create_time = 9
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The time the config was updated.
google.protobuf.Timestamp update_time = 10
[(google.api.field_behavior) = OUTPUT_ONLY];
}
Loading

0 comments on commit c18942b

Please sign in to comment.