Module: ESP
- Defined in:
- lib/esp/aws_clients.rb,
lib/esp.rb,
lib/esp/version.rb,
lib/esp/exceptions.rb,
lib/esp/resources/tag.rb,
lib/esp/resources/stat.rb,
lib/esp/resources/team.rb,
lib/esp/resources/user.rb,
lib/esp/resources/alert.rb,
lib/esp/commands/console.rb,
lib/esp/resources/region.rb,
lib/esp/resources/report.rb,
lib/esp/resources/service.rb,
lib/esp/resources/metadata.rb,
lib/esp/resources/resource.rb,
lib/esp/resources/dashboard.rb,
lib/esp/resources/signature.rb,
lib/esp/resources/stat_region.rb,
lib/esp/resources/suppression.rb,
lib/esp/resources/organization.rb,
lib/esp/resources/stat_service.rb,
lib/esp/commands/commands_tasks.rb,
lib/esp/resources/scan_interval.rb,
lib/esp/external_account_creator.rb,
lib/esp/resources/stat_signature.rb,
lib/esp/resources/contact_request.rb,
lib/esp/resources/custom_signature.rb,
lib/esp/resources/external_account.rb,
lib/esp/resources/sub_organization.rb,
lib/esp/resources/cloud_trail_event.rb,
lib/esp/resources/suppression/region.rb,
lib/esp/resources/stat_custom_signature.rb,
lib/esp/resources/suppression/signature.rb,
lib/esp/resources/reports/export/integration.rb,
lib/esp/resources/suppression/unique_identifier.rb
Overview
:nodoc: all
Defined Under Namespace
Modules: StatTotals Classes: AWSClients, AddExternalAccountError, Alert, CloudTrailEvent, CommandsTasks, Console, ContactRequest, CustomSignature, Dashboard, ExternalAccount, ExternalAccountCreator, Metadata, NotImplementedError, Organization, Region, Report, Resource, ScanInterval, Service, Signature, Stat, StatCustomSignature, StatRegion, StatService, StatSignature, SubOrganization, Suppression, Tag, Team, User
Constant Summary collapse
- PATH =
'/api/v2'.freeze
- HOST =
{ development: "http://localhost:3000".freeze, test: "http://localhost:3000".freeze, production: "https://api.evident.io".freeze }.freeze
- VERSION =
'2.3.0'
Class Method Summary collapse
-
.access_key_id ⇒ Object
Reads the
ESP_ACCESS_KEY_IDenvironment variable if ::access_key_id was not set manually. -
.access_key_id=(access_key_id) ⇒ Object
Manually set the access_key_id you created from esp.evident.io/settings/api_keys.
-
.configure {|_self| ... } ⇒ Object
For use in a Rails initializer to set the ::access_key_id, ::secret_access_key and ::site.
-
.env ⇒ Object
Default environment is production which will set ::site to “api.evident.io/api/v2”.
-
.host=(host) ⇒ Object
Users of the Evident.io marketplace appliance application will need to set the host for their instance.
-
.http_proxy ⇒ Object
Reads the
HTTP_PROXYenvironment variable if ::http_proxy was not set manually. -
.http_proxy=(proxy) ⇒ Object
Manually set an http_proxy.
-
.secret_access_key ⇒ Object
Reads the
ESP_SECRET_ACCESS_KEYenvironment variable if ::secret_access_key was not set manually. -
.secret_access_key=(secret_access_key) ⇒ Object
Manually set the secret_access_key you created from esp.evident.io/settings/api_keys.
-
.site ⇒ Object
The site the SDK will hit.
Class Method Details
.access_key_id ⇒ Object
Reads the ESP_ACCESS_KEY_ID environment variable if ::access_key_id was not set manually.
11 12 13 |
# File 'lib/esp.rb', line 11 def self.access_key_id @access_key_id || ENV['ESP_ACCESS_KEY_ID'] end |
.access_key_id=(access_key_id) ⇒ Object
Manually set the access_key_id you created from esp.evident.io/settings/api_keys.
You can optionally set the ESP_ACCESS_KEY_ID environment variable.
5 6 7 8 |
# File 'lib/esp.rb', line 5 def self.access_key_id=(access_key_id) @access_key_id = access_key_id ESP::Resource.hmac_access_id = access_key_id end |
.configure {|_self| ... } ⇒ Object
For use in a Rails initializer to set the ::access_key_id, ::secret_access_key and ::site.
Example
ESP.configure do |config|
config.access_key_id = <your key>
config.secret_access_key = <your secret key>
config.host = <host of your appliance instance>
config.http_proxy = <your proxy URI>
end
76 77 78 |
# File 'lib/esp.rb', line 76 def self.configure yield self end |
.env ⇒ Object
Default environment is production which will set ::site to “api.evident.io/api/v2”.
81 82 83 |
# File 'lib/esp.rb', line 81 def self.env @env ||= ActiveSupport::StringInquirer.new(ENV['ESP_ENV'] || ENV['RAILS_ENV'] || 'production') end |
.host=(host) ⇒ Object
Users of the Evident.io marketplace appliance application will need to set the host for their instance.
Attribute
-
host- The host for the installed appliance instance.
39 40 41 42 |
# File 'lib/esp.rb', line 39 def self.host=(host) @host = host ESP::Resource.site = site end |
.http_proxy ⇒ Object
Reads the HTTP_PROXY environment variable if ::http_proxy was not set manually.
62 63 64 |
# File 'lib/esp.rb', line 62 def self.http_proxy @http_proxy || ENV['http_proxy'] end |
.http_proxy=(proxy) ⇒ Object
Manually set an http_proxy
You can optionally set the HTTP_PROXY environment variable.
Attribute
-
http_proxy- The URI of the http proxy
56 57 58 59 |
# File 'lib/esp.rb', line 56 def self.http_proxy=(proxy) @http_proxy = proxy ESP::Resource.proxy = http_proxy end |
.secret_access_key ⇒ Object
Reads the ESP_SECRET_ACCESS_KEY environment variable if ::secret_access_key was not set manually.
24 25 26 |
# File 'lib/esp.rb', line 24 def self.secret_access_key @secret_access_key || ENV['ESP_SECRET_ACCESS_KEY'] end |
.secret_access_key=(secret_access_key) ⇒ Object
Manually set the secret_access_key you created from esp.evident.io/settings/api_keys.
You can optionally set the ESP_SECRET_ACCESS_KEY environment variable.
18 19 20 21 |
# File 'lib/esp.rb', line 18 def self.secret_access_key=(secret_access_key) @secret_access_key = secret_access_key ESP::Resource.hmac_secret_key = secret_access_key end |
.site ⇒ Object
The site the SDK will hit.
45 46 47 |
# File 'lib/esp.rb', line 45 def self.site "#{(@host || HOST[ESP.env.to_sym] || ENV['ESP_HOST'])}#{PATH}" end |