google-cloud-orchestration-airflow-service-v1 0.6.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb +509 -1
- data/lib/google/cloud/orchestration/airflow/service/v1/environments/operations.rb +10 -1
- data/lib/google/cloud/orchestration/airflow/service/v1/environments/rest/client.rb +615 -0
- data/lib/google/cloud/orchestration/airflow/service/v1/environments/rest/operations.rb +75 -0
- data/lib/google/cloud/orchestration/airflow/service/v1/environments/rest/service_stub.rb +299 -0
- data/lib/google/cloud/orchestration/airflow/service/v1/environments_pb.rb +14 -1
- data/lib/google/cloud/orchestration/airflow/service/v1/environments_services_pb.rb +10 -0
- data/lib/google/cloud/orchestration/airflow/service/v1/image_versions/client.rb +10 -1
- data/lib/google/cloud/orchestration/airflow/service/v1/image_versions/rest/client.rb +20 -0
- data/lib/google/cloud/orchestration/airflow/service/v1/operations_pb.rb +1 -1
- data/lib/google/cloud/orchestration/airflow/service/v1/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +14 -0
- data/proto_docs/google/cloud/orchestration/airflow/service/v1/environments.rb +197 -0
- data/proto_docs/google/cloud/orchestration/airflow/service/v1/operations.rb +4 -0
- metadata +5 -5
@@ -180,6 +180,29 @@ module Google
|
|
180
180
|
# @return [::Gapic::Operation]
|
181
181
|
#
|
182
182
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
183
|
+
#
|
184
|
+
# @example Basic example
|
185
|
+
# require "google/cloud/orchestration/airflow/service/v1"
|
186
|
+
#
|
187
|
+
# # Create a client object. The client can be reused for multiple calls.
|
188
|
+
# client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Rest::Client.new
|
189
|
+
#
|
190
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
191
|
+
# request = Google::Cloud::Orchestration::Airflow::Service::V1::CreateEnvironmentRequest.new
|
192
|
+
#
|
193
|
+
# # Call the create_environment method.
|
194
|
+
# result = client.create_environment request
|
195
|
+
#
|
196
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
197
|
+
# # check the status of an operation, cancel it, or wait for results.
|
198
|
+
# # Here is how to wait for a response.
|
199
|
+
# result.wait_until_done! timeout: 60
|
200
|
+
# if result.response?
|
201
|
+
# p result.response
|
202
|
+
# else
|
203
|
+
# puts "No response received."
|
204
|
+
# end
|
205
|
+
#
|
183
206
|
def create_environment request, options = nil
|
184
207
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
185
208
|
|
@@ -244,6 +267,22 @@ module Google
|
|
244
267
|
# @return [::Google::Cloud::Orchestration::Airflow::Service::V1::Environment]
|
245
268
|
#
|
246
269
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
270
|
+
#
|
271
|
+
# @example Basic example
|
272
|
+
# require "google/cloud/orchestration/airflow/service/v1"
|
273
|
+
#
|
274
|
+
# # Create a client object. The client can be reused for multiple calls.
|
275
|
+
# client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Rest::Client.new
|
276
|
+
#
|
277
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
278
|
+
# request = Google::Cloud::Orchestration::Airflow::Service::V1::GetEnvironmentRequest.new
|
279
|
+
#
|
280
|
+
# # Call the get_environment method.
|
281
|
+
# result = client.get_environment request
|
282
|
+
#
|
283
|
+
# # The returned object is of type Google::Cloud::Orchestration::Airflow::Service::V1::Environment.
|
284
|
+
# p result
|
285
|
+
#
|
247
286
|
def get_environment request, options = nil
|
248
287
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
249
288
|
|
@@ -311,6 +350,26 @@ module Google
|
|
311
350
|
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Orchestration::Airflow::Service::V1::Environment>]
|
312
351
|
#
|
313
352
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
353
|
+
#
|
354
|
+
# @example Basic example
|
355
|
+
# require "google/cloud/orchestration/airflow/service/v1"
|
356
|
+
#
|
357
|
+
# # Create a client object. The client can be reused for multiple calls.
|
358
|
+
# client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Rest::Client.new
|
359
|
+
#
|
360
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
361
|
+
# request = Google::Cloud::Orchestration::Airflow::Service::V1::ListEnvironmentsRequest.new
|
362
|
+
#
|
363
|
+
# # Call the list_environments method.
|
364
|
+
# result = client.list_environments request
|
365
|
+
#
|
366
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
367
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
368
|
+
# result.each do |item|
|
369
|
+
# # Each element is of type ::Google::Cloud::Orchestration::Airflow::Service::V1::Environment.
|
370
|
+
# p item
|
371
|
+
# end
|
372
|
+
#
|
314
373
|
def list_environments request, options = nil
|
315
374
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
316
375
|
|
@@ -502,6 +561,29 @@ module Google
|
|
502
561
|
# @return [::Gapic::Operation]
|
503
562
|
#
|
504
563
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
564
|
+
#
|
565
|
+
# @example Basic example
|
566
|
+
# require "google/cloud/orchestration/airflow/service/v1"
|
567
|
+
#
|
568
|
+
# # Create a client object. The client can be reused for multiple calls.
|
569
|
+
# client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Rest::Client.new
|
570
|
+
#
|
571
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
572
|
+
# request = Google::Cloud::Orchestration::Airflow::Service::V1::UpdateEnvironmentRequest.new
|
573
|
+
#
|
574
|
+
# # Call the update_environment method.
|
575
|
+
# result = client.update_environment request
|
576
|
+
#
|
577
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
578
|
+
# # check the status of an operation, cancel it, or wait for results.
|
579
|
+
# # Here is how to wait for a response.
|
580
|
+
# result.wait_until_done! timeout: 60
|
581
|
+
# if result.response?
|
582
|
+
# p result.response
|
583
|
+
# else
|
584
|
+
# puts "No response received."
|
585
|
+
# end
|
586
|
+
#
|
505
587
|
def update_environment request, options = nil
|
506
588
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
507
589
|
|
@@ -566,6 +648,29 @@ module Google
|
|
566
648
|
# @return [::Gapic::Operation]
|
567
649
|
#
|
568
650
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
651
|
+
#
|
652
|
+
# @example Basic example
|
653
|
+
# require "google/cloud/orchestration/airflow/service/v1"
|
654
|
+
#
|
655
|
+
# # Create a client object. The client can be reused for multiple calls.
|
656
|
+
# client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Rest::Client.new
|
657
|
+
#
|
658
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
659
|
+
# request = Google::Cloud::Orchestration::Airflow::Service::V1::DeleteEnvironmentRequest.new
|
660
|
+
#
|
661
|
+
# # Call the delete_environment method.
|
662
|
+
# result = client.delete_environment request
|
663
|
+
#
|
664
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
665
|
+
# # check the status of an operation, cancel it, or wait for results.
|
666
|
+
# # Here is how to wait for a response.
|
667
|
+
# result.wait_until_done! timeout: 60
|
668
|
+
# if result.response?
|
669
|
+
# p result.response
|
670
|
+
# else
|
671
|
+
# puts "No response received."
|
672
|
+
# end
|
673
|
+
#
|
569
674
|
def delete_environment request, options = nil
|
570
675
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
571
676
|
|
@@ -602,6 +707,269 @@ module Google
|
|
602
707
|
raise ::Google::Cloud::Error.from_error(e)
|
603
708
|
end
|
604
709
|
|
710
|
+
##
|
711
|
+
# Executes Airflow CLI command.
|
712
|
+
#
|
713
|
+
# @overload execute_airflow_command(request, options = nil)
|
714
|
+
# Pass arguments to `execute_airflow_command` via a request object, either of type
|
715
|
+
# {::Google::Cloud::Orchestration::Airflow::Service::V1::ExecuteAirflowCommandRequest} or an equivalent Hash.
|
716
|
+
#
|
717
|
+
# @param request [::Google::Cloud::Orchestration::Airflow::Service::V1::ExecuteAirflowCommandRequest, ::Hash]
|
718
|
+
# A request object representing the call parameters. Required. To specify no
|
719
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
720
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
721
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
722
|
+
#
|
723
|
+
# @overload execute_airflow_command(environment: nil, command: nil, subcommand: nil, parameters: nil)
|
724
|
+
# Pass arguments to `execute_airflow_command` via keyword arguments. Note that at
|
725
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
726
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
727
|
+
#
|
728
|
+
# @param environment [::String]
|
729
|
+
# The resource name of the environment in the form:
|
730
|
+
# "projects/\\{projectId}/locations/\\{locationId}/environments/\\{environmentId}".
|
731
|
+
# @param command [::String]
|
732
|
+
# Airflow command.
|
733
|
+
# @param subcommand [::String]
|
734
|
+
# Airflow subcommand.
|
735
|
+
# @param parameters [::Array<::String>]
|
736
|
+
# Parameters for the Airflow command/subcommand as an array of arguments.
|
737
|
+
# It may contain positional arguments like `["my-dag-id"]`, key-value
|
738
|
+
# parameters like `["--foo=bar"]` or `["--foo","bar"]`,
|
739
|
+
# or other flags like `["-f"]`.
|
740
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
741
|
+
# @yieldparam result [::Google::Cloud::Orchestration::Airflow::Service::V1::ExecuteAirflowCommandResponse]
|
742
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
743
|
+
#
|
744
|
+
# @return [::Google::Cloud::Orchestration::Airflow::Service::V1::ExecuteAirflowCommandResponse]
|
745
|
+
#
|
746
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
747
|
+
#
|
748
|
+
# @example Basic example
|
749
|
+
# require "google/cloud/orchestration/airflow/service/v1"
|
750
|
+
#
|
751
|
+
# # Create a client object. The client can be reused for multiple calls.
|
752
|
+
# client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Rest::Client.new
|
753
|
+
#
|
754
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
755
|
+
# request = Google::Cloud::Orchestration::Airflow::Service::V1::ExecuteAirflowCommandRequest.new
|
756
|
+
#
|
757
|
+
# # Call the execute_airflow_command method.
|
758
|
+
# result = client.execute_airflow_command request
|
759
|
+
#
|
760
|
+
# # The returned object is of type Google::Cloud::Orchestration::Airflow::Service::V1::ExecuteAirflowCommandResponse.
|
761
|
+
# p result
|
762
|
+
#
|
763
|
+
def execute_airflow_command request, options = nil
|
764
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
765
|
+
|
766
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::ExecuteAirflowCommandRequest
|
767
|
+
|
768
|
+
# Converts hash and nil to an options object
|
769
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
770
|
+
|
771
|
+
# Customize the options with defaults
|
772
|
+
call_metadata = @config.rpcs.execute_airflow_command.metadata.to_h
|
773
|
+
|
774
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
775
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
776
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
777
|
+
gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION,
|
778
|
+
transports_version_send: [:rest]
|
779
|
+
|
780
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
781
|
+
|
782
|
+
options.apply_defaults timeout: @config.rpcs.execute_airflow_command.timeout,
|
783
|
+
metadata: call_metadata,
|
784
|
+
retry_policy: @config.rpcs.execute_airflow_command.retry_policy
|
785
|
+
|
786
|
+
options.apply_defaults timeout: @config.timeout,
|
787
|
+
metadata: @config.metadata,
|
788
|
+
retry_policy: @config.retry_policy
|
789
|
+
|
790
|
+
@environments_stub.execute_airflow_command request, options do |result, operation|
|
791
|
+
yield result, operation if block_given?
|
792
|
+
return result
|
793
|
+
end
|
794
|
+
rescue ::Gapic::Rest::Error => e
|
795
|
+
raise ::Google::Cloud::Error.from_error(e)
|
796
|
+
end
|
797
|
+
|
798
|
+
##
|
799
|
+
# Stops Airflow CLI command execution.
|
800
|
+
#
|
801
|
+
# @overload stop_airflow_command(request, options = nil)
|
802
|
+
# Pass arguments to `stop_airflow_command` via a request object, either of type
|
803
|
+
# {::Google::Cloud::Orchestration::Airflow::Service::V1::StopAirflowCommandRequest} or an equivalent Hash.
|
804
|
+
#
|
805
|
+
# @param request [::Google::Cloud::Orchestration::Airflow::Service::V1::StopAirflowCommandRequest, ::Hash]
|
806
|
+
# A request object representing the call parameters. Required. To specify no
|
807
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
808
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
809
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
810
|
+
#
|
811
|
+
# @overload stop_airflow_command(environment: nil, execution_id: nil, pod: nil, pod_namespace: nil, force: nil)
|
812
|
+
# Pass arguments to `stop_airflow_command` via keyword arguments. Note that at
|
813
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
814
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
815
|
+
#
|
816
|
+
# @param environment [::String]
|
817
|
+
# The resource name of the environment in the form:
|
818
|
+
# "projects/\\{projectId}/locations/\\{locationId}/environments/\\{environmentId}".
|
819
|
+
# @param execution_id [::String]
|
820
|
+
# The unique ID of the command execution.
|
821
|
+
# @param pod [::String]
|
822
|
+
# The name of the pod where the command is executed.
|
823
|
+
# @param pod_namespace [::String]
|
824
|
+
# The namespace of the pod where the command is executed.
|
825
|
+
# @param force [::Boolean]
|
826
|
+
# If true, the execution is terminated forcefully (SIGKILL). If false, the
|
827
|
+
# execution is stopped gracefully, giving it time for cleanup.
|
828
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
829
|
+
# @yieldparam result [::Google::Cloud::Orchestration::Airflow::Service::V1::StopAirflowCommandResponse]
|
830
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
831
|
+
#
|
832
|
+
# @return [::Google::Cloud::Orchestration::Airflow::Service::V1::StopAirflowCommandResponse]
|
833
|
+
#
|
834
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
835
|
+
#
|
836
|
+
# @example Basic example
|
837
|
+
# require "google/cloud/orchestration/airflow/service/v1"
|
838
|
+
#
|
839
|
+
# # Create a client object. The client can be reused for multiple calls.
|
840
|
+
# client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Rest::Client.new
|
841
|
+
#
|
842
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
843
|
+
# request = Google::Cloud::Orchestration::Airflow::Service::V1::StopAirflowCommandRequest.new
|
844
|
+
#
|
845
|
+
# # Call the stop_airflow_command method.
|
846
|
+
# result = client.stop_airflow_command request
|
847
|
+
#
|
848
|
+
# # The returned object is of type Google::Cloud::Orchestration::Airflow::Service::V1::StopAirflowCommandResponse.
|
849
|
+
# p result
|
850
|
+
#
|
851
|
+
def stop_airflow_command request, options = nil
|
852
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
853
|
+
|
854
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::StopAirflowCommandRequest
|
855
|
+
|
856
|
+
# Converts hash and nil to an options object
|
857
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
858
|
+
|
859
|
+
# Customize the options with defaults
|
860
|
+
call_metadata = @config.rpcs.stop_airflow_command.metadata.to_h
|
861
|
+
|
862
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
863
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
864
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
865
|
+
gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION,
|
866
|
+
transports_version_send: [:rest]
|
867
|
+
|
868
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
869
|
+
|
870
|
+
options.apply_defaults timeout: @config.rpcs.stop_airflow_command.timeout,
|
871
|
+
metadata: call_metadata,
|
872
|
+
retry_policy: @config.rpcs.stop_airflow_command.retry_policy
|
873
|
+
|
874
|
+
options.apply_defaults timeout: @config.timeout,
|
875
|
+
metadata: @config.metadata,
|
876
|
+
retry_policy: @config.retry_policy
|
877
|
+
|
878
|
+
@environments_stub.stop_airflow_command request, options do |result, operation|
|
879
|
+
yield result, operation if block_given?
|
880
|
+
return result
|
881
|
+
end
|
882
|
+
rescue ::Gapic::Rest::Error => e
|
883
|
+
raise ::Google::Cloud::Error.from_error(e)
|
884
|
+
end
|
885
|
+
|
886
|
+
##
|
887
|
+
# Polls Airflow CLI command execution and fetches logs.
|
888
|
+
#
|
889
|
+
# @overload poll_airflow_command(request, options = nil)
|
890
|
+
# Pass arguments to `poll_airflow_command` via a request object, either of type
|
891
|
+
# {::Google::Cloud::Orchestration::Airflow::Service::V1::PollAirflowCommandRequest} or an equivalent Hash.
|
892
|
+
#
|
893
|
+
# @param request [::Google::Cloud::Orchestration::Airflow::Service::V1::PollAirflowCommandRequest, ::Hash]
|
894
|
+
# A request object representing the call parameters. Required. To specify no
|
895
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
896
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
897
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
898
|
+
#
|
899
|
+
# @overload poll_airflow_command(environment: nil, execution_id: nil, pod: nil, pod_namespace: nil, next_line_number: nil)
|
900
|
+
# Pass arguments to `poll_airflow_command` via keyword arguments. Note that at
|
901
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
902
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
903
|
+
#
|
904
|
+
# @param environment [::String]
|
905
|
+
# The resource name of the environment in the form:
|
906
|
+
# "projects/\\{projectId}/locations/\\{locationId}/environments/\\{environmentId}"
|
907
|
+
# @param execution_id [::String]
|
908
|
+
# The unique ID of the command execution.
|
909
|
+
# @param pod [::String]
|
910
|
+
# The name of the pod where the command is executed.
|
911
|
+
# @param pod_namespace [::String]
|
912
|
+
# The namespace of the pod where the command is executed.
|
913
|
+
# @param next_line_number [::Integer]
|
914
|
+
# Line number from which new logs should be fetched.
|
915
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
916
|
+
# @yieldparam result [::Google::Cloud::Orchestration::Airflow::Service::V1::PollAirflowCommandResponse]
|
917
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
918
|
+
#
|
919
|
+
# @return [::Google::Cloud::Orchestration::Airflow::Service::V1::PollAirflowCommandResponse]
|
920
|
+
#
|
921
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
922
|
+
#
|
923
|
+
# @example Basic example
|
924
|
+
# require "google/cloud/orchestration/airflow/service/v1"
|
925
|
+
#
|
926
|
+
# # Create a client object. The client can be reused for multiple calls.
|
927
|
+
# client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Rest::Client.new
|
928
|
+
#
|
929
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
930
|
+
# request = Google::Cloud::Orchestration::Airflow::Service::V1::PollAirflowCommandRequest.new
|
931
|
+
#
|
932
|
+
# # Call the poll_airflow_command method.
|
933
|
+
# result = client.poll_airflow_command request
|
934
|
+
#
|
935
|
+
# # The returned object is of type Google::Cloud::Orchestration::Airflow::Service::V1::PollAirflowCommandResponse.
|
936
|
+
# p result
|
937
|
+
#
|
938
|
+
def poll_airflow_command request, options = nil
|
939
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
940
|
+
|
941
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::PollAirflowCommandRequest
|
942
|
+
|
943
|
+
# Converts hash and nil to an options object
|
944
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
945
|
+
|
946
|
+
# Customize the options with defaults
|
947
|
+
call_metadata = @config.rpcs.poll_airflow_command.metadata.to_h
|
948
|
+
|
949
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
950
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
951
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
952
|
+
gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION,
|
953
|
+
transports_version_send: [:rest]
|
954
|
+
|
955
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
956
|
+
|
957
|
+
options.apply_defaults timeout: @config.rpcs.poll_airflow_command.timeout,
|
958
|
+
metadata: call_metadata,
|
959
|
+
retry_policy: @config.rpcs.poll_airflow_command.retry_policy
|
960
|
+
|
961
|
+
options.apply_defaults timeout: @config.timeout,
|
962
|
+
metadata: @config.metadata,
|
963
|
+
retry_policy: @config.retry_policy
|
964
|
+
|
965
|
+
@environments_stub.poll_airflow_command request, options do |result, operation|
|
966
|
+
yield result, operation if block_given?
|
967
|
+
return result
|
968
|
+
end
|
969
|
+
rescue ::Gapic::Rest::Error => e
|
970
|
+
raise ::Google::Cloud::Error.from_error(e)
|
971
|
+
end
|
972
|
+
|
605
973
|
##
|
606
974
|
# Creates a snapshots of a Cloud Composer environment.
|
607
975
|
#
|
@@ -636,6 +1004,29 @@ module Google
|
|
636
1004
|
# @return [::Gapic::Operation]
|
637
1005
|
#
|
638
1006
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1007
|
+
#
|
1008
|
+
# @example Basic example
|
1009
|
+
# require "google/cloud/orchestration/airflow/service/v1"
|
1010
|
+
#
|
1011
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1012
|
+
# client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Rest::Client.new
|
1013
|
+
#
|
1014
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1015
|
+
# request = Google::Cloud::Orchestration::Airflow::Service::V1::SaveSnapshotRequest.new
|
1016
|
+
#
|
1017
|
+
# # Call the save_snapshot method.
|
1018
|
+
# result = client.save_snapshot request
|
1019
|
+
#
|
1020
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1021
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1022
|
+
# # Here is how to wait for a response.
|
1023
|
+
# result.wait_until_done! timeout: 60
|
1024
|
+
# if result.response?
|
1025
|
+
# p result.response
|
1026
|
+
# else
|
1027
|
+
# puts "No response received."
|
1028
|
+
# end
|
1029
|
+
#
|
639
1030
|
def save_snapshot request, options = nil
|
640
1031
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
641
1032
|
|
@@ -718,6 +1109,29 @@ module Google
|
|
718
1109
|
# @return [::Gapic::Operation]
|
719
1110
|
#
|
720
1111
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1112
|
+
#
|
1113
|
+
# @example Basic example
|
1114
|
+
# require "google/cloud/orchestration/airflow/service/v1"
|
1115
|
+
#
|
1116
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1117
|
+
# client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Rest::Client.new
|
1118
|
+
#
|
1119
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1120
|
+
# request = Google::Cloud::Orchestration::Airflow::Service::V1::LoadSnapshotRequest.new
|
1121
|
+
#
|
1122
|
+
# # Call the load_snapshot method.
|
1123
|
+
# result = client.load_snapshot request
|
1124
|
+
#
|
1125
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1126
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1127
|
+
# # Here is how to wait for a response.
|
1128
|
+
# result.wait_until_done! timeout: 60
|
1129
|
+
# if result.response?
|
1130
|
+
# p result.response
|
1131
|
+
# else
|
1132
|
+
# puts "No response received."
|
1133
|
+
# end
|
1134
|
+
#
|
721
1135
|
def load_snapshot request, options = nil
|
722
1136
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
723
1137
|
|
@@ -754,6 +1168,172 @@ module Google
|
|
754
1168
|
raise ::Google::Cloud::Error.from_error(e)
|
755
1169
|
end
|
756
1170
|
|
1171
|
+
##
|
1172
|
+
# Triggers database failover (only for highly resilient environments).
|
1173
|
+
#
|
1174
|
+
# @overload database_failover(request, options = nil)
|
1175
|
+
# Pass arguments to `database_failover` via a request object, either of type
|
1176
|
+
# {::Google::Cloud::Orchestration::Airflow::Service::V1::DatabaseFailoverRequest} or an equivalent Hash.
|
1177
|
+
#
|
1178
|
+
# @param request [::Google::Cloud::Orchestration::Airflow::Service::V1::DatabaseFailoverRequest, ::Hash]
|
1179
|
+
# A request object representing the call parameters. Required. To specify no
|
1180
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1181
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1182
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1183
|
+
#
|
1184
|
+
# @overload database_failover(environment: nil)
|
1185
|
+
# Pass arguments to `database_failover` via keyword arguments. Note that at
|
1186
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1187
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1188
|
+
#
|
1189
|
+
# @param environment [::String]
|
1190
|
+
# Target environment:
|
1191
|
+
# "projects/\\{projectId}/locations/\\{locationId}/environments/\\{environmentId}"
|
1192
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1193
|
+
# @yieldparam result [::Gapic::Operation]
|
1194
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1195
|
+
#
|
1196
|
+
# @return [::Gapic::Operation]
|
1197
|
+
#
|
1198
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1199
|
+
#
|
1200
|
+
# @example Basic example
|
1201
|
+
# require "google/cloud/orchestration/airflow/service/v1"
|
1202
|
+
#
|
1203
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1204
|
+
# client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Rest::Client.new
|
1205
|
+
#
|
1206
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1207
|
+
# request = Google::Cloud::Orchestration::Airflow::Service::V1::DatabaseFailoverRequest.new
|
1208
|
+
#
|
1209
|
+
# # Call the database_failover method.
|
1210
|
+
# result = client.database_failover request
|
1211
|
+
#
|
1212
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1213
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1214
|
+
# # Here is how to wait for a response.
|
1215
|
+
# result.wait_until_done! timeout: 60
|
1216
|
+
# if result.response?
|
1217
|
+
# p result.response
|
1218
|
+
# else
|
1219
|
+
# puts "No response received."
|
1220
|
+
# end
|
1221
|
+
#
|
1222
|
+
def database_failover request, options = nil
|
1223
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1224
|
+
|
1225
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::DatabaseFailoverRequest
|
1226
|
+
|
1227
|
+
# Converts hash and nil to an options object
|
1228
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1229
|
+
|
1230
|
+
# Customize the options with defaults
|
1231
|
+
call_metadata = @config.rpcs.database_failover.metadata.to_h
|
1232
|
+
|
1233
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1234
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1235
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1236
|
+
gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION,
|
1237
|
+
transports_version_send: [:rest]
|
1238
|
+
|
1239
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1240
|
+
|
1241
|
+
options.apply_defaults timeout: @config.rpcs.database_failover.timeout,
|
1242
|
+
metadata: call_metadata,
|
1243
|
+
retry_policy: @config.rpcs.database_failover.retry_policy
|
1244
|
+
|
1245
|
+
options.apply_defaults timeout: @config.timeout,
|
1246
|
+
metadata: @config.metadata,
|
1247
|
+
retry_policy: @config.retry_policy
|
1248
|
+
|
1249
|
+
@environments_stub.database_failover request, options do |result, operation|
|
1250
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1251
|
+
yield result, operation if block_given?
|
1252
|
+
return result
|
1253
|
+
end
|
1254
|
+
rescue ::Gapic::Rest::Error => e
|
1255
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1256
|
+
end
|
1257
|
+
|
1258
|
+
##
|
1259
|
+
# Fetches database properties.
|
1260
|
+
#
|
1261
|
+
# @overload fetch_database_properties(request, options = nil)
|
1262
|
+
# Pass arguments to `fetch_database_properties` via a request object, either of type
|
1263
|
+
# {::Google::Cloud::Orchestration::Airflow::Service::V1::FetchDatabasePropertiesRequest} or an equivalent Hash.
|
1264
|
+
#
|
1265
|
+
# @param request [::Google::Cloud::Orchestration::Airflow::Service::V1::FetchDatabasePropertiesRequest, ::Hash]
|
1266
|
+
# A request object representing the call parameters. Required. To specify no
|
1267
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1268
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1269
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1270
|
+
#
|
1271
|
+
# @overload fetch_database_properties(environment: nil)
|
1272
|
+
# Pass arguments to `fetch_database_properties` via keyword arguments. Note that at
|
1273
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1274
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1275
|
+
#
|
1276
|
+
# @param environment [::String]
|
1277
|
+
# Required. The resource name of the environment, in the form:
|
1278
|
+
# "projects/\\{projectId}/locations/\\{locationId}/environments/\\{environmentId}"
|
1279
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1280
|
+
# @yieldparam result [::Google::Cloud::Orchestration::Airflow::Service::V1::FetchDatabasePropertiesResponse]
|
1281
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1282
|
+
#
|
1283
|
+
# @return [::Google::Cloud::Orchestration::Airflow::Service::V1::FetchDatabasePropertiesResponse]
|
1284
|
+
#
|
1285
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1286
|
+
#
|
1287
|
+
# @example Basic example
|
1288
|
+
# require "google/cloud/orchestration/airflow/service/v1"
|
1289
|
+
#
|
1290
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1291
|
+
# client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Rest::Client.new
|
1292
|
+
#
|
1293
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1294
|
+
# request = Google::Cloud::Orchestration::Airflow::Service::V1::FetchDatabasePropertiesRequest.new
|
1295
|
+
#
|
1296
|
+
# # Call the fetch_database_properties method.
|
1297
|
+
# result = client.fetch_database_properties request
|
1298
|
+
#
|
1299
|
+
# # The returned object is of type Google::Cloud::Orchestration::Airflow::Service::V1::FetchDatabasePropertiesResponse.
|
1300
|
+
# p result
|
1301
|
+
#
|
1302
|
+
def fetch_database_properties request, options = nil
|
1303
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1304
|
+
|
1305
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::FetchDatabasePropertiesRequest
|
1306
|
+
|
1307
|
+
# Converts hash and nil to an options object
|
1308
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1309
|
+
|
1310
|
+
# Customize the options with defaults
|
1311
|
+
call_metadata = @config.rpcs.fetch_database_properties.metadata.to_h
|
1312
|
+
|
1313
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1314
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1315
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1316
|
+
gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION,
|
1317
|
+
transports_version_send: [:rest]
|
1318
|
+
|
1319
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1320
|
+
|
1321
|
+
options.apply_defaults timeout: @config.rpcs.fetch_database_properties.timeout,
|
1322
|
+
metadata: call_metadata,
|
1323
|
+
retry_policy: @config.rpcs.fetch_database_properties.retry_policy
|
1324
|
+
|
1325
|
+
options.apply_defaults timeout: @config.timeout,
|
1326
|
+
metadata: @config.metadata,
|
1327
|
+
retry_policy: @config.retry_policy
|
1328
|
+
|
1329
|
+
@environments_stub.fetch_database_properties request, options do |result, operation|
|
1330
|
+
yield result, operation if block_given?
|
1331
|
+
return result
|
1332
|
+
end
|
1333
|
+
rescue ::Gapic::Rest::Error => e
|
1334
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1335
|
+
end
|
1336
|
+
|
757
1337
|
##
|
758
1338
|
# Configuration class for the Environments REST API.
|
759
1339
|
#
|
@@ -905,6 +1485,21 @@ module Google
|
|
905
1485
|
#
|
906
1486
|
attr_reader :delete_environment
|
907
1487
|
##
|
1488
|
+
# RPC-specific configuration for `execute_airflow_command`
|
1489
|
+
# @return [::Gapic::Config::Method]
|
1490
|
+
#
|
1491
|
+
attr_reader :execute_airflow_command
|
1492
|
+
##
|
1493
|
+
# RPC-specific configuration for `stop_airflow_command`
|
1494
|
+
# @return [::Gapic::Config::Method]
|
1495
|
+
#
|
1496
|
+
attr_reader :stop_airflow_command
|
1497
|
+
##
|
1498
|
+
# RPC-specific configuration for `poll_airflow_command`
|
1499
|
+
# @return [::Gapic::Config::Method]
|
1500
|
+
#
|
1501
|
+
attr_reader :poll_airflow_command
|
1502
|
+
##
|
908
1503
|
# RPC-specific configuration for `save_snapshot`
|
909
1504
|
# @return [::Gapic::Config::Method]
|
910
1505
|
#
|
@@ -914,6 +1509,16 @@ module Google
|
|
914
1509
|
# @return [::Gapic::Config::Method]
|
915
1510
|
#
|
916
1511
|
attr_reader :load_snapshot
|
1512
|
+
##
|
1513
|
+
# RPC-specific configuration for `database_failover`
|
1514
|
+
# @return [::Gapic::Config::Method]
|
1515
|
+
#
|
1516
|
+
attr_reader :database_failover
|
1517
|
+
##
|
1518
|
+
# RPC-specific configuration for `fetch_database_properties`
|
1519
|
+
# @return [::Gapic::Config::Method]
|
1520
|
+
#
|
1521
|
+
attr_reader :fetch_database_properties
|
917
1522
|
|
918
1523
|
# @private
|
919
1524
|
def initialize parent_rpcs = nil
|
@@ -927,10 +1532,20 @@ module Google
|
|
927
1532
|
@update_environment = ::Gapic::Config::Method.new update_environment_config
|
928
1533
|
delete_environment_config = parent_rpcs.delete_environment if parent_rpcs.respond_to? :delete_environment
|
929
1534
|
@delete_environment = ::Gapic::Config::Method.new delete_environment_config
|
1535
|
+
execute_airflow_command_config = parent_rpcs.execute_airflow_command if parent_rpcs.respond_to? :execute_airflow_command
|
1536
|
+
@execute_airflow_command = ::Gapic::Config::Method.new execute_airflow_command_config
|
1537
|
+
stop_airflow_command_config = parent_rpcs.stop_airflow_command if parent_rpcs.respond_to? :stop_airflow_command
|
1538
|
+
@stop_airflow_command = ::Gapic::Config::Method.new stop_airflow_command_config
|
1539
|
+
poll_airflow_command_config = parent_rpcs.poll_airflow_command if parent_rpcs.respond_to? :poll_airflow_command
|
1540
|
+
@poll_airflow_command = ::Gapic::Config::Method.new poll_airflow_command_config
|
930
1541
|
save_snapshot_config = parent_rpcs.save_snapshot if parent_rpcs.respond_to? :save_snapshot
|
931
1542
|
@save_snapshot = ::Gapic::Config::Method.new save_snapshot_config
|
932
1543
|
load_snapshot_config = parent_rpcs.load_snapshot if parent_rpcs.respond_to? :load_snapshot
|
933
1544
|
@load_snapshot = ::Gapic::Config::Method.new load_snapshot_config
|
1545
|
+
database_failover_config = parent_rpcs.database_failover if parent_rpcs.respond_to? :database_failover
|
1546
|
+
@database_failover = ::Gapic::Config::Method.new database_failover_config
|
1547
|
+
fetch_database_properties_config = parent_rpcs.fetch_database_properties if parent_rpcs.respond_to? :fetch_database_properties
|
1548
|
+
@fetch_database_properties = ::Gapic::Config::Method.new fetch_database_properties_config
|
934
1549
|
|
935
1550
|
yield self if block_given?
|
936
1551
|
end
|