Class: Connectors::GitLab::Connector
Instance Attribute Summary
#advanced_filter_config, #rules
Class Method Summary
collapse
Instance Method Summary
collapse
configurable_fields_indifferent_access, #do_health_check!, filter_transformers, #is_healthy?, kibana_features, #metadata, simple_rules_validators, validate_filtering, #yield_with_handling_tolerable_errors
Constructor Details
#initialize(configuration: {}, job_description: nil) ⇒ Connector
Returns a new instance of Connector.
44
45
46
47
48
49
50
51
|
# File 'lib/connectors/gitlab/connector.rb', line 44
def initialize(configuration: {}, job_description: nil)
super
@extractor = Connectors::GitLab::Extractor.new(
:base_url => @configuration.dig(:base_url, :value),
:api_token => @configuration.dig(:api_token, :value)
)
end
|
Class Method Details
.advanced_snippet_validators ⇒ Object
.configurable_fields ⇒ Object
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/connectors/gitlab/connector.rb', line 28
def self.configurable_fields
{
:base_url => {
:label => 'Base URL',
:value => Connectors::GitLab::DEFAULT_BASE_URL
},
:api_key => {
:label => 'API Key'
}
}
end
|
.display_name ⇒ Object
24
25
26
|
# File 'lib/connectors/gitlab/connector.rb', line 24
def self.display_name
'GitLab Connector'
end
|
.service_type ⇒ Object
20
21
22
|
# File 'lib/connectors/gitlab/connector.rb', line 20
def self.service_type
'gitlab'
end
|
Instance Method Details
#yield_documents ⇒ Object
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/connectors/gitlab/connector.rb', line 53
def yield_documents
next_page_link = nil
loop do
next_page_link = @extractor.yield_projects_page(next_page_link) do |projects_chunk|
projects_chunk.each do |project|
yield Connectors::GitLab::Adapter.to_es_document(:project, project)
end
end
break unless next_page_link.present?
end
end
|