Class RegionSecurityPoliciesClient (2.23.0-rc)

Service for the regionSecurityPolicies resource.

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

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

RegionSecurityPoliciesClient(RegionSecurityPoliciesClient const &)

Copy and move support

Parameter
NameDescription
RegionSecurityPoliciesClient const &

RegionSecurityPoliciesClient(RegionSecurityPoliciesClient &&)

Copy and move support

Parameter
NameDescription
RegionSecurityPoliciesClient &&

RegionSecurityPoliciesClient(std::shared_ptr< RegionSecurityPoliciesConnection >, Options)

Parameters
NameDescription
connection std::shared_ptr< RegionSecurityPoliciesConnection >
opts Options

Operators

operator=(RegionSecurityPoliciesClient const &)

Copy and move support

Parameter
NameDescription
RegionSecurityPoliciesClient const &
Returns
TypeDescription
RegionSecurityPoliciesClient &

operator=(RegionSecurityPoliciesClient &&)

Copy and move support

Parameter
NameDescription
RegionSecurityPoliciesClient &&
Returns
TypeDescription
RegionSecurityPoliciesClient &

Functions

AddRule(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::SecurityPolicyRule const &, Options)

Inserts a rule into a security policy.

Parameters
NameDescription
project std::string const &

Project ID for this request.

region std::string const &

Name of the region scoping this request.

security_policy std::string const &

Name of the security policy to update.

security_policy_rule_resource google::cloud::cpp::compute::v1::SecurityPolicyRule const &

The SecurityPolicyRule for this request.

opts Options

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

Returns
TypeDescription
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.

AddRule(google::cloud::cpp::compute::region_security_policies::v1::AddRuleRequest const &, Options)

Inserts a rule into a security policy.

Parameters
NameDescription
request google::cloud::cpp::compute::region_security_policies::v1::AddRuleRequest 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.region_security_policies.v1.AddRuleRequest. 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
TypeDescription
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.

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

Deletes the specified policy.

Parameters
NameDescription
project std::string const &

Project ID for this request.

region std::string const &

Name of the region scoping this request.

security_policy std::string const &

Name of the security policy to delete.

opts Options

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

Returns
TypeDescription
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.

DeleteSecurityPolicy(google::cloud::cpp::compute::region_security_policies::v1::DeleteSecurityPolicyRequest const &, Options)

Deletes the specified policy.

Parameters
NameDescription
request google::cloud::cpp::compute::region_security_policies::v1::DeleteSecurityPolicyRequest 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.region_security_policies.v1.DeleteSecurityPolicyRequest. 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
TypeDescription
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.

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

List all of the ordered rules present in a single specified policy.

Parameters
NameDescription
project std::string const &

Project ID for this request.

region std::string const &

Name of the region scoping this request.

security_policy std::string const &

Name of the security policy to get.

opts Options

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

Returns
TypeDescription
StatusOr< google::cloud::cpp::compute::v1::SecurityPolicy >

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

GetSecurityPolicy(google::cloud::cpp::compute::region_security_policies::v1::GetSecurityPolicyRequest const &, Options)

List all of the ordered rules present in a single specified policy.

Parameters
NameDescription
request google::cloud::cpp::compute::region_security_policies::v1::GetSecurityPolicyRequest 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.region_security_policies.v1.GetSecurityPolicyRequest. 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
TypeDescription
StatusOr< google::cloud::cpp::compute::v1::SecurityPolicy >

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

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

Gets a rule at the specified priority.

Parameters
NameDescription
project std::string const &

Project ID for this request.

region std::string const &

Name of the region scoping this request.

security_policy std::string const &

Name of the security policy to which the queried rule belongs.

opts Options

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

Returns
TypeDescription
StatusOr< google::cloud::cpp::compute::v1::SecurityPolicyRule >

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

GetRule(google::cloud::cpp::compute::region_security_policies::v1::GetRuleRequest const &, Options)

Gets a rule at the specified priority.

Parameters
NameDescription
request google::cloud::cpp::compute::region_security_policies::v1::GetRuleRequest 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.region_security_policies.v1.GetRuleRequest. 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
TypeDescription
StatusOr< google::cloud::cpp::compute::v1::SecurityPolicyRule >

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

InsertSecurityPolicy(std::string const &, std::string const &, google::cloud::cpp::compute::v1::SecurityPolicy const &, Options)

Creates a new policy in the specified project using the data included in the request.

Parameters
NameDescription
project std::string const &

Project ID for this request.

region std::string const &

Name of the region scoping this request.

security_policy_resource google::cloud::cpp::compute::v1::SecurityPolicy const &

The SecurityPolicy for this request.

opts Options

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

Returns
TypeDescription
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.

InsertSecurityPolicy(google::cloud::cpp::compute::region_security_policies::v1::InsertSecurityPolicyRequest const &, Options)

Creates a new policy in the specified project using the data included in the request.

Parameters
NameDescription
request google::cloud::cpp::compute::region_security_policies::v1::InsertSecurityPolicyRequest 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.region_security_policies.v1.InsertSecurityPolicyRequest. 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
TypeDescription
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.

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

List all the policies that have been configured for the specified project and region.

Parameters
NameDescription
project std::string const &

Project ID for this request.

region std::string const &

Name of the region scoping this request.

opts Options

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

Returns
TypeDescription
StreamRange< google::cloud::cpp::compute::v1::SecurityPolicy >

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.SecurityPolicy, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListRegionSecurityPolicies(google::cloud::cpp::compute::region_security_policies::v1::ListRegionSecurityPoliciesRequest, Options)

List all the policies that have been configured for the specified project and region.

Parameters
NameDescription
request google::cloud::cpp::compute::region_security_policies::v1::ListRegionSecurityPoliciesRequest

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.region_security_policies.v1.ListRegionSecurityPoliciesRequest. 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
TypeDescription
StreamRange< google::cloud::cpp::compute::v1::SecurityPolicy >

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.SecurityPolicy, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

PatchSecurityPolicy(std::string const &, std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::SecurityPolicy const &, Options)

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

To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead. https://cloud.google.com/compute/docs/reference/rest/v1/regionSecurityPolicies/patch

Parameters
NameDescription
project std::string const &

Project ID for this request.

region std::string const &

Name of the region scoping this request.

security_policy std::string const &

Name of the security policy to update.

update_mask std::string const &

Indicates fields to be cleared as part of this request.

security_policy_resource google::cloud::cpp::compute::v1::SecurityPolicy const &

The SecurityPolicy for this request.

opts Options

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

Returns
TypeDescription
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.

PatchSecurityPolicy(google::cloud::cpp::compute::region_security_policies::v1::PatchSecurityPolicyRequest const &, Options)

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

To clear fields in the policy, leave the fields empty and specify them in the updateMask. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead. https://cloud.google.com/compute/docs/reference/rest/v1/regionSecurityPolicies/patch

Parameters
NameDescription
request google::cloud::cpp::compute::region_security_policies::v1::PatchSecurityPolicyRequest 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.region_security_policies.v1.PatchSecurityPolicyRequest. 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
TypeDescription
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.

PatchRule(std::string const &, std::string const &, std::string const &, google::cloud::cpp::compute::v1::SecurityPolicyRule const &, Options)

Patches a rule at the specified priority.

To clear fields in the rule, leave the fields empty and specify them in the updateMask. https://cloud.google.com/compute/docs/reference/rest/v1/regionSecurityPolicies/patchRule

Parameters
NameDescription
project std::string const &

Project ID for this request.

region std::string const &

Name of the region scoping this request.

security_policy std::string const &

Name of the security policy to update.

security_policy_rule_resource google::cloud::cpp::compute::v1::SecurityPolicyRule const &

The SecurityPolicyRule for this request.

opts Options

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

Returns
TypeDescription
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.

PatchRule(google::cloud::cpp::compute::region_security_policies::v1::PatchRuleRequest const &, Options)

Patches a rule at the specified priority.

To clear fields in the rule, leave the fields empty and specify them in the updateMask. https://cloud.google.com/compute/docs/reference/rest/v1/regionSecurityPolicies/patchRule

Parameters
NameDescription
request google::cloud::cpp::compute::region_security_policies::v1::PatchRuleRequest 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.region_security_policies.v1.PatchRuleRequest. 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
TypeDescription
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.

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

Deletes a rule at the specified priority.

Parameters
NameDescription
project std::string const &

Project ID for this request.

region std::string const &

Name of the region scoping this request.

security_policy std::string const &

Name of the security policy to update.

opts Options

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

Returns
TypeDescription
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.

RemoveRule(google::cloud::cpp::compute::region_security_policies::v1::RemoveRuleRequest const &, Options)

Deletes a rule at the specified priority.

Parameters
NameDescription
request google::cloud::cpp::compute::region_security_policies::v1::RemoveRuleRequest 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.region_security_policies.v1.RemoveRuleRequest. 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
TypeDescription
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.