gitlab-org--gitlab-foss/app/serializers/cluster_application_entity.rb
Thong Kuah 44eec56834 Expose can_uninstall in cluster_status.json
Only prometheus can be uninstalled atm, the rest will be dealt with
later.

Presumption is that new application types will have uninstallation
implmemented at the same time.
2019-04-29 22:55:11 -07:00

14 lines
593 B
Ruby

# frozen_string_literal: true
class ClusterApplicationEntity < Grape::Entity
expose :name
expose :status_name, as: :status
expose :status_reason
expose :version
expose :external_ip, if: -> (e, _) { e.respond_to?(:external_ip) }
expose :external_hostname, if: -> (e, _) { e.respond_to?(:external_hostname) }
expose :hostname, if: -> (e, _) { e.respond_to?(:hostname) }
expose :email, if: -> (e, _) { e.respond_to?(:email) }
expose :update_available?, as: :update_available, if: -> (e, _) { e.respond_to?(:update_available?) }
expose :can_uninstall?, as: :can_uninstall
end