1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Monitoring
  5. getAlarmHistoryCollection
Oracle Cloud Infrastructure v1.31.0 published on Wednesday, Apr 10, 2024 by Pulumi

oci.Monitoring.getAlarmHistoryCollection

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.31.0 published on Wednesday, Apr 10, 2024 by Pulumi

    This data source provides details about a specific Alarm History Collection resource in Oracle Cloud Infrastructure Monitoring service.

    Get the history of the specified alarm. For more information, see Getting History of an Alarm. For important limits information, see Limits on Monitoring.

    This call is subject to a Monitoring limit that applies to the total number of requests across all alarm operations. Monitoring might throttle this call to reject an otherwise valid request when the total rate of alarm operations exceeds 10 requests, or transactions, per second (TPS) for a given tenancy.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testAlarmHistoryCollection = oci.Monitoring.getAlarmHistoryCollection({
        alarmId: oci_monitoring_alarm.test_alarm.id,
        alarmHistorytype: _var.alarm_history_collection_alarm_historytype,
        timestampGreaterThanOrEqualTo: _var.alarm_history_collection_timestamp_greater_than_or_equal_to,
        timestampLessThan: _var.alarm_history_collection_timestamp_less_than,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_alarm_history_collection = oci.Monitoring.get_alarm_history_collection(alarm_id=oci_monitoring_alarm["test_alarm"]["id"],
        alarm_historytype=var["alarm_history_collection_alarm_historytype"],
        timestamp_greater_than_or_equal_to=var["alarm_history_collection_timestamp_greater_than_or_equal_to"],
        timestamp_less_than=var["alarm_history_collection_timestamp_less_than"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/Monitoring"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Monitoring.GetAlarmHistoryCollection(ctx, &monitoring.GetAlarmHistoryCollectionArgs{
    			AlarmId:                       oci_monitoring_alarm.Test_alarm.Id,
    			AlarmHistorytype:              pulumi.StringRef(_var.Alarm_history_collection_alarm_historytype),
    			TimestampGreaterThanOrEqualTo: pulumi.StringRef(_var.Alarm_history_collection_timestamp_greater_than_or_equal_to),
    			TimestampLessThan:             pulumi.StringRef(_var.Alarm_history_collection_timestamp_less_than),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testAlarmHistoryCollection = Oci.Monitoring.GetAlarmHistoryCollection.Invoke(new()
        {
            AlarmId = oci_monitoring_alarm.Test_alarm.Id,
            AlarmHistorytype = @var.Alarm_history_collection_alarm_historytype,
            TimestampGreaterThanOrEqualTo = @var.Alarm_history_collection_timestamp_greater_than_or_equal_to,
            TimestampLessThan = @var.Alarm_history_collection_timestamp_less_than,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Monitoring.MonitoringFunctions;
    import com.pulumi.oci.Monitoring.inputs.GetAlarmHistoryCollectionArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var testAlarmHistoryCollection = MonitoringFunctions.getAlarmHistoryCollection(GetAlarmHistoryCollectionArgs.builder()
                .alarmId(oci_monitoring_alarm.test_alarm().id())
                .alarmHistorytype(var_.alarm_history_collection_alarm_historytype())
                .timestampGreaterThanOrEqualTo(var_.alarm_history_collection_timestamp_greater_than_or_equal_to())
                .timestampLessThan(var_.alarm_history_collection_timestamp_less_than())
                .build());
    
        }
    }
    
    variables:
      testAlarmHistoryCollection:
        fn::invoke:
          Function: oci:Monitoring:getAlarmHistoryCollection
          Arguments:
            alarmId: ${oci_monitoring_alarm.test_alarm.id}
            alarmHistorytype: ${var.alarm_history_collection_alarm_historytype}
            timestampGreaterThanOrEqualTo: ${var.alarm_history_collection_timestamp_greater_than_or_equal_to}
            timestampLessThan: ${var.alarm_history_collection_timestamp_less_than}
    

    Using getAlarmHistoryCollection

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getAlarmHistoryCollection(args: GetAlarmHistoryCollectionArgs, opts?: InvokeOptions): Promise<GetAlarmHistoryCollectionResult>
    function getAlarmHistoryCollectionOutput(args: GetAlarmHistoryCollectionOutputArgs, opts?: InvokeOptions): Output<GetAlarmHistoryCollectionResult>
    def get_alarm_history_collection(alarm_historytype: Optional[str] = None,
                                     alarm_id: Optional[str] = None,
                                     timestamp_greater_than_or_equal_to: Optional[str] = None,
                                     timestamp_less_than: Optional[str] = None,
                                     opts: Optional[InvokeOptions] = None) -> GetAlarmHistoryCollectionResult
    def get_alarm_history_collection_output(alarm_historytype: Optional[pulumi.Input[str]] = None,
                                     alarm_id: Optional[pulumi.Input[str]] = None,
                                     timestamp_greater_than_or_equal_to: Optional[pulumi.Input[str]] = None,
                                     timestamp_less_than: Optional[pulumi.Input[str]] = None,
                                     opts: Optional[InvokeOptions] = None) -> Output[GetAlarmHistoryCollectionResult]
    func GetAlarmHistoryCollection(ctx *Context, args *GetAlarmHistoryCollectionArgs, opts ...InvokeOption) (*GetAlarmHistoryCollectionResult, error)
    func GetAlarmHistoryCollectionOutput(ctx *Context, args *GetAlarmHistoryCollectionOutputArgs, opts ...InvokeOption) GetAlarmHistoryCollectionResultOutput

    > Note: This function is named GetAlarmHistoryCollection in the Go SDK.

    public static class GetAlarmHistoryCollection 
    {
        public static Task<GetAlarmHistoryCollectionResult> InvokeAsync(GetAlarmHistoryCollectionArgs args, InvokeOptions? opts = null)
        public static Output<GetAlarmHistoryCollectionResult> Invoke(GetAlarmHistoryCollectionInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAlarmHistoryCollectionResult> getAlarmHistoryCollection(GetAlarmHistoryCollectionArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:Monitoring/getAlarmHistoryCollection:getAlarmHistoryCollection
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AlarmId string
    The OCID of an alarm.
    AlarmHistorytype string
    The type of history entries to retrieve. State history (STATE_HISTORY), state transition history (STATE_TRANSITION_HISTORY), rule history (RULE_HISTORY) or rule transition history (RULE_TRANSITION_HISTORY). If not specified, entries of all types are retrieved. Example: STATE_HISTORY
    TimestampGreaterThanOrEqualTo string
    A filter to return only alarm history entries with timestamps occurring on or after the specified date and time. Format defined by RFC3339. Example: 2023-01-01T01:00:00.789Z
    TimestampLessThan string
    A filter to return only alarm history entries with timestamps occurring before the specified date and time. Format defined by RFC3339. Example: 2023-01-02T01:00:00.789Z
    AlarmId string
    The OCID of an alarm.
    AlarmHistorytype string
    The type of history entries to retrieve. State history (STATE_HISTORY), state transition history (STATE_TRANSITION_HISTORY), rule history (RULE_HISTORY) or rule transition history (RULE_TRANSITION_HISTORY). If not specified, entries of all types are retrieved. Example: STATE_HISTORY
    TimestampGreaterThanOrEqualTo string
    A filter to return only alarm history entries with timestamps occurring on or after the specified date and time. Format defined by RFC3339. Example: 2023-01-01T01:00:00.789Z
    TimestampLessThan string
    A filter to return only alarm history entries with timestamps occurring before the specified date and time. Format defined by RFC3339. Example: 2023-01-02T01:00:00.789Z
    alarmId String
    The OCID of an alarm.
    alarmHistorytype String
    The type of history entries to retrieve. State history (STATE_HISTORY), state transition history (STATE_TRANSITION_HISTORY), rule history (RULE_HISTORY) or rule transition history (RULE_TRANSITION_HISTORY). If not specified, entries of all types are retrieved. Example: STATE_HISTORY
    timestampGreaterThanOrEqualTo String
    A filter to return only alarm history entries with timestamps occurring on or after the specified date and time. Format defined by RFC3339. Example: 2023-01-01T01:00:00.789Z
    timestampLessThan String
    A filter to return only alarm history entries with timestamps occurring before the specified date and time. Format defined by RFC3339. Example: 2023-01-02T01:00:00.789Z
    alarmId string
    The OCID of an alarm.
    alarmHistorytype string
    The type of history entries to retrieve. State history (STATE_HISTORY), state transition history (STATE_TRANSITION_HISTORY), rule history (RULE_HISTORY) or rule transition history (RULE_TRANSITION_HISTORY). If not specified, entries of all types are retrieved. Example: STATE_HISTORY
    timestampGreaterThanOrEqualTo string
    A filter to return only alarm history entries with timestamps occurring on or after the specified date and time. Format defined by RFC3339. Example: 2023-01-01T01:00:00.789Z
    timestampLessThan string
    A filter to return only alarm history entries with timestamps occurring before the specified date and time. Format defined by RFC3339. Example: 2023-01-02T01:00:00.789Z
    alarm_id str
    The OCID of an alarm.
    alarm_historytype str
    The type of history entries to retrieve. State history (STATE_HISTORY), state transition history (STATE_TRANSITION_HISTORY), rule history (RULE_HISTORY) or rule transition history (RULE_TRANSITION_HISTORY). If not specified, entries of all types are retrieved. Example: STATE_HISTORY
    timestamp_greater_than_or_equal_to str
    A filter to return only alarm history entries with timestamps occurring on or after the specified date and time. Format defined by RFC3339. Example: 2023-01-01T01:00:00.789Z
    timestamp_less_than str
    A filter to return only alarm history entries with timestamps occurring before the specified date and time. Format defined by RFC3339. Example: 2023-01-02T01:00:00.789Z
    alarmId String
    The OCID of an alarm.
    alarmHistorytype String
    The type of history entries to retrieve. State history (STATE_HISTORY), state transition history (STATE_TRANSITION_HISTORY), rule history (RULE_HISTORY) or rule transition history (RULE_TRANSITION_HISTORY). If not specified, entries of all types are retrieved. Example: STATE_HISTORY
    timestampGreaterThanOrEqualTo String
    A filter to return only alarm history entries with timestamps occurring on or after the specified date and time. Format defined by RFC3339. Example: 2023-01-01T01:00:00.789Z
    timestampLessThan String
    A filter to return only alarm history entries with timestamps occurring before the specified date and time. Format defined by RFC3339. Example: 2023-01-02T01:00:00.789Z

    getAlarmHistoryCollection Result

    The following output properties are available:

    AlarmId string
    The OCID of the alarm to retrieve history for.
    Entries List<GetAlarmHistoryCollectionEntry>
    The set of history entries retrieved for the alarm.
    Id string
    The provider-assigned unique ID for this managed resource.
    IsEnabled bool
    Whether the alarm is enabled. Example: true
    AlarmHistorytype string
    TimestampGreaterThanOrEqualTo string
    TimestampLessThan string
    AlarmId string
    The OCID of the alarm to retrieve history for.
    Entries []GetAlarmHistoryCollectionEntry
    The set of history entries retrieved for the alarm.
    Id string
    The provider-assigned unique ID for this managed resource.
    IsEnabled bool
    Whether the alarm is enabled. Example: true
    AlarmHistorytype string
    TimestampGreaterThanOrEqualTo string
    TimestampLessThan string
    alarmId String
    The OCID of the alarm to retrieve history for.
    entries List<GetAlarmHistoryCollectionEntry>
    The set of history entries retrieved for the alarm.
    id String
    The provider-assigned unique ID for this managed resource.
    isEnabled Boolean
    Whether the alarm is enabled. Example: true
    alarmHistorytype String
    timestampGreaterThanOrEqualTo String
    timestampLessThan String
    alarmId string
    The OCID of the alarm to retrieve history for.
    entries GetAlarmHistoryCollectionEntry[]
    The set of history entries retrieved for the alarm.
    id string
    The provider-assigned unique ID for this managed resource.
    isEnabled boolean
    Whether the alarm is enabled. Example: true
    alarmHistorytype string
    timestampGreaterThanOrEqualTo string
    timestampLessThan string
    alarm_id str
    The OCID of the alarm to retrieve history for.
    entries Sequence[monitoring.GetAlarmHistoryCollectionEntry]
    The set of history entries retrieved for the alarm.
    id str
    The provider-assigned unique ID for this managed resource.
    is_enabled bool
    Whether the alarm is enabled. Example: true
    alarm_historytype str
    timestamp_greater_than_or_equal_to str
    timestamp_less_than str
    alarmId String
    The OCID of the alarm to retrieve history for.
    entries List<Property Map>
    The set of history entries retrieved for the alarm.
    id String
    The provider-assigned unique ID for this managed resource.
    isEnabled Boolean
    Whether the alarm is enabled. Example: true
    alarmHistorytype String
    timestampGreaterThanOrEqualTo String
    timestampLessThan String

    Supporting Types

    GetAlarmHistoryCollectionEntry

    Summary string
    Description for this alarm history entry.
    Timestamp string
    Timestamp for this alarm history entry. Format defined by RFC3339. Example: 2023-02-01T01:02:29.600Z
    TimestampTriggered string
    Timestamp for the transition of the alarm state. For example, the time when the alarm transitioned from OK to Firing. Available for state transition entries only. Note: A three-minute lag for this value accounts for any late-arriving metrics. Example: 2023-02-01T0:59:00.789Z
    Summary string
    Description for this alarm history entry.
    Timestamp string
    Timestamp for this alarm history entry. Format defined by RFC3339. Example: 2023-02-01T01:02:29.600Z
    TimestampTriggered string
    Timestamp for the transition of the alarm state. For example, the time when the alarm transitioned from OK to Firing. Available for state transition entries only. Note: A three-minute lag for this value accounts for any late-arriving metrics. Example: 2023-02-01T0:59:00.789Z
    summary String
    Description for this alarm history entry.
    timestamp String
    Timestamp for this alarm history entry. Format defined by RFC3339. Example: 2023-02-01T01:02:29.600Z
    timestampTriggered String
    Timestamp for the transition of the alarm state. For example, the time when the alarm transitioned from OK to Firing. Available for state transition entries only. Note: A three-minute lag for this value accounts for any late-arriving metrics. Example: 2023-02-01T0:59:00.789Z
    summary string
    Description for this alarm history entry.
    timestamp string
    Timestamp for this alarm history entry. Format defined by RFC3339. Example: 2023-02-01T01:02:29.600Z
    timestampTriggered string
    Timestamp for the transition of the alarm state. For example, the time when the alarm transitioned from OK to Firing. Available for state transition entries only. Note: A three-minute lag for this value accounts for any late-arriving metrics. Example: 2023-02-01T0:59:00.789Z
    summary str
    Description for this alarm history entry.
    timestamp str
    Timestamp for this alarm history entry. Format defined by RFC3339. Example: 2023-02-01T01:02:29.600Z
    timestamp_triggered str
    Timestamp for the transition of the alarm state. For example, the time when the alarm transitioned from OK to Firing. Available for state transition entries only. Note: A three-minute lag for this value accounts for any late-arriving metrics. Example: 2023-02-01T0:59:00.789Z
    summary String
    Description for this alarm history entry.
    timestamp String
    Timestamp for this alarm history entry. Format defined by RFC3339. Example: 2023-02-01T01:02:29.600Z
    timestampTriggered String
    Timestamp for the transition of the alarm state. For example, the time when the alarm transitioned from OK to Firing. Available for state transition entries only. Note: A three-minute lag for this value accounts for any late-arriving metrics. Example: 2023-02-01T0:59:00.789Z

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v1.31.0 published on Wednesday, Apr 10, 2024 by Pulumi