Skip to content

Commit

Permalink
Revert "add service level objectives support (#188)"
Browse files Browse the repository at this point in the history
This reverts commit cd70fef.
  • Loading branch information
nmuesch committed Nov 4, 2019
1 parent 5a0de48 commit 28ea62f
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 342 deletions.
127 changes: 58 additions & 69 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2019-10-23 14:52:35 -0500 using RuboCop version 0.49.1.
# on 2018-10-01 12:52:09 +0200 using RuboCop version 0.49.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -51,14 +51,14 @@ Layout/EmptyLines:
- 'lib/capistrano/datadog/v2.rb'
- 'lib/dogapi/facade.rb'

# Offense count: 78
# Offense count: 63
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
Layout/EmptyLinesAroundClassBody:
Enabled: false

# Offense count: 4
# Offense count: 1
# Cop supports --auto-correct.
Layout/EmptyLinesAroundMethodBody:
Exclude:
Expand All @@ -85,20 +85,10 @@ Layout/ExtraSpacing:

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: consistent, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
Layout/FirstParameterIndentation:
Exclude:
- 'spec/spec_helper.rb'

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# Configuration parameters: SupportedStyles, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_braces
Layout/IndentHash:
Exclude:
- 'lib/dogapi/v1/event.rb'
- 'lib/dogapi/v1/service_level_objective.rb'
EnforcedStyle: consistent

# Offense count: 1
# Cop supports --auto-correct.
Expand Down Expand Up @@ -130,7 +120,7 @@ Layout/SpaceAfterComma:
Exclude:
- 'examples/custom_metric.rb'

# Offense count: 83
# Offense count: 75
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: space, no_space
Expand All @@ -157,29 +147,12 @@ Layout/SpaceAroundOperators:
- 'examples/custom_metric.rb'
- 'lib/dogapi/event.rb'

# Offense count: 8
# Cop supports --auto-correct.
Layout/SpaceBeforeComma:
Exclude:
- 'lib/dogapi/facade.rb'
- 'lib/dogapi/v1/service_level_objective.rb'

# Offense count: 2
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment.
Layout/SpaceBeforeFirstArg:
Exclude:
- 'lib/capistrano/datadog/v2.rb'
- 'lib/dogapi/v1/service_level_objective.rb'

# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SupportedStylesForEmptyBraces.
# SupportedStyles: space, no_space, compact
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceInsideHashLiteralBraces:
Exclude:
- 'spec/integration/service_level_objective_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
Expand Down Expand Up @@ -228,42 +201,44 @@ Lint/UselessAssignment:
Exclude:
- 'lib/capistrano/datadog.rb'

# Offense count: 13
# Offense count: 11
Metrics/AbcSize:
Max: 51

# Offense count: 24
# Offense count: 18
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
Max: 102
Max: 96
Exclude:
- 'spec/integration/monitor_spec.rb'

# Offense count: 5
# Offense count: 2
Metrics/CyclomaticComplexity:
Max: 11
Max: 8

# Offense count: 18
# Offense count: 15
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 34

# Offense count: 7
# Offense count: 2
# Configuration parameters: CountKeywordArgs.
Metrics/ParameterLists:
Max: 11
Max: 7

# Offense count: 4
# Offense count: 1
Metrics/PerceivedComplexity:
Max: 12
Max: 9

# Offense count: 13
# Offense count: 11
Style/AccessorMethodName:
Exclude:
- 'lib/dogapi/facade.rb'
- 'lib/dogapi/v1/alert.rb'
- 'lib/dogapi/v1/dash.rb'
- 'lib/dogapi/v1/dashboard.rb'
- 'lib/dogapi/v1/embed.rb'
- 'lib/dogapi/v1/screenboard.rb'
- 'lib/dogapi/v1/dashboard.rb'
- 'lib/dogapi/v1/user.rb'

# Offense count: 1
Expand Down Expand Up @@ -308,7 +283,7 @@ Style/ClassMethods:
Exclude:
- 'lib/dogapi/common.rb'

# Offense count: 3
# Offense count: 2
Style/ClassVars:
Exclude:
- 'lib/dogapi/common.rb'
Expand All @@ -320,24 +295,24 @@ Style/ColonMethodCall:
- 'lib/capistrano/datadog.rb'
- 'lib/capistrano/datadog/v2.rb'

# Offense count: 1
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerBackticks.
# SupportedStyles: backticks, percent_x, mixed
Style/CommandLiteral:
Exclude:
- 'lib/capistrano/datadog.rb'
- 'lib/dogapi/common.rb'

# Offense count: 2
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly, IncludeTernaryExpressions.
# SupportedStyles: assign_to_condition, assign_inside_condition
Style/ConditionalAssignment:
Exclude:
- 'lib/capistrano/datadog.rb'
- 'lib/dogapi/v1/service_level_objective.rb'

# Offense count: 21
# Offense count: 20
# Cop supports --auto-correct.
Style/DefWithParentheses:
Exclude:
Expand All @@ -347,17 +322,36 @@ Style/DefWithParentheses:
- 'lib/dogapi/v1/metric.rb'
- 'lib/dogapi/v1/screenboard.rb'

# Offense count: 23
# Offense count: 21
Style/Documentation:
Enabled: false
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'lib/capistrano/datadog.rb'
- 'lib/capistrano/datadog/v2.rb'
- 'lib/capistrano/datadog/v3.rb'
- 'lib/dogapi/common.rb'
- 'lib/dogapi/v1/alert.rb'
- 'lib/dogapi/v1/comment.rb'
- 'lib/dogapi/v1/dash.rb'
- 'lib/dogapi/v1/metadata.rb'
- 'lib/dogapi/v1/monitor.rb'
- 'lib/dogapi/v1/screenboard.rb'
- 'lib/dogapi/v1/search.rb'
- 'lib/dogapi/v1/service_check.rb'
- 'lib/dogapi/v1/snapshot.rb'
- 'lib/dogapi/v1/user.rb'
- 'lib/dogapi/v1/integration.rb'
- 'lib/dogapi/v1/usage.rb'
- 'lib/dogapi/v1/metric.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/EmptyLiteral:
Exclude:
- 'lib/dogapi/v1/metric.rb'

# Offense count: 3
# Offense count: 2
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Exclude:
Expand Down Expand Up @@ -405,7 +399,7 @@ Style/LineEndConcatenation:
Exclude:
- 'dogapi.gemspec'

# Offense count: 18
# Offense count: 15
# Cop supports --auto-correct.
Style/MethodCallWithoutArgsParentheses:
Exclude:
Expand All @@ -420,7 +414,7 @@ Style/MultilineIfThen:
Exclude:
- 'lib/capistrano/datadog.rb'

# Offense count: 30
# Offense count: 21
# Cop supports --auto-correct.
Style/MutableConstant:
Enabled: false
Expand All @@ -440,17 +434,12 @@ Style/Not:
Exclude:
- 'lib/dogapi/v1/metric.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Strict.
Style/NumericLiterals:
MinDigits: 8

# Offense count: 4
# Offense count: 5
# Cop supports --auto-correct.
# Configuration parameters: PreferredDelimiters.
Style/PercentLiteralDelimiters:
Exclude:
- 'lib/capistrano/datadog.rb'
- 'lib/dogapi/common.rb'
- 'spec/integration/event_spec.rb'
- 'spec/integration/monitor_spec.rb'
Expand All @@ -463,11 +452,12 @@ Style/PreferredHashMethods:
Exclude:
- 'lib/dogapi/common.rb'

# Offense count: 2
# Offense count: 3
# Cop supports --auto-correct.
Style/RedundantBegin:
Exclude:
- 'lib/capistrano/datadog.rb'
- 'lib/dogapi/common.rb'
- 'lib/dogapi/v1/metric.rb'

# Offense count: 2
Expand Down Expand Up @@ -507,7 +497,7 @@ Style/SpecialGlobalVars:
Exclude:
- 'dogapi.gemspec'

# Offense count: 23
# Offense count: 22
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Expand All @@ -519,7 +509,6 @@ Style/StringLiterals:
- 'examples/Capfile'
- 'examples/custom_event.rb'
- 'lib/dogapi/event.rb'
- 'spec/integration/service_level_objective_spec.rb'

# Offense count: 10
# Cop supports --auto-correct.
Expand All @@ -537,11 +526,11 @@ Style/TrailingCommaInLiteral:

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: SupportedStyles, WordRegex.
# Configuration parameters: EnforcedStyle, SupportedStyles, MinSize, WordRegex.
# SupportedStyles: percent, brackets
Style/WordArray:
EnforcedStyle: percent
MinSize: 3
Exclude:
- 'examples/custom_event.rb'

# Offense count: 1
# Cop supports --auto-correct.
Expand Down
54 changes: 0 additions & 54 deletions lib/dogapi/facade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ def initialize(api_key, application_key=nil, host=nil, device=nil, silent=true,
@hosts_svc = Dogapi::V1::HostsService.new(@api_key, @application_key, silent, timeout, @datadog_host)
@integration_svc = Dogapi::V1::IntegrationService.new(@api_key, @application_key, silent, timeout, @datadog_host)
@usage_svc = Dogapi::V1::UsageService.new(@api_key, @application_key, silent, timeout, @datadog_host)
@service_level_objective_svc = Dogapi::V1::ServiceLevelObjectiveService.new(@api_key, @application_key, silent,
timeout, @datadog_host)

# Support for Dashboard List API v2.
@v2 = Dogapi::ClientV2.new(@api_key, @application_key, true, true, @datadog_host)
Expand Down Expand Up @@ -618,58 +616,6 @@ def unmute_host(hostname)
@monitor_svc.unmute_host(hostname)
end

#
# SERVICE LEVEL OBJECTIVES
#

def create_service_level_objective(type: , name: , description: nil, tags: nil, thresholds: nil, numerator: nil,
denominator: nil, monitor_ids: nil, monitor_search: nil, groups: nil)
@service_level_objective_svc.create_service_level_objective(type: type, name: name, description: description,
tags: tags, thresholds: thresholds,
numerator: numerator, denominator: denominator,
monitor_ids: monitor_ids,
monitor_search: monitor_search, groups: groups)
end

def update_service_level_objective(slo_id: , type: , name: nil, description: nil, tags: nil, thresholds: nil,
numerator: nil, denominator: nil, monitor_ids: nil, monitor_search: nil,
groups: nil)
@service_level_objective_svc.update_service_level_objective(slo_id: slo_id, type: type, name: name,
description: description, tags: tags,
thresholds: thresholds, numerator: numerator,
denominator: denominator, monitor_ids: monitor_ids,
monitor_search: monitor_search, groups: groups)
end

def get_service_level_objective(slo_id)
@service_level_objective_svc.get_service_level_objective(slo_id)
end

def get_service_level_objective_history(slo_id, from_ts, to_ts)
@service_level_objective_svc.get_service_level_objective_history(slo_id, from_ts, to_ts)
end

def search_service_level_objective(slo_ids: nil, query: nil, offset: nil, limit: nil)
@service_level_objective_svc.search_service_level_objective(slo_ids: slo_ids, query: query, offset: offset,
limit: limit)
end

def can_delete_service_level_objective(slo_ids)
@service_level_objective_svc.can_delete_service_level_objective(slo_ids)
end

def delete_service_level_objective(slo_id)
@service_level_objective_svc.delete_service_level_objective(slo_id)
end

def delete_many_service_level_objective(slo_ids)
@service_level_objective_svc.delete_many_service_level_objective(slo_ids)
end

def delete_timeframes_service_level_objective(ops)
@service_level_objective_svc.delete_timeframes_service_level_objective(ops)
end

#
# SERVICE CHECKS
#
Expand Down
1 change: 0 additions & 1 deletion lib/dogapi/v1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
require 'dogapi/v1/screenboard'
require 'dogapi/v1/search'
require 'dogapi/v1/service_check'
require 'dogapi/v1/service_level_objective'
require 'dogapi/v1/snapshot'
require 'dogapi/v1/tag'
require 'dogapi/v1/user'
Expand Down
Loading

0 comments on commit 28ea62f

Please sign in to comment.