Skip to content

Commit

Permalink
Merge pull request #13741 from Jiri-Kremser/server-group-power-ops
Browse files Browse the repository at this point in the history
Middelware server group power ops
  • Loading branch information
agrare authored Feb 14, 2017
2 parents 4242a1e + bfeba58 commit 345a535
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 7 deletions.
41 changes: 35 additions & 6 deletions app/models/manageiq/providers/hawkular/middleware_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,21 @@ def alerts_client
with_provider_connection(&:alerts)
end

# server ops
def shutdown_middleware_server(ems_ref, params = {})
timeout = params[:timeout] || 0
run_generic_operation(:Shutdown, ems_ref, :restart => false, :timeout => timeout)
end

def suspend_middleware_server(ems_ref, params = {})
timeout = params[:timeout] || 0
run_generic_operation(:Suspend, ems_ref, :timeout => timeout)
end

def resume_middleware_server(ems_ref)
run_generic_operation(:Resume, ems_ref)
end

def reload_middleware_server(ems_ref)
run_generic_operation(:Reload, ems_ref)
end
Expand All @@ -195,6 +210,7 @@ def restart_middleware_server(ems_ref)
run_generic_operation(:Shutdown, ems_ref, :restart => true)
end

# domain server ops
def restart_middleware_domain_server(ems_ref)
run_generic_operation(:Restart, ems_ref)
end
Expand All @@ -203,18 +219,31 @@ def kill_middleware_domain_server(ems_ref)
run_generic_operation(:Kill, ems_ref)
end

def shutdown_middleware_server(ems_ref, params)
# server group ops
def start_middleware_server_group(ems_ref)
run_generic_operation('Start Servers', ems_ref)
end

def stop_middleware_server_group(ems_ref, params = {})
timeout = params[:timeout] || 0
run_generic_operation(:Shutdown, ems_ref, :restart => false, :timeout => timeout)
run_generic_operation('Stop Servers', ems_ref, :timeout => timeout)
end

def restart_middleware_server_group(ems_ref)
run_generic_operation('Restart Servers', ems_ref)
end

def suspend_middleware_server(ems_ref, params)
def reload_middleware_server_group(ems_ref)
run_generic_operation('Reload Servers', ems_ref)
end

def suspend_middleware_server_group(ems_ref, params = {})
timeout = params[:timeout] || 0
run_generic_operation(:Suspend, ems_ref, :timeout => timeout)
run_generic_operation('Suspend Servers', ems_ref, :timeout => timeout)
end

def resume_middleware_server(ems_ref)
run_generic_operation(:Resume, ems_ref)
def resume_middleware_server_group(ems_ref)
run_generic_operation('Resume Servers', ems_ref)
end

def create_jdr_report(ems_ref)
Expand Down
26 changes: 25 additions & 1 deletion db/fixtures/miq_product_features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4069,8 +4069,32 @@
:description: Edit Tags of Middleware Server Groups
:feature_type: control
:identifier: middleware_server_group_tag
- :name: Reload middleware server group
:description: Trigger reload operation for Middleware Server Group
:feature_type: admin
:identifier: middleware_server_group_reload
- :name: Stop middleware server group
:description: Stop Middleware Server Group
:feature_type: admin
:identifier: middleware_server_group_stop
- :name: Start middleware server group
:description: Start Middleware Server Group
:feature_type: admin
:identifier: middleware_server_group_start
- :name: Suspend middleware server group
:description: Suspend Middleware Server Group
:feature_type: admin
:identifier: middleware_server_group_suspend
- :name: Resume middleware server group
:description: Resume a suspended Middleware Server Group
:feature_type: admin
:identifier: middleware_server_group_resume
- :name: Restart middleware server group
:description: Restart a Middleware Server Group
:feature_type: admin
:identifier: middleware_server_group_restart
- :name: Add middleware deployment
:description: Add middleware deployment
:description: Add middleware deployment for Server Group
:feature_type: admin
:identifier: middleware_group_deployment_add

Expand Down

0 comments on commit 345a535

Please sign in to comment.