2018-07-19 14:43:13 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-10-03 17:21:54 -04:00
|
|
|
class ClusterSerializer < BaseSerializer
|
2020-04-30 17:09:47 -04:00
|
|
|
include WithPagination
|
2017-10-03 17:21:54 -04:00
|
|
|
entity ClusterEntity
|
|
|
|
|
2020-04-30 17:09:47 -04:00
|
|
|
def represent_list(resource)
|
|
|
|
represent(resource, {
|
|
|
|
only: [
|
|
|
|
:cluster_type,
|
|
|
|
:enabled,
|
|
|
|
:environment_scope,
|
2020-07-14 11:09:05 -04:00
|
|
|
:gitlab_managed_apps_logs_path,
|
2020-08-05 17:09:40 -04:00
|
|
|
:kubernetes_errors,
|
2020-04-30 17:09:47 -04:00
|
|
|
:name,
|
2020-05-14 17:07:52 -04:00
|
|
|
:nodes,
|
2020-04-30 17:09:47 -04:00
|
|
|
:path,
|
2020-06-10 14:09:15 -04:00
|
|
|
:provider_type,
|
2020-04-30 17:09:47 -04:00
|
|
|
:status
|
|
|
|
]
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2017-10-03 17:21:54 -04:00
|
|
|
def represent_status(resource)
|
2017-10-31 06:29:56 -04:00
|
|
|
represent(resource, { only: [:status, :status_reason, :applications] })
|
2017-10-03 17:21:54 -04:00
|
|
|
end
|
|
|
|
end
|