2019-02-15 15:39:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Projects
|
|
|
|
module Serverless
|
|
|
|
class ServiceEntity < Grape::Entity
|
|
|
|
include RequestAwareEntity
|
|
|
|
|
2020-03-09 13:42:32 +05:30
|
|
|
expose :name
|
|
|
|
expose :namespace
|
|
|
|
expose :environment_scope
|
|
|
|
expose :podcount
|
|
|
|
expose :created_at
|
|
|
|
expose :image
|
|
|
|
expose :description
|
|
|
|
expose :url
|
2019-03-02 22:35:43 +05:30
|
|
|
|
|
|
|
expose :detail_url do |service|
|
|
|
|
project_serverless_path(
|
|
|
|
request.project,
|
2020-03-09 13:42:32 +05:30
|
|
|
service.environment_scope,
|
|
|
|
service.name)
|
2019-03-02 22:35:43 +05:30
|
|
|
end
|
|
|
|
|
2019-07-07 11:18:12 +05:30
|
|
|
expose :metrics_url do |service|
|
|
|
|
project_serverless_metrics_path(
|
|
|
|
request.project,
|
2020-03-09 13:42:32 +05:30
|
|
|
service.environment_scope,
|
|
|
|
service.name, format: :json)
|
2019-12-26 22:10:19 +05:30
|
|
|
end
|
|
|
|
|
2020-03-09 13:42:32 +05:30
|
|
|
expose :cluster_id do |service|
|
|
|
|
service.cluster&.id
|
2019-02-15 15:39:39 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|