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
|
2021-01-03 14:25:43 +05:30
|
|
|
expose :id
|
|
|
|
expose :namespace_per_environment
|
2020-05-24 23:13:21 +05:30
|
|
|
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
|
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
|
|
|
|
2020-10-24 23:57:45 +05:30
|
|
|
expose :kubernetes_errors do |cluster|
|
2022-05-07 20:08:51 +05:30
|
|
|
Clusters::KubernetesErrorEntity.new(cluster)
|
2020-10-24 23:57:45 +05:30
|
|
|
end
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|