fluke/devops-service/providers/static.rb

46 lines
1.0 KiB
Ruby
Raw Normal View History

2018-04-04 22:44:39 +03:00
require_relative "provider"
require_relative "static/static_connector"
require_relative "static/static_provider_account"
require_relative "static/category_provider_static"
module Provider
2018-04-04 22:44:39 +03:00
class Static < AbstractProvider
2018-04-04 22:44:39 +03:00
PROVIDER = "static"
def name
PROVIDER
end
2018-04-04 22:44:39 +03:00
def create_connector config, account
options = {
#static_ssh_key: account.ssh_key,
2018-04-04 22:44:39 +03:00
# static_proxy: config[:static_proxy],
# static_no_proxy: config[:static_no_proxy],
static_integration_run_list: config[:static_integration_run_list]
}
add_connector(account.account_name, StaticConnector.new(options))
end
2018-04-04 22:44:39 +03:00
def create_account hash
Devops::Model::StaticProviderAccount.new(hash)
end
2018-04-04 22:44:39 +03:00
def create_category_provider hash
Devops::Model::CategoryProviderStatic.new(hash)
end
2018-04-04 22:44:39 +03:00
def account name
Devops::Model::StaticProviderAccount.find(name)
end
2018-04-04 22:44:39 +03:00
def accounts
Devops::Model::StaticProviderAccount.all
end
2018-04-04 22:44:39 +03:00
end
2018-04-04 22:44:39 +03:00
register Static
end