Class: Dogapi::V1::IntegrationService

Inherits:
APIService
  • Object
show all
Defined in:
lib/dogapi/v1/integration.rb

Constant Summary collapse

API_VERSION =
'v1'

Instance Attribute Summary

Attributes inherited from APIService

#api_key, #application_key

Instance Method Summary collapse

Methods inherited from APIService

#connect, #handle_redirect, #handle_response, #initialize, #prepare_params, #prepare_request, #request, #should_set_api_and_app_keys_in_params?, #suppress_error_if_silent

Constructor Details

This class inherits a constructor from Dogapi::APIService

Instance Method Details

#create_integration(source_type_name, config) ⇒ Object

Create an integration

:source_type_name => String: the name of an integration source :config => Hash: integration config that varies based on the source type. See docs.datadoghq.com/api/#integrations.



17
18
19
# File 'lib/dogapi/v1/integration.rb', line 17

def create_integration(source_type_name, config)
  request(Net::HTTP::Post, "/api/#{API_VERSION}/integration/#{source_type_name}", nil, config, true)
end

#delete_integration(source_type_name) ⇒ Object

Delete an integration

:source_type_name => String: the name of an integration source



40
41
42
# File 'lib/dogapi/v1/integration.rb', line 40

def delete_integration(source_type_name)
  request(Net::HTTP::Delete, "/api/#{API_VERSION}/integration/#{source_type_name}", nil, nil, false)
end

#get_integration(source_type_name) ⇒ Object

Retrieve integration information

:source_type_name => String: the name of an integration source



33
34
35
# File 'lib/dogapi/v1/integration.rb', line 33

def get_integration(source_type_name)
  request(Net::HTTP::Get, "/api/#{API_VERSION}/integration/#{source_type_name}", nil, nil, false)
end

#update_integration(source_type_name, config) ⇒ Object

Update an integration

:source_type_name => String: the name of an integration source :config => Hash: integration config that varies based on the source type. source type (docs.datadoghq.com/api/#integrations)



26
27
28
# File 'lib/dogapi/v1/integration.rb', line 26

def update_integration(source_type_name, config)
  request(Net::HTTP::Put, "/api/#{API_VERSION}/integration/#{source_type_name}", nil, config, true)
end