Class: PEClient::Resource::OrchestratorV1
- Inherits:
-
BaseWithPort
show all
- Defined in:
- lib/pe_client/resources/orchestrator.v1.rb,
lib/pe_client/resources/orchestrator.v1/jobs.rb,
lib/pe_client/resources/orchestrator.v1/plans.rb,
lib/pe_client/resources/orchestrator.v1/tasks.rb,
lib/pe_client/resources/orchestrator.v1/scopes.rb,
lib/pe_client/resources/orchestrator.v1/command.rb,
lib/pe_client/resources/orchestrator.v1/inventory.rb,
lib/pe_client/resources/orchestrator.v1/plan_jobs.rb,
lib/pe_client/resources/orchestrator.v1/scheduled_jobs.rb
Overview
You can use the orchestrator API to run jobs and plans on demand; schedule tasks and plans; get information about jobs, plans, and events; track node usage; and more.
Defined Under Namespace
Classes: Command, Inventory, Jobs, PlanJobs, Plans, ScheduledJobs, Scopes, Tasks
Constant Summary
collapse
- BASE_PATH =
The base path for Orchestrator API v1 endpoints.
"/orchestrator/v1"
- PORT =
Default Orchestrator API Port
8143
Instance Method Summary
collapse
#initialize
Instance Method Details
56
57
58
59
|
# File 'lib/pe_client/resources/orchestrator.v1.rb', line 56
def command
require_relative "orchestrator.v1/command"
@command ||= OrchestratorV1::Command.new(@client)
end
|
#get ⇒ Hash
Returns metadata about the orchestrator API, along with a list of links to application management resources.
34
35
36
|
# File 'lib/pe_client/resources/orchestrator.v1.rb', line 34
def get
@client.get BASE_PATH
end
|
62
63
64
65
|
# File 'lib/pe_client/resources/orchestrator.v1.rb', line 62
def inventory
require_relative "orchestrator.v1/inventory"
@inventory ||= OrchestratorV1::Inventory.new(@client)
end
|
68
69
70
71
|
# File 'lib/pe_client/resources/orchestrator.v1.rb', line 68
def jobs
require_relative "orchestrator.v1/jobs"
@jobs ||= OrchestratorV1::Jobs.new(@client)
end
|
86
87
88
89
|
# File 'lib/pe_client/resources/orchestrator.v1.rb', line 86
def plan_jobs
require_relative "orchestrator.v1/plan_jobs"
@plan_jobs ||= OrchestratorV1::PlanJobs.new(@client)
end
|
80
81
82
83
|
# File 'lib/pe_client/resources/orchestrator.v1.rb', line 80
def plans
require_relative "orchestrator.v1/plans"
@plans ||= OrchestratorV1::Plans.new(@client)
end
|
74
75
76
77
|
# File 'lib/pe_client/resources/orchestrator.v1.rb', line 74
def scheduled_jobs
require_relative "orchestrator.v1/scheduled_jobs"
@scheduled_jobs ||= OrchestratorV1::ScheduledJobs.new(@client)
end
|
98
99
100
101
|
# File 'lib/pe_client/resources/orchestrator.v1.rb', line 98
def scopes
require_relative "orchestrator.v1/scopes"
@scopes ||= OrchestratorV1::Scopes.new(@client)
end
|
92
93
94
95
|
# File 'lib/pe_client/resources/orchestrator.v1.rb', line 92
def tasks
require_relative "orchestrator.v1/tasks"
@tasks ||= OrchestratorV1::Tasks.new(@client)
end
|
#usage(start_date: nil, end_date: nil, events: nil) ⇒ Hash
Retrieves information about the orchestrator’s daily node usage, Puppet events activity on nodes, and nodes that are present in PuppetDB.
51
52
53
|
# File 'lib/pe_client/resources/orchestrator.v1.rb', line 51
def usage(start_date: nil, end_date: nil, events: nil)
@client.get "#{BASE_PATH}/usage", params: {start_date:, end_date:, events:}.compact
end
|