Class: GlobusClient::EndpointManager
- Inherits:
-
Object
- Object
- GlobusClient::EndpointManager
- Defined in:
- lib/globus_client/endpoint_manager.rb
Overview
The namespace for endpoint management API operations
Constant Summary collapse
- IN_PROGRESS_STATUSES =
%w[ACTIVE INACTIVE].freeze
Instance Method Summary collapse
-
#task_list(owner_id: nil, status: [], destination_path: nil) ⇒ Array
List tasks for the configured transfer endpoint docs.globus.org/api/transfer/advanced_collection_management/#get_tasks Note that this method does not support pagination, as there are unlikely to be many tasks.
-
#tasks_in_progress?(owner_id: nil, destination_path: nil) ⇒ boolean
True if there are tasks in progress.
Instance Method Details
#task_list(owner_id: nil, status: [], destination_path: nil) ⇒ Array
List tasks for the configured transfer endpoint docs.globus.org/api/transfer/advanced_collection_management/#get_tasks Note that this method does not support pagination, as there are unlikely to be many tasks. Also note that if destination_path is provided, only transfer tasks will be returned.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/globus_client/endpoint_manager.rb', line 16 def task_list(owner_id: nil, status: [], destination_path: nil) tasks = GlobusClient.instance.get( base_url: GlobusClient.config.transfer_url, path: '/v0.10/endpoint_manager/task_list', params: task_list_params(owner_id:, status:) )['DATA'] return tasks unless destination_path destination_base_path = destination_path.delete_suffix('/') << '/' tasks.select { |task| task['destination_base_path']&.start_with?(destination_base_path) } end |
#tasks_in_progress?(owner_id: nil, destination_path: nil) ⇒ boolean
Returns true if there are tasks in progress.
31 32 33 |
# File 'lib/globus_client/endpoint_manager.rb', line 31 def tasks_in_progress?(owner_id: nil, destination_path: nil) task_list(owner_id:, destination_path:, status: IN_PROGRESS_STATUSES).present? end |