google-cloud-spanner-admin-database-v1 0.19.0 → 1.0.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 +4 -4
- data/lib/google/cloud/spanner/admin/database/v1/database_admin/client.rb +524 -0
- data/lib/google/cloud/spanner/admin/database/v1/database_admin/paths.rb +21 -0
- data/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/client.rb +489 -0
- data/lib/google/cloud/spanner/admin/database/v1/database_admin/rest/service_stub.rb +321 -0
- data/lib/google/cloud/spanner/admin/database/v1/version.rb +1 -1
- data/lib/google/spanner/admin/database/v1/backup_pb.rb +2 -1
- data/lib/google/spanner/admin/database/v1/backup_schedule_pb.rb +65 -0
- data/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb +2 -1
- data/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb +10 -0
- data/proto_docs/google/spanner/admin/database/v1/backup.rb +19 -0
- data/proto_docs/google/spanner/admin/database/v1/backup_schedule.rb +213 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1538d1bd5acc4d426a9f2a34c05d31438ebf2e25f1242e1438b5207c9b3d4a6
|
4
|
+
data.tar.gz: 3c5d5da5f170ea982bde13a428808318264b8dc84fb6541b5c4aad83ece1acc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eebb60ecb0562a803b994b18898e63168eced322c7e202749ede696b606d53c611db7fe8ddde3133170eb2fbc3a5d1fc09c1fd28b8658df194d8f28ea2b86162
|
7
|
+
data.tar.gz: 254c5923b662a33c3660607509abc7b76b5674e5cc659edd6c2dc9c2062c957cfa901a0654a5301d409b158b90b9a76fa15a0c60b24bf5cde8ed0fd6a380761d
|
@@ -160,6 +160,31 @@ module Google
|
|
160
160
|
initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
|
161
161
|
}
|
162
162
|
|
163
|
+
default_config.rpcs.create_backup_schedule.timeout = 3600.0
|
164
|
+
default_config.rpcs.create_backup_schedule.retry_policy = {
|
165
|
+
initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
|
166
|
+
}
|
167
|
+
|
168
|
+
default_config.rpcs.get_backup_schedule.timeout = 3600.0
|
169
|
+
default_config.rpcs.get_backup_schedule.retry_policy = {
|
170
|
+
initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
|
171
|
+
}
|
172
|
+
|
173
|
+
default_config.rpcs.update_backup_schedule.timeout = 3600.0
|
174
|
+
default_config.rpcs.update_backup_schedule.retry_policy = {
|
175
|
+
initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
|
176
|
+
}
|
177
|
+
|
178
|
+
default_config.rpcs.delete_backup_schedule.timeout = 3600.0
|
179
|
+
default_config.rpcs.delete_backup_schedule.retry_policy = {
|
180
|
+
initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
|
181
|
+
}
|
182
|
+
|
183
|
+
default_config.rpcs.list_backup_schedules.timeout = 3600.0
|
184
|
+
default_config.rpcs.list_backup_schedules.retry_policy = {
|
185
|
+
initial_delay: 1.0, max_delay: 32.0, multiplier: 1.3, retry_codes: [14, 4]
|
186
|
+
}
|
187
|
+
|
163
188
|
default_config
|
164
189
|
end
|
165
190
|
yield @configure if block_given?
|
@@ -2579,6 +2604,470 @@ module Google
|
|
2579
2604
|
raise ::Google::Cloud::Error.from_error(e)
|
2580
2605
|
end
|
2581
2606
|
|
2607
|
+
##
|
2608
|
+
# Creates a new backup schedule.
|
2609
|
+
#
|
2610
|
+
# @overload create_backup_schedule(request, options = nil)
|
2611
|
+
# Pass arguments to `create_backup_schedule` via a request object, either of type
|
2612
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest} or an equivalent Hash.
|
2613
|
+
#
|
2614
|
+
# @param request [::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest, ::Hash]
|
2615
|
+
# A request object representing the call parameters. Required. To specify no
|
2616
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2617
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2618
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2619
|
+
#
|
2620
|
+
# @overload create_backup_schedule(parent: nil, backup_schedule_id: nil, backup_schedule: nil)
|
2621
|
+
# Pass arguments to `create_backup_schedule` via keyword arguments. Note that at
|
2622
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2623
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2624
|
+
#
|
2625
|
+
# @param parent [::String]
|
2626
|
+
# Required. The name of the database that this backup schedule applies to.
|
2627
|
+
# @param backup_schedule_id [::String]
|
2628
|
+
# Required. The Id to use for the backup schedule. The `backup_schedule_id`
|
2629
|
+
# appended to `parent` forms the full backup schedule name of the form
|
2630
|
+
# `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
|
2631
|
+
# @param backup_schedule [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule, ::Hash]
|
2632
|
+
# Required. The backup schedule to create.
|
2633
|
+
#
|
2634
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2635
|
+
# @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule]
|
2636
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2637
|
+
#
|
2638
|
+
# @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule]
|
2639
|
+
#
|
2640
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2641
|
+
#
|
2642
|
+
# @example Basic example
|
2643
|
+
# require "google/cloud/spanner/admin/database/v1"
|
2644
|
+
#
|
2645
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2646
|
+
# client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new
|
2647
|
+
#
|
2648
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2649
|
+
# request = Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest.new
|
2650
|
+
#
|
2651
|
+
# # Call the create_backup_schedule method.
|
2652
|
+
# result = client.create_backup_schedule request
|
2653
|
+
#
|
2654
|
+
# # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.
|
2655
|
+
# p result
|
2656
|
+
#
|
2657
|
+
def create_backup_schedule request, options = nil
|
2658
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2659
|
+
|
2660
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::CreateBackupScheduleRequest
|
2661
|
+
|
2662
|
+
# Converts hash and nil to an options object
|
2663
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2664
|
+
|
2665
|
+
# Customize the options with defaults
|
2666
|
+
metadata = @config.rpcs.create_backup_schedule.metadata.to_h
|
2667
|
+
|
2668
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2669
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2670
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2671
|
+
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION
|
2672
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2673
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2674
|
+
|
2675
|
+
header_params = {}
|
2676
|
+
if request.parent
|
2677
|
+
header_params["parent"] = request.parent
|
2678
|
+
end
|
2679
|
+
|
2680
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2681
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2682
|
+
|
2683
|
+
options.apply_defaults timeout: @config.rpcs.create_backup_schedule.timeout,
|
2684
|
+
metadata: metadata,
|
2685
|
+
retry_policy: @config.rpcs.create_backup_schedule.retry_policy
|
2686
|
+
|
2687
|
+
options.apply_defaults timeout: @config.timeout,
|
2688
|
+
metadata: @config.metadata,
|
2689
|
+
retry_policy: @config.retry_policy
|
2690
|
+
|
2691
|
+
@database_admin_stub.call_rpc :create_backup_schedule, request, options: options do |response, operation|
|
2692
|
+
yield response, operation if block_given?
|
2693
|
+
return response
|
2694
|
+
end
|
2695
|
+
rescue ::GRPC::BadStatus => e
|
2696
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2697
|
+
end
|
2698
|
+
|
2699
|
+
##
|
2700
|
+
# Gets backup schedule for the input schedule name.
|
2701
|
+
#
|
2702
|
+
# @overload get_backup_schedule(request, options = nil)
|
2703
|
+
# Pass arguments to `get_backup_schedule` via a request object, either of type
|
2704
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest} or an equivalent Hash.
|
2705
|
+
#
|
2706
|
+
# @param request [::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest, ::Hash]
|
2707
|
+
# A request object representing the call parameters. Required. To specify no
|
2708
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2709
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2710
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2711
|
+
#
|
2712
|
+
# @overload get_backup_schedule(name: nil)
|
2713
|
+
# Pass arguments to `get_backup_schedule` via keyword arguments. Note that at
|
2714
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2715
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2716
|
+
#
|
2717
|
+
# @param name [::String]
|
2718
|
+
# Required. The name of the schedule to retrieve.
|
2719
|
+
# Values are of the form
|
2720
|
+
# `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
|
2721
|
+
#
|
2722
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2723
|
+
# @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule]
|
2724
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2725
|
+
#
|
2726
|
+
# @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule]
|
2727
|
+
#
|
2728
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2729
|
+
#
|
2730
|
+
# @example Basic example
|
2731
|
+
# require "google/cloud/spanner/admin/database/v1"
|
2732
|
+
#
|
2733
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2734
|
+
# client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new
|
2735
|
+
#
|
2736
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2737
|
+
# request = Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest.new
|
2738
|
+
#
|
2739
|
+
# # Call the get_backup_schedule method.
|
2740
|
+
# result = client.get_backup_schedule request
|
2741
|
+
#
|
2742
|
+
# # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.
|
2743
|
+
# p result
|
2744
|
+
#
|
2745
|
+
def get_backup_schedule request, options = nil
|
2746
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2747
|
+
|
2748
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::GetBackupScheduleRequest
|
2749
|
+
|
2750
|
+
# Converts hash and nil to an options object
|
2751
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2752
|
+
|
2753
|
+
# Customize the options with defaults
|
2754
|
+
metadata = @config.rpcs.get_backup_schedule.metadata.to_h
|
2755
|
+
|
2756
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2757
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2758
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2759
|
+
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION
|
2760
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2761
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2762
|
+
|
2763
|
+
header_params = {}
|
2764
|
+
if request.name
|
2765
|
+
header_params["name"] = request.name
|
2766
|
+
end
|
2767
|
+
|
2768
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2769
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2770
|
+
|
2771
|
+
options.apply_defaults timeout: @config.rpcs.get_backup_schedule.timeout,
|
2772
|
+
metadata: metadata,
|
2773
|
+
retry_policy: @config.rpcs.get_backup_schedule.retry_policy
|
2774
|
+
|
2775
|
+
options.apply_defaults timeout: @config.timeout,
|
2776
|
+
metadata: @config.metadata,
|
2777
|
+
retry_policy: @config.retry_policy
|
2778
|
+
|
2779
|
+
@database_admin_stub.call_rpc :get_backup_schedule, request, options: options do |response, operation|
|
2780
|
+
yield response, operation if block_given?
|
2781
|
+
return response
|
2782
|
+
end
|
2783
|
+
rescue ::GRPC::BadStatus => e
|
2784
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2785
|
+
end
|
2786
|
+
|
2787
|
+
##
|
2788
|
+
# Updates a backup schedule.
|
2789
|
+
#
|
2790
|
+
# @overload update_backup_schedule(request, options = nil)
|
2791
|
+
# Pass arguments to `update_backup_schedule` via a request object, either of type
|
2792
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest} or an equivalent Hash.
|
2793
|
+
#
|
2794
|
+
# @param request [::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest, ::Hash]
|
2795
|
+
# A request object representing the call parameters. Required. To specify no
|
2796
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2797
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2798
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2799
|
+
#
|
2800
|
+
# @overload update_backup_schedule(backup_schedule: nil, update_mask: nil)
|
2801
|
+
# Pass arguments to `update_backup_schedule` via keyword arguments. Note that at
|
2802
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2803
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2804
|
+
#
|
2805
|
+
# @param backup_schedule [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule, ::Hash]
|
2806
|
+
# Required. The backup schedule to update. `backup_schedule.name`, and the
|
2807
|
+
# fields to be updated as specified by `update_mask` are required. Other
|
2808
|
+
# fields are ignored.
|
2809
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
2810
|
+
# Required. A mask specifying which fields in the BackupSchedule resource
|
2811
|
+
# should be updated. This mask is relative to the BackupSchedule resource,
|
2812
|
+
# not to the request message. The field mask must always be
|
2813
|
+
# specified; this prevents any future fields from being erased
|
2814
|
+
# accidentally.
|
2815
|
+
#
|
2816
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2817
|
+
# @yieldparam response [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule]
|
2818
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2819
|
+
#
|
2820
|
+
# @return [::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule]
|
2821
|
+
#
|
2822
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2823
|
+
#
|
2824
|
+
# @example Basic example
|
2825
|
+
# require "google/cloud/spanner/admin/database/v1"
|
2826
|
+
#
|
2827
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2828
|
+
# client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new
|
2829
|
+
#
|
2830
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2831
|
+
# request = Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest.new
|
2832
|
+
#
|
2833
|
+
# # Call the update_backup_schedule method.
|
2834
|
+
# result = client.update_backup_schedule request
|
2835
|
+
#
|
2836
|
+
# # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.
|
2837
|
+
# p result
|
2838
|
+
#
|
2839
|
+
def update_backup_schedule request, options = nil
|
2840
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2841
|
+
|
2842
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupScheduleRequest
|
2843
|
+
|
2844
|
+
# Converts hash and nil to an options object
|
2845
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2846
|
+
|
2847
|
+
# Customize the options with defaults
|
2848
|
+
metadata = @config.rpcs.update_backup_schedule.metadata.to_h
|
2849
|
+
|
2850
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2851
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2852
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2853
|
+
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION
|
2854
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2855
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2856
|
+
|
2857
|
+
header_params = {}
|
2858
|
+
if request.backup_schedule&.name
|
2859
|
+
header_params["backup_schedule.name"] = request.backup_schedule.name
|
2860
|
+
end
|
2861
|
+
|
2862
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2863
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2864
|
+
|
2865
|
+
options.apply_defaults timeout: @config.rpcs.update_backup_schedule.timeout,
|
2866
|
+
metadata: metadata,
|
2867
|
+
retry_policy: @config.rpcs.update_backup_schedule.retry_policy
|
2868
|
+
|
2869
|
+
options.apply_defaults timeout: @config.timeout,
|
2870
|
+
metadata: @config.metadata,
|
2871
|
+
retry_policy: @config.retry_policy
|
2872
|
+
|
2873
|
+
@database_admin_stub.call_rpc :update_backup_schedule, request, options: options do |response, operation|
|
2874
|
+
yield response, operation if block_given?
|
2875
|
+
return response
|
2876
|
+
end
|
2877
|
+
rescue ::GRPC::BadStatus => e
|
2878
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2879
|
+
end
|
2880
|
+
|
2881
|
+
##
|
2882
|
+
# Deletes a backup schedule.
|
2883
|
+
#
|
2884
|
+
# @overload delete_backup_schedule(request, options = nil)
|
2885
|
+
# Pass arguments to `delete_backup_schedule` via a request object, either of type
|
2886
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest} or an equivalent Hash.
|
2887
|
+
#
|
2888
|
+
# @param request [::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest, ::Hash]
|
2889
|
+
# A request object representing the call parameters. Required. To specify no
|
2890
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2891
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2892
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2893
|
+
#
|
2894
|
+
# @overload delete_backup_schedule(name: nil)
|
2895
|
+
# Pass arguments to `delete_backup_schedule` via keyword arguments. Note that at
|
2896
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2897
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2898
|
+
#
|
2899
|
+
# @param name [::String]
|
2900
|
+
# Required. The name of the schedule to delete.
|
2901
|
+
# Values are of the form
|
2902
|
+
# `projects/<project>/instances/<instance>/databases/<database>/backupSchedules/<backup_schedule_id>`.
|
2903
|
+
#
|
2904
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2905
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
2906
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2907
|
+
#
|
2908
|
+
# @return [::Google::Protobuf::Empty]
|
2909
|
+
#
|
2910
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2911
|
+
#
|
2912
|
+
# @example Basic example
|
2913
|
+
# require "google/cloud/spanner/admin/database/v1"
|
2914
|
+
#
|
2915
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2916
|
+
# client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new
|
2917
|
+
#
|
2918
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2919
|
+
# request = Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest.new
|
2920
|
+
#
|
2921
|
+
# # Call the delete_backup_schedule method.
|
2922
|
+
# result = client.delete_backup_schedule request
|
2923
|
+
#
|
2924
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
2925
|
+
# p result
|
2926
|
+
#
|
2927
|
+
def delete_backup_schedule request, options = nil
|
2928
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2929
|
+
|
2930
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupScheduleRequest
|
2931
|
+
|
2932
|
+
# Converts hash and nil to an options object
|
2933
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2934
|
+
|
2935
|
+
# Customize the options with defaults
|
2936
|
+
metadata = @config.rpcs.delete_backup_schedule.metadata.to_h
|
2937
|
+
|
2938
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2939
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2940
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2941
|
+
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION
|
2942
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2943
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2944
|
+
|
2945
|
+
header_params = {}
|
2946
|
+
if request.name
|
2947
|
+
header_params["name"] = request.name
|
2948
|
+
end
|
2949
|
+
|
2950
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2951
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2952
|
+
|
2953
|
+
options.apply_defaults timeout: @config.rpcs.delete_backup_schedule.timeout,
|
2954
|
+
metadata: metadata,
|
2955
|
+
retry_policy: @config.rpcs.delete_backup_schedule.retry_policy
|
2956
|
+
|
2957
|
+
options.apply_defaults timeout: @config.timeout,
|
2958
|
+
metadata: @config.metadata,
|
2959
|
+
retry_policy: @config.retry_policy
|
2960
|
+
|
2961
|
+
@database_admin_stub.call_rpc :delete_backup_schedule, request, options: options do |response, operation|
|
2962
|
+
yield response, operation if block_given?
|
2963
|
+
return response
|
2964
|
+
end
|
2965
|
+
rescue ::GRPC::BadStatus => e
|
2966
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2967
|
+
end
|
2968
|
+
|
2969
|
+
##
|
2970
|
+
# Lists all the backup schedules for the database.
|
2971
|
+
#
|
2972
|
+
# @overload list_backup_schedules(request, options = nil)
|
2973
|
+
# Pass arguments to `list_backup_schedules` via a request object, either of type
|
2974
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest} or an equivalent Hash.
|
2975
|
+
#
|
2976
|
+
# @param request [::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest, ::Hash]
|
2977
|
+
# A request object representing the call parameters. Required. To specify no
|
2978
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2979
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2980
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2981
|
+
#
|
2982
|
+
# @overload list_backup_schedules(parent: nil, page_size: nil, page_token: nil)
|
2983
|
+
# Pass arguments to `list_backup_schedules` via keyword arguments. Note that at
|
2984
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2985
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2986
|
+
#
|
2987
|
+
# @param parent [::String]
|
2988
|
+
# Required. Database is the parent resource whose backup schedules should be
|
2989
|
+
# listed. Values are of the form
|
2990
|
+
# projects/<project>/instances/<instance>/databases/<database>
|
2991
|
+
# @param page_size [::Integer]
|
2992
|
+
# Optional. Number of backup schedules to be returned in the response. If 0
|
2993
|
+
# or less, defaults to the server's maximum allowed page size.
|
2994
|
+
# @param page_token [::String]
|
2995
|
+
# Optional. If non-empty, `page_token` should contain a
|
2996
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse#next_page_token next_page_token}
|
2997
|
+
# from a previous
|
2998
|
+
# {::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesResponse ListBackupSchedulesResponse}
|
2999
|
+
# to the same `parent`.
|
3000
|
+
#
|
3001
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
3002
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule>]
|
3003
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
3004
|
+
#
|
3005
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule>]
|
3006
|
+
#
|
3007
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
3008
|
+
#
|
3009
|
+
# @example Basic example
|
3010
|
+
# require "google/cloud/spanner/admin/database/v1"
|
3011
|
+
#
|
3012
|
+
# # Create a client object. The client can be reused for multiple calls.
|
3013
|
+
# client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new
|
3014
|
+
#
|
3015
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
3016
|
+
# request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest.new
|
3017
|
+
#
|
3018
|
+
# # Call the list_backup_schedules method.
|
3019
|
+
# result = client.list_backup_schedules request
|
3020
|
+
#
|
3021
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
3022
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
3023
|
+
# result.each do |item|
|
3024
|
+
# # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::BackupSchedule.
|
3025
|
+
# p item
|
3026
|
+
# end
|
3027
|
+
#
|
3028
|
+
def list_backup_schedules request, options = nil
|
3029
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
3030
|
+
|
3031
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Database::V1::ListBackupSchedulesRequest
|
3032
|
+
|
3033
|
+
# Converts hash and nil to an options object
|
3034
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
3035
|
+
|
3036
|
+
# Customize the options with defaults
|
3037
|
+
metadata = @config.rpcs.list_backup_schedules.metadata.to_h
|
3038
|
+
|
3039
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
3040
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
3041
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
3042
|
+
gapic_version: ::Google::Cloud::Spanner::Admin::Database::V1::VERSION
|
3043
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
3044
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
3045
|
+
|
3046
|
+
header_params = {}
|
3047
|
+
if request.parent
|
3048
|
+
header_params["parent"] = request.parent
|
3049
|
+
end
|
3050
|
+
|
3051
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
3052
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
3053
|
+
|
3054
|
+
options.apply_defaults timeout: @config.rpcs.list_backup_schedules.timeout,
|
3055
|
+
metadata: metadata,
|
3056
|
+
retry_policy: @config.rpcs.list_backup_schedules.retry_policy
|
3057
|
+
|
3058
|
+
options.apply_defaults timeout: @config.timeout,
|
3059
|
+
metadata: @config.metadata,
|
3060
|
+
retry_policy: @config.retry_policy
|
3061
|
+
|
3062
|
+
@database_admin_stub.call_rpc :list_backup_schedules, request, options: options do |response, operation|
|
3063
|
+
response = ::Gapic::PagedEnumerable.new @database_admin_stub, :list_backup_schedules, request, response, operation, options
|
3064
|
+
yield response, operation if block_given?
|
3065
|
+
return response
|
3066
|
+
end
|
3067
|
+
rescue ::GRPC::BadStatus => e
|
3068
|
+
raise ::Google::Cloud::Error.from_error(e)
|
3069
|
+
end
|
3070
|
+
|
2582
3071
|
##
|
2583
3072
|
# Configuration class for the DatabaseAdmin API.
|
2584
3073
|
#
|
@@ -2832,6 +3321,31 @@ module Google
|
|
2832
3321
|
# @return [::Gapic::Config::Method]
|
2833
3322
|
#
|
2834
3323
|
attr_reader :list_database_roles
|
3324
|
+
##
|
3325
|
+
# RPC-specific configuration for `create_backup_schedule`
|
3326
|
+
# @return [::Gapic::Config::Method]
|
3327
|
+
#
|
3328
|
+
attr_reader :create_backup_schedule
|
3329
|
+
##
|
3330
|
+
# RPC-specific configuration for `get_backup_schedule`
|
3331
|
+
# @return [::Gapic::Config::Method]
|
3332
|
+
#
|
3333
|
+
attr_reader :get_backup_schedule
|
3334
|
+
##
|
3335
|
+
# RPC-specific configuration for `update_backup_schedule`
|
3336
|
+
# @return [::Gapic::Config::Method]
|
3337
|
+
#
|
3338
|
+
attr_reader :update_backup_schedule
|
3339
|
+
##
|
3340
|
+
# RPC-specific configuration for `delete_backup_schedule`
|
3341
|
+
# @return [::Gapic::Config::Method]
|
3342
|
+
#
|
3343
|
+
attr_reader :delete_backup_schedule
|
3344
|
+
##
|
3345
|
+
# RPC-specific configuration for `list_backup_schedules`
|
3346
|
+
# @return [::Gapic::Config::Method]
|
3347
|
+
#
|
3348
|
+
attr_reader :list_backup_schedules
|
2835
3349
|
|
2836
3350
|
# @private
|
2837
3351
|
def initialize parent_rpcs = nil
|
@@ -2875,6 +3389,16 @@ module Google
|
|
2875
3389
|
@list_backup_operations = ::Gapic::Config::Method.new list_backup_operations_config
|
2876
3390
|
list_database_roles_config = parent_rpcs.list_database_roles if parent_rpcs.respond_to? :list_database_roles
|
2877
3391
|
@list_database_roles = ::Gapic::Config::Method.new list_database_roles_config
|
3392
|
+
create_backup_schedule_config = parent_rpcs.create_backup_schedule if parent_rpcs.respond_to? :create_backup_schedule
|
3393
|
+
@create_backup_schedule = ::Gapic::Config::Method.new create_backup_schedule_config
|
3394
|
+
get_backup_schedule_config = parent_rpcs.get_backup_schedule if parent_rpcs.respond_to? :get_backup_schedule
|
3395
|
+
@get_backup_schedule = ::Gapic::Config::Method.new get_backup_schedule_config
|
3396
|
+
update_backup_schedule_config = parent_rpcs.update_backup_schedule if parent_rpcs.respond_to? :update_backup_schedule
|
3397
|
+
@update_backup_schedule = ::Gapic::Config::Method.new update_backup_schedule_config
|
3398
|
+
delete_backup_schedule_config = parent_rpcs.delete_backup_schedule if parent_rpcs.respond_to? :delete_backup_schedule
|
3399
|
+
@delete_backup_schedule = ::Gapic::Config::Method.new delete_backup_schedule_config
|
3400
|
+
list_backup_schedules_config = parent_rpcs.list_backup_schedules if parent_rpcs.respond_to? :list_backup_schedules
|
3401
|
+
@list_backup_schedules = ::Gapic::Config::Method.new list_backup_schedules_config
|
2878
3402
|
|
2879
3403
|
yield self if block_given?
|
2880
3404
|
end
|
@@ -45,6 +45,27 @@ module Google
|
|
45
45
|
"projects/#{project}/instances/#{instance}/backups/#{backup}"
|
46
46
|
end
|
47
47
|
|
48
|
+
##
|
49
|
+
# Create a fully-qualified BackupSchedule resource string.
|
50
|
+
#
|
51
|
+
# The resource will be in the following format:
|
52
|
+
#
|
53
|
+
# `projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}`
|
54
|
+
#
|
55
|
+
# @param project [String]
|
56
|
+
# @param instance [String]
|
57
|
+
# @param database [String]
|
58
|
+
# @param schedule [String]
|
59
|
+
#
|
60
|
+
# @return [::String]
|
61
|
+
def backup_schedule_path project:, instance:, database:, schedule:
|
62
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
63
|
+
raise ::ArgumentError, "instance cannot contain /" if instance.to_s.include? "/"
|
64
|
+
raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/"
|
65
|
+
|
66
|
+
"projects/#{project}/instances/#{instance}/databases/#{database}/backupSchedules/#{schedule}"
|
67
|
+
end
|
68
|
+
|
48
69
|
##
|
49
70
|
# Create a fully-qualified CryptoKey resource string.
|
50
71
|
#
|