Class: Dogapi::V1::AwsIntegrationService

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

Overview

AwsIntegrationService for user interaction with AWS configs.

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

#aws_integration_create(config) ⇒ Object

Create an AWS integration :config => Hash: integration config. config =

:account_id => '<AWS_ACCOUNT>',
:host_tags => ['api:example'],
:role_name => '<AWS_ROLE_NAME>'

Access Key/Secret Access Key based accounts (GovCloud and China only)

config =

:access_key_id => '<AWS_ACCESS_KEY_ID>',
:host_tags => ['api:example'],
:secret_access_key => '<AWS_SECRET_ACCESS_KEY>'

dog = Dogapi::Client.new(api_key, app_key)

puts dog.aws_integration_create(config)



37
38
39
# File 'lib/dogapi/v1/aws_integration.rb', line 37

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

#aws_integration_delete(config) ⇒ Object

Delete an integration :config => Hash: integration config. config =

:account_id => '<AWS_ACCOUNT>',
:role_name => '<AWS_ROLE_NAME>'

Access Key/Secret Access Key based accounts (GovCloud and China only)

config =

:access_key_id => '<AWS_ACCESS_KEY_ID>',

dog = Dogapi::Client.new(api_key, app_key)

puts dog.aws_integration_delete(config)



56
57
58
# File 'lib/dogapi/v1/aws_integration.rb', line 56

def aws_integration_delete(config)
  request(Net::HTTP::Delete, "/api/#{API_VERSION}/integration/aws", nil, config, true)
end

#aws_integration_generate_external_id(config) ⇒ Object

Generate new AWS external ID for a specific integrated account :config => Hash: integration config. config =

:account_id => '<AWS_ACCOUNT>',
:role_name => '<AWS_ROLE_NAME>'

dog = Dogapi::Client.new(api_key, app_key)

puts dog.aws_integration_generate_external_id(config)



75
76
77
# File 'lib/dogapi/v1/aws_integration.rb', line 75

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

#aws_integration_listObject

Retrieve AWS integration information



14
15
16
# File 'lib/dogapi/v1/aws_integration.rb', line 14

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

#aws_integration_list_namespacesObject

List available AWS namespaces



61
62
63
# File 'lib/dogapi/v1/aws_integration.rb', line 61

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

#aws_integration_update(config, new_config) ⇒ Object

puts dog.aws_integration_update(config, new_config)



108
109
110
# File 'lib/dogapi/v1/aws_integration.rb', line 108

def aws_integration_update(config, new_config)
  request(Net::HTTP::Put, "/api/#{API_VERSION}/integration/aws", config, new_config, true)
end