2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
class ClusterEntity < Grape::Entity
|
|
|
|
include RequestAwareEntity
|
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
expose :cluster_type
|
|
|
|
expose :enabled
|
|
|
|
expose :environment_scope
|
|
|
|
expose :name
|
|
|
|
expose :nodes
|
2020-06-23 00:09:42 +05:30
|
|
|
expose :provider_type
|
2018-03-17 18:26:18 +05:30
|
|
|
expose :status_name, as: :status
|
|
|
|
expose :status_reason
|
|
|
|
expose :applications, using: ClusterApplicationEntity
|
2020-05-24 23:13:21 +05:30
|
|
|
|
|
|
|
expose :path do |cluster|
|
|
|
|
Clusters::ClusterPresenter.new(cluster).show_path # rubocop: disable CodeReuse/Presenter
|
|
|
|
end
|
2020-07-28 23:09:34 +05:30
|
|
|
|
|
|
|
expose :gitlab_managed_apps_logs_path do |cluster|
|
|
|
|
Clusters::ClusterPresenter.new(cluster, current_user: request.current_user).gitlab_managed_apps_logs_path # rubocop: disable CodeReuse/Presenter
|
|
|
|
end
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|