feat: Add new gcloud commands, API clients, and third-party libraries across various services.

This commit is contained in:
2026-01-01 20:26:35 +01:00
parent 5e23cbece0
commit a19e592eb7
25221 changed files with 8324611 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
"""Manage Network Management resources."""
from googlecloudsdk.calliope import base
from surface.network_management import _init_extensions as extensions
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
@base.Autogenerated
@base.Hidden
class NetworkManagementAlpha(extensions.NetworkManagementAlpha):
"""Manage Network Management resources."""
@base.ReleaseTracks(base.ReleaseTrack.BETA)
@base.Autogenerated
class NetworkManagementBeta(extensions.NetworkManagementBeta):
"""Manage Network Management resources."""
@base.ReleaseTracks(base.ReleaseTrack.GA)
@base.Autogenerated
class NetworkManagementGa(extensions.NetworkManagementGa):
"""Manage Network Management resources."""

View File

@@ -0,0 +1,49 @@
# -*- coding: utf-8 -*- #
# Copyright 2024 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
"""File to add optional custom code to extend __init__.py."""
from googlecloudsdk.calliope import base
class NetworkManagementAlpha(base.Group):
"""Optional no-auto-generated code for ALPHA."""
category = base.NETWORKING_CATEGORY
def Filter(self, context, args):
# TODO(b/190538024): Determine if command group works with project number
base.RequireProjectID(args)
del context, args
class NetworkManagementBeta(base.Group):
"""Optional no-auto-generated code for BETA."""
category = base.NETWORKING_CATEGORY
def Filter(self, context, args):
# TODO(b/190538024): Determine if command group works with project number
base.RequireProjectID(args)
del context, args
class NetworkManagementGa(base.Group):
"""Optional no-auto-generated code for GA."""
category = base.NETWORKING_CATEGORY
def Filter(self, context, args):
# TODO(b/190538024): Determine if command group works with project number
base.RequireProjectID(args)
del context, args

View File

@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*- #
# Copyright 2020 Google LLC. All Rights Reserved.
#
# 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.
"""Command group for Network Management Connectivity Tests."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.GA, base.ReleaseTrack.BETA)
class ConnectivityTests(base.Group):
"""Manage Network Management ConnectivityTests."""

View File

@@ -0,0 +1,192 @@
- release_tracks: [GA, BETA]
help_text:
brief: |
Create a new connectivity test.
description: |
Create a new connectivity test with the given name.
examples: |
The following command creates a connectivity test with the name my-test,
and the test between a source VM and a destination IP address in a peering
network.
$ {command} my-test \
--source-instance=projects/my-project/zones/us-west-1/instances/my-instance
--destination-ip-address=10.142.0.2 --destination-network=projects/my-project/global/networks/peering-network
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_management.resources:connectivityTest
help_text: |
Name of the connectivity test you want to create.
params:
- group:
required: true
params:
- arg_name: source-instance
api_field: connectivityTest.source.instance
help_text: |
A Compute Engine instance URI as the source endpoint.
- arg_name: source-ip-address
api_field: connectivityTest.source.ipAddress
help_text: |
The IP address of the source which can be an external or internal IP.
- arg_name: source-gke-master-cluster
api_field: connectivityTest.source.gkeMasterCluster
help_text: |
A cluster URI for Google Kubernetes Engine master as the source endpoint.
- arg_name: source-cloud-sql-instance
api_field: connectivityTest.source.cloudSqlInstance
help_text: |
A Cloud SQL instance URI as the source endpoint.
- arg_name: source-cloud-function
api_field: connectivityTest.source.cloudFunction.uri
help_text: |
A Cloud function URI as the source endpoint.
- arg_name: source-app-engine-version
api_field: connectivityTest.source.appEngineVersion.uri
help_text: |
App Engine version URI as the source endpoint.
- arg_name: source-cloud-run-revision
api_field: connectivityTest.source.cloudRunRevision.uri
help_text: |
Cloud Run revision URI as the source endpoint.
- arg_name: source-network
api_field: connectivityTest.source.network
help_text: |
A VPC network URI where the source is located.
- arg_name: source-network-type
api_field: connectivityTest.source.networkType
help_text: |
Type of the network where the source is located.
choices:
- enum_value: gcp-network
arg_value: gcp-network
help_text: Network in Google Cloud Platform.
- enum_value: non-gcp-network
arg_value: non-gcp-network
help_text: Network outside Google Cloud Platform.
default: gcp-network
- arg_name: source-project
api_field: connectivityTest.source.projectId
help_text: |
Project ID of the source endpoint.
- group:
required: true
params:
- arg_name: destination-instance
api_field: connectivityTest.destination.instance
help_text: |
A Compute Engine instance URI as the destination endpoint.
- arg_name: destination-ip-address
api_field: connectivityTest.destination.ipAddress
help_text: |
The IP address of the destination which can be an external or internal IP.
- arg_name: destination-gke-master-cluster
api_field: connectivityTest.destination.gkeMasterCluster
help_text: |
A cluster URI for Google Kubernetes Engine master as the destination endpoint.
- arg_name: destination-cloud-sql-instance
api_field: connectivityTest.destination.cloudSqlInstance
help_text: |
A Cloud SQL instance URI as the destination endpoint.
- arg_name: destination-forwarding-rule
api_field: connectivityTest.destination.forwardingRule
help_text: |
A forwarding rule URI as the destination endpoint.
- arg_name: destination-redis-instance
api_field: connectivityTest.destination.redisInstance
help_text: |
A Redis instance URI as the destination endpoint.
- arg_name: destination-redis-cluster
api_field: connectivityTest.destination.redisCluster
help_text: |
A Redis cluster URI as the destination endpoint.
- arg_name: destination-network
api_field: connectivityTest.destination.network
help_text: |
A VPC network URI where the destination is located.
- arg_name: destination-port
api_field: connectivityTest.destination.port
help_text: |
The IP protocol port of the destination. Only applicable when protocol is
TCP or UDP.
- arg_name: destination-project
api_field: connectivityTest.destination.projectId
help_text: |
Project ID of the destination endpoint.
- arg_name: destination-fqdn
api_field: connectivityTest.destination.fqdn
help_text: |
A hostname as the destination endpoint. Only applicable for Google Kubernetes Engine.
- arg_name: description
api_field: connectivityTest.description
help_text: |
The description of the connectivity test.
- arg_name: protocol
api_field: connectivityTest.protocol
help_text: |
Type of protocol for the test. When not provided, "TCP" is assumed.
- arg_name: round-trip
type: bool
api_field: connectivityTest.roundTrip
help_text: |
This boolean controls whether return traces (from the destination to the
source) will be additionally calculated if packet successfully reaches
the destination from the source.
- arg_name: bypass-firewall-checks
type: bool
api_field: connectivityTest.bypassFirewallChecks
help_text: |
This boolean controls whether to skip firewall checking.
- arg_name: other-projects
api_field: connectivityTest.relatedProjects
repeated: true
help_text: |
IDs of other projects involved in the connectivity test, besides
the source and destination project.
- arg_name: labels
api_field: connectivityTest.labels.additionalProperties
metavar: KEY=VALUE
help_text: |
List of label KEY=VALUE pairs to add.
type:
arg_dict:
spec:
- api_field: key
- api_field: value
async:
collection: networkmanagement.projects.locations.global.operations
request:
BETA:
api_version: v1beta1
modify_request_hooks:
- googlecloudsdk.command_lib.network_management.util:ValidateInstanceNames
- googlecloudsdk.command_lib.network_management.util:ValidateNetworkURIs
- googlecloudsdk.command_lib.network_management.util:AppendLocationsGlobalToParent
- googlecloudsdk.command_lib.network_management.util:ValidateGKEMasterClustersURIs
- googlecloudsdk.command_lib.network_management.util:ValidateCloudSQLInstancesURIs
- googlecloudsdk.command_lib.network_management.util:ValidateCloudFunctionsURIs
- googlecloudsdk.command_lib.network_management.util:ValidateAppEngineVersionsURIs
- googlecloudsdk.command_lib.network_management.util:ValidateCloudRunRevisionsURIs
- googlecloudsdk.command_lib.network_management.util:ValidateForwardingRulesURIs
- googlecloudsdk.command_lib.network_management.util:ValidateRedisInstancesURIs
- googlecloudsdk.command_lib.network_management.util:ValidateRedisClustersURIs
- googlecloudsdk.command_lib.network_management.util:ValidateFqdn
GA:
api_version: v1
modify_request_hooks:
- googlecloudsdk.command_lib.network_management.util:ValidateInstanceNames
- googlecloudsdk.command_lib.network_management.util:ValidateNetworkURIs
- googlecloudsdk.command_lib.network_management.util:AppendLocationsGlobalToParent
- googlecloudsdk.command_lib.network_management.util:ValidateGKEMasterClustersURIs
- googlecloudsdk.command_lib.network_management.util:ValidateCloudSQLInstancesURIs
- googlecloudsdk.command_lib.network_management.util:ValidateCloudFunctionsURIs
- googlecloudsdk.command_lib.network_management.util:ValidateAppEngineVersionsURIs
- googlecloudsdk.command_lib.network_management.util:ValidateCloudRunRevisionsURIs
- googlecloudsdk.command_lib.network_management.util:ValidateForwardingRulesURIs
- googlecloudsdk.command_lib.network_management.util:ValidateRedisInstancesURIs
- googlecloudsdk.command_lib.network_management.util:ValidateRedisClustersURIs
- googlecloudsdk.command_lib.network_management.util:ValidateFqdn
collection: networkmanagement.projects.locations.global.connectivityTests
method: create

View File

@@ -0,0 +1,29 @@
- release_tracks: [GA, BETA]
help_text:
brief: |
Delete a connectivity test.
description: |
Delete the specified connectivity test.
examples: |
The following command deletes a connectivity test with the name `my-test`.
$ {command} my-test
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_management.resources:connectivityTest
help_text: |
Name of the connectivity test you want to delete.
async:
collection: networkmanagement.projects.locations.global.operations
request: &request
BETA:
api_version: v1beta1
GA:
api_version: v1
api_version: v1
collection: networkmanagement.projects.locations.global.connectivityTests

View File

@@ -0,0 +1,25 @@
- release_tracks: [GA, BETA]
help_text:
brief: |
Describe a connectivity test.
description: |
Show details of a connectivity test.
examples: |
The following command prints of a connectivity test with the name `my-test`.
$ {command} my-test
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_management.resources:connectivityTest
help_text: |
Name of the connectivity test you want to describe.
request: &request
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: networkmanagement.projects.locations.global.connectivityTests

View File

@@ -0,0 +1,52 @@
- release_tracks: [GA, BETA]
help_text:
brief: |
List connectivity tests.
description: |
List all connectivity tests in the specified project.
You can specify the maximum number of connectivity tests to list using the
`--limit` flag.
examples: |
The following command lists a maximum of five connectivity tests:
$ {command} --limit=5
request: &request
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: networkmanagement.projects.locations.global.connectivityTests
modify_request_hooks:
- googlecloudsdk.command_lib.network_management.util:AppendLocationsGlobalToParent
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_management.resources:project
help_text: |
The project of the connectivity tests to display.
output:
format: |
table(
name.basename():label=NAME,
protocol:label=PROTOCOL,
source.projectId:label=SRC_PROJECT,
source.network:label=SRC_NW,
source.ipAddress:label=SRC_IP,
source.instance:label=SRC_VM,
source.gkeMasterCluster:label=SRC_GKE,
source.cloudSqlInstance:label=SRC_SQL,
destination.projectId:label=DST_PROJECT,
destination.network:label=DST_NW,
destination.ipAddress:label=DST_IP,
destination.forwardingRule:label=DST_FR,
destination.instance:label=DST_VM,
destination.gkeMasterCluster:label=DST_GKE,
destination.cloudSqlInstance:label=DST_SQL,
destination.port:label=DST_PORT,
updateTime.date():label=UPDATED,
labels
)

View File

@@ -0,0 +1,29 @@
- release_tracks: [GA, BETA]
help_text:
brief: |
Rerun a connectivity test.
description: |
Rerun the specified connectivity test.
examples: |
The following command reruns a connectivity test with the name `my-test`.
$ {command} my-test
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_management.resources:connectivityTest
help_text: |
Name of the connectivity test you want to rerun.
async:
collection: networkmanagement.projects.locations.global.operations
request: &request
method: rerun
BETA:
api_version: v1beta1
GA:
api_version: v1
collection: networkmanagement.projects.locations.global.connectivityTests

View File

@@ -0,0 +1,286 @@
- release_tracks: [GA, BETA]
help_text:
brief: |
Update an existing connectivity test.
description: |
Update an existing connectivity test with the given name.
examples: |
The following command updates a connectivity test with the name my-test,
modifying the description and destination IP address.
$ {command} my-test \
--description='update dst addr' --destination-ip-address='10.142.0.3'
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_management.resources:connectivityTest
help_text: |
Name of the connectivity test you want to update.
params:
- group:
mutex: true
params:
- arg_name: source-instance
api_field: connectivityTest.source.instance
help_text: |
A Compute Engine instance URI as the source endpoint.
- arg_name: clear-source-instance
type: bool
help_text: |
Clear existing source instance.
- arg_name: source-network
api_field: connectivityTest.source.network
help_text: |
A VPC network URI where the source is located.
- arg_name: source-network-type
api_field: connectivityTest.source.networkType
help_text: |
Type of the network where the source is located.
choices:
- enum_value: gcp-network
arg_value: gcp-network
help_text: Network in Google Cloud Platform.
- enum_value: non-gcp-network
arg_value: non-gcp-network
help_text: Network outside Google Cloud Platform.
default: gcp-network
- group:
mutex: true
params:
- arg_name: source-ip-address
api_field: connectivityTest.source.ipAddress
help_text: |
The IP address of the source which can be an external or internal IP.
- arg_name: clear-source-ip-address
type: bool
help_text: |
Clear existing source IP address.
- arg_name: source-project
api_field: connectivityTest.source.projectId
help_text: |
Project ID of the source endpoint.
- group:
mutex: true
params:
- arg_name: source-gke-master-cluster
api_field: connectivityTest.source.gkeMasterCluster
help_text: |
A cluster URI for Google Kubernetes Engine master as the source endpoint.
- arg_name: clear-source-gke-master-cluster
type: bool
help_text: |
Clear existing source cluster for Google Kubernetes Engine master.
- group:
mutex: true
params:
- arg_name: source-cloud-sql-instance
api_field: connectivityTest.source.cloudSqlInstance
help_text: |
A Cloud SQL instance URI as the source endpoint.
- arg_name: clear-source-cloud-sql-instance
type: bool
help_text: |
Clear existing source Cloud SQL instance.
- group:
mutex: true
params:
- arg_name: source-cloud-function
api_field: connectivityTest.source.cloudFunction.uri
help_text: |
A Cloud function URI as the source endpoint.
- arg_name: clear-source-cloud-function
type: bool
help_text: |
Clear existing source Cloud function.
- group:
mutex: true
params:
- arg_name: source-app-engine-version
api_field: connectivityTest.source.appEngineVersion.uri
help_text: |
App Engine version URI as the source endpoint.
- arg_name: clear-source-app-engine-version
type: bool
help_text: |
Clear existing source App Engine version.
- group:
mutex: true
params:
- arg_name: source-cloud-run-revision
api_field: connectivityTest.source.cloudRunRevision.uri
help_text: |
Cloud Run revision URI as the source endpoint.
- arg_name: clear-source-cloud-run-revision
type: bool
help_text: |
Clear existing source Cloud Run revision.
- group:
mutex: true
params:
- arg_name: destination-instance
api_field: connectivityTest.destination.instance
help_text: |
A Compute Engine instance URI as the destination endpoint.
- arg_name: clear-destination-instance
type: bool
help_text:
Clear existing destination instance.
- arg_name: destination-network
api_field: connectivityTest.destination.network
help_text: |
A VPC network URI where the destination is located.
- arg_name: destination-port
api_field: connectivityTest.destination.port
help_text: |
The IP protocol port of the destination. Only applicable when protocol is
TCP or UDP.
- group:
mutex: true
params:
- arg_name: destination-ip-address
api_field: connectivityTest.destination.ipAddress
help_text: |
The IP address of the destination which can be an external or internal IP.
- arg_name: clear-destination-ip-address
type: bool
help_text: |
Clear existing destination IP address.
- arg_name: destination-project
api_field: connectivityTest.destination.projectId
help_text: |
Project ID of the destination endpoint.
- arg_name: destination-fqdn
api_field: connectivityTest.destination.fqdn
help_text: |
A hostname as the destination endpoint. Only applicable for Google Kubernetes Engine.
- group:
mutex: true
params:
- arg_name: destination-gke-master-cluster
api_field: connectivityTest.destination.gkeMasterCluster
help_text: |
A cluster URI for Google Kubernetes Engine master as the destination endpoint.
- arg_name: clear-destination-gke-master-cluster
type: bool
help_text: |
Clear existing destination cluster for Google Kubernetes Engine master.
- group:
mutex: true
params:
- arg_name: destination-cloud-sql-instance
api_field: connectivityTest.destination.cloudSqlInstance
help_text: |
A Cloud SQL instance URI as the destination endpoint.
- arg_name: clear-destination-cloud-sql-instance
type: bool
help_text: |
Clear existing destination Cloud SQL instance.
- group:
mutex: true
params:
- arg_name: destination-forwarding-rule
api_field: connectivityTest.destination.forwardingRule
help_text: |
A forwarding rule URI as the destination endpoint.
- arg_name: clear-destination-forwarding-rule
type: bool
help_text: |
Clear existing destination forwarding rule.
- group:
mutex: true
params:
- arg_name: destination-redis-instance
api_field: connectivityTest.destination.redisInstance
help_text: |
A Redis instance URI as the destination endpoint.
- arg_name: clear-destination-redis-instance
type: bool
help_text: |
Clear existing destination Redis Instance.
- group:
mutex: true
params:
- arg_name: destination-redis-cluster
api_field: connectivityTest.destination.redisCluster
help_text: |
A Redis cluster URI as the destination endpoint.
- arg_name: clear-destination-redis-cluster
type: bool
help_text: |
Clear existing destination Redis Cluster.
- arg_name: description
api_field: connectivityTest.description
help_text: |
The description of the connectivity test.
- arg_name: protocol
api_field: connectivityTest.protocol
help_text: |
Type of protocol for the test. When not provided, "TCP" is assumed.
- arg_name: round-trip
type: bool
api_field: connectivityTest.roundTrip
help_text: |
This boolean controls whether return traces (from the destination to the
source) will be additionally calculated if packet successfully reaches
the destination from the source. Use --no-round-trip to disable.
- arg_name: bypass-firewall-checks
type: bool
api_field: connectivityTest.bypassFirewallChecks
help_text: |
This boolean controls whether to skip firewall checking. Use
--no-bypass-firewall-checks to disable.
- arg_name: other-projects
api_field: connectivityTest.relatedProjects
repeated: true
help_text: |
IDs of other projects involved in the connectivity test, besides
the source and destination project.
- arg_name: labels
api_field: connectivityTest.labels.additionalProperties
metavar: KEY=VALUE
help_text: |
List of label KEY=VALUE pairs to add.
type:
arg_dict:
spec:
- api_field: key
- api_field: value
async:
collection: networkmanagement.projects.locations.global.operations
request:
BETA:
api_version: v1beta1
modify_request_hooks:
- googlecloudsdk.command_lib.network_management.util:ValidateInstanceNames
- googlecloudsdk.command_lib.network_management.util:ValidateNetworkURIs
- googlecloudsdk.command_lib.network_management.util:ClearEndpointAttrsBeta
- googlecloudsdk.command_lib.network_management.util:ValidateGKEMasterClustersURIs
- googlecloudsdk.command_lib.network_management.util:ValidateCloudSQLInstancesURIs
- googlecloudsdk.command_lib.network_management.util:ValidateCloudFunctionsURIs
- googlecloudsdk.command_lib.network_management.util:ValidateAppEngineVersionsURIs
- googlecloudsdk.command_lib.network_management.util:ValidateCloudRunRevisionsURIs
- googlecloudsdk.command_lib.network_management.util:ValidateForwardingRulesURIs
- googlecloudsdk.command_lib.network_management.util:ValidateRedisInstancesURIs
- googlecloudsdk.command_lib.network_management.util:ValidateRedisClustersURIs
- googlecloudsdk.command_lib.network_management.util:ValidateFqdn
GA:
api_version: v1
modify_request_hooks:
- googlecloudsdk.command_lib.network_management.util:ValidateInstanceNames
- googlecloudsdk.command_lib.network_management.util:ValidateNetworkURIs
- googlecloudsdk.command_lib.network_management.util:ClearEndpointAttrs
- googlecloudsdk.command_lib.network_management.util:ValidateGKEMasterClustersURIs
- googlecloudsdk.command_lib.network_management.util:ValidateCloudSQLInstancesURIs
- googlecloudsdk.command_lib.network_management.util:ValidateCloudFunctionsURIs
- googlecloudsdk.command_lib.network_management.util:ValidateAppEngineVersionsURIs
- googlecloudsdk.command_lib.network_management.util:ValidateCloudRunRevisionsURIs
- googlecloudsdk.command_lib.network_management.util:ValidateForwardingRulesURIs
- googlecloudsdk.command_lib.network_management.util:ValidateRedisInstancesURIs
- googlecloudsdk.command_lib.network_management.util:ValidateRedisClustersURIs
- googlecloudsdk.command_lib.network_management.util:ValidateFqdn
method: patch
collection: networkmanagement.projects.locations.global.connectivityTests
update:
read_modify_update: true

View File

@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
"""Manage Network Monitoring Provider resources."""
from googlecloudsdk.calliope import base
from surface.network_management.network_monitoring_providers import _init_extensions as extensions
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
@base.Autogenerated
@base.Hidden
class NetworkMonitoringProvidersAlpha(
extensions.NetworkMonitoringProvidersAlpha
):
"""A Network Monitoring Provider manages the enablement state of the Network Insights service.
The service is considered enabled when provider resource is in 'ACTIVE' state.
"""

View File

@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
"""File to add optional custom code to extend __init__.py."""
from googlecloudsdk.calliope import base
class NetworkMonitoringProvidersAlpha(base.Group):
"""Optional no-auto-generated code for ALPHA."""
class NetworkMonitoringProvidersBeta(base.Group):
"""Optional no-auto-generated code for BETA."""
class NetworkMonitoringProvidersGa(base.Group):
"""Optional no-auto-generated code for GA."""

View File

@@ -0,0 +1,61 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- ALPHA
auto_generated: true
hidden: true
help_text:
brief: Create a Network Monitoring Provider.
description: |-
Create a new Network Monitoring Provider.
To create this resource for the first time in a Google Cloud project, you must use the Cloud Console to accept the Broadcom Terms of Service (TOS).
Note: The only supported location for these resources is `global`.
examples: |-
To create a Network Monitoring Provider `my-provider-id` of type `EXTERNAL`, run:
$ {command} my-provider-id --location=global --provider-type=EXTERNAL
arguments:
params:
- help_text: |-
Identifier. Name of the resource.
Format:
`projects/{project}/locations/{location}/networkMonitoringProviders/{network_monitoring_provider}`
is_positional: true
is_primary_resource: true
request_id_field: networkMonitoringProviderId
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1alpha1_resources:projects_locations_network_monitoring_providers
required: true
- arg_name: provider-type
api_field: networkMonitoringProvider.providerType
required: true
help_text: |-
Type of the NetworkMonitoringProvider.
choices:
- arg_value: external
enum_value: EXTERNAL
help_text: |-
External provider.
request:
api_version: v1alpha1
collection:
- networkmanagement.projects.locations.networkMonitoringProviders
async:
collection:
- networkmanagement.projects.locations.operations

View File

@@ -0,0 +1,59 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- ALPHA
auto_generated: true
hidden: true
help_text:
brief: Delete a Network Monitoring Provider.
description: |-
Delete a specific Network Monitoring Provider.
Note: The only supported location for these resources is `global`.
examples: |-
To delete the Network Monitoring Provider `my-provider-id`, run:
$ {command} my-provider-id --location=global
arguments:
params:
- help_text: |-
Name of the resource.
Format:
projects/{project}/locations/{location}/networkMonitoringProviders/{network_monitoring_provider}
is_positional: true
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1alpha1_resources:projects_locations_network_monitoring_providers
required: true
- arg_name: force
api_field: force
action: store_true
required: false
type: bool
help_text: |-
If set to true, any nested [MonitoringPoints][google.cloud.networkmanagement.v1alpha1.MonitoringPoint],
[NetworkPaths][google.cloud.networkmanagement.v1alpha1.NetworkPath] and [WebPaths][google.cloud.networkmanagement.v1alpha1.WebPath] resources from this
[NetworkMonitoringProvider][google.cloud.networkmanagement.v1alpha1.NetworkMonitoringProvider] will also be deleted.
Otherwise, the request will only work if there are no nested resources.
default: null
request:
api_version: v1alpha1
collection:
- networkmanagement.projects.locations.networkMonitoringProviders
async:
collection:
- networkmanagement.projects.locations.operations

View File

@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- ALPHA
auto_generated: true
hidden: true
help_text:
brief: Describe a Network Monitoring Provider.
description: |-
Get details about a specific Network Monitoring Provider.
Note: The only supported location for these resources is `global`.
examples: |-
To describe the Network Monitoring Provider `my-provider-id`, run:
$ {command} my-provider-id --location=global
arguments:
params:
- help_text: |-
Name of the resource.
Format:
`projects/{project}/locations/{location}/networkMonitoringProviders/{network_monitoring_provider}`
is_positional: true
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1alpha1_resources:projects_locations_network_monitoring_providers
required: true
request:
api_version: v1alpha1
collection:
- networkmanagement.projects.locations.networkMonitoringProviders

View File

@@ -0,0 +1,55 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- ALPHA
auto_generated: true
hidden: true
help_text:
brief: Generate a provider access token.
description: |-
Exchanges a valid Google Cloud access token for a temporary access token that can be used to authenticate requests to the partner's platform API.
The generated partner's access token's lifetime is tied to the input Google Cloud access token; it will expire when the Google Cloud token expires. This token is necessary for any direct API interactions with partner's resources.
Note: The only supported location for these resources is `global`.
examples: |-
To generate a provider access token for the Network Monitoring Provider `my-provider-id`, run:
$ {command} my-provider-id --location=global --gcp-access-token=<GCP_ACCESS_TOKEN>
arguments:
params:
- help_text: |-
Name of the resource.
Format:
projects/{project}/locations/{location}/networkMonitoringProviders/{network_monitoring_provider}
is_positional: true
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1alpha1_resources:projects_locations_network_monitoring_providers
required: true
- arg_name: gcp-access-token
api_field: gcpAccessToken
required: true
repeated: false
help_text: |-
Google Cloud access token.
request:
api_version: v1alpha1
collection:
- networkmanagement.projects.locations.networkMonitoringProviders
method: generateProviderAccessToken
command_type: GENERIC

View File

@@ -0,0 +1,47 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- ALPHA
auto_generated: true
hidden: true
help_text:
brief: List Network Monitoring Providers.
description: |-
List all Network Monitoring Providers for a given project.
Note: The only supported location for these resources is `global`.
examples: |-
To list all Network Monitoring Providers, run:
$ {command} --location=global
arguments:
params:
- help_text: |-
Parent value for ListNetworkMonitoringProvidersRequest.
Format:
`projects/{project}/locations/{location}`
is_positional: false
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1alpha1_resources:projects_locations
required: true
request:
api_version: v1alpha1
collection:
- networkmanagement.projects.locations.networkMonitoringProviders
response:
id_field: name

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
_PARTIALS_: true

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
_PARTIALS_: true

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
_PARTIALS_: true

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
_PARTIALS_: true

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
_PARTIALS_: true

View File

@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
"""Manage Monitoring Point resources."""
from googlecloudsdk.calliope import base
from surface.network_management.network_monitoring_providers.monitoring_points import _init_extensions as extensions
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
@base.Autogenerated
@base.Hidden
class MonitoringPointsAlpha(extensions.MonitoringPointsAlpha):
"""A Monitoring Point is an agent within your network or application infrastructure that sends probes and reports the results to AppNeta.
The Monitoring Point can also be the target.
"""

View File

@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
"""File to add optional custom code to extend __init__.py."""
from googlecloudsdk.calliope import base
class MonitoringPointsAlpha(base.Group):
"""Optional no-auto-generated code for ALPHA."""
class MonitoringPointsBeta(base.Group):
"""Optional no-auto-generated code for BETA."""
class MonitoringPointsGa(base.Group):
"""Optional no-auto-generated code for GA."""

View File

@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- ALPHA
auto_generated: true
hidden: true
help_text:
brief: Describe a Monitoring Point.
description: |-
Get details about a specific Monitoring Point.
Note: The only supported location for these resources is `global`.
examples: |-
To describe the Monitoring Point `my-monitoring-point-id` under provider `my-provider-id`, run:
$ {command} my-monitoring-point-id --network-monitoring-provider=my-provider-id --location=global
arguments:
params:
- help_text: |-
Name of the resource.
Format:
projects/{project}/locations/{location}/networkMonitoringProviders/{network_monitoring_provider}/monitoringPoints/{monitoring_point}
is_positional: true
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1alpha1_resources:projects_locations_network_monitoring_providers_monitoring_points
required: true
request:
api_version: v1alpha1
collection:
- networkmanagement.projects.locations.networkMonitoringProviders.monitoringPoints

View File

@@ -0,0 +1,47 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- ALPHA
auto_generated: true
hidden: true
help_text:
brief: List Monitoring Points.
description: |-
List all Monitoring Points for a given Network Monitoring Provider.
Note: The only supported location for these resources is `global`.
examples: |-
To list all Monitoring Points for the provider `my-provider-id`, run:
$ {command} --network-monitoring-provider=my-provider-id --location=global
arguments:
params:
- help_text: |-
Parent value for ListMonitoringPointsRequest.
Format:
projects/{project}/locations/{location}/networkMonitoringProviders/{network_monitoring_provider}
is_positional: false
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1alpha1_resources:projects_locations_network_monitoring_providers
required: true
request:
api_version: v1alpha1
collection:
- networkmanagement.projects.locations.networkMonitoringProviders.monitoringPoints
response:
id_field: name

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
_PARTIALS_: true

View File

@@ -0,0 +1,347 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
"""Command to download an installation script for a Monitoring Point."""
from urllib import parse
from googlecloudsdk.api_lib.util import apis
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.core import log
from googlecloudsdk.core import properties
from googlecloudsdk.core.credentials import transports
from googlecloudsdk.core.util import files
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
@base.DefaultUniverseOnly
@base.Hidden
class DownloadInstallScript(base.Command):
"""Download an installation script for a Monitoring Point."""
detailed_help = {
'BRIEF': 'Download an installation script for a Monitoring Point.',
'DESCRIPTION': """\
Downloads an installation script for a Monitoring Point for a given
Network Monitoring Provider.
The command downloads a tarball for `--monitoring-point-type=container`,
or a zip file for `--monitoring-point-type=kvm` or
`--monitoring-point-type=vmware`.
The `--network-monitoring-provider`, `--location`, `--monitoring-point-type`,
and `--hostname` arguments are required for all Monitoring Points.
Additional arguments depend on the value of `--monitoring-point-type`.
If `--monitoring-point-type=container` is specified, no other flags
are required, and flags like `--password`, `--time-zone`,
`--use-dhcp`, and `--static-ip-address` are not allowed.
If `--monitoring-point-type=kvm` or `--monitoring-point-type=vmware`
is specified, `--password` and `--time-zone` are also required.
You must also specify either `--use-dhcp` for DHCP configurations or
`--static-ip-address` for static IP configurations. If using
`--static-ip-address`, `--gateway-address` and `--dns-server-address`
are also required.
""",
'EXAMPLES': """\
To download the install script for a Monitoring Point of type `container`, run:
$ {command} --network-monitoring-provider=my-provider --location=global --monitoring-point-type=container --hostname=container-hostname --output-file=compose.container-hostname.tar.gz
To download the install script for a Monitoring Point of type `kvm` using DHCP, run:
$ {command} --network-monitoring-provider=my-provider --location=global --monitoring-point-type=kvm --hostname=kvm-hostname --password=my-password --time-zone=America/Los_Angeles --use-dhcp --output-file=kvm.kvm-hostname.zip
To download the install script for a Monitoring Point of type `vmware` using a static IP, run:
$ {command} --network-monitoring-provider=my-provider --location=global --monitoring-point-type=vmware --hostname=vmware-hostname --password=my-password --time-zone=America/Los_Angeles --static-ip-address=192.168.1.100 --netmask=255.255.255.0 --gateway-address=192.168.1.1 --dns-server-address=8.8.8.8 --output-file=vmwareApplianceConfig.zip
""",
}
@staticmethod
def Args(parser):
parser.add_argument(
'--network-monitoring-provider',
required=True,
help='The ID of the Network Monitoring Provider.',
)
parser.add_argument(
'--location',
required=True,
help=(
'The location of the Network Monitoring Provider (example:,'
' `global`).'
),
)
parser.add_argument(
'--monitoring-point-type',
required=True,
choices=['container', 'kvm', 'vmware'],
help='The type of the Monitoring Point.',
)
parser.add_argument(
'--hostname',
required=True,
help='The hostname of the Monitoring Point (example: `test-vm`).',
)
parser.add_argument(
'--output-file',
required=True,
help='The path to save the downloaded install script.',
)
parser.add_argument(
'--password',
help=(
'Password for logging into the Monitoring Point. Required for'
' types KVM and VMWARE, not allowed for CONTAINER.'
),
)
parser.add_argument(
'--time-zone',
help=(
'Time zone ID for the Monitoring Point (example: '
' `America/Los_Angeles`). Required for types KVM and VMWARE, not'
' allowed for CONTAINER.'
),
)
parser.add_argument(
'--use-dhcp',
action='store_true',
help=(
'Whether to use DHCP for IP address configuration. Allowed for'
' types KVM and VMWARE only.'
),
)
static_ip_group = parser.add_group(
help=(
'Static IP address configuration. Allowed for types KVM and VMWARE'
' only.'
)
)
static_ip_group.add_argument(
'--static-ip-address',
help=(
'Static IP address of the Monitoring Point. If specified,'
' `--gateway-address` and `--dns-server-address` are required.'
),
)
static_ip_group.add_argument(
'--netmask',
help=(
'Network mask (example: "255.255.255.0"). Used'
' with `--static-ip-address`.'
),
)
static_ip_group.add_argument(
'--gateway-address',
help=(
'Gateway IP address. Required if `--static-ip-address` is'
' specified.'
),
)
static_ip_group.add_argument(
'--dns-server-address',
help=(
'Primary DNS server address. Required if `--static-ip-address` is'
' specified.'
),
)
static_ip_group.add_argument(
'--dns-server-secondary-address',
help='Secondary DNS server address. Used with `--static-ip-address`.',
)
static_ip_group.add_argument(
'--domain',
help=(
'Domain name of the Monitoring Point. Used with'
' `--static-ip-address`.'
),
)
parser.add_argument(
'--ntp-server-address',
help=(
'Primary NTP server address (IP address or FQDN). Allowed for'
' types KVM and VMWARE only.'
),
)
parser.add_argument(
'--ntp-server-secondary-address',
help=(
'Secondary NTP server address (IP address or FQDN). Allowed for'
' types KVM and VMWARE only.'
),
)
def _ValidateArgs(self, args):
"""Validates argument combinations based on monitoring_point_type."""
mp_type = args.monitoring_point_type.upper()
if mp_type == 'CONTAINER':
illegal_container_args = [
'password',
'time_zone',
'use_dhcp',
'static_ip_address',
'netmask',
'gateway_address',
'dns_server_address',
'dns_server_secondary_address',
'domain',
'ntp_server_address',
'ntp_server_secondary_address',
]
for arg_name in illegal_container_args:
if args.IsSpecified(arg_name):
arg_name_dash = arg_name.replace('_', '-')
raise exceptions.InvalidArgumentException(
arg_name_dash,
f'{arg_name_dash} is not allowed for type CONTAINER',
)
elif mp_type in ['KVM', 'VMWARE']:
if not args.IsSpecified('time_zone'):
raise exceptions.RequiredArgumentException(
'time-zone', f'Time zone is required for type {mp_type}'
)
if not args.IsSpecified('password'):
raise exceptions.RequiredArgumentException(
'password', f'Password is required for type {mp_type}'
)
has_use_dhcp = args.IsSpecified('use_dhcp')
has_static_ip = args.IsSpecified('static_ip_address')
if not (has_use_dhcp or has_static_ip):
raise exceptions.OneOfArgumentsRequiredException(
['--use-dhcp', '--static-ip-address'],
'Specify either --use-dhcp or --static-ip-address for type'
f' {mp_type}.',
)
if has_use_dhcp and has_static_ip:
raise exceptions.ConflictingArgumentsException(
'--use-dhcp', '--static-ip-address'
)
if has_static_ip:
if not args.IsSpecified('gateway_address'):
raise exceptions.RequiredArgumentException(
'gateway-address',
'`--gateway-address` is required when `--static-ip-address` is'
' specified',
)
if not args.IsSpecified('dns_server_address'):
raise exceptions.RequiredArgumentException(
'dns-server-address',
'`--dns-server-address` is required when `--static-ip-address`'
' is specified',
)
else:
# This case should not be reached if choices in Args are enforced
raise exceptions.InvalidArgumentException(
'monitoring-point-type',
f'Invalid monitoringPointType: {args.monitoring_point_type}',
)
def Run(self, args):
self._ValidateArgs(args)
project = properties.VALUES.core.project.Get(required=True)
location = args.location
provider_id = args.network_monitoring_provider
release_track = self.ReleaseTrack()
if release_track == base.ReleaseTrack.ALPHA:
api_version = 'v1alpha1'
else:
api_version = 'v1'
parent = f'projects/{project}/locations/{location}/networkMonitoringProviders/{provider_id}'
request_path = (
f'{api_version}/{parent}/monitoringPoints:downloadInstallScript'
)
query_params = [
('hostname', args.hostname),
('monitoringPointType', args.monitoring_point_type.upper()),
]
if args.IsSpecified('password'):
query_params.append(('password', args.password))
if args.IsSpecified('time_zone'):
query_params.append(('timeZone.id', args.time_zone))
if args.IsSpecified('use_dhcp'):
query_params.append(('useDhcp', args.use_dhcp))
if args.IsSpecified('static_ip_address'):
query_params.append(('staticIpAddress.ipAddress', args.static_ip_address))
if args.IsSpecified('netmask'):
query_params.append(('staticIpAddress.netmask', args.netmask))
if args.IsSpecified('gateway_address'):
query_params.append(
('staticIpAddress.gatewayAddress', args.gateway_address)
)
if args.IsSpecified('dns_server_address'):
query_params.append(
('staticIpAddress.dnsServerAddress', args.dns_server_address)
)
if args.IsSpecified('dns_server_secondary_address'):
query_params.append((
'staticIpAddress.dnsServerSecondaryAddress',
args.dns_server_secondary_address,
))
if args.IsSpecified('domain'):
query_params.append(('staticIpAddress.domain', args.domain))
if args.IsSpecified('ntp_server_address'):
query_params.append(('ntpServerAddress', args.ntp_server_address))
if args.IsSpecified('ntp_server_secondary_address'):
query_params.append(
('ntpServerSecondaryAddress', args.ntp_server_secondary_address)
)
encoded_params = parse.urlencode(query_params)
base_uri = apis.GetEffectiveApiEndpoint('networkmanagement', api_version)
uri = f'{base_uri}{request_path}?{encoded_params}'
http = transports.GetApitoolsTransport(response_encoding=None)
response, body = http.request(
uri,
method='GET',
headers={},
)
if response.status != 200:
raise exceptions.HttpException(
f'API request failed with status {response.status}:'
f' {body.decode("utf-8")}'
)
content_type = (
response['content-type']
if 'content-type' in response
else 'unknown'
)
try:
with files.BinaryFileWriter(args.output_file) as f:
f.write(body)
log.status.Print(
f'Downloaded {content_type} install script to [{args.output_file}]'
)
except Exception as e:
raise exceptions.BadFileException(
f'Failed to write file [{args.output_file}]: {e}'
)
return None

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
_PARTIALS_: true

View File

@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
"""Manage Network Path resources."""
from googlecloudsdk.calliope import base
from surface.network_management.network_monitoring_providers.network_paths import _init_extensions as extensions
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
@base.Autogenerated
@base.Hidden
class NetworkPathsAlpha(extensions.NetworkPathsAlpha):
"""A Network Path represents the hop-by-hop route and active network delivery quality between a Monitoring Point (source) and a target destination."""

View File

@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
"""File to add optional custom code to extend __init__.py."""
from googlecloudsdk.calliope import base
class NetworkPathsAlpha(base.Group):
"""Optional no-auto-generated code for ALPHA."""
class NetworkPathsBeta(base.Group):
"""Optional no-auto-generated code for BETA."""
class NetworkPathsGa(base.Group):
"""Optional no-auto-generated code for GA."""

View File

@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- ALPHA
auto_generated: true
hidden: true
help_text:
brief: Describe a Network Path.
description: |-
Get details about a specific Network Path.
Note: The only supported location for these resources is `global`.
examples: |-
To describe the Network Path `my-path-id` under provider `my-provider-id`, run:
$ {command} my-path-id --network-monitoring-provider=my-provider-id --location=global
arguments:
params:
- help_text: |-
Name of the resource.
Format:
projects/{project}/locations/{location}/networkMonitoringProviders/{network_monitoring_provider}/networkPaths/{network_path}
is_positional: true
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1alpha1_resources:projects_locations_network_monitoring_providers_network_paths
required: true
request:
api_version: v1alpha1
collection:
- networkmanagement.projects.locations.networkMonitoringProviders.networkPaths

View File

@@ -0,0 +1,47 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- ALPHA
auto_generated: true
hidden: true
help_text:
brief: List Network Paths.
description: |-
List all Network Paths for a given Network Monitoring Provider.
Note: The only supported location for these resources is `global`.
examples: |-
To list all Network Paths for the provider `my-provider-id`, run:
$ {command} --network-monitoring-provider=my-provider-id --location=global
arguments:
params:
- help_text: |-
Parent value for ListNetworkPathsRequest.
Format:
projects/{project}/locations/{location}/networkMonitoringProviders/{network_monitoring_provider}
is_positional: false
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1alpha1_resources:projects_locations_network_monitoring_providers
required: true
request:
api_version: v1alpha1
collection:
- networkmanagement.projects.locations.networkMonitoringProviders.networkPaths
response:
id_field: name

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
_PARTIALS_: true

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
_PARTIALS_: true

View File

@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
"""Manage Web Path resources."""
from googlecloudsdk.calliope import base
from surface.network_management.network_monitoring_providers.web_paths import _init_extensions as extensions
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
@base.Autogenerated
@base.Hidden
class WebPathsAlpha(extensions.WebPathsAlpha):
"""A Web Path represents a monitored web application or URL, assessed from a monitoring point to measure performance and availability."""

View File

@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
"""File to add optional custom code to extend __init__.py."""
from googlecloudsdk.calliope import base
class WebPathsAlpha(base.Group):
"""Optional no-auto-generated code for ALPHA."""
class WebPathsBeta(base.Group):
"""Optional no-auto-generated code for BETA."""
class WebPathsGa(base.Group):
"""Optional no-auto-generated code for GA."""

View File

@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- ALPHA
auto_generated: true
hidden: true
help_text:
brief: Describe a Web Path.
description: |-
Get details about a specific Web Path.
Note: The only supported location for these resources is `global`.
examples: |-
To describe the Web Path `my-web-path-id` under provider `my-provider-id`, run:
$ {command} my-web-path-id --network-monitoring-provider=my-provider-id --location=global
arguments:
params:
- help_text: |-
Name of the resource..
Format:
projects/{project}/locations/{location}/networkMonitoringProviders/{network_monitoring_provider}/webPaths/{web_path}
is_positional: true
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1alpha1_resources:projects_locations_network_monitoring_providers_web_paths
required: true
request:
api_version: v1alpha1
collection:
- networkmanagement.projects.locations.networkMonitoringProviders.webPaths

View File

@@ -0,0 +1,47 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- ALPHA
auto_generated: true
hidden: true
help_text:
brief: List Web Paths.
description: |-
List all Web Paths for a given Network Monitoring Provider.
Note: The only supported location for these resources is `global`.
examples: |-
To list all Web Paths for the provider `my-provider-id`, run:
$ {command} --network-monitoring-provider=my-provider-id --location=global
arguments:
params:
- help_text: |-
Parent value for ListWebPathsRequest.
Format:
projects/{project}/locations/{location}/networkMonitoringProviders/{network_monitoring_provider}
is_positional: false
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1alpha1_resources:projects_locations_network_monitoring_providers
required: true
request:
api_version: v1alpha1
collection:
- networkmanagement.projects.locations.networkMonitoringProviders.webPaths
response:
id_field: name

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
_PARTIALS_: true

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
_PARTIALS_: true

View File

@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*- #
# Copyright 2020 Google LLC. All Rights Reserved.
#
# 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.
"""Command group for Network Management operations."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.GA, base.ReleaseTrack.BETA)
class Operations(base.Group):
"""Manage Network Management operations."""

View File

@@ -0,0 +1,22 @@
- release_tracks: [GA, BETA]
help_text:
brief: |
Describe a Network Management operation.
description: |
Describe a Network Management operation given a valid operation name.
examples: |
The following command describes an operation called
`operation-12345`:
$ {command} operation-12345
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_management.resources:operation
help_text: |
Name of the Network Management operation you want to describe.
request:
api_version: v1
collection: networkmanagement.projects.locations.global.operations

View File

@@ -0,0 +1,37 @@
- release_tracks: [GA, BETA]
help_text:
brief: |
List Network Management operations.
description: |
List all Network Management operations in the specified project.
You can specify the maximum number of operations to list using the
`--limit` flag.
examples: |
The following command lists a maximum of five operations:
$ {command} --limit=5
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_management.resources:project
help_text: |
Project of the operations to display.
request:
api_version: v1
collection: networkmanagement.projects.locations.global.operations
modify_request_hooks:
- googlecloudsdk.command_lib.network_management.util:UpdateOperationRequestNameVariable
output:
format: |
table(
name.basename():label=OPERATION_NAME,
metadata.verb:label=TYPE,
metadata.target.basename(),
done,
metadata.createTime.date():sort=1,
duration(start=metadata.createTime,end=metadata.endTime,precision=0,calendar=false).slice(2:).join("").yesno(no="<1S"):label=DURATION
)

View File

@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*- #
# Copyright 2022 Google LLC. All Rights Reserved.
#
# 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.
"""Command group for Simulation operations."""
from googlecloudsdk.calliope import base
@base.Hidden
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class Simulation(base.Group):
"""Manage Network Management Simulations."""

View File

@@ -0,0 +1,67 @@
- release_tracks: [ALPHA]
help_text:
brief: |
Create a simulation.
description: |
Create a new simulation.
examples: |
The following command creates a simulation where the proposed config changes are specified
in the `PROPOSED_CONFIG_FILE` argument and the file is in tf format and
requested simulation-type is connectivity-test.
$ {command} --proposed-config-file=`PROPOSED_CONFIG_FILE` --file-format=tf --simulation-type=connectivity-test
The following command creates a simulation where the proposed config changes are specified
in the `PROPOSED_CONFIG_FILE` argument, original config is specified in `ORIGINAL_CONFIG_FILE`
argument and both the files are in gcp format and requested simulation-type is connectivity-test.
$ {command} --proposed-config-file=`PROPOSED_CONFIG_FILE` --original-config=`ORIGINAL_CONFIG_FILE` --file-format=gcp --simulation-type=connectivity-test
request:
collection: networkmanagement.projects.locations.simulations
disable_resource_check: true
ALPHA:
api_version: v1alpha1
modify_request_hooks:
- googlecloudsdk.command_lib.network_management.simulation.hooks:SetProjectAsParent
- googlecloudsdk.command_lib.network_management.simulation.hooks:ProcessSimulationConfigChangesFile
arguments:
params:
- arg_name: proposed-config-file
metavar: PROPOSED_CONFIG_FILE
required: true
help_text: |
Path to json file containing the changes.
- arg_name: original-config-file
metavar: ORIGINAL_CONFIG_FILE
help_text: |
Path to JSON file with the original config. Required when FILE_FORMAT is gcp.
- arg_name: file-format
metavar: FILE_FORMAT
required: true
help_text: |
Format of the proposed-config-file.
choices:
- arg_value: gcp
help_text: The config change file is in gcp format.
- arg_value: tf
help_text: The config change file is in terraform format.
- arg_name: simulation-type
required: true
help_text: |
Type of simulation.
choices:
- arg_value: connectivity-test
- arg_value: shadowed-firewall
async:
collection: networkmanagement.projects.locations.operations
output:
format: |
table(
response.name.basename():label=SIMULATION_ID
)

View File

@@ -0,0 +1,26 @@
- release_tracks: [ALPHA]
help_text:
brief: |
Delete a simulation.
description: |
Delete the specified simulation.
examples: |
The following command deletes the simulation with id `1234`.
$ {command} 1234
request:
ALPHA:
api_version: v1alpha1
collection: networkmanagement.projects.locations.simulations
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_management.simulation.resources:simulation
help_text: |
ID of the simulation to delete.
async:
collection: networkmanagement.projects.locations.operations

View File

@@ -0,0 +1,22 @@
- release_tracks: [ALPHA]
help_text:
brief: |
Describe a simulation.
description: |
Show details of a simulation.
examples: |
The following command prints the simulation with id `1234`.
$ {command} 1234
request:
ALPHA:
api_version: v1alpha1
collection: networkmanagement.projects.locations.simulations
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_management.simulation.resources:simulation
help_text: |
ID of the simulation to describe.

View File

@@ -0,0 +1,26 @@
- release_tracks: [ALPHA]
help_text:
brief: |
List simulations.
description: |
List all simulations in the specified project.
examples: |
The following command lists all the simulations.
$ {command}
request:
ALPHA:
api_version: v1alpha1
collection: networkmanagement.projects.locations.simulations
modify_request_hooks:
- googlecloudsdk.command_lib.network_management.simulation.hooks:SetProjectAsParent
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_management.simulation.resources:location
help_text: Arguments and flags that define the simulation you want to list.
response:
id_field: name

View File

@@ -0,0 +1,64 @@
- release_tracks: [ALPHA]
help_text:
brief: |
Update a simulation.
description: |
Update an existing simulation.
examples: |
The following command updates the simulation with id `1234` where the proposed config changes
are specified in the `PROPOSED_CONFIG_FILE` argument and file is in tf format
and requested simulation-type is connectivity-test.
$ {command} 1234 --proposed-config-file=`PROPOSED_CONFIG_FILE` --file-format=tf --simulation-type=connectivity-test
The following command updates the simulation with id `1234` where the proposed config changes
are specified in the `PROPOSED_CONFIG_FILE` argument, original config is specified in `ORIGINAL_CONFIG_FILE`
argument and both files are in gcp format and requested simulation-type is connectivity-test.
$ {command} 1234 --proposed-config-file=`PROPOSED_CONFIG_FILE` --original-config=`ORIGINAL_CONFIG_FILE` --file-format=gcp --simulation-type=connectivity-test
request:
ALPHA:
api_version: v1alpha1
collection: networkmanagement.projects.locations.simulations
modify_request_hooks:
- googlecloudsdk.command_lib.network_management.simulation.hooks:ProcessSimulationConfigChangesFile
async:
collection: networkmanagement.projects.locations.operations
arguments:
resource:
spec: !REF googlecloudsdk.command_lib.network_management.simulation.resources:simulation
help_text: |
ID of the simulation to update.
params:
- arg_name: proposed-config-file
metavar: PROPOSED_CONFIG_FILE
required: true
help_text: |
Path to json file containing the changes.
- arg_name: original-config-file
metavar: ORIGINAL_CONFIG_FILE
help_text: |
Path to JSON file with the original config. Required when FILE_FORMAT is gcp.
- arg_name: file-format
metavar: FILE_FORMAT
required: true
help_text: |
Format of the proposed-config-file.
choices:
- arg_value: gcp
help_text: The config change file is in gcp format.
- arg_value: tf
help_text: The config change file is in terraform format.
- arg_name: simulation-type
required: true
help_text: |
Type of simulation.
choices:
- arg_value: connectivity-test
- arg_value: shadowed-firewall

View File

@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
"""Manage the VPC Flow Logs configurations."""
from googlecloudsdk.calliope import base
from surface.network_management.vpc_flow_logs_configs import _init_extensions as extensions
@base.ReleaseTracks(base.ReleaseTrack.BETA)
@base.Autogenerated
class VpcFlowLogsConfigsBeta(extensions.VpcFlowLogsConfigsBeta):
"""Manage the VPC Flow Logs configurations.
The flag --location=global is required for all the commands.
You can either specify resources for project-level configurations, or use the
--organization flag to apply organization-level configurations.
"""
@base.ReleaseTracks(base.ReleaseTrack.GA)
@base.Autogenerated
class VpcFlowLogsConfigsGa(extensions.VpcFlowLogsConfigsGa):
"""Manage the VPC Flow Logs configurations.
The flag --location=global is required for all the commands.
You can either specify resources for project-level configurations, or use the
--organization flag to apply organization-level configurations.
"""

View File

@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*- #
# Copyright 2024 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
"""File to add optional custom code to extend __init__.py."""
from googlecloudsdk.calliope import base
class VpcFlowLogsConfigsAlpha(base.Group):
"""Optional no-auto-generated code for ALPHA."""
class VpcFlowLogsConfigsBeta(base.Group):
"""Optional no-auto-generated code for BETA."""
class VpcFlowLogsConfigsGa(base.Group):
"""Optional no-auto-generated code for GA."""

View File

@@ -0,0 +1,269 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- BETA
auto_generated: true
help_text:
brief: Creates a new VPC Flow Logs configuration.
description: |-
Creates a new VPC Flow Logs configuration.
Project-level configuration: Specify a target resource, either: --subnet, --network, --interconnect-attachment, or --vpn-tunnel
Organization-level configuration: Specify the --organization flag without a target resource to apply the configuration across an entire organization.
The --location=global flag is always required.
examples: |-
To create a new VPC Flow Logs configuration `my-config` in organization `my-org-number`, run:
$ {command} my-config --location=global --organization=<my-org-number>
To create a new VPC Flow Logs configuration `my-config` in project `my-project` for a VLAN attachment for Cloud Interconnect, run:
$ {command} my-config --location=global --interconnect-attachment="projects/{project_id}/regions/{region}/interconnectAttachments/{interconnect_attachment_id}"
To create a new VPC Flow Logs configuration `my-config` in project `my-project` for a Cloud VPN tunnel, run:
$ {command} my-config --location=global --subnet="projects/{project_id}/regions/{region}/vpnTunnels/{vpn_tunnel_id}"
To create a new VPC Flow Logs configuration `my-config` in project `my-project` for a subnet, run:
$ {command} my-config --location=global --subnet="projects/{project_id}/regions/{region}/subnets/{subnet_id}"
To create a new VPC Flow Logs configuration `my-config` in project `my-project` for a VPC network, run:
$ {command} my-config --location=global --network="projects/{project_id}/global/networks/{network_id}"
arguments:
params:
- group:
mutex: true
help_text: |-
Arguments for the description.
params:
- arg_name: description
api_field: vpcFlowLogsConfig.description
required: false
repeated: false
help_text: |-
The user-supplied description of the VPC Flow Logs configuration.
Maximum of 512 characters.
- group:
mutex: true
help_text: |-
Arguments for the state.
params:
- arg_name: state
api_field: vpcFlowLogsConfig.state
required: false
help_text: |-
The state of the VPC Flow Log configuration. Default value is ENABLED.
When creating a new configuration, it must be enabled.
Setting state=DISABLED will pause the log generation for this config.
choices:
- arg_value: enabled
enum_value: ENABLED
help_text: |-
When ENABLED, this configuration will generate logs.
- arg_value: disabled
enum_value: DISABLED
help_text: |-
When DISABLED, this configuration will not generate logs.
- group:
mutex: true
help_text: |-
Arguments for the aggregation interval.
params:
- arg_name: aggregation-interval
api_field: vpcFlowLogsConfig.aggregationInterval
required: false
help_text: |-
The aggregation interval for the logs. Default value is INTERVAL_5_SEC.
choices:
- arg_value: interval-5-sec
enum_value: INTERVAL_5_SEC
help_text: |-
Aggregate logs in 5s intervals.
- arg_value: interval-30-sec
enum_value: INTERVAL_30_SEC
help_text: |-
Aggregate logs in 30s intervals.
- arg_value: interval-1-min
enum_value: INTERVAL_1_MIN
help_text: |-
Aggregate logs in 1m intervals.
- arg_value: interval-5-min
enum_value: INTERVAL_5_MIN
help_text: |-
Aggregate logs in 5m intervals.
- arg_value: interval-10-min
enum_value: INTERVAL_10_MIN
help_text: |-
Aggregate logs in 10m intervals.
- arg_value: interval-15-min
enum_value: INTERVAL_15_MIN
help_text: |-
Aggregate logs in 15m intervals.
- group:
mutex: true
help_text: |-
Arguments for the flow sampling.
params:
- arg_name: flow-sampling
api_field: vpcFlowLogsConfig.flowSampling
required: false
repeated: false
type: float
help_text: |-
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.
- group:
mutex: true
help_text: |-
Arguments for the metadata.
params:
- arg_name: metadata
api_field: vpcFlowLogsConfig.metadata
required: false
help_text: |-
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.
choices:
- arg_value: include-all-metadata
enum_value: INCLUDE_ALL_METADATA
help_text: |-
Include all metadata fields.
- arg_value: exclude-all-metadata
enum_value: EXCLUDE_ALL_METADATA
help_text: |-
Exclude all metadata fields.
- arg_value: custom-metadata
enum_value: CUSTOM_METADATA
help_text: |-
Include only custom fields (specified in metadata_fields).
- group:
mutex: true
help_text: |-
Arguments for the filter expr.
params:
- arg_name: filter-expr
api_field: vpcFlowLogsConfig.filterExpr
required: false
repeated: false
help_text: |-
Export filter used to define which VPC Flow Logs should be logged.
- group:
mutex: true
help_text: |-
Arguments for the cross project metadata.
params:
- arg_name: cross-project-metadata
api_field: vpcFlowLogsConfig.crossProjectMetadata
required: false
help_text: |-
Determines whether to include cross project annotations in the logs.
This field is available only for organization configurations. If not
specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
choices:
- arg_value: cross-project-metadata-enabled
enum_value: CROSS_PROJECT_METADATA_ENABLED
help_text: |-
When CROSS_PROJECT_METADATA_ENABLED, metadata from other projects will be
included in the logs.
- arg_value: cross-project-metadata-disabled
enum_value: CROSS_PROJECT_METADATA_DISABLED
help_text: |-
When CROSS_PROJECT_METADATA_DISABLED, metadata from other projects will
not be included in the logs.
- group:
mutex: true
help_text: |-
Arguments for the target resource.
params:
- arg_name: network
api_field: vpcFlowLogsConfig.network
required: false
repeated: false
help_text: |-
Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments
within the network.
Format: projects/{project_id}/global/networks/{name}
- arg_name: subnet
api_field: vpcFlowLogsConfig.subnet
required: false
repeated: false
help_text: |-
Traffic will be logged from VMs within the subnetwork.
Format: projects/{project_id}/regions/{region}/subnetworks/{name}
- arg_name: interconnect-attachment
api_field: vpcFlowLogsConfig.interconnectAttachment
required: false
repeated: false
help_text: |-
Traffic will be logged from the Interconnect Attachment.
Format:
projects/{project_id}/regions/{region}/interconnectAttachments/{name}
- arg_name: vpn-tunnel
api_field: vpcFlowLogsConfig.vpnTunnel
required: false
repeated: false
help_text: |-
Traffic will be logged from the VPN Tunnel.
Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
- help_text: |-
Identifier. Unique name of the configuration. The name can have one of the following
forms:
- For project-level configurations:
`projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
- For organization-level configurations:
`organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
is_positional: true
is_primary_resource: true
request_id_field: vpcFlowLogsConfigId
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1beta1_resources:organizations_or_projects_locations_vpc_flow_logs_configs
required: true
- arg_name: metadata-fields
api_field: vpcFlowLogsConfig.metadataFields
required: false
repeated: true
help_text: |-
Custom metadata fields to include in the reported VPC flow logs.
Can only be specified if "metadata" was set to CUSTOM_METADATA.
- arg_name: labels
api_field: vpcFlowLogsConfig.labels
required: false
repeated: true
help_text: |-
Resource labels to represent user-provided metadata.
spec:
- api_field: key
- api_field: value
request:
api_version: v1beta1
collection:
- networkmanagement.organizations.locations.vpcFlowLogsConfigs
- networkmanagement.projects.locations.vpcFlowLogsConfigs
async:
collection:
- networkmanagement.organizations.locations.global.operations
- networkmanagement.projects.locations.global.operations

View File

@@ -0,0 +1,269 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- GA
auto_generated: true
help_text:
brief: Creates a new VPC Flow Logs configuration.
description: |-
Creates a new VPC Flow Logs configuration.
Project-level configuration: Specify a target resource, either: --subnet, --network, --interconnect-attachment, or --vpn-tunnel
Organization-level configuration: Specify the --organization flag without a target resource to apply the configuration across an entire organization.
The --location=global flag is always required.
examples: |-
To create a new VPC Flow Logs configuration `my-config` in organization `my-org-number`, run:
$ {command} my-config --location=global --organization=<my-org-number>
To create a new VPC Flow Logs configuration `my-config` in project `my-project` for a VLAN attachment for Cloud Interconnect, run:
$ {command} my-config --location=global --interconnect-attachment="projects/{project_id}/regions/{region}/interconnectAttachments/{interconnect_attachment_id}"
To create a new VPC Flow Logs configuration `my-config` in project `my-project` for a Cloud VPN tunnel, run:
$ {command} my-config --location=global --subnet="projects/{project_id}/regions/{region}/vpnTunnels/{vpn_tunnel_id}"
To create a new VPC Flow Logs configuration `my-config` in project `my-project` for a subnet, run:
$ {command} my-config --location=global --subnet="projects/{project_id}/regions/{region}/subnets/{subnet_id}"
To create a new VPC Flow Logs configuration `my-config` in project `my-project` for a VPC network, run:
$ {command} my-config --location=global --network="projects/{project_id}/global/networks/{network_id}"
arguments:
params:
- group:
mutex: true
help_text: |-
Arguments for the description.
params:
- arg_name: description
api_field: vpcFlowLogsConfig.description
required: false
repeated: false
help_text: |-
The user-supplied description of the VPC Flow Logs configuration.
Maximum of 512 characters.
- group:
mutex: true
help_text: |-
Arguments for the state.
params:
- arg_name: state
api_field: vpcFlowLogsConfig.state
required: false
help_text: |-
The state of the VPC Flow Log configuration. Default value is ENABLED.
When creating a new configuration, it must be enabled.
Setting state=DISABLED will pause the log generation for this config.
choices:
- arg_value: enabled
enum_value: ENABLED
help_text: |-
When ENABLED, this configuration will generate logs.
- arg_value: disabled
enum_value: DISABLED
help_text: |-
When DISABLED, this configuration will not generate logs.
- group:
mutex: true
help_text: |-
Arguments for the aggregation interval.
params:
- arg_name: aggregation-interval
api_field: vpcFlowLogsConfig.aggregationInterval
required: false
help_text: |-
The aggregation interval for the logs. Default value is INTERVAL_5_SEC.
choices:
- arg_value: interval-5-sec
enum_value: INTERVAL_5_SEC
help_text: |-
Aggregate logs in 5s intervals.
- arg_value: interval-30-sec
enum_value: INTERVAL_30_SEC
help_text: |-
Aggregate logs in 30s intervals.
- arg_value: interval-1-min
enum_value: INTERVAL_1_MIN
help_text: |-
Aggregate logs in 1m intervals.
- arg_value: interval-5-min
enum_value: INTERVAL_5_MIN
help_text: |-
Aggregate logs in 5m intervals.
- arg_value: interval-10-min
enum_value: INTERVAL_10_MIN
help_text: |-
Aggregate logs in 10m intervals.
- arg_value: interval-15-min
enum_value: INTERVAL_15_MIN
help_text: |-
Aggregate logs in 15m intervals.
- group:
mutex: true
help_text: |-
Arguments for the flow sampling.
params:
- arg_name: flow-sampling
api_field: vpcFlowLogsConfig.flowSampling
required: false
repeated: false
type: float
help_text: |-
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.
- group:
mutex: true
help_text: |-
Arguments for the metadata.
params:
- arg_name: metadata
api_field: vpcFlowLogsConfig.metadata
required: false
help_text: |-
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.
choices:
- arg_value: include-all-metadata
enum_value: INCLUDE_ALL_METADATA
help_text: |-
Include all metadata fields.
- arg_value: exclude-all-metadata
enum_value: EXCLUDE_ALL_METADATA
help_text: |-
Exclude all metadata fields.
- arg_value: custom-metadata
enum_value: CUSTOM_METADATA
help_text: |-
Include only custom fields (specified in metadata_fields).
- group:
mutex: true
help_text: |-
Arguments for the filter expr.
params:
- arg_name: filter-expr
api_field: vpcFlowLogsConfig.filterExpr
required: false
repeated: false
help_text: |-
Export filter used to define which VPC Flow Logs should be logged.
- group:
mutex: true
help_text: |-
Arguments for the cross project metadata.
params:
- arg_name: cross-project-metadata
api_field: vpcFlowLogsConfig.crossProjectMetadata
required: false
help_text: |-
Determines whether to include cross project annotations in the logs.
This field is available only for organization configurations. If not
specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
choices:
- arg_value: cross-project-metadata-enabled
enum_value: CROSS_PROJECT_METADATA_ENABLED
help_text: |-
When CROSS_PROJECT_METADATA_ENABLED, metadata from other projects will be
included in the logs.
- arg_value: cross-project-metadata-disabled
enum_value: CROSS_PROJECT_METADATA_DISABLED
help_text: |-
When CROSS_PROJECT_METADATA_DISABLED, metadata from other projects will
not be included in the logs.
- group:
mutex: true
help_text: |-
Arguments for the target resource.
params:
- arg_name: network
api_field: vpcFlowLogsConfig.network
required: false
repeated: false
help_text: |-
Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments
within the network.
Format: projects/{project_id}/global/networks/{name}
- arg_name: subnet
api_field: vpcFlowLogsConfig.subnet
required: false
repeated: false
help_text: |-
Traffic will be logged from VMs within the subnetwork.
Format: projects/{project_id}/regions/{region}/subnetworks/{name}
- arg_name: interconnect-attachment
api_field: vpcFlowLogsConfig.interconnectAttachment
required: false
repeated: false
help_text: |-
Traffic will be logged from the Interconnect Attachment.
Format:
projects/{project_id}/regions/{region}/interconnectAttachments/{name}
- arg_name: vpn-tunnel
api_field: vpcFlowLogsConfig.vpnTunnel
required: false
repeated: false
help_text: |-
Traffic will be logged from the VPN Tunnel.
Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
- help_text: |-
Identifier. Unique name of the configuration. The name can have one of the following
forms:
- For project-level configurations:
`projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
- For organization-level configurations:
`organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
is_positional: true
is_primary_resource: true
request_id_field: vpcFlowLogsConfigId
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1_resources:organizations_or_projects_locations_vpc_flow_logs_configs
required: true
- arg_name: metadata-fields
api_field: vpcFlowLogsConfig.metadataFields
required: false
repeated: true
help_text: |-
Custom metadata fields to include in the reported VPC flow logs.
Can only be specified if "metadata" was set to CUSTOM_METADATA.
- arg_name: labels
api_field: vpcFlowLogsConfig.labels
required: false
repeated: true
help_text: |-
Resource labels to represent user-provided metadata.
spec:
- api_field: key
- api_field: value
request:
api_version: v1
collection:
- networkmanagement.organizations.locations.vpcFlowLogsConfigs
- networkmanagement.projects.locations.vpcFlowLogsConfigs
async:
collection:
- networkmanagement.organizations.locations.operations
- networkmanagement.projects.locations.global.operations

View File

@@ -0,0 +1,55 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- BETA
auto_generated: true
help_text:
brief: Deletes the specified VPC Flow Logs configuration.
description: Deletes the specified VPC Flow Logs configuration.
examples: |-
To delete a VPC Flow Logs configuration `my-config` within the organization `my-org-number`, run:
$ {command} my-config --location=global --organization=<my-org-number>
To delete a VPC Flow Logs configuration `my-config`, run:
$ {command} my-config --location=global
arguments:
params:
- help_text: |-
The resource name of the VpcFlowLogsConfig,
in one of the following formats:
- For a project-level resource:
`projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
- For an organization-level resource:
`organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
is_positional: true
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1beta1_resources:organizations_or_projects_locations_vpc_flow_logs_configs
required: true
request:
api_version: v1beta1
collection:
- networkmanagement.organizations.locations.vpcFlowLogsConfigs
- networkmanagement.projects.locations.vpcFlowLogsConfigs
async:
collection:
- networkmanagement.organizations.locations.global.operations
- networkmanagement.projects.locations.global.operations

View File

@@ -0,0 +1,55 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- GA
auto_generated: true
help_text:
brief: Deletes the specified VPC Flow Logs configuration.
description: Deletes the specified VPC Flow Logs configuration.
examples: |-
To delete a VPC Flow Logs configuration `my-config` within the organization `my-org-number`, run:
$ {command} my-config --location=global --organization=<my-org-number>
To delete a VPC Flow Logs configuration `my-config`, run:
$ {command} my-config --location=global
arguments:
params:
- help_text: |-
The resource name of the VpcFlowLogsConfig,
in one of the following formats:
- For a project-level resource:
`projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
- For an organization-level resource:
`organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
is_positional: true
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1_resources:organizations_or_projects_locations_vpc_flow_logs_configs
required: true
request:
api_version: v1
collection:
- networkmanagement.organizations.locations.vpcFlowLogsConfigs
- networkmanagement.projects.locations.vpcFlowLogsConfigs
async:
collection:
- networkmanagement.organizations.locations.operations
- networkmanagement.projects.locations.global.operations

View File

@@ -0,0 +1,51 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- BETA
auto_generated: true
help_text:
brief: Describe the details of a specific VPC Flow Logs configuration.
description: Describes the details of a specific VPC Flow Logs configuration.
examples: |-
To get the details of a VPC Flow Logs configuration `my-config`, within the organization `my-org-number`, run:
$ {command} my-config --location=global --organization=<my-org-number>
To get the details of a VPC Flow Logs configuration `my-config`, run:
$ {command} my-config --location=global
arguments:
params:
- help_text: |-
The resource name of the VpcFlowLogsConfig,
in one of the following formats:
- For project-level resources:
`projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
- For organization-level resources:
`organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
is_positional: true
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1beta1_resources:organizations_or_projects_locations_vpc_flow_logs_configs
required: true
request:
api_version: v1beta1
collection:
- networkmanagement.organizations.locations.vpcFlowLogsConfigs
- networkmanagement.projects.locations.vpcFlowLogsConfigs

View File

@@ -0,0 +1,51 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- GA
auto_generated: true
help_text:
brief: Describe the details of a specific VPC Flow Logs configuration.
description: Describes the details of a specific VPC Flow Logs configuration.
examples: |-
To get the details of a VPC Flow Logs configuration `my-config`, within the organization `my-org-number`, run:
$ {command} my-config --location=global --organization=<my-org-number>
To get the details of a VPC Flow Logs configuration `my-config`, run:
$ {command} my-config --location=global
arguments:
params:
- help_text: |-
The resource name of the VpcFlowLogsConfig,
in one of the following formats:
- For project-level resources:
`projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
- For organization-level resources:
`organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
is_positional: true
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1_resources:organizations_or_projects_locations_vpc_flow_logs_configs
required: true
request:
api_version: v1
collection:
- networkmanagement.organizations.locations.vpcFlowLogsConfigs
- networkmanagement.projects.locations.vpcFlowLogsConfigs

View File

@@ -0,0 +1,52 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- BETA
auto_generated: true
help_text:
brief: List all VPC Flow Logs configurations.
description: By default, lists all project-level VPC Flow Logs configurations. Use the --organization flag to list all organization-level configurations.
examples: |-
To list all the VPC Flow Logs configurations within the project, run:
$ {command} --location=global
To list all the VPC Flow Logs configurations within the project with state 'ENABLED', run:
$ {command} --location=global --filter="state:ENABLED"
arguments:
params:
- help_text: |-
The parent resource of the VpcFlowLogsConfig,
in one of the following formats:
- For project-level resourcs: `projects/{project_id}/locations/global`
- For organization-level resources:
`organizations/{organization_id}/locations/global`
is_positional: false
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1beta1_resources:organizations_or_projects_locations
required: true
request:
api_version: v1beta1
collection:
- networkmanagement.organizations.locations.vpcFlowLogsConfigs
- networkmanagement.projects.locations.vpcFlowLogsConfigs
response:
id_field: name

View File

@@ -0,0 +1,52 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- GA
auto_generated: true
help_text:
brief: List all VPC Flow Logs configurations.
description: By default, lists all project-level VPC Flow Logs configurations. Use the --organization flag to list all organization-level configurations.
examples: |-
To list all the VPC Flow Logs configurations within the project, run:
$ {command} --location=global
To list all the VPC Flow Logs configurations within the project with state 'ENABLED', run:
$ {command} --location=global --filter="state:ENABLED"
arguments:
params:
- help_text: |-
The parent resource of the VpcFlowLogsConfig,
in one of the following formats:
- For project-level resourcs: `projects/{project_id}/locations/global`
- For organization-level resources:
`organizations/{organization_id}/locations/global`
is_positional: false
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1_resources:organizations_or_projects_locations
required: true
request:
api_version: v1
collection:
- networkmanagement.organizations.locations.vpcFlowLogsConfigs
- networkmanagement.projects.locations.vpcFlowLogsConfigs
response:
id_field: name

View File

@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- BETA
auto_generated: true
help_text:
brief: Fetch all organization-level VPC Flow Logs configurations associated with the project.
description: |-
Fetch all organization-level VPC Flow Logs configurations that the project is associated with.
This method allows you to retrieve which organization-level configurations are applied to the current project.
examples: |-
To fetch all the organization-level VPC Flow Logs configurations associated with the project, run:
$ {command} --location=global
arguments:
params:
- help_text: |-
The parent resource of the VpcFlowLogsConfig, specified in
the following format: `projects/{project_id}/locations/global`
is_positional: false
is_parent_resource: true
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1beta1_resources:projects_locations
required: true
request:
api_version: v1beta1
collection:
- networkmanagement.projects.locations.vpcFlowLogsConfigs
method: queryOrgVpcFlowLogsConfigs
command_type: GENERIC

View File

@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- GA
auto_generated: true
help_text:
brief: Fetch all organization-level VPC Flow Logs configurations associated with the project.
description: |-
Fetch all organization-level VPC Flow Logs configurations that the project is associated with.
This method allows you to retrieve which organization-level configurations are applied to the current project.
examples: |-
To fetch all the organization-level VPC Flow Logs configurations associated with the project, run:
$ {command} --location=global
arguments:
params:
- help_text: |-
The parent resource of the VpcFlowLogsConfig, specified in
the following format: `projects/{project_id}/locations/global`
is_positional: false
is_parent_resource: true
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1_resources:projects_locations
required: true
request:
api_version: v1
collection:
- networkmanagement.projects.locations.vpcFlowLogsConfigs
method: queryOrgVpcFlowLogsConfigs
command_type: GENERIC

View File

@@ -0,0 +1,54 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- BETA
auto_generated: true
help_text:
brief: Show all effective VPC Flow Logs configurations for a resource.
description: Shows all effective VPC Flow Logs configurations for a resource. The effective configurations include all configurations that apply to the resource, including inherited ones from parent resources.
examples: |-
To show all effective VPC Flow Logs configurations for a network `my-network` in project `my-project`, run:
$ {command} \
--location=global \
--resource="projects/my-project/global/networks/my-network"
arguments:
params:
- help_text: |-
The parent resource of the VpcFlowLogsConfig, specified in
the following format: `projects/{project_id}/locations/global`
is_positional: false
is_parent_resource: true
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1beta1_resources:projects_locations
required: true
- arg_name: resource
api_field: resource
required: true
repeated: false
help_text: |-
The resource to get the effective VPC Flow Logs configuration for.
The resource must belong to the same project as the parent.
The resource must be a network, subnetwork, interconnect attachment,
VPN tunnel, or a project.
request:
api_version: v1beta1
collection:
- networkmanagement.projects.locations.vpcFlowLogsConfigs
method: showEffectiveFlowLogsConfigs
command_type: GENERIC

View File

@@ -0,0 +1,54 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- GA
auto_generated: true
help_text:
brief: Show all effective VPC Flow Logs configurations for a resource.
description: Shows all effective VPC Flow Logs configurations for a resource. The effective configurations include all configurations that apply to the resource, including inherited ones from parent resources.
examples: |-
To show all effective VPC Flow Logs configurations for a network `my-network` in project `my-project`, run:
$ {command} \
--location=global \
--resource="projects/my-project/global/networks/my-network"
arguments:
params:
- help_text: |-
The parent resource of the VpcFlowLogsConfig, specified in
the following format: `projects/{project_id}/locations/global`
is_positional: false
is_parent_resource: true
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1_resources:projects_locations
required: true
- arg_name: resource
api_field: resource
required: true
repeated: false
help_text: |-
The resource to get the effective VPC Flow Logs configuration for.
The resource must belong to the same project as the parent.
The resource must be a network, subnetwork, interconnect attachment,
VPN tunnel, or a project.
request:
api_version: v1
collection:
- networkmanagement.projects.locations.vpcFlowLogsConfigs
method: showEffectiveFlowLogsConfigs
command_type: GENERIC

View File

@@ -0,0 +1,253 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- BETA
auto_generated: true
help_text:
brief: Updates one or more fields in an existing VPC Flow Logs configuration.
description: Updates one or more fields in an existing VPC Flow Logs configuration.
examples: |-
To update the state field to be 'DISABLED' in the VPC Flow Logs configuration `my-config`, run:
$ {command} my-config --location=global --organization=<my-org-number> --state=DISABLED
To update the state field to be 'DISABLED' in the VPC Flow Logs configuration `my-config`, run:
$ {command} my-config --location=global --state=DISABLED
arguments:
params:
- group:
mutex: true
help_text: |-
Arguments for the description.
params:
- arg_name: description
api_field: vpcFlowLogsConfig.description
required: false
repeated: false
help_text: |-
The user-supplied description of the VPC Flow Logs configuration.
Maximum of 512 characters.
- group:
mutex: true
help_text: |-
Arguments for the state.
params:
- arg_name: state
api_field: vpcFlowLogsConfig.state
required: false
help_text: |-
The state of the VPC Flow Log configuration. Default value is ENABLED.
When creating a new configuration, it must be enabled.
Setting state=DISABLED will pause the log generation for this config.
choices:
- arg_value: enabled
enum_value: ENABLED
help_text: |-
When ENABLED, this configuration will generate logs.
- arg_value: disabled
enum_value: DISABLED
help_text: |-
When DISABLED, this configuration will not generate logs.
- group:
mutex: true
help_text: |-
Arguments for the aggregation interval.
params:
- arg_name: aggregation-interval
api_field: vpcFlowLogsConfig.aggregationInterval
required: false
help_text: |-
The aggregation interval for the logs. Default value is INTERVAL_5_SEC.
choices:
- arg_value: interval-5-sec
enum_value: INTERVAL_5_SEC
help_text: |-
Aggregate logs in 5s intervals.
- arg_value: interval-30-sec
enum_value: INTERVAL_30_SEC
help_text: |-
Aggregate logs in 30s intervals.
- arg_value: interval-1-min
enum_value: INTERVAL_1_MIN
help_text: |-
Aggregate logs in 1m intervals.
- arg_value: interval-5-min
enum_value: INTERVAL_5_MIN
help_text: |-
Aggregate logs in 5m intervals.
- arg_value: interval-10-min
enum_value: INTERVAL_10_MIN
help_text: |-
Aggregate logs in 10m intervals.
- arg_value: interval-15-min
enum_value: INTERVAL_15_MIN
help_text: |-
Aggregate logs in 15m intervals.
- group:
mutex: true
help_text: |-
Arguments for the flow sampling.
params:
- arg_name: flow-sampling
api_field: vpcFlowLogsConfig.flowSampling
required: false
repeated: false
type: float
help_text: |-
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.
- group:
mutex: true
help_text: |-
Arguments for the metadata.
params:
- arg_name: metadata
api_field: vpcFlowLogsConfig.metadata
required: false
help_text: |-
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.
choices:
- arg_value: include-all-metadata
enum_value: INCLUDE_ALL_METADATA
help_text: |-
Include all metadata fields.
- arg_value: exclude-all-metadata
enum_value: EXCLUDE_ALL_METADATA
help_text: |-
Exclude all metadata fields.
- arg_value: custom-metadata
enum_value: CUSTOM_METADATA
help_text: |-
Include only custom fields (specified in metadata_fields).
- group:
mutex: true
help_text: |-
Arguments for the filter expr.
params:
- arg_name: filter-expr
api_field: vpcFlowLogsConfig.filterExpr
required: false
repeated: false
help_text: |-
Export filter used to define which VPC Flow Logs should be logged.
- group:
mutex: true
help_text: |-
Arguments for the cross project metadata.
params:
- arg_name: cross-project-metadata
api_field: vpcFlowLogsConfig.crossProjectMetadata
required: false
help_text: |-
Determines whether to include cross project annotations in the logs.
This field is available only for organization configurations. If not
specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
choices:
- arg_value: cross-project-metadata-enabled
enum_value: CROSS_PROJECT_METADATA_ENABLED
help_text: |-
When CROSS_PROJECT_METADATA_ENABLED, metadata from other projects will be
included in the logs.
- arg_value: cross-project-metadata-disabled
enum_value: CROSS_PROJECT_METADATA_DISABLED
help_text: |-
When CROSS_PROJECT_METADATA_DISABLED, metadata from other projects will
not be included in the logs.
- group:
mutex: true
help_text: |-
Arguments for the target resource.
params:
- arg_name: network
api_field: vpcFlowLogsConfig.network
required: false
repeated: false
help_text: |-
Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments
within the network.
Format: projects/{project_id}/global/networks/{name}
- arg_name: subnet
api_field: vpcFlowLogsConfig.subnet
required: false
repeated: false
help_text: |-
Traffic will be logged from VMs within the subnetwork.
Format: projects/{project_id}/regions/{region}/subnetworks/{name}
- arg_name: interconnect-attachment
api_field: vpcFlowLogsConfig.interconnectAttachment
required: false
repeated: false
help_text: |-
Traffic will be logged from the Interconnect Attachment.
Format:
projects/{project_id}/regions/{region}/interconnectAttachments/{name}
- arg_name: vpn-tunnel
api_field: vpcFlowLogsConfig.vpnTunnel
required: false
repeated: false
help_text: |-
Traffic will be logged from the VPN Tunnel.
Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
- help_text: |-
Identifier. Unique name of the configuration. The name can have one of the following
forms:
- For project-level configurations:
`projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
- For organization-level configurations:
`organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
is_positional: true
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1beta1_resources:organizations_or_projects_locations_vpc_flow_logs_configs
required: true
- arg_name: metadata-fields
api_field: vpcFlowLogsConfig.metadataFields
required: false
repeated: true
help_text: |-
Custom metadata fields to include in the reported VPC flow logs.
Can only be specified if "metadata" was set to CUSTOM_METADATA.
clearable: true
- arg_name: labels
api_field: vpcFlowLogsConfig.labels
required: false
repeated: true
help_text: |-
Resource labels to represent user-provided metadata.
clearable: true
spec:
- api_field: key
- api_field: value
request:
api_version: v1beta1
collection:
- networkmanagement.organizations.locations.vpcFlowLogsConfigs
- networkmanagement.projects.locations.vpcFlowLogsConfigs
async:
collection:
- networkmanagement.organizations.locations.global.operations
- networkmanagement.projects.locations.global.operations
update:
read_modify_update: true

View File

@@ -0,0 +1,253 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
- GA
auto_generated: true
help_text:
brief: Updates one or more fields in an existing VPC Flow Logs configuration.
description: Updates one or more fields in an existing VPC Flow Logs configuration.
examples: |-
To update the state field to be 'DISABLED' in the VPC Flow Logs configuration `my-config`, run:
$ {command} my-config --location=global --organization=<my-org-number> --state=DISABLED
To update the state field to be 'DISABLED' in the VPC Flow Logs configuration `my-config`, run:
$ {command} my-config --location=global --state=DISABLED
arguments:
params:
- group:
mutex: true
help_text: |-
Arguments for the description.
params:
- arg_name: description
api_field: vpcFlowLogsConfig.description
required: false
repeated: false
help_text: |-
The user-supplied description of the VPC Flow Logs configuration.
Maximum of 512 characters.
- group:
mutex: true
help_text: |-
Arguments for the state.
params:
- arg_name: state
api_field: vpcFlowLogsConfig.state
required: false
help_text: |-
The state of the VPC Flow Log configuration. Default value is ENABLED.
When creating a new configuration, it must be enabled.
Setting state=DISABLED will pause the log generation for this config.
choices:
- arg_value: enabled
enum_value: ENABLED
help_text: |-
When ENABLED, this configuration will generate logs.
- arg_value: disabled
enum_value: DISABLED
help_text: |-
When DISABLED, this configuration will not generate logs.
- group:
mutex: true
help_text: |-
Arguments for the aggregation interval.
params:
- arg_name: aggregation-interval
api_field: vpcFlowLogsConfig.aggregationInterval
required: false
help_text: |-
The aggregation interval for the logs. Default value is INTERVAL_5_SEC.
choices:
- arg_value: interval-5-sec
enum_value: INTERVAL_5_SEC
help_text: |-
Aggregate logs in 5s intervals.
- arg_value: interval-30-sec
enum_value: INTERVAL_30_SEC
help_text: |-
Aggregate logs in 30s intervals.
- arg_value: interval-1-min
enum_value: INTERVAL_1_MIN
help_text: |-
Aggregate logs in 1m intervals.
- arg_value: interval-5-min
enum_value: INTERVAL_5_MIN
help_text: |-
Aggregate logs in 5m intervals.
- arg_value: interval-10-min
enum_value: INTERVAL_10_MIN
help_text: |-
Aggregate logs in 10m intervals.
- arg_value: interval-15-min
enum_value: INTERVAL_15_MIN
help_text: |-
Aggregate logs in 15m intervals.
- group:
mutex: true
help_text: |-
Arguments for the flow sampling.
params:
- arg_name: flow-sampling
api_field: vpcFlowLogsConfig.flowSampling
required: false
repeated: false
type: float
help_text: |-
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.
- group:
mutex: true
help_text: |-
Arguments for the metadata.
params:
- arg_name: metadata
api_field: vpcFlowLogsConfig.metadata
required: false
help_text: |-
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.
choices:
- arg_value: include-all-metadata
enum_value: INCLUDE_ALL_METADATA
help_text: |-
Include all metadata fields.
- arg_value: exclude-all-metadata
enum_value: EXCLUDE_ALL_METADATA
help_text: |-
Exclude all metadata fields.
- arg_value: custom-metadata
enum_value: CUSTOM_METADATA
help_text: |-
Include only custom fields (specified in metadata_fields).
- group:
mutex: true
help_text: |-
Arguments for the filter expr.
params:
- arg_name: filter-expr
api_field: vpcFlowLogsConfig.filterExpr
required: false
repeated: false
help_text: |-
Export filter used to define which VPC Flow Logs should be logged.
- group:
mutex: true
help_text: |-
Arguments for the cross project metadata.
params:
- arg_name: cross-project-metadata
api_field: vpcFlowLogsConfig.crossProjectMetadata
required: false
help_text: |-
Determines whether to include cross project annotations in the logs.
This field is available only for organization configurations. If not
specified in org configs will be set to CROSS_PROJECT_METADATA_ENABLED.
choices:
- arg_value: cross-project-metadata-enabled
enum_value: CROSS_PROJECT_METADATA_ENABLED
help_text: |-
When CROSS_PROJECT_METADATA_ENABLED, metadata from other projects will be
included in the logs.
- arg_value: cross-project-metadata-disabled
enum_value: CROSS_PROJECT_METADATA_DISABLED
help_text: |-
When CROSS_PROJECT_METADATA_DISABLED, metadata from other projects will
not be included in the logs.
- group:
mutex: true
help_text: |-
Arguments for the target resource.
params:
- arg_name: network
api_field: vpcFlowLogsConfig.network
required: false
repeated: false
help_text: |-
Traffic will be logged from VMs, VPN tunnels and Interconnect Attachments
within the network.
Format: projects/{project_id}/global/networks/{name}
- arg_name: subnet
api_field: vpcFlowLogsConfig.subnet
required: false
repeated: false
help_text: |-
Traffic will be logged from VMs within the subnetwork.
Format: projects/{project_id}/regions/{region}/subnetworks/{name}
- arg_name: interconnect-attachment
api_field: vpcFlowLogsConfig.interconnectAttachment
required: false
repeated: false
help_text: |-
Traffic will be logged from the Interconnect Attachment.
Format:
projects/{project_id}/regions/{region}/interconnectAttachments/{name}
- arg_name: vpn-tunnel
api_field: vpcFlowLogsConfig.vpnTunnel
required: false
repeated: false
help_text: |-
Traffic will be logged from the VPN Tunnel.
Format: projects/{project_id}/regions/{region}/vpnTunnels/{name}
- help_text: |-
Identifier. Unique name of the configuration. The name can have one of the following
forms:
- For project-level configurations:
`projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
- For organization-level configurations:
`organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`
is_positional: true
is_primary_resource: true
resource_spec: !REF googlecloudsdk.command_lib.network_management.v1_resources:organizations_or_projects_locations_vpc_flow_logs_configs
required: true
- arg_name: metadata-fields
api_field: vpcFlowLogsConfig.metadataFields
required: false
repeated: true
help_text: |-
Custom metadata fields to include in the reported VPC flow logs.
Can only be specified if "metadata" was set to CUSTOM_METADATA.
clearable: true
- arg_name: labels
api_field: vpcFlowLogsConfig.labels
required: false
repeated: true
help_text: |-
Resource labels to represent user-provided metadata.
clearable: true
spec:
- api_field: key
- api_field: value
request:
api_version: v1
collection:
- networkmanagement.organizations.locations.vpcFlowLogsConfigs
- networkmanagement.projects.locations.vpcFlowLogsConfigs
async:
collection:
- networkmanagement.organizations.locations.operations
- networkmanagement.projects.locations.global.operations
update:
read_modify_update: true

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
_PARTIALS_: true

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
_PARTIALS_: true

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
_PARTIALS_: true

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
_PARTIALS_: true

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
_PARTIALS_: true

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
_PARTIALS_: true

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# 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.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
_PARTIALS_: true