Class NetworksClient (2.20.0)

Service for the networks resource.

https://cloud.google.com/compute/docs/reference/rest/v1/networks

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

NetworksClient(NetworksClient const &)

Copy and move support

Parameter
Name Description
NetworksClient const &

NetworksClient(NetworksClient &&)

Copy and move support

Parameter
Name Description
NetworksClient &&

NetworksClient(std::shared_ptr< NetworksConnection >, Options)

Parameters
Name Description
connection std::shared_ptr< NetworksConnection >
opts Options

Operators

operator=(NetworksClient const &)

Copy and move support

Parameter
Name Description
NetworksClient const &
Returns
Type Description
NetworksClient &

operator=(NetworksClient &&)

Copy and move support

Parameter
Name Description
NetworksClient &&
Returns
Type Description
NetworksClient &

Functions

AddPeering(std::string const &, std::string const &, google::cloud::cpp::compute::v1::NetworksAddPeeringRequest const &, Options)

Adds a peering to the specified network.

Parameters
Name Description
project std::string const &

Project ID for this request.

network std::string const &

Name of the network resource to add peering to.

networks_add_peering_request_resource google::cloud::cpp::compute::v1::NetworksAddPeeringRequest const &

The NetworksAddPeeringRequest for this request.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a [google.cloud.cpp.compute.v1.Operation] proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

AddPeering(google::cloud::cpp::compute::networks::v1::AddPeeringRequest const &, Options)

Adds a peering to the specified network.

Parameters
Name Description
request google::cloud::cpp::compute::networks::v1::AddPeeringRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.cpp.compute.networks.v1.AddPeeringRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a [google.cloud.cpp.compute.v1.Operation] proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteNetwork(std::string const &, std::string const &, Options)

Deletes the specified network.

Parameters
Name Description
project std::string const &

Project ID for this request.

network std::string const &

Name of the network to delete.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a [google.cloud.cpp.compute.v1.Operation] proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteNetwork(google::cloud::cpp::compute::networks::v1::DeleteNetworkRequest const &, Options)

Deletes the specified network.

Parameters
Name Description
request google::cloud::cpp::compute::networks::v1::DeleteNetworkRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.cpp.compute.networks.v1.DeleteNetworkRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a [google.cloud.cpp.compute.v1.Operation] proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

GetNetwork(std::string const &, std::string const &, Options)

Returns the specified network.

Parameters
Name Description
project std::string const &

Project ID for this request.

network std::string const &

Name of the network to return.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::cpp::compute::v1::Network >

the result of the RPC. The response message type (google.cloud.cpp.compute.v1.Network) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetNetwork(google::cloud::cpp::compute::networks::v1::GetNetworkRequest const &, Options)

Returns the specified network.

Parameters
Name Description
request google::cloud::cpp::compute::networks::v1::GetNetworkRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.cpp.compute.networks.v1.GetNetworkRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::cpp::compute::v1::Network >

the result of the RPC. The response message type (google.cloud.cpp.compute.v1.Network) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetEffectiveFirewalls(std::string const &, std::string const &, Options)

Returns the effective firewalls on a given network.

Parameters
Name Description
project std::string const &

Project ID for this request.

network std::string const &

Name of the network for this request.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::cpp::compute::v1::NetworksGetEffectiveFirewallsResponse >

the result of the RPC. The response message type (google.cloud.cpp.compute.v1.NetworksGetEffectiveFirewallsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetEffectiveFirewalls(google::cloud::cpp::compute::networks::v1::GetEffectiveFirewallsRequest const &, Options)

Returns the effective firewalls on a given network.

Parameters
Name Description
request google::cloud::cpp::compute::networks::v1::GetEffectiveFirewallsRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.cpp.compute.networks.v1.GetEffectiveFirewallsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::cpp::compute::v1::NetworksGetEffectiveFirewallsResponse >

the result of the RPC. The response message type (google.cloud.cpp.compute.v1.NetworksGetEffectiveFirewallsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

InsertNetwork(std::string const &, google::cloud::cpp::compute::v1::Network const &, Options)

Creates a network in the specified project using the data included in the request.

Parameters
Name Description
project std::string const &

Project ID for this request.

network_resource google::cloud::cpp::compute::v1::Network const &

The Network for this request.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a [google.cloud.cpp.compute.v1.Operation] proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

InsertNetwork(google::cloud::cpp::compute::networks::v1::InsertNetworkRequest const &, Options)

Creates a network in the specified project using the data included in the request.

Parameters
Name Description
request google::cloud::cpp::compute::networks::v1::InsertNetworkRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.cpp.compute.networks.v1.InsertNetworkRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a [google.cloud.cpp.compute.v1.Operation] proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

ListNetworks(std::string const &, Options)

Retrieves the list of networks available to the specified project.

Parameters
Name Description
project std::string const &

Project ID for this request.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::cpp::compute::v1::Network >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.cpp.compute.v1.Network, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListNetworks(google::cloud::cpp::compute::networks::v1::ListNetworksRequest, Options)

Retrieves the list of networks available to the specified project.

Parameters
Name Description
request google::cloud::cpp::compute::networks::v1::ListNetworksRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.cpp.compute.networks.v1.ListNetworksRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::cpp::compute::v1::Network >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.cpp.compute.v1.Network, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListPeeringRoutes(std::string const &, std::string const &, Options)

Lists the peering routes exchanged over peering connection.

Parameters
Name Description
project std::string const &

Project ID for this request.

network std::string const &

Name of the network for this request.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::cpp::compute::v1::ExchangedPeeringRoute >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.cpp.compute.v1.ExchangedPeeringRoute, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListPeeringRoutes(google::cloud::cpp::compute::networks::v1::ListPeeringRoutesRequest, Options)

Lists the peering routes exchanged over peering connection.

Parameters
Name Description
request google::cloud::cpp::compute::networks::v1::ListPeeringRoutesRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.cpp.compute.networks.v1.ListPeeringRoutesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::cpp::compute::v1::ExchangedPeeringRoute >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.cpp.compute.v1.ExchangedPeeringRoute, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

PatchNetwork(std::string const &, std::string const &, google::cloud::cpp::compute::v1::Network const &, Options)

Patches the specified network with the data included in the request.

Only the following fields can be modified: routingConfig.routingMode. https://cloud.google.com/compute/docs/reference/rest/v1/networks/patch

Parameters
Name Description
project std::string const &

Project ID for this request.

network std::string const &

Name of the network to update.

network_resource google::cloud::cpp::compute::v1::Network const &

The Network for this request.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a [google.cloud.cpp.compute.v1.Operation] proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

PatchNetwork(google::cloud::cpp::compute::networks::v1::PatchNetworkRequest const &, Options)

Patches the specified network with the data included in the request.

Only the following fields can be modified: routingConfig.routingMode. https://cloud.google.com/compute/docs/reference/rest/v1/networks/patch

Parameters
Name Description
request google::cloud::cpp::compute::networks::v1::PatchNetworkRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.cpp.compute.networks.v1.PatchNetworkRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a [google.cloud.cpp.compute.v1.Operation] proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

RemovePeering(std::string const &, std::string const &, google::cloud::cpp::compute::v1::NetworksRemovePeeringRequest const &, Options)

Removes a peering from the specified network.

Parameters
Name Description
project std::string const &

Project ID for this request.

network std::string const &

Name of the network resource to remove peering from.

networks_remove_peering_request_resource google::cloud::cpp::compute::v1::NetworksRemovePeeringRequest const &

The NetworksRemovePeeringRequest for this request.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a [google.cloud.cpp.compute.v1.Operation] proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

RemovePeering(google::cloud::cpp::compute::networks::v1::RemovePeeringRequest const &, Options)

Removes a peering from the specified network.

Parameters
Name Description
request google::cloud::cpp::compute::networks::v1::RemovePeeringRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.cpp.compute.networks.v1.RemovePeeringRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a [google.cloud.cpp.compute.v1.Operation] proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

SwitchToCustomMode(std::string const &, std::string const &, Options)

Switches the network mode from auto subnet mode to custom subnet mode.

Parameters
Name Description
project std::string const &

Project ID for this request.

network std::string const &

Name of the network to be updated.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a [google.cloud.cpp.compute.v1.Operation] proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

SwitchToCustomMode(google::cloud::cpp::compute::networks::v1::SwitchToCustomModeRequest const &, Options)

Switches the network mode from auto subnet mode to custom subnet mode.

Parameters
Name Description
request google::cloud::cpp::compute::networks::v1::SwitchToCustomModeRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.cpp.compute.networks.v1.SwitchToCustomModeRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a [google.cloud.cpp.compute.v1.Operation] proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdatePeering(std::string const &, std::string const &, google::cloud::cpp::compute::v1::NetworksUpdatePeeringRequest const &, Options)

Updates the specified network peering with the data included in the request.

You can only modify the NetworkPeering.export_custom_routes field and the NetworkPeering.import_custom_routes field. https://cloud.google.com/compute/docs/reference/rest/v1/networks/updatePeering

Parameters
Name Description
project std::string const &

Project ID for this request.

network std::string const &

Name of the network resource which the updated peering is belonging to.

networks_update_peering_request_resource google::cloud::cpp::compute::v1::NetworksUpdatePeeringRequest const &

The NetworksUpdatePeeringRequest for this request.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a [google.cloud.cpp.compute.v1.Operation] proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdatePeering(google::cloud::cpp::compute::networks::v1::UpdatePeeringRequest const &, Options)

Updates the specified network peering with the data included in the request.

You can only modify the NetworkPeering.export_custom_routes field and the NetworkPeering.import_custom_routes field. https://cloud.google.com/compute/docs/reference/rest/v1/networks/updatePeering

Parameters
Name Description
request google::cloud::cpp::compute::networks::v1::UpdatePeeringRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.cpp.compute.networks.v1.UpdatePeeringRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::cpp::compute::v1::Operation > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a [google.cloud.cpp.compute.v1.Operation] proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.