debian-mirror-gitlab/app/serializers/cluster_entity.rb

34 lines
907 B
Ruby
Raw Normal View History

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
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
2020-10-24 23:57:45 +05:30
expose :kubernetes_errors do |cluster|
ClusterErrorEntity.new(cluster)
end
2020-11-24 15:15:51 +05:30
expose :enable_advanced_logs_querying do |cluster|
2021-06-08 01:23:25 +05:30
cluster.elastic_stack_available?
2020-11-24 15:15:51 +05:30
end
2018-03-17 18:26:18 +05:30
end