2017-09-28 09:11:17 +00:00
|
|
|
module Ci
|
|
|
|
class CreateClusterService < BaseService
|
2017-09-30 15:54:22 +00:00
|
|
|
def execute(access_token)
|
2017-10-01 08:48:21 +00:00
|
|
|
if params['machine_type'].blank?
|
|
|
|
params['machine_type'] = GoogleApi::CloudPlatform::Client::DEFAULT_MACHINE_TYPE
|
|
|
|
end
|
|
|
|
|
2017-09-30 15:54:22 +00:00
|
|
|
project.clusters.create(
|
|
|
|
params.merge(user: current_user,
|
|
|
|
status: Ci::Cluster.statuses[:scheduled],
|
|
|
|
gcp_token: access_token))
|
2017-09-28 09:11:17 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|