2021-09-30 23:02:18 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module API
|
|
|
|
module Entities
|
|
|
|
module Ci
|
|
|
|
class Runner < Grape::Entity
|
2023-01-13 00:05:48 +05:30
|
|
|
expose :id, documentation: { type: 'integer', example: 8 }
|
|
|
|
expose :description, documentation: { type: 'string', example: 'test-1-20150125' }
|
|
|
|
expose :ip_address, documentation: { type: 'string', example: '127.0.0.1' }
|
|
|
|
# TODO Remove in v5 in favor of `paused` for REST calls, see https://gitlab.com/gitlab-org/gitlab/-/issues/375709
|
|
|
|
expose :active, documentation: { type: 'boolean', example: true }
|
|
|
|
expose :paused, documentation: { type: 'boolean', example: false } do |runner|
|
2022-04-04 11:22:00 +05:30
|
|
|
!runner.active
|
|
|
|
end
|
2023-01-13 00:05:48 +05:30
|
|
|
expose :instance_type?, as: :is_shared, documentation: { type: 'boolean', example: true }
|
|
|
|
expose :runner_type,
|
|
|
|
documentation: { type: 'string', values: ::Ci::Runner.runner_types.keys, example: 'instance_type' }
|
|
|
|
expose :name, documentation: { type: 'string', example: 'test' }
|
|
|
|
expose :online?, as: :online, documentation: { type: 'boolean', example: true }
|
2021-12-11 22:18:48 +05:30
|
|
|
# DEPRECATED
|
2022-11-25 23:54:43 +05:30
|
|
|
# TODO Remove in v5 in favor of `status` for REST calls, see https://gitlab.com/gitlab-org/gitlab/-/issues/375709
|
2023-01-13 00:05:48 +05:30
|
|
|
expose :deprecated_rest_status, as: :status, documentation: { type: 'string', example: 'online' }
|
2021-09-30 23:02:18 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|