Class: Aws::LookoutMetrics::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb

Overview

An API client for LookoutMetrics. To construct a client, you need to configure a :region and :credentials.

client = Aws::LookoutMetrics::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

For details on configuring region and credentials see the developer guide.

See #initialize for a full list of supported configuration options.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#api_requests, #stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.

Parameters:

  • options (Hash)

Options Hash (options):

  • :plugins (Array<Seahorse::Client::Plugin>) — default: []]

    A list of plugins to apply to the client. Each plugin is either a class name or an instance of a plugin class.

  • :credentials (required, Aws::CredentialProvider)

    Your AWS credentials. This can be an instance of any one of the following classes:

    • Aws::Credentials - Used for configuring static, non-refreshing credentials.

    • Aws::SharedCredentials - Used for loading static credentials from a shared file, such as ~/.aws/config.

    • Aws::AssumeRoleCredentials - Used when you need to assume a role.

    • Aws::AssumeRoleWebIdentityCredentials - Used when you need to assume a role after providing credentials via the web.

    • Aws::SSOCredentials - Used for loading credentials from AWS SSO using an access token generated from aws login.

    • Aws::ProcessCredentials - Used for loading credentials from a process that outputs to stdout.

    • Aws::InstanceProfileCredentials - Used for loading credentials from an EC2 IMDS on an EC2 instance.

    • Aws::ECSCredentials - Used for loading credentials from instances running in ECS.

    • Aws::CognitoIdentityCredentials - Used for loading credentials from the Cognito Identity service.

    When :credentials are not configured directly, the following locations will be searched for credentials:

    • Aws.config[:credentials]
    • The :access_key_id, :secret_access_key, :session_token, and :account_id options.
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'], ENV['AWS_SESSION_TOKEN'], and ENV['AWS_ACCOUNT_ID']
    • ~/.aws/credentials
    • ~/.aws/config
    • EC2/ECS IMDS instance profile - When used by default, the timeouts are very aggressive. Construct and pass an instance of Aws::InstanceProfileCredentials or Aws::ECSCredentials to enable retries and extended timeouts. Instance profile credential fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED'] to true.
  • :region (required, String)

    The AWS region to connect to. The configured :region is used to determine the service :endpoint. When not passed, a default :region is searched for in the following locations:

    • Aws.config[:region]
    • ENV['AWS_REGION']
    • ENV['AMAZON_REGION']
    • ENV['AWS_DEFAULT_REGION']
    • ~/.aws/credentials
    • ~/.aws/config
  • :access_key_id (String)
  • :account_id (String)
  • :active_endpoint_cache (Boolean) — default: false

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false.

  • :adaptive_retry_wait_to_fill (Boolean) — default: true

    Used only in adaptive retry mode. When true, the request will sleep until there is sufficent client side capacity to retry the request. When false, the request will raise a RetryCapacityNotAvailableError and will not retry instead of sleeping.

  • :client_side_monitoring (Boolean) — default: false

    When true, client-side metrics will be collected for all API requests from this client.

  • :client_side_monitoring_client_id (String) — default: ""

    Allows you to provide an identifier for this client which will be attached to all generated client side metrics. Defaults to an empty string.

  • :client_side_monitoring_host (String) — default: "127.0.0.1"

    Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_port (Integer) — default: 31000

    Required for publishing client metrics. The port that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher) — default: Aws::ClientSideMonitoring::Publisher

    Allows you to provide a custom client-side monitoring publisher class. By default, will use the Client Side Monitoring Agent Publisher.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types.

  • :correct_clock_skew (Boolean) — default: true

    Used only in standard and adaptive retry modes. Specifies whether to apply a clock skew correction and retry requests with skewed client clocks.

  • :defaults_mode (String) — default: "legacy"

    See DefaultsModeConfiguration for a list of the accepted modes and the configuration defaults that are included.

  • :disable_host_prefix_injection (Boolean) — default: false

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available.

  • :disable_request_compression (Boolean) — default: false

    When set to 'true' the request body will not be compressed for supported operations.

  • :endpoint (String, URI::HTTPS, URI::HTTP)

    Normally you should not configure the :endpoint option directly. This is normally constructed from the :region option. Configuring :endpoint is normally reserved for connecting to test or custom endpoints. The endpoint should be a URI formatted like:

    'http://example.com'
    'https://example.com'
    'http://example.com:123'
    
  • :endpoint_cache_max_entries (Integer) — default: 1000

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000.

  • :endpoint_cache_max_threads (Integer) — default: 10

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.

  • :endpoint_cache_poll_interval (Integer) — default: 60

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec.

  • :endpoint_discovery (Boolean) — default: false

    When set to true, endpoint discovery will be enabled for operations when available.

  • :ignore_configured_endpoint_urls (Boolean)

    Setting to true disables use of endpoint URLs provided via environment variables and the shared configuration file.

  • :log_formatter (Aws::Log::Formatter) — default: Aws::Log::Formatter.default

    The log formatter.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the :logger at.

  • :logger (Logger)

    The Logger instance to send log messages to. If this option is not set, logging will be disabled.

  • :max_attempts (Integer) — default: 3

    An integer representing the maximum number attempts that will be made for a single request, including the initial attempt. For example, setting this value to 5 will result in a request being retried up to 4 times. Used in standard and adaptive retry modes.

  • :profile (String) — default: "default"

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used.

  • :request_min_compression_size_bytes (Integer) — default: 10240

    The minimum size in bytes that triggers compression for request bodies. The value must be non-negative integer value between 0 and 10485780 bytes inclusive.

  • :retry_backoff (Proc)

    A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay. This option is only used in the legacy retry mode.

  • :retry_base_delay (Float) — default: 0.3

    The base delay in seconds used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_jitter (Symbol) — default: :none

    A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number. This option is only used in the legacy retry mode.

    @see https://www.awsarchitectureblog.com/2015/03/backoff.html

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors, auth errors, endpoint discovery, and errors from expired credentials. This option is only used in the legacy retry mode.

  • :retry_max_delay (Integer) — default: 0

    The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_mode (String) — default: "legacy"

    Specifies which retry algorithm to use. Values are:

    • legacy - The pre-existing retry behavior. This is default value if no retry mode is provided.

    • standard - A standardized set of retry rules across the AWS SDKs. This includes support for retry quotas, which limit the number of unsuccessful retries a client can make.

    • adaptive - An experimental retry mode that includes all the functionality of standard mode along with automatic client side throttling. This is a provisional mode that may change behavior in the future.

  • :sdk_ua_app_id (String)

    A unique and opaque application ID that is appended to the User-Agent header as app/sdk_ua_app_id. It should have a maximum length of 50. This variable is sourced from environment variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.

  • :secret_access_key (String)
  • :session_token (String)
  • :sigv4a_signing_region_set (Array)

    A list of regions that should be signed with SigV4a signing. When not passed, a default :sigv4a_signing_region_set is searched for in the following locations:

    • Aws.config[:sigv4a_signing_region_set]
    • ENV['AWS_SIGV4A_SIGNING_REGION_SET']
    • ~/.aws/config
  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled.

  • :telemetry_provider (Aws::Telemetry::TelemetryProviderBase) — default: Aws::Telemetry::NoOpTelemetryProvider

    Allows you to provide a telemetry provider, which is used to emit telemetry data. By default, uses NoOpTelemetryProvider which will not record or emit any telemetry data. The SDK supports the following telemetry providers:

    • OpenTelemetry (OTel) - To use the OTel provider, install and require the opentelemetry-sdk gem and then, pass in an instance of a Aws::Telemetry::OTelProvider for telemetry provider.
  • :token_provider (Aws::TokenProvider)

    A Bearer Token Provider. This can be an instance of any one of the following classes:

    • Aws::StaticTokenProvider - Used for configuring static, non-refreshing tokens.

    • Aws::SSOTokenProvider - Used for loading tokens from AWS SSO using an access token generated from aws login.

    When :token_provider is not configured directly, the Aws::TokenProviderChain will be used to search for tokens configured for your profile in shared configuration files.

  • :use_dualstack_endpoint (Boolean)

    When set to true, dualstack enabled endpoints (with .aws TLD) will be used if available.

  • :use_fips_endpoint (Boolean)

    When set to true, fips compatible endpoints will be used if available. When a fips region is used, the region is normalized and this config is set to true.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request.

  • :endpoint_provider (Aws::LookoutMetrics::EndpointProvider)

    The endpoint provider used to resolve endpoints. Any object that responds to #resolve_endpoint(parameters) where parameters is a Struct similar to Aws::LookoutMetrics::EndpointParameters.

  • :http_continue_timeout (Float) — default: 1

    The number of seconds to wait for a 100-continue response before sending the request body. This option has no effect unless the request has "Expect" header set to "100-continue". Defaults to nil which disables this behaviour. This value can safely be set per request on the session.

  • :http_idle_timeout (Float) — default: 5

    The number of seconds a connection is allowed to sit idle before it is considered stale. Stale connections are closed and removed from the pool before making a request.

  • :http_open_timeout (Float) — default: 15

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_proxy (URI::HTTP, String)

    A proxy to send requests through. Formatted like 'http://proxy.com:123'.

  • :http_read_timeout (Float) — default: 60

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_wire_trace (Boolean) — default: false

    When true, HTTP debug output will be sent to the :logger.

  • :on_chunk_received (Proc)

    When a Proc object is provided, it will be used as callback when each chunk of the response body is received. It provides three arguments: the chunk, the number of bytes received, and the total number of bytes in the response (or nil if the server did not send a content-length).

  • :on_chunk_sent (Proc)

    When a Proc object is provided, it will be used as callback when each chunk of the request body is sent. It provides three arguments: the chunk, the number of bytes read from the body, and the total number of bytes in the body.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised.

  • :ssl_ca_bundle (String)

    Full path to the SSL certificate authority bundle file that should be used when verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.

  • :ssl_ca_directory (String)

    Full path of the directory that contains the unbundled SSL certificate authority files for verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.

  • :ssl_ca_store (String)

    Sets the X509::Store to verify peer certificate.

  • :ssl_cert (OpenSSL::X509::Certificate)

    Sets a client certificate when creating http connections.

  • :ssl_key (OpenSSL::PKey)

    Sets a client key when creating http connections.

  • :ssl_timeout (Float)

    Sets the SSL timeout in seconds

  • :ssl_verify_peer (Boolean) — default: true

    When true, SSL peer certificates are verified when establishing a connection.



444
445
446
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 444

def initialize(*args)
  super
end

Instance Method Details

#activate_anomaly_detector(params = {}) ⇒ Struct

Activates an anomaly detector.

Examples:

Request syntax with placeholder values


resp = client.activate_anomaly_detector({
  anomaly_detector_arn: "Arn", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_detector_arn (required, String)

    The ARN of the anomaly detector.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



467
468
469
470
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 467

def activate_anomaly_detector(params = {}, options = {})
  req = build_request(:activate_anomaly_detector, params)
  req.send_request(options)
end

#back_test_anomaly_detector(params = {}) ⇒ Struct

Runs a backtest for anomaly detection for the specified resource.

Examples:

Request syntax with placeholder values


resp = client.back_test_anomaly_detector({
  anomaly_detector_arn: "Arn", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_detector_arn (required, String)

    The Amazon Resource Name (ARN) of the anomaly detector.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



489
490
491
492
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 489

def back_test_anomaly_detector(params = {}, options = {})
  req = build_request(:back_test_anomaly_detector, params)
  req.send_request(options)
end

#create_alert(params = {}) ⇒ Types::CreateAlertResponse

Creates an alert for an anomaly detector.

Examples:

Request syntax with placeholder values


resp = client.create_alert({
  alert_name: "AlertName", # required
  alert_sensitivity_threshold: 1,
  alert_description: "AlertDescription",
  anomaly_detector_arn: "Arn", # required
  action: { # required
    sns_configuration: {
      role_arn: "Arn", # required
      sns_topic_arn: "Arn", # required
      sns_format: "LONG_TEXT", # accepts LONG_TEXT, SHORT_TEXT, JSON
    },
    lambda_configuration: {
      role_arn: "Arn", # required
      lambda_arn: "Arn", # required
    },
  },
  tags: {
    "TagKey" => "TagValue",
  },
  alert_filters: {
    metric_list: ["MetricName"],
    dimension_filter_list: [
      {
        dimension_name: "ColumnName",
        dimension_value_list: ["DimensionValue"],
      },
    ],
  },
})

Response structure


resp.alert_arn #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :alert_name (required, String)

    The name of the alert.

  • :alert_sensitivity_threshold (Integer)

    An integer from 0 to 100 specifying the alert sensitivity threshold.

  • :alert_description (String)

    A description of the alert.

  • :anomaly_detector_arn (required, String)

    The ARN of the detector to which the alert is attached.

  • :action (required, Types::Action)

    Action that will be triggered when there is an alert.

  • :tags (Hash<String,String>)

    A list of tags to apply to the alert.

  • :alert_filters (Types::AlertFilters)

    The configuration of the alert filters, containing MetricList and DimensionFilterList.

Returns:

See Also:



566
567
568
569
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 566

def create_alert(params = {}, options = {})
  req = build_request(:create_alert, params)
  req.send_request(options)
end

#create_anomaly_detector(params = {}) ⇒ Types::CreateAnomalyDetectorResponse

Creates an anomaly detector.

Examples:

Request syntax with placeholder values


resp = client.create_anomaly_detector({
  anomaly_detector_name: "AnomalyDetectorName", # required
  anomaly_detector_description: "AnomalyDetectorDescription",
  anomaly_detector_config: { # required
    anomaly_detector_frequency: "P1D", # accepts P1D, PT1H, PT10M, PT5M
  },
  kms_key_arn: "KmsKeyArn",
  tags: {
    "TagKey" => "TagValue",
  },
})

Response structure


resp.anomaly_detector_arn #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_detector_name (required, String)

    The name of the detector.

  • :anomaly_detector_description (String)

    A description of the detector.

  • :anomaly_detector_config (required, Types::AnomalyDetectorConfig)

    Contains information about the configuration of the anomaly detector.

  • :kms_key_arn (String)

    The ARN of the KMS key to use to encrypt your data.

  • :tags (Hash<String,String>)

    A list of tags to apply to the anomaly detector.

Returns:

See Also:



618
619
620
621
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 618

def create_anomaly_detector(params = {}, options = {})
  req = build_request(:create_anomaly_detector, params)
  req.send_request(options)
end

#create_metric_set(params = {}) ⇒ Types::CreateMetricSetResponse

Creates a dataset.

Examples:

Request syntax with placeholder values


resp = client.create_metric_set({
  anomaly_detector_arn: "Arn", # required
  metric_set_name: "MetricSetName", # required
  metric_set_description: "MetricSetDescription",
  metric_list: [ # required
    {
      metric_name: "ColumnName", # required
      aggregation_function: "AVG", # required, accepts AVG, SUM
      namespace: "Namespace",
    },
  ],
  offset: 1,
  timestamp_column: {
    column_name: "ColumnName",
    column_format: "DateTimeFormat",
  },
  dimension_list: ["ColumnName"],
  metric_set_frequency: "P1D", # accepts P1D, PT1H, PT10M, PT5M
  metric_source: { # required
    s3_source_config: {
      role_arn: "Arn",
      templated_path_list: ["TemplatedPath"],
      historical_data_path_list: ["HistoricalDataPath"],
      file_format_descriptor: {
        csv_format_descriptor: {
          file_compression: "NONE", # accepts NONE, GZIP
          charset: "Charset",
          contains_header: false,
          delimiter: "Delimiter",
          header_list: ["ColumnName"],
          quote_symbol: "QuoteSymbol",
        },
        json_format_descriptor: {
          file_compression: "NONE", # accepts NONE, GZIP
          charset: "Charset",
        },
      },
    },
    app_flow_config: {
      role_arn: "Arn",
      flow_name: "FlowName",
    },
    cloud_watch_config: {
      role_arn: "Arn",
      back_test_configuration: {
        run_back_test_mode: false, # required
      },
    },
    rds_source_config: {
      db_instance_identifier: "RDSDatabaseIdentifier",
      database_host: "DatabaseHost",
      database_port: 1,
      secret_manager_arn: "PoirotSecretManagerArn",
      database_name: "RDSDatabaseName",
      table_name: "TableName",
      role_arn: "Arn",
      vpc_configuration: {
        subnet_id_list: ["SubnetId"], # required
        security_group_id_list: ["SecurityGroupId"], # required
      },
    },
    redshift_source_config: {
      cluster_identifier: "RedshiftClusterIdentifier",
      database_host: "DatabaseHost",
      database_port: 1,
      secret_manager_arn: "PoirotSecretManagerArn",
      database_name: "RedshiftDatabaseName",
      table_name: "TableName",
      role_arn: "Arn",
      vpc_configuration: {
        subnet_id_list: ["SubnetId"], # required
        security_group_id_list: ["SecurityGroupId"], # required
      },
    },
    athena_source_config: {
      role_arn: "Arn",
      database_name: "AthenaDatabaseName",
      data_catalog: "AthenaDataCatalog",
      table_name: "AthenaTableName",
      work_group_name: "AthenaWorkGroupName",
      s3_results_path: "AthenaS3ResultsPath",
      back_test_configuration: {
        run_back_test_mode: false, # required
      },
    },
  },
  timezone: "Timezone",
  tags: {
    "TagKey" => "TagValue",
  },
  dimension_filter_list: [
    {
      name: "ColumnName",
      filter_list: [
        {
          dimension_value: "DimensionValue",
          filter_operation: "EQUALS", # accepts EQUALS
        },
      ],
    },
  ],
})

Response structure


resp.metric_set_arn #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_detector_arn (required, String)

    The ARN of the anomaly detector that will use the dataset.

  • :metric_set_name (required, String)

    The name of the dataset.

  • :metric_set_description (String)

    A description of the dataset you are creating.

  • :metric_list (required, Array<Types::Metric>)

    A list of metrics that the dataset will contain.

  • :offset (Integer)

    After an interval ends, the amount of seconds that the detector waits before importing data. Offset is only supported for S3, Redshift, Athena and datasources.

  • :timestamp_column (Types::TimestampColumn)

    Contains information about the column used for tracking time in your source data.

  • :dimension_list (Array<String>)

    A list of the fields you want to treat as dimensions.

  • :metric_set_frequency (String)

    The frequency with which the source data will be analyzed for anomalies.

  • :metric_source (required, Types::MetricSource)

    Contains information about how the source data should be interpreted.

  • :timezone (String)

    The time zone in which your source data was recorded.

  • :tags (Hash<String,String>)

    A list of tags to apply to the dataset.

  • :dimension_filter_list (Array<Types::MetricSetDimensionFilter>)

    A list of filters that specify which data is kept for anomaly detection.

Returns:

See Also:



787
788
789
790
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 787

def create_metric_set(params = {}, options = {})
  req = build_request(:create_metric_set, params)
  req.send_request(options)
end

#deactivate_anomaly_detector(params = {}) ⇒ Struct

Deactivates an anomaly detector.

Examples:

Request syntax with placeholder values


resp = client.deactivate_anomaly_detector({
  anomaly_detector_arn: "Arn", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_detector_arn (required, String)

    The Amazon Resource Name (ARN) of the anomaly detector.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



809
810
811
812
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 809

def deactivate_anomaly_detector(params = {}, options = {})
  req = build_request(:deactivate_anomaly_detector, params)
  req.send_request(options)
end

#delete_alert(params = {}) ⇒ Struct

Deletes an alert.

Examples:

Request syntax with placeholder values


resp = client.delete_alert({
  alert_arn: "Arn", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :alert_arn (required, String)

    The ARN of the alert to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



831
832
833
834
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 831

def delete_alert(params = {}, options = {})
  req = build_request(:delete_alert, params)
  req.send_request(options)
end

#delete_anomaly_detector(params = {}) ⇒ Struct

Deletes a detector. Deleting an anomaly detector will delete all of its corresponding resources including any configured datasets and alerts.

Examples:

Request syntax with placeholder values


resp = client.delete_anomaly_detector({
  anomaly_detector_arn: "Arn", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_detector_arn (required, String)

    The ARN of the detector to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



855
856
857
858
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 855

def delete_anomaly_detector(params = {}, options = {})
  req = build_request(:delete_anomaly_detector, params)
  req.send_request(options)
end

#describe_alert(params = {}) ⇒ Types::DescribeAlertResponse

Describes an alert.

Amazon Lookout for Metrics API actions are eventually consistent. If you do a read operation on a resource immediately after creating or modifying it, use retries to allow time for the write operation to complete.

Examples:

Request syntax with placeholder values


resp = client.describe_alert({
  alert_arn: "Arn", # required
})

Response structure


resp.alert.action.sns_configuration.role_arn #=> String
resp.alert.action.sns_configuration.sns_topic_arn #=> String
resp.alert.action.sns_configuration.sns_format #=> String, one of "LONG_TEXT", "SHORT_TEXT", "JSON"
resp.alert.action.lambda_configuration.role_arn #=> String
resp.alert.action.lambda_configuration.lambda_arn #=> String
resp.alert.alert_description #=> String
resp.alert.alert_arn #=> String
resp.alert.anomaly_detector_arn #=> String
resp.alert.alert_name #=> String
resp.alert.alert_sensitivity_threshold #=> Integer
resp.alert.alert_type #=> String, one of "SNS", "LAMBDA"
resp.alert.alert_status #=> String, one of "ACTIVE", "INACTIVE"
resp.alert.last_modification_time #=> Time
resp.alert.creation_time #=> Time
resp.alert.alert_filters.metric_list #=> Array
resp.alert.alert_filters.metric_list[0] #=> String
resp.alert.alert_filters.dimension_filter_list #=> Array
resp.alert.alert_filters.dimension_filter_list[0].dimension_name #=> String
resp.alert.alert_filters.dimension_filter_list[0].dimension_value_list #=> Array
resp.alert.alert_filters.dimension_filter_list[0].dimension_value_list[0] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :alert_arn (required, String)

    The ARN of the alert to describe.

Returns:

See Also:



907
908
909
910
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 907

def describe_alert(params = {}, options = {})
  req = build_request(:describe_alert, params)
  req.send_request(options)
end

#describe_anomaly_detection_executions(params = {}) ⇒ Types::DescribeAnomalyDetectionExecutionsResponse

Returns information about the status of the specified anomaly detection jobs.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.describe_anomaly_detection_executions({
  anomaly_detector_arn: "Arn", # required
  timestamp: "TimestampString",
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.execution_list #=> Array
resp.execution_list[0].timestamp #=> String
resp.execution_list[0].status #=> String, one of "PENDING", "IN_PROGRESS", "COMPLETED", "FAILED", "FAILED_TO_SCHEDULE"
resp.execution_list[0].failure_reason #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_detector_arn (required, String)

    The Amazon Resource Name (ARN) of the anomaly detector.

  • :timestamp (String)

    The timestamp of the anomaly detection job.

  • :max_results (Integer)

    The number of items to return in the response.

  • :next_token (String)

    Specify the pagination token that's returned by a previous request to retrieve the next page of results.

Returns:

See Also:



956
957
958
959
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 956

def describe_anomaly_detection_executions(params = {}, options = {})
  req = build_request(:describe_anomaly_detection_executions, params)
  req.send_request(options)
end

#describe_anomaly_detector(params = {}) ⇒ Types::DescribeAnomalyDetectorResponse

Describes a detector.

Amazon Lookout for Metrics API actions are eventually consistent. If you do a read operation on a resource immediately after creating or modifying it, use retries to allow time for the write operation to complete.

Examples:

Request syntax with placeholder values


resp = client.describe_anomaly_detector({
  anomaly_detector_arn: "Arn", # required
})

Response structure


resp.anomaly_detector_arn #=> String
resp.anomaly_detector_name #=> String
resp.anomaly_detector_description #=> String
resp.anomaly_detector_config.anomaly_detector_frequency #=> String, one of "P1D", "PT1H", "PT10M", "PT5M"
resp.creation_time #=> Time
resp.last_modification_time #=> Time
resp.status #=> String, one of "ACTIVE", "ACTIVATING", "DELETING", "FAILED", "INACTIVE", "LEARNING", "BACK_TEST_ACTIVATING", "BACK_TEST_ACTIVE", "BACK_TEST_COMPLETE", "DEACTIVATED", "DEACTIVATING"
resp.failure_reason #=> String
resp.kms_key_arn #=> String
resp.failure_type #=> String, one of "ACTIVATION_FAILURE", "BACK_TEST_ACTIVATION_FAILURE", "DELETION_FAILURE", "DEACTIVATION_FAILURE"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_detector_arn (required, String)

    The ARN of the detector to describe.

Returns:

See Also:



1007
1008
1009
1010
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1007

def describe_anomaly_detector(params = {}, options = {})
  req = build_request(:describe_anomaly_detector, params)
  req.send_request(options)
end

#describe_metric_set(params = {}) ⇒ Types::DescribeMetricSetResponse

Describes a dataset.

Amazon Lookout for Metrics API actions are eventually consistent. If you do a read operation on a resource immediately after creating or modifying it, use retries to allow time for the write operation to complete.

Examples:

Request syntax with placeholder values


resp = client.describe_metric_set({
  metric_set_arn: "Arn", # required
})

Response structure


resp.metric_set_arn #=> String
resp.anomaly_detector_arn #=> String
resp.metric_set_name #=> String
resp.metric_set_description #=> String
resp.creation_time #=> Time
resp.last_modification_time #=> Time
resp.offset #=> Integer
resp.metric_list #=> Array
resp.metric_list[0].metric_name #=> String
resp.metric_list[0].aggregation_function #=> String, one of "AVG", "SUM"
resp.metric_list[0].namespace #=> String
resp.timestamp_column.column_name #=> String
resp.timestamp_column.column_format #=> String
resp.dimension_list #=> Array
resp.dimension_list[0] #=> String
resp.metric_set_frequency #=> String, one of "P1D", "PT1H", "PT10M", "PT5M"
resp.timezone #=> String
resp.metric_source.s3_source_config.role_arn #=> String
resp.metric_source.s3_source_config.templated_path_list #=> Array
resp.metric_source.s3_source_config.templated_path_list[0] #=> String
resp.metric_source.s3_source_config.historical_data_path_list #=> Array
resp.metric_source.s3_source_config.historical_data_path_list[0] #=> String
resp.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.file_compression #=> String, one of "NONE", "GZIP"
resp.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.charset #=> String
resp.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.contains_header #=> Boolean
resp.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.delimiter #=> String
resp.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.header_list #=> Array
resp.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.header_list[0] #=> String
resp.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.quote_symbol #=> String
resp.metric_source.s3_source_config.file_format_descriptor.json_format_descriptor.file_compression #=> String, one of "NONE", "GZIP"
resp.metric_source.s3_source_config.file_format_descriptor.json_format_descriptor.charset #=> String
resp.metric_source.app_flow_config.role_arn #=> String
resp.metric_source.app_flow_config.flow_name #=> String
resp.metric_source.cloud_watch_config.role_arn #=> String
resp.metric_source.cloud_watch_config.back_test_configuration.run_back_test_mode #=> Boolean
resp.metric_source.rds_source_config.db_instance_identifier #=> String
resp.metric_source.rds_source_config.database_host #=> String
resp.metric_source.rds_source_config.database_port #=> Integer
resp.metric_source.rds_source_config.secret_manager_arn #=> String
resp.metric_source.rds_source_config.database_name #=> String
resp.metric_source.rds_source_config.table_name #=> String
resp.metric_source.rds_source_config.role_arn #=> String
resp.metric_source.rds_source_config.vpc_configuration.subnet_id_list #=> Array
resp.metric_source.rds_source_config.vpc_configuration.subnet_id_list[0] #=> String
resp.metric_source.rds_source_config.vpc_configuration.security_group_id_list #=> Array
resp.metric_source.rds_source_config.vpc_configuration.security_group_id_list[0] #=> String
resp.metric_source.redshift_source_config.cluster_identifier #=> String
resp.metric_source.redshift_source_config.database_host #=> String
resp.metric_source.redshift_source_config.database_port #=> Integer
resp.metric_source.redshift_source_config.secret_manager_arn #=> String
resp.metric_source.redshift_source_config.database_name #=> String
resp.metric_source.redshift_source_config.table_name #=> String
resp.metric_source.redshift_source_config.role_arn #=> String
resp.metric_source.redshift_source_config.vpc_configuration.subnet_id_list #=> Array
resp.metric_source.redshift_source_config.vpc_configuration.subnet_id_list[0] #=> String
resp.metric_source.redshift_source_config.vpc_configuration.security_group_id_list #=> Array
resp.metric_source.redshift_source_config.vpc_configuration.security_group_id_list[0] #=> String
resp.metric_source.athena_source_config.role_arn #=> String
resp.metric_source.athena_source_config.database_name #=> String
resp.metric_source.athena_source_config.data_catalog #=> String
resp.metric_source.athena_source_config.table_name #=> String
resp.metric_source.athena_source_config.work_group_name #=> String
resp.metric_source.athena_source_config.s3_results_path #=> String
resp.metric_source.athena_source_config.back_test_configuration.run_back_test_mode #=> Boolean
resp.dimension_filter_list #=> Array
resp.dimension_filter_list[0].name #=> String
resp.dimension_filter_list[0].filter_list #=> Array
resp.dimension_filter_list[0].filter_list[0].dimension_value #=> String
resp.dimension_filter_list[0].filter_list[0].filter_operation #=> String, one of "EQUALS"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :metric_set_arn (required, String)

    The ARN of the dataset.

Returns:

See Also:



1121
1122
1123
1124
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1121

def describe_metric_set(params = {}, options = {})
  req = build_request(:describe_metric_set, params)
  req.send_request(options)
end

#detect_metric_set_config(params = {}) ⇒ Types::DetectMetricSetConfigResponse

Detects an Amazon S3 dataset's file format, interval, and offset.

Examples:

Request syntax with placeholder values


resp = client.detect_metric_set_config({
  anomaly_detector_arn: "Arn", # required
  auto_detection_metric_source: { # required
    s3_source_config: {
      templated_path_list: ["TemplatedPath"],
      historical_data_path_list: ["HistoricalDataPath"],
    },
  },
})

Response structure


resp.detected_metric_set_config.offset.value #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.detected_metric_set_config.offset.confidence #=> String, one of "HIGH", "LOW", "NONE"
resp.detected_metric_set_config.offset.message #=> String
resp.detected_metric_set_config.metric_set_frequency.value #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.detected_metric_set_config.metric_set_frequency.confidence #=> String, one of "HIGH", "LOW", "NONE"
resp.detected_metric_set_config.metric_set_frequency.message #=> String
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.file_compression.value #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.file_compression.confidence #=> String, one of "HIGH", "LOW", "NONE"
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.file_compression.message #=> String
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.charset.value #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.charset.confidence #=> String, one of "HIGH", "LOW", "NONE"
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.charset.message #=> String
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.contains_header.value #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.contains_header.confidence #=> String, one of "HIGH", "LOW", "NONE"
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.contains_header.message #=> String
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.delimiter.value #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.delimiter.confidence #=> String, one of "HIGH", "LOW", "NONE"
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.delimiter.message #=> String
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.header_list.value #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.header_list.confidence #=> String, one of "HIGH", "LOW", "NONE"
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.header_list.message #=> String
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.quote_symbol.value #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.quote_symbol.confidence #=> String, one of "HIGH", "LOW", "NONE"
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.csv_format_descriptor.quote_symbol.message #=> String
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.json_format_descriptor.file_compression.value #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.json_format_descriptor.file_compression.confidence #=> String, one of "HIGH", "LOW", "NONE"
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.json_format_descriptor.file_compression.message #=> String
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.json_format_descriptor.charset.value #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.json_format_descriptor.charset.confidence #=> String, one of "HIGH", "LOW", "NONE"
resp.detected_metric_set_config.metric_source.s3_source_config.file_format_descriptor.json_format_descriptor.charset.message #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_detector_arn (required, String)

    An anomaly detector ARN.

  • :auto_detection_metric_source (required, Types::AutoDetectionMetricSource)

    A data source.

Returns:

See Also:



1187
1188
1189
1190
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1187

def detect_metric_set_config(params = {}, options = {})
  req = build_request(:detect_metric_set_config, params)
  req.send_request(options)
end

#get_anomaly_group(params = {}) ⇒ Types::GetAnomalyGroupResponse

Returns details about a group of anomalous metrics.

Examples:

Request syntax with placeholder values


resp = client.get_anomaly_group({
  anomaly_group_id: "UUID", # required
  anomaly_detector_arn: "Arn", # required
})

Response structure


resp.anomaly_group.start_time #=> String
resp.anomaly_group.end_time #=> String
resp.anomaly_group.anomaly_group_id #=> String
resp.anomaly_group.anomaly_group_score #=> Float
resp.anomaly_group.primary_metric_name #=> String
resp.anomaly_group.metric_level_impact_list #=> Array
resp.anomaly_group.metric_level_impact_list[0].metric_name #=> String
resp.anomaly_group.metric_level_impact_list[0].num_time_series #=> Integer
resp.anomaly_group.metric_level_impact_list[0].contribution_matrix.dimension_contribution_list #=> Array
resp.anomaly_group.metric_level_impact_list[0].contribution_matrix.dimension_contribution_list[0].dimension_name #=> String
resp.anomaly_group.metric_level_impact_list[0].contribution_matrix.dimension_contribution_list[0].dimension_value_contribution_list #=> Array
resp.anomaly_group.metric_level_impact_list[0].contribution_matrix.dimension_contribution_list[0].dimension_value_contribution_list[0].dimension_value #=> String
resp.anomaly_group.metric_level_impact_list[0].contribution_matrix.dimension_contribution_list[0].dimension_value_contribution_list[0].contribution_score #=> Float

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_group_id (required, String)

    The ID of the anomaly group.

  • :anomaly_detector_arn (required, String)

    The Amazon Resource Name (ARN) of the anomaly detector.

Returns:

See Also:



1231
1232
1233
1234
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1231

def get_anomaly_group(params = {}, options = {})
  req = build_request(:get_anomaly_group, params)
  req.send_request(options)
end

#get_data_quality_metrics(params = {}) ⇒ Types::GetDataQualityMetricsResponse

Returns details about the requested data quality metrics.

Examples:

Request syntax with placeholder values


resp = client.get_data_quality_metrics({
  anomaly_detector_arn: "Arn", # required
  metric_set_arn: "Arn",
})

Response structure


resp.anomaly_detector_data_quality_metric_list #=> Array
resp.anomaly_detector_data_quality_metric_list[0].start_timestamp #=> Time
resp.anomaly_detector_data_quality_metric_list[0].metric_set_data_quality_metric_list #=> Array
resp.anomaly_detector_data_quality_metric_list[0].metric_set_data_quality_metric_list[0].metric_set_arn #=> String
resp.anomaly_detector_data_quality_metric_list[0].metric_set_data_quality_metric_list[0].data_quality_metric_list #=> Array
resp.anomaly_detector_data_quality_metric_list[0].metric_set_data_quality_metric_list[0].data_quality_metric_list[0].metric_type #=> String, one of "COLUMN_COMPLETENESS", "DIMENSION_UNIQUENESS", "TIME_SERIES_COUNT", "ROWS_PROCESSED", "ROWS_PARTIAL_COMPLIANCE", "INVALID_ROWS_COMPLIANCE", "BACKTEST_TRAINING_DATA_START_TIME_STAMP", "BACKTEST_TRAINING_DATA_END_TIME_STAMP", "BACKTEST_INFERENCE_DATA_START_TIME_STAMP", "BACKTEST_INFERENCE_DATA_END_TIME_STAMP"
resp.anomaly_detector_data_quality_metric_list[0].metric_set_data_quality_metric_list[0].data_quality_metric_list[0].metric_description #=> String
resp.anomaly_detector_data_quality_metric_list[0].metric_set_data_quality_metric_list[0].data_quality_metric_list[0].related_column_name #=> String
resp.anomaly_detector_data_quality_metric_list[0].metric_set_data_quality_metric_list[0].data_quality_metric_list[0].metric_value #=> Float

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_detector_arn (required, String)

    The Amazon Resource Name (ARN) of the anomaly detector that you want to investigate.

  • :metric_set_arn (String)

    The Amazon Resource Name (ARN) of a specific data quality metric set.

Returns:

See Also:



1272
1273
1274
1275
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1272

def get_data_quality_metrics(params = {}, options = {})
  req = build_request(:get_data_quality_metrics, params)
  req.send_request(options)
end

#get_feedback(params = {}) ⇒ Types::GetFeedbackResponse

Get feedback for an anomaly group.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.get_feedback({
  anomaly_detector_arn: "Arn", # required
  anomaly_group_time_series_feedback: { # required
    anomaly_group_id: "UUID", # required
    time_series_id: "TimeSeriesId",
  },
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.anomaly_group_time_series_feedback #=> Array
resp.anomaly_group_time_series_feedback[0].time_series_id #=> String
resp.anomaly_group_time_series_feedback[0].is_anomaly #=> Boolean
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_detector_arn (required, String)

    The Amazon Resource Name (ARN) of the anomaly detector.

  • :anomaly_group_time_series_feedback (required, Types::AnomalyGroupTimeSeries)

    The anomalous metric and group ID.

  • :max_results (Integer)

    The maximum number of results to return.

  • :next_token (String)

    Specify the pagination token that's returned by a previous request to retrieve the next page of results.

Returns:

See Also:



1322
1323
1324
1325
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1322

def get_feedback(params = {}, options = {})
  req = build_request(:get_feedback, params)
  req.send_request(options)
end

#get_sample_data(params = {}) ⇒ Types::GetSampleDataResponse

Returns a selection of sample records from an Amazon S3 datasource.

Examples:

Request syntax with placeholder values


resp = client.get_sample_data({
  s3_source_config: {
    role_arn: "Arn", # required
    templated_path_list: ["TemplatedPath"],
    historical_data_path_list: ["HistoricalDataPath"],
    file_format_descriptor: { # required
      csv_format_descriptor: {
        file_compression: "NONE", # accepts NONE, GZIP
        charset: "Charset",
        contains_header: false,
        delimiter: "Delimiter",
        header_list: ["ColumnName"],
        quote_symbol: "QuoteSymbol",
      },
      json_format_descriptor: {
        file_compression: "NONE", # accepts NONE, GZIP
        charset: "Charset",
      },
    },
  },
})

Response structure


resp.header_values #=> Array
resp.header_values[0] #=> String
resp.sample_rows #=> Array
resp.sample_rows[0] #=> Array
resp.sample_rows[0][0] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

Returns:

See Also:



1373
1374
1375
1376
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1373

def get_sample_data(params = {}, options = {})
  req = build_request(:get_sample_data, params)
  req.send_request(options)
end

#list_alerts(params = {}) ⇒ Types::ListAlertsResponse

Lists the alerts attached to a detector.

Amazon Lookout for Metrics API actions are eventually consistent. If you do a read operation on a resource immediately after creating or modifying it, use retries to allow time for the write operation to complete.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_alerts({
  anomaly_detector_arn: "Arn",
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.alert_summary_list #=> Array
resp.alert_summary_list[0].alert_arn #=> String
resp.alert_summary_list[0].anomaly_detector_arn #=> String
resp.alert_summary_list[0].alert_name #=> String
resp.alert_summary_list[0].alert_sensitivity_threshold #=> Integer
resp.alert_summary_list[0].alert_type #=> String, one of "SNS", "LAMBDA"
resp.alert_summary_list[0].alert_status #=> String, one of "ACTIVE", "INACTIVE"
resp.alert_summary_list[0].last_modification_time #=> Time
resp.alert_summary_list[0].creation_time #=> Time
resp.alert_summary_list[0].tags #=> Hash
resp.alert_summary_list[0].tags["TagKey"] #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_detector_arn (String)

    The ARN of the alert's detector.

  • :next_token (String)

    If the result of the previous request is truncated, the response includes a NextToken. To retrieve the next set of results, use the token in the next request. Tokens expire after 24 hours.

  • :max_results (Integer)

    The maximum number of results that will be displayed by the request.

Returns:

See Also:



1430
1431
1432
1433
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1430

def list_alerts(params = {}, options = {})
  req = build_request(:list_alerts, params)
  req.send_request(options)
end

#list_anomaly_detectors(params = {}) ⇒ Types::ListAnomalyDetectorsResponse

Lists the detectors in the current AWS Region.

Amazon Lookout for Metrics API actions are eventually consistent. If you do a read operation on a resource immediately after creating or modifying it, use retries to allow time for the write operation to complete.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_anomaly_detectors({
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.anomaly_detector_summary_list #=> Array
resp.anomaly_detector_summary_list[0].anomaly_detector_arn #=> String
resp.anomaly_detector_summary_list[0].anomaly_detector_name #=> String
resp.anomaly_detector_summary_list[0].anomaly_detector_description #=> String
resp.anomaly_detector_summary_list[0].creation_time #=> Time
resp.anomaly_detector_summary_list[0].last_modification_time #=> Time
resp.anomaly_detector_summary_list[0].status #=> String, one of "ACTIVE", "ACTIVATING", "DELETING", "FAILED", "INACTIVE", "LEARNING", "BACK_TEST_ACTIVATING", "BACK_TEST_ACTIVE", "BACK_TEST_COMPLETE", "DEACTIVATED", "DEACTIVATING"
resp.anomaly_detector_summary_list[0].tags #=> Hash
resp.anomaly_detector_summary_list[0].tags["TagKey"] #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :max_results (Integer)

    The maximum number of results to return.

  • :next_token (String)

    If the result of the previous request was truncated, the response includes a NextToken. To retrieve the next set of results, use the token in the next request. Tokens expire after 24 hours.

Returns:

See Also:



1481
1482
1483
1484
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1481

def list_anomaly_detectors(params = {}, options = {})
  req = build_request(:list_anomaly_detectors, params)
  req.send_request(options)
end

Returns a list of measures that are potential causes or effects of an anomaly group.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_anomaly_group_related_metrics({
  anomaly_detector_arn: "Arn", # required
  anomaly_group_id: "UUID", # required
  relationship_type_filter: "CAUSE_OF_INPUT_ANOMALY_GROUP", # accepts CAUSE_OF_INPUT_ANOMALY_GROUP, EFFECT_OF_INPUT_ANOMALY_GROUP
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.inter_metric_impact_list #=> Array
resp.inter_metric_impact_list[0].metric_name #=> String
resp.inter_metric_impact_list[0].anomaly_group_id #=> String
resp.inter_metric_impact_list[0].relationship_type #=> String, one of "CAUSE_OF_INPUT_ANOMALY_GROUP", "EFFECT_OF_INPUT_ANOMALY_GROUP"
resp.inter_metric_impact_list[0].contribution_percentage #=> Float
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_detector_arn (required, String)

    The Amazon Resource Name (ARN) of the anomaly detector.

  • :anomaly_group_id (required, String)

    The ID of the anomaly group.

  • :relationship_type_filter (String)

    Filter for potential causes (CAUSE_OF_INPUT_ANOMALY_GROUP) or downstream effects (EFFECT_OF_INPUT_ANOMALY_GROUP) of the anomaly group.

  • :max_results (Integer)

    The maximum number of results to return.

  • :next_token (String)

    Specify the pagination token that's returned by a previous request to retrieve the next page of results.

Returns:

See Also:



1537
1538
1539
1540
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1537

def list_anomaly_group_related_metrics(params = {}, options = {})
  req = build_request(:list_anomaly_group_related_metrics, params)
  req.send_request(options)
end

#list_anomaly_group_summaries(params = {}) ⇒ Types::ListAnomalyGroupSummariesResponse

Returns a list of anomaly groups.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_anomaly_group_summaries({
  anomaly_detector_arn: "Arn", # required
  sensitivity_threshold: 1, # required
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.anomaly_group_summary_list #=> Array
resp.anomaly_group_summary_list[0].start_time #=> String
resp.anomaly_group_summary_list[0].end_time #=> String
resp.anomaly_group_summary_list[0].anomaly_group_id #=> String
resp.anomaly_group_summary_list[0].anomaly_group_score #=> Float
resp.anomaly_group_summary_list[0].primary_metric_name #=> String
resp.anomaly_group_statistics.evaluation_start_date #=> String
resp.anomaly_group_statistics.total_count #=> Integer
resp.anomaly_group_statistics.itemized_metric_stats_list #=> Array
resp.anomaly_group_statistics.itemized_metric_stats_list[0].metric_name #=> String
resp.anomaly_group_statistics.itemized_metric_stats_list[0].occurrence_count #=> Integer
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_detector_arn (required, String)

    The Amazon Resource Name (ARN) of the anomaly detector.

  • :sensitivity_threshold (required, Integer)

    The minimum severity score for inclusion in the output.

  • :max_results (Integer)

    The maximum number of results to return.

  • :next_token (String)

    Specify the pagination token that's returned by a previous request to retrieve the next page of results.

Returns:

See Also:



1593
1594
1595
1596
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1593

def list_anomaly_group_summaries(params = {}, options = {})
  req = build_request(:list_anomaly_group_summaries, params)
  req.send_request(options)
end

#list_anomaly_group_time_series(params = {}) ⇒ Types::ListAnomalyGroupTimeSeriesResponse

Gets a list of anomalous metrics for a measure in an anomaly group.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_anomaly_group_time_series({
  anomaly_detector_arn: "Arn", # required
  anomaly_group_id: "UUID", # required
  metric_name: "MetricName", # required
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.anomaly_group_id #=> String
resp.metric_name #=> String
resp.timestamp_list #=> Array
resp.timestamp_list[0] #=> String
resp.next_token #=> String
resp.time_series_list #=> Array
resp.time_series_list[0].time_series_id #=> String
resp.time_series_list[0].dimension_list #=> Array
resp.time_series_list[0].dimension_list[0].dimension_name #=> String
resp.time_series_list[0].dimension_list[0].dimension_value #=> String
resp.time_series_list[0].metric_value_list #=> Array
resp.time_series_list[0].metric_value_list[0] #=> Float

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_detector_arn (required, String)

    The Amazon Resource Name (ARN) of the anomaly detector.

  • :anomaly_group_id (required, String)

    The ID of the anomaly group.

  • :metric_name (required, String)

    The name of the measure field.

  • :max_results (Integer)

    The maximum number of results to return.

  • :next_token (String)

    Specify the pagination token that's returned by a previous request to retrieve the next page of results.

Returns:

See Also:



1655
1656
1657
1658
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1655

def list_anomaly_group_time_series(params = {}, options = {})
  req = build_request(:list_anomaly_group_time_series, params)
  req.send_request(options)
end

#list_metric_sets(params = {}) ⇒ Types::ListMetricSetsResponse

Lists the datasets in the current AWS Region.

Amazon Lookout for Metrics API actions are eventually consistent. If you do a read operation on a resource immediately after creating or modifying it, use retries to allow time for the write operation to complete.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_metric_sets({
  anomaly_detector_arn: "Arn",
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.metric_set_summary_list #=> Array
resp.metric_set_summary_list[0].metric_set_arn #=> String
resp.metric_set_summary_list[0].anomaly_detector_arn #=> String
resp.metric_set_summary_list[0].metric_set_description #=> String
resp.metric_set_summary_list[0].metric_set_name #=> String
resp.metric_set_summary_list[0].creation_time #=> Time
resp.metric_set_summary_list[0].last_modification_time #=> Time
resp.metric_set_summary_list[0].tags #=> Hash
resp.metric_set_summary_list[0].tags["TagKey"] #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_detector_arn (String)

    The ARN of the anomaly detector containing the metrics sets to list.

  • :max_results (Integer)

    The maximum number of results to return.

  • :next_token (String)

    If the result of the previous request was truncated, the response includes a NextToken. To retrieve the next set of results, use the token in the next request. Tokens expire after 24 hours.

Returns:

See Also:



1710
1711
1712
1713
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1710

def list_metric_sets(params = {}, options = {})
  req = build_request(:list_metric_sets, params)
  req.send_request(options)
end

#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse

Gets a list of tags for a detector, dataset, or alert.

Examples:

Request syntax with placeholder values


resp = client.list_tags_for_resource({
  resource_arn: "Arn", # required
})

Response structure


resp.tags #=> Hash
resp.tags["TagKey"] #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :resource_arn (required, String)

    The resource's Amazon Resource Name (ARN).

Returns:

See Also:



1743
1744
1745
1746
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1743

def list_tags_for_resource(params = {}, options = {})
  req = build_request(:list_tags_for_resource, params)
  req.send_request(options)
end

#put_feedback(params = {}) ⇒ Struct

Add feedback for an anomalous metric.

Examples:

Request syntax with placeholder values


resp = client.put_feedback({
  anomaly_detector_arn: "Arn", # required
  anomaly_group_time_series_feedback: { # required
    anomaly_group_id: "UUID", # required
    time_series_id: "TimeSeriesId", # required
    is_anomaly: false, # required
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_detector_arn (required, String)

    The Amazon Resource Name (ARN) of the anomaly detector.

  • :anomaly_group_time_series_feedback (required, Types::AnomalyGroupTimeSeriesFeedback)

    Feedback for an anomalous metric.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1773
1774
1775
1776
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1773

def put_feedback(params = {}, options = {})
  req = build_request(:put_feedback, params)
  req.send_request(options)
end

#tag_resource(params = {}) ⇒ Struct

Adds tags to a detector, dataset, or alert.

Examples:

Request syntax with placeholder values


resp = client.tag_resource({
  resource_arn: "Arn", # required
  tags: { # required
    "TagKey" => "TagValue",
  },
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :resource_arn (required, String)

    The resource's Amazon Resource Name (ARN).

  • :tags (required, Hash<String,String>)

    Tags to apply to the resource. Tag keys and values can contain letters, numbers, spaces, and the following symbols: _.:/=+@-

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1806
1807
1808
1809
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1806

def tag_resource(params = {}, options = {})
  req = build_request(:tag_resource, params)
  req.send_request(options)
end

#untag_resource(params = {}) ⇒ Struct

Removes tags from a detector, dataset, or alert.

Examples:

Request syntax with placeholder values


resp = client.untag_resource({
  resource_arn: "Arn", # required
  tag_keys: ["TagKey"], # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :resource_arn (required, String)

    The resource's Amazon Resource Name (ARN).

  • :tag_keys (required, Array<String>)

    Keys to remove from the resource's tags.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1836
1837
1838
1839
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1836

def untag_resource(params = {}, options = {})
  req = build_request(:untag_resource, params)
  req.send_request(options)
end

#update_alert(params = {}) ⇒ Types::UpdateAlertResponse

Make changes to an existing alert.

Examples:

Request syntax with placeholder values


resp = client.update_alert({
  alert_arn: "Arn", # required
  alert_description: "AlertDescription",
  alert_sensitivity_threshold: 1,
  action: {
    sns_configuration: {
      role_arn: "Arn", # required
      sns_topic_arn: "Arn", # required
      sns_format: "LONG_TEXT", # accepts LONG_TEXT, SHORT_TEXT, JSON
    },
    lambda_configuration: {
      role_arn: "Arn", # required
      lambda_arn: "Arn", # required
    },
  },
  alert_filters: {
    metric_list: ["MetricName"],
    dimension_filter_list: [
      {
        dimension_name: "ColumnName",
        dimension_value_list: ["DimensionValue"],
      },
    ],
  },
})

Response structure


resp.alert_arn #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :alert_arn (required, String)

    The ARN of the alert to update.

  • :alert_description (String)

    A description of the alert.

  • :alert_sensitivity_threshold (Integer)

    An integer from 0 to 100 specifying the alert sensitivity threshold.

  • :action (Types::Action)

    Action that will be triggered when there is an alert.

  • :alert_filters (Types::AlertFilters)

    The configuration of the alert filters, containing MetricList and DimensionFilterList.

Returns:

See Also:



1899
1900
1901
1902
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1899

def update_alert(params = {}, options = {})
  req = build_request(:update_alert, params)
  req.send_request(options)
end

#update_anomaly_detector(params = {}) ⇒ Types::UpdateAnomalyDetectorResponse

Updates a detector. After activation, you can only change a detector's ingestion delay and description.

Examples:

Request syntax with placeholder values


resp = client.update_anomaly_detector({
  anomaly_detector_arn: "Arn", # required
  kms_key_arn: "KmsKeyArn",
  anomaly_detector_description: "AnomalyDetectorDescription",
  anomaly_detector_config: {
    anomaly_detector_frequency: "P1D", # accepts P1D, PT1H, PT10M, PT5M
  },
})

Response structure


resp.anomaly_detector_arn #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :anomaly_detector_arn (required, String)

    The ARN of the detector to update.

  • :kms_key_arn (String)

    The Amazon Resource Name (ARN) of an AWS KMS encryption key.

  • :anomaly_detector_description (String)

    The updated detector description.

  • :anomaly_detector_config (Types::AnomalyDetectorConfig)

    Contains information about the configuration to which the detector will be updated.

Returns:

See Also:



1943
1944
1945
1946
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 1943

def update_anomaly_detector(params = {}, options = {})
  req = build_request(:update_anomaly_detector, params)
  req.send_request(options)
end

#update_metric_set(params = {}) ⇒ Types::UpdateMetricSetResponse

Updates a dataset.

Examples:

Request syntax with placeholder values


resp = client.update_metric_set({
  metric_set_arn: "Arn", # required
  metric_set_description: "MetricSetDescription",
  metric_list: [
    {
      metric_name: "ColumnName", # required
      aggregation_function: "AVG", # required, accepts AVG, SUM
      namespace: "Namespace",
    },
  ],
  offset: 1,
  timestamp_column: {
    column_name: "ColumnName",
    column_format: "DateTimeFormat",
  },
  dimension_list: ["ColumnName"],
  metric_set_frequency: "P1D", # accepts P1D, PT1H, PT10M, PT5M
  metric_source: {
    s3_source_config: {
      role_arn: "Arn",
      templated_path_list: ["TemplatedPath"],
      historical_data_path_list: ["HistoricalDataPath"],
      file_format_descriptor: {
        csv_format_descriptor: {
          file_compression: "NONE", # accepts NONE, GZIP
          charset: "Charset",
          contains_header: false,
          delimiter: "Delimiter",
          header_list: ["ColumnName"],
          quote_symbol: "QuoteSymbol",
        },
        json_format_descriptor: {
          file_compression: "NONE", # accepts NONE, GZIP
          charset: "Charset",
        },
      },
    },
    app_flow_config: {
      role_arn: "Arn",
      flow_name: "FlowName",
    },
    cloud_watch_config: {
      role_arn: "Arn",
      back_test_configuration: {
        run_back_test_mode: false, # required
      },
    },
    rds_source_config: {
      db_instance_identifier: "RDSDatabaseIdentifier",
      database_host: "DatabaseHost",
      database_port: 1,
      secret_manager_arn: "PoirotSecretManagerArn",
      database_name: "RDSDatabaseName",
      table_name: "TableName",
      role_arn: "Arn",
      vpc_configuration: {
        subnet_id_list: ["SubnetId"], # required
        security_group_id_list: ["SecurityGroupId"], # required
      },
    },
    redshift_source_config: {
      cluster_identifier: "RedshiftClusterIdentifier",
      database_host: "DatabaseHost",
      database_port: 1,
      secret_manager_arn: "PoirotSecretManagerArn",
      database_name: "RedshiftDatabaseName",
      table_name: "TableName",
      role_arn: "Arn",
      vpc_configuration: {
        subnet_id_list: ["SubnetId"], # required
        security_group_id_list: ["SecurityGroupId"], # required
      },
    },
    athena_source_config: {
      role_arn: "Arn",
      database_name: "AthenaDatabaseName",
      data_catalog: "AthenaDataCatalog",
      table_name: "AthenaTableName",
      work_group_name: "AthenaWorkGroupName",
      s3_results_path: "AthenaS3ResultsPath",
      back_test_configuration: {
        run_back_test_mode: false, # required
      },
    },
  },
  dimension_filter_list: [
    {
      name: "ColumnName",
      filter_list: [
        {
          dimension_value: "DimensionValue",
          filter_operation: "EQUALS", # accepts EQUALS
        },
      ],
    },
  ],
})

Response structure


resp.metric_set_arn #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :metric_set_arn (required, String)

    The ARN of the dataset to update.

  • :metric_set_description (String)

    The dataset's description.

  • :metric_list (Array<Types::Metric>)

    The metric list.

  • :offset (Integer)

    After an interval ends, the amount of seconds that the detector waits before importing data. Offset is only supported for S3, Redshift, Athena and datasources.

  • :timestamp_column (Types::TimestampColumn)

    The timestamp column.

  • :dimension_list (Array<String>)

    The dimension list.

  • :metric_set_frequency (String)

    The dataset's interval.

  • :metric_source (Types::MetricSource)

    Contains information about source data used to generate metrics.

  • :dimension_filter_list (Array<Types::MetricSetDimensionFilter>)

    Describes a list of filters for choosing specific dimensions and specific values. Each filter consists of the dimension and one of its values that you want to include. When multiple dimensions or values are specified, the dimensions are joined with an AND operation and the values are joined with an OR operation.

Returns:

See Also:



2095
2096
2097
2098
# File 'gems/aws-sdk-lookoutmetrics/lib/aws-sdk-lookoutmetrics/client.rb', line 2095

def update_metric_set(params = {}, options = {})
  req = build_request(:update_metric_set, params)
  req.send_request(options)
end