Class: ForemanOrchestration::OrchestrationClient

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
app/models/foreman_orchestration/orchestration_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(tenant, credentials) ⇒ OrchestrationClient



6
7
8
9
# File 'app/models/foreman_orchestration/orchestration_client.rb', line 6

def initialize(tenant, credentials)
  @tenant = tenant
  @credentials = credentials
end

Instance Method Details

#create_stack(stack) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'app/models/foreman_orchestration/orchestration_client.rb', line 15

def create_stack(stack)
  params = {
    files: {},
    disable_rollback: true,
    parameters: stack.parameters,
    stack_name: stack.name,
    environment: {},
    template: stack.template_body
  }
  client.create_stack(params)
end

#delete_stack(stack) ⇒ Object



27
28
29
30
# File 'app/models/foreman_orchestration/orchestration_client.rb', line 27

def delete_stack(stack)
  fog_model = fog_model_for_stack(stack.id)
  client.delete_stack(fog_model)
end

#stacksObject



11
12
13
# File 'app/models/foreman_orchestration/orchestration_client.rb', line 11

def stacks
  client.stacks
end