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-10-02 12:58:50 +00:00
|
|
|
project.create_cluster(
|
2017-09-30 15:54:22 +00:00
|
|
|
params.merge(user: current_user,
|
2017-10-02 12:58:50 +00:00
|
|
|
status: Gcp::Cluster.statuses[:scheduled],
|
2017-09-30 15:54:22 +00:00
|
|
|
gcp_token: access_token))
|
2017-09-28 09:11:17 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|