google-cloud-backupdr-v1 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f10381819fccd36319f6f0e85907f5a6b285d501fac87c98f9cda3a32750617
4
- data.tar.gz: 51e5e7e4e3f576f1d9a8f0ead55d5c1dd50905ccfe91b2258f4223b84b191446
3
+ metadata.gz: '08534cc34dc75f775b5e86920233ce9178cd666ede2e2092075c36c5a9936cc4'
4
+ data.tar.gz: f13d2f06ebc5a271509024c674f95bf2681beeff7a3f9b81c4cf6b8d18245d3a
5
5
  SHA512:
6
- metadata.gz: 50c87efb60c9c5a2daedc530bcda3674db75ce2d8e405280ce58a6a98521fc6df85567d3652f9db3a283124ecb04eac1c348cd6c4b0687f666d6002d52a22734
7
- data.tar.gz: 4063ba9eabdbed5bde4d7aea44b664375a737b4490149052d3f8a67159f78086cd83cd3c27d6951757a6ed6f93ae4d98a31d2b15d18e4d353e0b06907db00a8f
6
+ metadata.gz: d49c834ee1aac20e561efc8bcdf8a960507287acae94f6e77c509e7d51b8884135cbc7b2cd86018999db85a464045f8a5bc148cb9153f47efc2a9d415629f847
7
+ data.tar.gz: d304e913511a22a4e042913040e8a3530fdf17e0a0321d9e03b1a72fa56f83e9e84102220e9b4e2a3d2e1571a7dbf1c9c33f0fdeffd20b5b8ecf9303acaaef60
@@ -1799,6 +1799,126 @@ module Google
1799
1799
  raise ::Google::Cloud::Error.from_error(e)
1800
1800
  end
1801
1801
 
1802
+ ##
1803
+ # Fetch Backups for a given resource type.
1804
+ #
1805
+ # @overload fetch_backups_for_resource_type(request, options = nil)
1806
+ # Pass arguments to `fetch_backups_for_resource_type` via a request object, either of type
1807
+ # {::Google::Cloud::BackupDR::V1::FetchBackupsForResourceTypeRequest} or an equivalent Hash.
1808
+ #
1809
+ # @param request [::Google::Cloud::BackupDR::V1::FetchBackupsForResourceTypeRequest, ::Hash]
1810
+ # A request object representing the call parameters. Required. To specify no
1811
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1812
+ # @param options [::Gapic::CallOptions, ::Hash]
1813
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1814
+ #
1815
+ # @overload fetch_backups_for_resource_type(parent: nil, resource_type: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil)
1816
+ # Pass arguments to `fetch_backups_for_resource_type` via keyword arguments. Note that at
1817
+ # least one keyword argument is required. To specify no parameters, or to keep all
1818
+ # the default parameter values, pass an empty Hash as a request object (see above).
1819
+ #
1820
+ # @param parent [::String]
1821
+ # Required. Datasources are the parent resource for the backups.
1822
+ # Format:
1823
+ # projects/\\{project}/locations/\\{location}/backupVaults/\\{backupVaultId}/dataSources/\\{datasourceId}
1824
+ # @param resource_type [::String]
1825
+ # Required. The type of the GCP resource.
1826
+ # Ex: sqladmin.googleapis.com/Instance
1827
+ # @param page_size [::Integer]
1828
+ # Optional. The maximum number of Backups to return. The service may
1829
+ # return fewer than this value. If unspecified, at most 50
1830
+ # Backups will be returned. The maximum value is 100; values
1831
+ # above 100 will be coerced to 100.
1832
+ # @param page_token [::String]
1833
+ # Optional. A page token, received from a previous call of
1834
+ # `FetchBackupsForResourceType`.
1835
+ # Provide this to retrieve the subsequent page.
1836
+ #
1837
+ # When paginating, all other parameters provided to
1838
+ # `FetchBackupsForResourceType` must match
1839
+ # the call that provided the page token.
1840
+ # @param filter [::String]
1841
+ # Optional. A filter expression that filters the results fetched in the
1842
+ # response. The expression must specify the field name, a comparison
1843
+ # operator, and the value that you want to use for filtering. Supported
1844
+ # fields:
1845
+ # @param order_by [::String]
1846
+ # Optional. A comma-separated list of fields to order by, sorted in ascending
1847
+ # order. Use "desc" after a field name for descending.
1848
+ # @param view [::Google::Cloud::BackupDR::V1::BackupView]
1849
+ # Optional. This parameter is used to specify the view of the backup.
1850
+ # If not specified, the default view is BASIC.
1851
+ #
1852
+ # @yield [response, operation] Access the result along with the RPC operation
1853
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::Backup>]
1854
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1855
+ #
1856
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::Backup>]
1857
+ #
1858
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1859
+ #
1860
+ # @example Basic example
1861
+ # require "google/cloud/backupdr/v1"
1862
+ #
1863
+ # # Create a client object. The client can be reused for multiple calls.
1864
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
1865
+ #
1866
+ # # Create a request. To set request fields, pass in keyword arguments.
1867
+ # request = Google::Cloud::BackupDR::V1::FetchBackupsForResourceTypeRequest.new
1868
+ #
1869
+ # # Call the fetch_backups_for_resource_type method.
1870
+ # result = client.fetch_backups_for_resource_type request
1871
+ #
1872
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1873
+ # # over elements, and API calls will be issued to fetch pages as needed.
1874
+ # result.each do |item|
1875
+ # # Each element is of type ::Google::Cloud::BackupDR::V1::Backup.
1876
+ # p item
1877
+ # end
1878
+ #
1879
+ def fetch_backups_for_resource_type request, options = nil
1880
+ raise ::ArgumentError, "request must be provided" if request.nil?
1881
+
1882
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::FetchBackupsForResourceTypeRequest
1883
+
1884
+ # Converts hash and nil to an options object
1885
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1886
+
1887
+ # Customize the options with defaults
1888
+ metadata = @config.rpcs.fetch_backups_for_resource_type.metadata.to_h
1889
+
1890
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1891
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1892
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1893
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
1894
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1895
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1896
+
1897
+ header_params = {}
1898
+ if request.parent
1899
+ header_params["parent"] = request.parent
1900
+ end
1901
+
1902
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1903
+ metadata[:"x-goog-request-params"] ||= request_params_header
1904
+
1905
+ options.apply_defaults timeout: @config.rpcs.fetch_backups_for_resource_type.timeout,
1906
+ metadata: metadata,
1907
+ retry_policy: @config.rpcs.fetch_backups_for_resource_type.retry_policy
1908
+
1909
+ options.apply_defaults timeout: @config.timeout,
1910
+ metadata: @config.metadata,
1911
+ retry_policy: @config.retry_policy
1912
+
1913
+ @backup_dr_stub.call_rpc :fetch_backups_for_resource_type, request, options: options do |response, operation|
1914
+ response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :fetch_backups_for_resource_type, request, response, operation, options
1915
+ yield response, operation if block_given?
1916
+ throw :response, response
1917
+ end
1918
+ rescue ::GRPC::BadStatus => e
1919
+ raise ::Google::Cloud::Error.from_error(e)
1920
+ end
1921
+
1802
1922
  ##
1803
1923
  # Gets details of a Backup.
1804
1924
  #
@@ -3830,6 +3950,127 @@ module Google
3830
3950
  raise ::Google::Cloud::Error.from_error(e)
3831
3951
  end
3832
3952
 
3953
+ ##
3954
+ # Lists DataSourceReferences for a given project and location.
3955
+ #
3956
+ # @overload list_data_source_references(request, options = nil)
3957
+ # Pass arguments to `list_data_source_references` via a request object, either of type
3958
+ # {::Google::Cloud::BackupDR::V1::ListDataSourceReferencesRequest} or an equivalent Hash.
3959
+ #
3960
+ # @param request [::Google::Cloud::BackupDR::V1::ListDataSourceReferencesRequest, ::Hash]
3961
+ # A request object representing the call parameters. Required. To specify no
3962
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3963
+ # @param options [::Gapic::CallOptions, ::Hash]
3964
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3965
+ #
3966
+ # @overload list_data_source_references(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
3967
+ # Pass arguments to `list_data_source_references` via keyword arguments. Note that at
3968
+ # least one keyword argument is required. To specify no parameters, or to keep all
3969
+ # the default parameter values, pass an empty Hash as a request object (see above).
3970
+ #
3971
+ # @param parent [::String]
3972
+ # Required. The parent resource name.
3973
+ # Format: projects/\\{project}/locations/\\{location}
3974
+ # @param page_size [::Integer]
3975
+ # Optional. The maximum number of DataSourceReferences to return. The service
3976
+ # may return fewer than this value. If unspecified, at most 50
3977
+ # DataSourceReferences will be returned. The maximum value is 100; values
3978
+ # above 100 will be coerced to 100.
3979
+ # @param page_token [::String]
3980
+ # Optional. A page token, received from a previous `ListDataSourceReferences`
3981
+ # call. Provide this to retrieve the subsequent page.
3982
+ #
3983
+ # When paginating, all other parameters provided to
3984
+ # `ListDataSourceReferences` must match the call that provided the page
3985
+ # token.
3986
+ # @param filter [::String]
3987
+ # Optional. A filter expression that filters the results listed in the
3988
+ # response. The expression must specify the field name, a comparison
3989
+ # operator, and the value that you want to use for filtering.
3990
+ #
3991
+ # The following field and operator combinations are supported:
3992
+ #
3993
+ # * data_source_gcp_resource_info.gcp_resourcename with `=`, `!=`
3994
+ # * data_source_gcp_resource_info.type with `=`, `!=`
3995
+ # @param order_by [::String]
3996
+ # Optional. A comma-separated list of fields to order by, sorted in ascending
3997
+ # order. Use "desc" after a field name for descending.
3998
+ #
3999
+ # Supported fields:
4000
+ #
4001
+ # * data_source
4002
+ # * data_source_gcp_resource_info.gcp_resourcename
4003
+ #
4004
+ # @yield [response, operation] Access the result along with the RPC operation
4005
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSourceReference>]
4006
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4007
+ #
4008
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::BackupDR::V1::DataSourceReference>]
4009
+ #
4010
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
4011
+ #
4012
+ # @example Basic example
4013
+ # require "google/cloud/backupdr/v1"
4014
+ #
4015
+ # # Create a client object. The client can be reused for multiple calls.
4016
+ # client = Google::Cloud::BackupDR::V1::BackupDR::Client.new
4017
+ #
4018
+ # # Create a request. To set request fields, pass in keyword arguments.
4019
+ # request = Google::Cloud::BackupDR::V1::ListDataSourceReferencesRequest.new
4020
+ #
4021
+ # # Call the list_data_source_references method.
4022
+ # result = client.list_data_source_references request
4023
+ #
4024
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
4025
+ # # over elements, and API calls will be issued to fetch pages as needed.
4026
+ # result.each do |item|
4027
+ # # Each element is of type ::Google::Cloud::BackupDR::V1::DataSourceReference.
4028
+ # p item
4029
+ # end
4030
+ #
4031
+ def list_data_source_references request, options = nil
4032
+ raise ::ArgumentError, "request must be provided" if request.nil?
4033
+
4034
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BackupDR::V1::ListDataSourceReferencesRequest
4035
+
4036
+ # Converts hash and nil to an options object
4037
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4038
+
4039
+ # Customize the options with defaults
4040
+ metadata = @config.rpcs.list_data_source_references.metadata.to_h
4041
+
4042
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
4043
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4044
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4045
+ gapic_version: ::Google::Cloud::BackupDR::V1::VERSION
4046
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
4047
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4048
+
4049
+ header_params = {}
4050
+ if request.parent
4051
+ header_params["parent"] = request.parent
4052
+ end
4053
+
4054
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4055
+ metadata[:"x-goog-request-params"] ||= request_params_header
4056
+
4057
+ options.apply_defaults timeout: @config.rpcs.list_data_source_references.timeout,
4058
+ metadata: metadata,
4059
+ retry_policy: @config.rpcs.list_data_source_references.retry_policy
4060
+
4061
+ options.apply_defaults timeout: @config.timeout,
4062
+ metadata: @config.metadata,
4063
+ retry_policy: @config.retry_policy
4064
+
4065
+ @backup_dr_stub.call_rpc :list_data_source_references, request, options: options do |response, operation|
4066
+ response = ::Gapic::PagedEnumerable.new @backup_dr_stub, :list_data_source_references, request, response, operation, options
4067
+ yield response, operation if block_given?
4068
+ throw :response, response
4069
+ end
4070
+ rescue ::GRPC::BadStatus => e
4071
+ raise ::Google::Cloud::Error.from_error(e)
4072
+ end
4073
+
3833
4074
  ##
3834
4075
  # Fetch DataSourceReferences for a given project, location and resource type.
3835
4076
  #
@@ -4109,8 +4350,6 @@ module Google
4109
4350
  # @return [::String,nil]
4110
4351
  # @!attribute [rw] credentials
4111
4352
  # Credentials to send with calls. You may provide any of the following types:
4112
- # * (`String`) The path to a service account key file in JSON format
4113
- # * (`Hash`) A service account key as a Hash
4114
4353
  # * (`Google::Auth::Credentials`) A googleauth credentials object
4115
4354
  # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
4116
4355
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
@@ -4119,7 +4358,26 @@ module Google
4119
4358
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
4120
4359
  # * (`nil`) indicating no credentials
4121
4360
  #
4122
- # Warning: If you accept a credential configuration (JSON file or Hash) from an
4361
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
4362
+ # is deprecated. Providing an unvalidated credential configuration to
4363
+ # Google APIs can compromise the security of your systems and data.
4364
+ #
4365
+ # @example
4366
+ #
4367
+ # # The recommended way to provide credentials is to use the `make_creds` method
4368
+ # # on the appropriate credentials class for your environment.
4369
+ #
4370
+ # require "googleauth"
4371
+ #
4372
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
4373
+ # json_key_io: ::File.open("/path/to/keyfile.json")
4374
+ # )
4375
+ #
4376
+ # client = ::Google::Cloud::BackupDR::V1::BackupDR::Client.new do |config|
4377
+ # config.credentials = credentials
4378
+ # end
4379
+ #
4380
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
4123
4381
  # external source for authentication to Google Cloud, you must validate it before
4124
4382
  # providing it to a Google API client library. Providing an unvalidated credential
4125
4383
  # configuration to Google APIs can compromise the security of your systems and data.
@@ -4311,6 +4569,11 @@ module Google
4311
4569
  #
4312
4570
  attr_reader :list_backups
4313
4571
  ##
4572
+ # RPC-specific configuration for `fetch_backups_for_resource_type`
4573
+ # @return [::Gapic::Config::Method]
4574
+ #
4575
+ attr_reader :fetch_backups_for_resource_type
4576
+ ##
4314
4577
  # RPC-specific configuration for `get_backup`
4315
4578
  # @return [::Gapic::Config::Method]
4316
4579
  #
@@ -4406,6 +4669,11 @@ module Google
4406
4669
  #
4407
4670
  attr_reader :get_data_source_reference
4408
4671
  ##
4672
+ # RPC-specific configuration for `list_data_source_references`
4673
+ # @return [::Gapic::Config::Method]
4674
+ #
4675
+ attr_reader :list_data_source_references
4676
+ ##
4409
4677
  # RPC-specific configuration for `fetch_data_source_references_for_resource_type`
4410
4678
  # @return [::Gapic::Config::Method]
4411
4679
  #
@@ -4446,6 +4714,8 @@ module Google
4446
4714
  @update_data_source = ::Gapic::Config::Method.new update_data_source_config
4447
4715
  list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
4448
4716
  @list_backups = ::Gapic::Config::Method.new list_backups_config
4717
+ fetch_backups_for_resource_type_config = parent_rpcs.fetch_backups_for_resource_type if parent_rpcs.respond_to? :fetch_backups_for_resource_type
4718
+ @fetch_backups_for_resource_type = ::Gapic::Config::Method.new fetch_backups_for_resource_type_config
4449
4719
  get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
4450
4720
  @get_backup = ::Gapic::Config::Method.new get_backup_config
4451
4721
  update_backup_config = parent_rpcs.update_backup if parent_rpcs.respond_to? :update_backup
@@ -4484,6 +4754,8 @@ module Google
4484
4754
  @trigger_backup = ::Gapic::Config::Method.new trigger_backup_config
4485
4755
  get_data_source_reference_config = parent_rpcs.get_data_source_reference if parent_rpcs.respond_to? :get_data_source_reference
4486
4756
  @get_data_source_reference = ::Gapic::Config::Method.new get_data_source_reference_config
4757
+ list_data_source_references_config = parent_rpcs.list_data_source_references if parent_rpcs.respond_to? :list_data_source_references
4758
+ @list_data_source_references = ::Gapic::Config::Method.new list_data_source_references_config
4487
4759
  fetch_data_source_references_for_resource_type_config = parent_rpcs.fetch_data_source_references_for_resource_type if parent_rpcs.respond_to? :fetch_data_source_references_for_resource_type
4488
4760
  @fetch_data_source_references_for_resource_type = ::Gapic::Config::Method.new fetch_data_source_references_for_resource_type_config
4489
4761
  initialize_service_config = parent_rpcs.initialize_service if parent_rpcs.respond_to? :initialize_service
@@ -642,8 +642,6 @@ module Google
642
642
  # @return [::String,nil]
643
643
  # @!attribute [rw] credentials
644
644
  # Credentials to send with calls. You may provide any of the following types:
645
- # * (`String`) The path to a service account key file in JSON format
646
- # * (`Hash`) A service account key as a Hash
647
645
  # * (`Google::Auth::Credentials`) A googleauth credentials object
648
646
  # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
649
647
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
@@ -652,7 +650,26 @@ module Google
652
650
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
653
651
  # * (`nil`) indicating no credentials
654
652
  #
655
- # Warning: If you accept a credential configuration (JSON file or Hash) from an
653
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
654
+ # is deprecated. Providing an unvalidated credential configuration to
655
+ # Google APIs can compromise the security of your systems and data.
656
+ #
657
+ # @example
658
+ #
659
+ # # The recommended way to provide credentials is to use the `make_creds` method
660
+ # # on the appropriate credentials class for your environment.
661
+ #
662
+ # require "googleauth"
663
+ #
664
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
665
+ # json_key_io: ::File.open("/path/to/keyfile.json")
666
+ # )
667
+ #
668
+ # client = ::Google::Longrunning::Operations::Client.new do |config|
669
+ # config.credentials = credentials
670
+ # end
671
+ #
672
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
656
673
  # external source for authentication to Google Cloud, you must validate it before
657
674
  # providing it to a Google API client library. Providing an unvalidated credential
658
675
  # configuration to Google APIs can compromise the security of your systems and data.