Welcome to mirror list, hosted at ThFree Co, Russian Federation.

runner_machine_type.rb « ci « types « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: db0ff722f4ef212b22699869f1fee2a551e0edc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# frozen_string_literal: true

module Types
  module Ci
    class RunnerMachineType < BaseObject
      graphql_name 'CiRunnerMachine'

      connection_type_class(::Types::CountableConnectionType)

      authorize :read_runner_machine

      alias_method :runner_machine, :object

      field :architecture_name, GraphQL::Types::String, null: true,
        description: 'Architecture provided by the runner machine.',
        method: :architecture
      field :contacted_at, Types::TimeType, null: true,
        description: 'Timestamp of last contact from the runner machine.',
        method: :contacted_at
      field :created_at, Types::TimeType, null: true,
        description: 'Timestamp of creation of the runner machine.'
      field :executor_name, GraphQL::Types::String, null: true,
        description: 'Executor last advertised by the runner.',
        method: :executor_name
      field :id, ::Types::GlobalIDType[::Ci::RunnerMachine], null: false,
        description: 'ID of the runner machine.'
      field :ip_address, GraphQL::Types::String, null: true,
        description: 'IP address of the runner machine.'
      field :platform_name, GraphQL::Types::String, null: true,
        description: 'Platform provided by the runner machine.',
        method: :platform
      field :revision, GraphQL::Types::String, null: true, description: 'Revision of the runner.'
      field :runner, RunnerType, null: true, description: 'Runner configuration for the runner machine.'
      field :status,
        Types::Ci::RunnerStatusEnum,
        null: false,
        description: 'Status of the runner machine.'
      field :version, GraphQL::Types::String, null: true, description: 'Version of the runner.'

      def executor_name
        ::Ci::Runner::EXECUTOR_TYPE_TO_NAMES[runner_machine.executor_type&.to_sym]
      end
    end
  end
end

Types::Ci::RunnerType.prepend_mod_with('Types::Ci::RunnerType')