Class: Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/network_security/v1/firewall_activation/client.rb

Overview

Client for the FirewallActivation service.

Service for managing Firewall Endpoints and Associations.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#firewall_endpoint_association_path, #firewall_endpoint_path, #location_path, #network_path, #organization_location_path, #tls_inspection_policy_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new FirewallActivation client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the FirewallActivation client.

Yield Parameters:



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 126

def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/cloud/networksecurity/v1/firewall_activation_services_pb"

  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end
  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @firewall_activation_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::NetworkSecurity::V1::FirewallActivation::Stub,
    credentials: credentials,
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors,
    channel_pool_config: @config.channel_pool,
    logger: @config.logger
  )

  @firewall_activation_stub.stub_logger&.info do |entry|
    entry.set_system_name
    entry.set_service
    entry.message = "Created client for #{entry.service}"
    entry.set_credentials_fields credentials
    entry.set "customEndpoint", @config.endpoint if @config.endpoint
    entry.set "defaultTimeout", @config.timeout if @config.timeout
    entry.set "quotaProject", @quota_project_id if @quota_project_id
  end

  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @firewall_activation_stub.endpoint
    config.universe_domain = @firewall_activation_stub.universe_domain
    config.logger = @firewall_activation_stub.logger if config.respond_to? :logger=
  end

  @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @firewall_activation_stub.endpoint
    config.universe_domain = @firewall_activation_stub.universe_domain
    config.logger = @firewall_activation_stub.logger if config.respond_to? :logger=
  end
end

Instance Attribute Details

#iam_policy_clientGoogle::Iam::V1::IAMPolicy::Client (readonly)

Get the associated client for mix-in of the IAMPolicy.

Returns:

  • (Google::Iam::V1::IAMPolicy::Client)


219
220
221
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 219

def iam_policy_client
  @iam_policy_client
end

#location_clientGoogle::Cloud::Location::Locations::Client (readonly)

Get the associated client for mix-in of the Locations.

Returns:

  • (Google::Cloud::Location::Locations::Client)


212
213
214
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 212

def location_client
  @location_client
end

#operations_client::Google::Cloud::NetworkSecurity::V1::FirewallActivation::Operations (readonly)

Get the associated client for long-running operations.



205
206
207
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 205

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the FirewallActivation Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all FirewallActivation clients
::Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 64

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "NetworkSecurity", "V1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#configure {|config| ... } ⇒ Client::Configuration

Configure the FirewallActivation Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



96
97
98
99
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 96

def configure
  yield @config if block_given?
  @config
end

#create_firewall_endpoint(request, options = nil) ⇒ ::Gapic::Operation #create_firewall_endpoint(parent: nil, firewall_endpoint_id: nil, firewall_endpoint: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a new FirewallEndpoint in a given organization and location.

Examples:

Basic example

require "google/cloud/network_security/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1::CreateFirewallEndpointRequest.new

# Call the create_firewall_endpoint method.
result = client.create_firewall_endpoint request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_firewall_endpoint(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_firewall_endpoint via a request object, either of type CreateFirewallEndpointRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::NetworkSecurity::V1::CreateFirewallEndpointRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_firewall_endpoint(parent: nil, firewall_endpoint_id: nil, firewall_endpoint: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_firewall_endpoint via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Value for parent.

    • firewall_endpoint_id (::String) (defaults to: nil)

      Required. Id of the requesting object. If auto-generating Id server-side, remove this field and firewall_endpoint_id from the method_signature of Create RPC.

    • firewall_endpoint (::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint, ::Hash) (defaults to: nil)

      Required. The resource being created

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 673

def create_firewall_endpoint request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1::CreateFirewallEndpointRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_firewall_endpoint..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::NetworkSecurity::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_firewall_endpoint.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_firewall_endpoint.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @firewall_activation_stub.call_rpc :create_firewall_endpoint, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_firewall_endpoint_association(request, options = nil) ⇒ ::Gapic::Operation #create_firewall_endpoint_association(parent: nil, firewall_endpoint_association_id: nil, firewall_endpoint_association: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a new FirewallEndpointAssociation in a given project and location.

Examples:

Basic example

require "google/cloud/network_security/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1::CreateFirewallEndpointAssociationRequest.new

# Call the create_firewall_endpoint_association method.
result = client.create_firewall_endpoint_association request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_firewall_endpoint_association(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_firewall_endpoint_association via a request object, either of type CreateFirewallEndpointAssociationRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::NetworkSecurity::V1::CreateFirewallEndpointAssociationRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_firewall_endpoint_association(parent: nil, firewall_endpoint_association_id: nil, firewall_endpoint_association: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_firewall_endpoint_association via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Value for parent.

    • firewall_endpoint_association_id (::String) (defaults to: nil)

      Optional. Id of the requesting object. If auto-generating Id server-side, remove this field and firewall_endpoint_association_id from the method_signature of Create RPC.

    • firewall_endpoint_association (::Google::Cloud::NetworkSecurity::V1::FirewallEndpointAssociation, ::Hash) (defaults to: nil)

      Required. The resource being created

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 1530

def create_firewall_endpoint_association request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1::CreateFirewallEndpointAssociationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_firewall_endpoint_association..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::NetworkSecurity::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_firewall_endpoint_association.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_firewall_endpoint_association.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @firewall_activation_stub.call_rpc :create_firewall_endpoint_association, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_project_firewall_endpoint(request, options = nil) ⇒ ::Gapic::Operation #create_project_firewall_endpoint(parent: nil, firewall_endpoint_id: nil, firewall_endpoint: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a new FirewallEndpoint in a given project and location.

Examples:

Basic example

require "google/cloud/network_security/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1::CreateFirewallEndpointRequest.new

# Call the create_project_firewall_endpoint method.
result = client.create_project_firewall_endpoint request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #create_project_firewall_endpoint(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_project_firewall_endpoint via a request object, either of type CreateFirewallEndpointRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::NetworkSecurity::V1::CreateFirewallEndpointRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_project_firewall_endpoint(parent: nil, firewall_endpoint_id: nil, firewall_endpoint: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_project_firewall_endpoint via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Value for parent.

    • firewall_endpoint_id (::String) (defaults to: nil)

      Required. Id of the requesting object. If auto-generating Id server-side, remove this field and firewall_endpoint_id from the method_signature of Create RPC.

    • firewall_endpoint (::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint, ::Hash) (defaults to: nil)

      Required. The resource being created

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 787

def create_project_firewall_endpoint request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1::CreateFirewallEndpointRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_project_firewall_endpoint..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::NetworkSecurity::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_project_firewall_endpoint.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_project_firewall_endpoint.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @firewall_activation_stub.call_rpc :create_project_firewall_endpoint, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_firewall_endpoint(request, options = nil) ⇒ ::Gapic::Operation #delete_firewall_endpoint(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes a single org Endpoint.

Examples:

Basic example

require "google/cloud/network_security/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1::DeleteFirewallEndpointRequest.new

# Call the delete_firewall_endpoint method.
result = client.delete_firewall_endpoint request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_firewall_endpoint(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_firewall_endpoint via a request object, either of type DeleteFirewallEndpointRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::NetworkSecurity::V1::DeleteFirewallEndpointRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_firewall_endpoint(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_firewall_endpoint via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 895

def delete_firewall_endpoint request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1::DeleteFirewallEndpointRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_firewall_endpoint..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::NetworkSecurity::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_firewall_endpoint.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_firewall_endpoint.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @firewall_activation_stub.call_rpc :delete_firewall_endpoint, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_firewall_endpoint_association(request, options = nil) ⇒ ::Gapic::Operation #delete_firewall_endpoint_association(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes a single FirewallEndpointAssociation.

Examples:

Basic example

require "google/cloud/network_security/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1::DeleteFirewallEndpointAssociationRequest.new

# Call the delete_firewall_endpoint_association method.
result = client.delete_firewall_endpoint_association request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_firewall_endpoint_association(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_firewall_endpoint_association via a request object, either of type DeleteFirewallEndpointAssociationRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::NetworkSecurity::V1::DeleteFirewallEndpointAssociationRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_firewall_endpoint_association(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_firewall_endpoint_association via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 1638

def delete_firewall_endpoint_association request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1::DeleteFirewallEndpointAssociationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_firewall_endpoint_association..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::NetworkSecurity::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_firewall_endpoint_association.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_firewall_endpoint_association.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @firewall_activation_stub.call_rpc :delete_firewall_endpoint_association, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_project_firewall_endpoint(request, options = nil) ⇒ ::Gapic::Operation #delete_project_firewall_endpoint(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes a single project Endpoint.

Examples:

Basic example

require "google/cloud/network_security/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1::DeleteFirewallEndpointRequest.new

# Call the delete_project_firewall_endpoint method.
result = client.delete_project_firewall_endpoint request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_project_firewall_endpoint(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_project_firewall_endpoint via a request object, either of type DeleteFirewallEndpointRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::NetworkSecurity::V1::DeleteFirewallEndpointRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_project_firewall_endpoint(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_project_firewall_endpoint via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 1003

def delete_project_firewall_endpoint request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1::DeleteFirewallEndpointRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_project_firewall_endpoint..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::NetworkSecurity::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_project_firewall_endpoint.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_project_firewall_endpoint.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @firewall_activation_stub.call_rpc :delete_project_firewall_endpoint, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_firewall_endpoint(request, options = nil) ⇒ ::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint #get_firewall_endpoint(name: nil) ⇒ ::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint

Gets details of a single org Endpoint.

Examples:

Basic example

require "google/cloud/network_security/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1::GetFirewallEndpointRequest.new

# Call the get_firewall_endpoint method.
result = client.get_firewall_endpoint request

# The returned object is of type Google::Cloud::NetworkSecurity::V1::FirewallEndpoint.
p result

Overloads:

  • #get_firewall_endpoint(request, options = nil) ⇒ ::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint

    Pass arguments to get_firewall_endpoint via a request object, either of type GetFirewallEndpointRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::NetworkSecurity::V1::GetFirewallEndpointRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_firewall_endpoint(name: nil) ⇒ ::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint

    Pass arguments to get_firewall_endpoint via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 476

def get_firewall_endpoint request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1::GetFirewallEndpointRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_firewall_endpoint..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::NetworkSecurity::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_firewall_endpoint.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_firewall_endpoint.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @firewall_activation_stub.call_rpc :get_firewall_endpoint, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_firewall_endpoint_association(request, options = nil) ⇒ ::Google::Cloud::NetworkSecurity::V1::FirewallEndpointAssociation #get_firewall_endpoint_association(name: nil) ⇒ ::Google::Cloud::NetworkSecurity::V1::FirewallEndpointAssociation

Gets details of a single FirewallEndpointAssociation.

Examples:

Basic example

require "google/cloud/network_security/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1::GetFirewallEndpointAssociationRequest.new

# Call the get_firewall_endpoint_association method.
result = client.get_firewall_endpoint_association request

# The returned object is of type Google::Cloud::NetworkSecurity::V1::FirewallEndpointAssociation.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 1418

def get_firewall_endpoint_association request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1::GetFirewallEndpointAssociationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_firewall_endpoint_association..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::NetworkSecurity::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_firewall_endpoint_association.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_firewall_endpoint_association.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @firewall_activation_stub.call_rpc :get_firewall_endpoint_association, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_project_firewall_endpoint(request, options = nil) ⇒ ::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint #get_project_firewall_endpoint(name: nil) ⇒ ::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint

Gets details of a single project Endpoint.

Examples:

Basic example

require "google/cloud/network_security/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1::GetFirewallEndpointRequest.new

# Call the get_project_firewall_endpoint method.
result = client.get_project_firewall_endpoint request

# The returned object is of type Google::Cloud::NetworkSecurity::V1::FirewallEndpoint.
p result

Overloads:

  • #get_project_firewall_endpoint(request, options = nil) ⇒ ::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint

    Pass arguments to get_project_firewall_endpoint via a request object, either of type GetFirewallEndpointRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::NetworkSecurity::V1::GetFirewallEndpointRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_project_firewall_endpoint(name: nil) ⇒ ::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint

    Pass arguments to get_project_firewall_endpoint via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 561

def get_project_firewall_endpoint request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1::GetFirewallEndpointRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_project_firewall_endpoint..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::NetworkSecurity::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_project_firewall_endpoint.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_project_firewall_endpoint.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @firewall_activation_stub.call_rpc :get_project_firewall_endpoint, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_firewall_endpoint_associations(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1::FirewallEndpointAssociation> #list_firewall_endpoint_associations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1::FirewallEndpointAssociation>

Lists Associations in a given project and location.

Examples:

Basic example

require "google/cloud/network_security/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1::ListFirewallEndpointAssociationsRequest.new

# Call the list_firewall_endpoint_associations method.
result = client.list_firewall_endpoint_associations request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::NetworkSecurity::V1::FirewallEndpointAssociation.
  p item
end

Overloads:

  • #list_firewall_endpoint_associations(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1::FirewallEndpointAssociation>

    Pass arguments to list_firewall_endpoint_associations via a request object, either of type ListFirewallEndpointAssociationsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::NetworkSecurity::V1::ListFirewallEndpointAssociationsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_firewall_endpoint_associations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1::FirewallEndpointAssociation>

    Pass arguments to list_firewall_endpoint_associations via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Parent value for ListAssociationsRequest

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      A token identifying a page of results the server should return.

    • filter (::String) (defaults to: nil)

      Optional. Filtering results

    • order_by (::String) (defaults to: nil)

      Hint for how to order the results

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 1331

def list_firewall_endpoint_associations request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1::ListFirewallEndpointAssociationsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_firewall_endpoint_associations..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::NetworkSecurity::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_firewall_endpoint_associations.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_firewall_endpoint_associations.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @firewall_activation_stub.call_rpc :list_firewall_endpoint_associations, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @firewall_activation_stub, :list_firewall_endpoint_associations, request, response, operation, options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_firewall_endpoints(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint> #list_firewall_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint>

Lists FirewallEndpoints in a given organization and location.

Examples:

Basic example

require "google/cloud/network_security/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1::ListFirewallEndpointsRequest.new

# Call the list_firewall_endpoints method.
result = client.list_firewall_endpoints request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint.
  p item
end

Overloads:

  • #list_firewall_endpoints(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint>

    Pass arguments to list_firewall_endpoints via a request object, either of type ListFirewallEndpointsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::NetworkSecurity::V1::ListFirewallEndpointsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_firewall_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint>

    Pass arguments to list_firewall_endpoints via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Parent value for ListEndpointsRequest

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      A token identifying a page of results the server should return.

    • filter (::String) (defaults to: nil)

      Optional. Filtering results

    • order_by (::String) (defaults to: nil)

      Hint for how to order the results

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 289

def list_firewall_endpoints request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1::ListFirewallEndpointsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_firewall_endpoints..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::NetworkSecurity::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_firewall_endpoints.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_firewall_endpoints.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @firewall_activation_stub.call_rpc :list_firewall_endpoints, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @firewall_activation_stub, :list_firewall_endpoints, request, response, operation, options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_project_firewall_endpoints(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint> #list_project_firewall_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint>

Lists FirewallEndpoints in a given project and location.

Examples:

Basic example

require "google/cloud/network_security/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1::ListFirewallEndpointsRequest.new

# Call the list_project_firewall_endpoints method.
result = client.list_project_firewall_endpoints request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint.
  p item
end

Overloads:

  • #list_project_firewall_endpoints(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint>

    Pass arguments to list_project_firewall_endpoints via a request object, either of type ListFirewallEndpointsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::NetworkSecurity::V1::ListFirewallEndpointsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_project_firewall_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint>

    Pass arguments to list_project_firewall_endpoints via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Parent value for ListEndpointsRequest

    • page_size (::Integer) (defaults to: nil)

      Optional. Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      A token identifying a page of results the server should return.

    • filter (::String) (defaults to: nil)

      Optional. Filtering results

    • order_by (::String) (defaults to: nil)

      Hint for how to order the results

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 389

def list_project_firewall_endpoints request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1::ListFirewallEndpointsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_project_firewall_endpoints..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::NetworkSecurity::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_project_firewall_endpoints.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_project_firewall_endpoints.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @firewall_activation_stub.call_rpc :list_project_firewall_endpoints, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @firewall_activation_stub, :list_project_firewall_endpoints, request, response, operation, options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


226
227
228
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 226

def logger
  @firewall_activation_stub.logger
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


106
107
108
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 106

def universe_domain
  @firewall_activation_stub.universe_domain
end

#update_firewall_endpoint(request, options = nil) ⇒ ::Gapic::Operation #update_firewall_endpoint(update_mask: nil, firewall_endpoint: nil, request_id: nil) ⇒ ::Gapic::Operation

Update a single org Endpoint.

Examples:

Basic example

require "google/cloud/network_security/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1::UpdateFirewallEndpointRequest.new

# Call the update_firewall_endpoint method.
result = client.update_firewall_endpoint request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_firewall_endpoint(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_firewall_endpoint via a request object, either of type UpdateFirewallEndpointRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::NetworkSecurity::V1::UpdateFirewallEndpointRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_firewall_endpoint(update_mask: nil, firewall_endpoint: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_firewall_endpoint via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. Field mask is used to specify the fields to be overwritten in the Endpoint resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

    • firewall_endpoint (::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint, ::Hash) (defaults to: nil)

      Required. The resource being updated

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 1117

def update_firewall_endpoint request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1::UpdateFirewallEndpointRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_firewall_endpoint..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::NetworkSecurity::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.firewall_endpoint&.name
    header_params["firewall_endpoint.name"] = request.firewall_endpoint.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_firewall_endpoint.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_firewall_endpoint.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @firewall_activation_stub.call_rpc :update_firewall_endpoint, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_firewall_endpoint_association(request, options = nil) ⇒ ::Gapic::Operation #update_firewall_endpoint_association(update_mask: nil, firewall_endpoint_association: nil, request_id: nil) ⇒ ::Gapic::Operation

Update a single FirewallEndpointAssociation.

Examples:

Basic example

require "google/cloud/network_security/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1::UpdateFirewallEndpointAssociationRequest.new

# Call the update_firewall_endpoint_association method.
result = client.update_firewall_endpoint_association request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_firewall_endpoint_association(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_firewall_endpoint_association via a request object, either of type UpdateFirewallEndpointAssociationRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::NetworkSecurity::V1::UpdateFirewallEndpointAssociationRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_firewall_endpoint_association(update_mask: nil, firewall_endpoint_association: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_firewall_endpoint_association via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. Field mask is used to specify the fields to be overwritten in the Association resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

    • firewall_endpoint_association (::Google::Cloud::NetworkSecurity::V1::FirewallEndpointAssociation, ::Hash) (defaults to: nil)

      Required. The resource being updated

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 1752

def update_firewall_endpoint_association request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1::UpdateFirewallEndpointAssociationRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_firewall_endpoint_association..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::NetworkSecurity::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.firewall_endpoint_association&.name
    header_params["firewall_endpoint_association.name"] = request.firewall_endpoint_association.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_firewall_endpoint_association.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_firewall_endpoint_association.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @firewall_activation_stub.call_rpc :update_firewall_endpoint_association, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_project_firewall_endpoint(request, options = nil) ⇒ ::Gapic::Operation #update_project_firewall_endpoint(update_mask: nil, firewall_endpoint: nil, request_id: nil) ⇒ ::Gapic::Operation

Update a single project Endpoint.

Examples:

Basic example

require "google/cloud/network_security/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkSecurity::V1::FirewallActivation::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkSecurity::V1::UpdateFirewallEndpointRequest.new

# Call the update_project_firewall_endpoint method.
result = client.update_project_firewall_endpoint request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #update_project_firewall_endpoint(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to update_project_firewall_endpoint via a request object, either of type UpdateFirewallEndpointRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::NetworkSecurity::V1::UpdateFirewallEndpointRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_project_firewall_endpoint(update_mask: nil, firewall_endpoint: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_project_firewall_endpoint via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. Field mask is used to specify the fields to be overwritten in the Endpoint resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

    • firewall_endpoint (::Google::Cloud::NetworkSecurity::V1::FirewallEndpoint, ::Hash) (defaults to: nil)

      Required. The resource being updated

    • request_id (::String) (defaults to: nil)

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
# File 'lib/google/cloud/network_security/v1/firewall_activation/client.rb', line 1231

def update_project_firewall_endpoint request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkSecurity::V1::UpdateFirewallEndpointRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_project_firewall_endpoint..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::NetworkSecurity::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.firewall_endpoint&.name
    header_params["firewall_endpoint.name"] = request.firewall_endpoint.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_project_firewall_endpoint.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_project_firewall_endpoint.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @firewall_activation_stub.call_rpc :update_project_firewall_endpoint, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    throw :response, response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end