Class: PEClient::Resource::OrchestratorV1::Tasks

Inherits:
Base
  • Object
show all
Defined in:
lib/pe_client/resources/orchestrator.v1/tasks.rb

Overview

Use the tasks endpoints to get information about tasks you’ve installed and tasks included with Puppet Enterprise (PE).

Constant Summary collapse

BASE_PATH =

The base path for OrchestratorV1 API v1 Tasks endpoints.

"#{OrchestratorV1::BASE_PATH}/tasks".freeze

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PEClient::Resource::Base

Instance Method Details

#get(module_name: nil, task_name: nil, environment: nil) ⇒ Hash

Lists all tasks in a specific environment. Or get information about a specific task, including metadata and file information.

Parameters:

  • module_name (String) (defaults to: nil)
  • task_name (String) (defaults to: nil)
  • environment (String) (defaults to: nil)

    The environment from which to retrieve tasks. Defaults to “production”.

Returns:

  • (Hash)


38
39
40
41
42
43
44
# File 'lib/pe_client/resources/orchestrator.v1/tasks.rb', line 38

def get(module_name: nil, task_name: nil, environment: nil)
  if module_name && task_name
    @client.get "#{BASE_PATH}/#{module_name}/#{task_name}", params: {environment:}.compact
  else
    @client.get BASE_PATH, params: {environment:}.compact
  end
end