Class: Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb

Overview

REST client for the CertificateAuthorityService service.

Certificate Authority Service manages private certificate authorities and issued certificates.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#certificate_authority_path, #certificate_path, #certificate_revocation_list_path, #location_path, #reusable_config_path

Constructor Details

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

Create a new CertificateAuthorityService REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the CertificateAuthorityService client.

Yield Parameters:



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
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 133

def initialize
  # 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 = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @certificate_authority_service_stub = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials
  )
end

Instance Attribute Details

#operations_client::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Operations (readonly)

Get the associated client for long-running operations.



176
177
178
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 176

def operations_client
  @operations_client
end

Class Method Details

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

Configure the CertificateAuthorityService Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all CertificateAuthorityService clients
::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 66

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "Security", "PrivateCA", "V1beta1"]
    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.timeout = 60.0
    default_config.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 14, 4]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#activate_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation #activate_certificate_authority(name: nil, pem_ca_certificate: nil, subordinate_config: nil, request_id: nil) ⇒ ::Gapic::Operation

Activate a CertificateAuthority that is in state PENDING_ACTIVATION and is of type SUBORDINATE. After the parent Certificate Authority signs a certificate signing request from FetchCertificateAuthorityCsr, this method can complete the activation process.

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest.new

# Call the activate_certificate_authority method.
result = client.activate_certificate_authority 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:

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

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

    Parameters:

  • #activate_certificate_authority(name: nil, pem_ca_certificate: nil, subordinate_config: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to activate_certificate_authority 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. The resource name for this CertificateAuthority in the format projects/*/locations/*/certificateAuthorities/*.

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

      Required. The signed CA certificate issued from FetchCertificateAuthorityCsrResponse.pem_csr.

    • subordinate_config (::Google::Cloud::Security::PrivateCA::V1beta1::SubordinateConfig, ::Hash) (defaults to: nil)

      Required. Must include information about the issuer of 'pem_ca_certificate', and any further issuers until the self-signed CA.

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

      Optional. An 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 t he 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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 733

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest

  # 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.activate_certificate_authority..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.activate_certificate_authority request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Configure the CertificateAuthorityService 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:



103
104
105
106
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 103

def configure
  yield @config if block_given?
  @config
end

#create_certificate(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate #create_certificate(parent: nil, certificate_id: nil, certificate: nil, request_id: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate

Create a new Certificate in a given Project, Location from a particular CertificateAuthority.

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new

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

# The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate.
p result

Overloads:

  • #create_certificate(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate

    Pass arguments to create_certificate via a request object, either of type Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest, ::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_certificate(parent: nil, certificate_id: nil, certificate: nil, request_id: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate

    Pass arguments to create_certificate 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. The resource name of the location and CertificateAuthority associated with the Certificate, in the format projects/*/locations/*/certificateAuthorities/*.

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

      Optional. It must be unique within a location and match the regular expression [a-zA-Z0-9_-]{1,63}. This field is required when using a CertificateAuthority in the Enterprise CertificateAuthority.Tier, but is optional and its value is ignored otherwise.

    • certificate (::Google::Cloud::Security::PrivateCA::V1beta1::Certificate, ::Hash) (defaults to: nil)

      Required. A Certificate with initial field values.

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

      Optional. An 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 t he 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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 247

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest

  # 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_certificate..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.create_certificate request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation #create_certificate_authority(parent: nil, certificate_authority_id: nil, certificate_authority: nil, request_id: nil) ⇒ ::Gapic::Operation

Create a new CertificateAuthority in a given Project and Location.

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest.new

# Call the create_certificate_authority method.
result = client.create_certificate_authority 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_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_certificate_authority via a request object, either of type Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest, ::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_certificate_authority(parent: nil, certificate_authority_id: nil, certificate_authority: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_certificate_authority 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. The resource name of the location associated with the CertificateAuthorities, in the format projects/*/locations/*.

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

      Required. It must be unique within a location and match the regular expression [a-zA-Z0-9_-]{1,63}

    • certificate_authority (::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority, ::Hash) (defaults to: nil)

      Required. A CertificateAuthority with initial field values.

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

      Optional. An 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 t he 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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 841

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest

  # 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_certificate_authority..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.create_certificate_authority request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest.new

# Call the disable_certificate_authority method.
result = client.disable_certificate_authority 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:

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

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

    Parameters:

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

    Pass arguments to disable_certificate_authority 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. The resource name for this CertificateAuthority in the format projects/*/locations/*/certificateAuthorities/*.

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

      Optional. An 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 t he 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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 943

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest

  # 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.disable_certificate_authority..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.disable_certificate_authority request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest.new

# Call the enable_certificate_authority method.
result = client.enable_certificate_authority 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:

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

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

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest, ::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.

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

    Pass arguments to enable_certificate_authority 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. The resource name for this CertificateAuthority in the format projects/*/locations/*/certificateAuthorities/*.

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

      Optional. An 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 t he 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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 1045

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest

  # 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.enable_certificate_authority..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.enable_certificate_authority request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#fetch_certificate_authority_csr(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse #fetch_certificate_authority_csr(name: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse

Fetch a certificate signing request (CSR) from a CertificateAuthority that is in state PENDING_ACTIVATION and is of type SUBORDINATE. The CSR must then be signed by the desired parent Certificate Authority, which could be another CertificateAuthority resource, or could be an on-prem certificate authority. See also ActivateCertificateAuthority.

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest.new

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

# The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



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
1159
1160
1161
1162
1163
1164
1165
1166
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 1132

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest

  # 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.fetch_certificate_authority_csr..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.fetch_certificate_authority_csr request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_certificate(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate #get_certificate(name: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate

Returns a Certificate.

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest.new

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

# The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 326

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest

  # 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_certificate..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.get_certificate request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_certificate_authority(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority #get_certificate_authority(name: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest.new

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

# The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 1212

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest

  # 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_certificate_authority..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.get_certificate_authority request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_certificate_revocation_list(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList #get_certificate_revocation_list(name: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest.new

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

# The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 1698

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest

  # 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_certificate_revocation_list..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.get_certificate_revocation_list request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_reusable_config(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig #get_reusable_config(name: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig

Returns a ReusableConfig.

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest.new

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

# The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig.
p result

Overloads:

  • #get_reusable_config(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig

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

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest, ::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_reusable_config(name: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig

    Pass arguments to get_reusable_config 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. The [name][ReusableConfigs.name] of the [ReusableConfigs][] to get.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 1979

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest

  # 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_reusable_config..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.get_reusable_config request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_certificate_authorities(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse #list_certificate_authorities(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesResponse

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest.new

# Call the list_certificate_authorities method.
result = client.list_certificate_authorities 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::Security::PrivateCA::V1beta1::CertificateAuthority.
  p item
end

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 1311

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest

  # 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_certificate_authorities..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.list_certificate_authorities request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_certificate_revocation_lists(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse #list_certificate_revocation_lists(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsResponse

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest.new

# Call the list_certificate_revocation_lists method.
result = client.list_certificate_revocation_lists 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::Security::PrivateCA::V1beta1::CertificateRevocationList.
  p item
end

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 1797

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest

  # 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_certificate_revocation_lists..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.list_certificate_revocation_lists request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_certificates(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse #list_certificates(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesResponse

Lists Certificates.

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest.new

# Call the list_certificates method.
result = client.list_certificates 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::Security::PrivateCA::V1beta1::Certificate.
  p item
end

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 429

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest

  # 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_certificates..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.list_certificates request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_reusable_configs(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse #list_reusable_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest.new

# Call the list_reusable_configs method.
result = client.list_reusable_configs 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::Security::PrivateCA::V1beta1::ReusableConfig.
  p item
end

Overloads:

  • #list_reusable_configs(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse

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

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest, ::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_reusable_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsResponse

    Pass arguments to list_reusable_configs 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. The resource name of the location associated with the ReusableConfigs, in the format projects/*/locations/*.

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

      Optional. Limit on the number of ReusableConfigs to include in the response. Further ReusableConfigs can subsequently be obtained by including the ListReusableConfigsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.

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

      Optional. Pagination token, returned earlier via ListReusableConfigsResponse.next_page_token.

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

      Optional. Only include resources that match the filter in the response.

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

      Optional. Specify how the results should be sorted.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 2078

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest

  # 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_reusable_configs..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.list_reusable_configs request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Restore a CertificateAuthority that is scheduled for deletion.

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest.new

# Call the restore_certificate_authority method.
result = client.restore_certificate_authority 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:

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

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

    Parameters:

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

    Pass arguments to restore_certificate_authority 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. The resource name for this CertificateAuthority in the format projects/*/locations/*/certificateAuthorities/*.

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

      Optional. An 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 t he 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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



1412
1413
1414
1415
1416
1417
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
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 1412

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest

  # 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.restore_certificate_authority..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.restore_certificate_authority request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#revoke_certificate(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate #revoke_certificate(name: nil, reason: nil, request_id: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate

Revoke a Certificate.

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest.new

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

# The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate.
p result

Overloads:

  • #revoke_certificate(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate

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

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest, ::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.

  • #revoke_certificate(name: nil, reason: nil, request_id: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate

    Pass arguments to revoke_certificate 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. The resource name for this Certificate in the format projects/*/locations/*/certificateAuthorities/*/certificates/*.

    • reason (::Google::Cloud::Security::PrivateCA::V1beta1::RevocationReason) (defaults to: nil)

      Required. The RevocationReason for revoking this certificate.

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

      Optional. An 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 t he 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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 525

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest

  # 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.revoke_certificate..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.revoke_certificate request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Schedule a CertificateAuthority for deletion.

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest.new

# Call the schedule_delete_certificate_authority method.
result = client.schedule_delete_certificate_authority 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:

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

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

    Parameters:

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

    Pass arguments to schedule_delete_certificate_authority 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. The resource name for this CertificateAuthority in the format projects/*/locations/*/certificateAuthorities/*.

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

      Optional. An 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 t he 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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 1514

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest

  # 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.schedule_delete_certificate_authority..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.schedule_delete_certificate_authority request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


113
114
115
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 113

def universe_domain
  @certificate_authority_service_stub.universe_domain
end

#update_certificate(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate #update_certificate(certificate: nil, update_mask: nil, request_id: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate

Update a Certificate. Currently, the only field you can update is the labels field.

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest.new

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

# The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate.
p result

Overloads:

  • #update_certificate(request, options = nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate

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

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest, ::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_certificate(certificate: nil, update_mask: nil, request_id: nil) ⇒ ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate

    Pass arguments to update_certificate 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:

    • certificate (::Google::Cloud::Security::PrivateCA::V1beta1::Certificate, ::Hash) (defaults to: nil)

      Required. Certificate with updated values.

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

      Required. A list of fields to be updated in this request.

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

      Optional. An 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 t he 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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 621

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest

  # 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_certificate..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.update_certificate request, options do |result, operation|
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation #update_certificate_authority(certificate_authority: nil, update_mask: nil, request_id: nil) ⇒ ::Gapic::Operation

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest.new

# Call the update_certificate_authority method.
result = client.update_certificate_authority 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_certificate_authority(request, options = nil) ⇒ ::Gapic::Operation

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

    Parameters:

    • request (::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest, ::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_certificate_authority(certificate_authority: nil, update_mask: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_certificate_authority 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:

    • certificate_authority (::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority, ::Hash) (defaults to: nil)

      Required. CertificateAuthority with updated values.

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

      Required. A list of fields to be updated in this request.

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

      Optional. An 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 t he 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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 1617

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest

  # 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_certificate_authority..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.update_certificate_authority request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_certificate_revocation_list(request, options = nil) ⇒ ::Gapic::Operation #update_certificate_revocation_list(certificate_revocation_list: nil, update_mask: nil, request_id: nil) ⇒ ::Gapic::Operation

Examples:

Basic example

require "google/cloud/security/private_ca/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest.new

# Call the update_certificate_revocation_list method.
result = client.update_certificate_revocation_list 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_certificate_revocation_list(request, options = nil) ⇒ ::Gapic::Operation

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

    Parameters:

  • #update_certificate_revocation_list(certificate_revocation_list: nil, update_mask: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_certificate_revocation_list 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:

    • certificate_revocation_list (::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList, ::Hash) (defaults to: nil)

      Required. CertificateRevocationList with updated values.

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

      Required. A list of fields to be updated in this request.

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

      Optional. An 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 t he 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:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the REST call is aborted.



1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
# File 'lib/google/cloud/security/private_ca/v1beta1/certificate_authority_service/rest/client.rb', line 1899

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest

  # 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_certificate_revocation_list..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::Security::PrivateCA::V1beta1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

  @certificate_authority_service_stub.update_certificate_revocation_list request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    return result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end