Class LogsQueryTimeInterval
java.lang.Object
com.azure.monitor.query.logs.models.LogsQueryTimeInterval
Class to represent a time interval.
Time intervals are inclusive at the start time and exclusive at the end time.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LogsQueryTimeIntervalTime interval of all time.static final LogsQueryTimeIntervalTime interval of the last hour.static final LogsQueryTimeIntervalTime interval of the last 12 hours.static final LogsQueryTimeIntervalTime interval of the last 2 days.static final LogsQueryTimeIntervalTime interval of the last 3 days.static final LogsQueryTimeIntervalTime interval of the last 30 minutes.static final LogsQueryTimeIntervalTime interval of the last 4 hours.static final LogsQueryTimeIntervalTime interval of the last 5 minutes.static final LogsQueryTimeIntervalTime interval of the last 7 days.static final LogsQueryTimeIntervalTime interval of the last day. -
Constructor Summary
ConstructorsConstructorDescriptionLogsQueryTimeInterval(Duration duration) Creates an instance ofLogsQueryTimeIntervalusing the provided duration.LogsQueryTimeInterval(OffsetDateTime startTime, Duration duration) Creates an instance ofLogsQueryTimeIntervalusing the start and end duration of the interval.LogsQueryTimeInterval(OffsetDateTime startTime, OffsetDateTime endTime) Creates an instance ofLogsQueryTimeIntervalusing the start and endOffsetDateTimes. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the duration of thisLogsQueryTimeIntervalinstance.Returns the end time of thisLogsQueryTimeIntervalinstance.Returns the start time of thisLogsQueryTimeIntervalinstance.inthashCode()static LogsQueryTimeIntervalThis method takes an ISO 8601 formatted time interval string and returns an instance ofLogsQueryTimeInterval.toString()
-
Field Details
-
ALL
Time interval of all time. -
LAST_5_MINUTES
Time interval of the last 5 minutes. -
LAST_30_MINUTES
Time interval of the last 30 minutes. -
LAST_1_HOUR
Time interval of the last hour. -
LAST_4_HOURS
Time interval of the last 4 hours. -
LAST_12_HOURS
Time interval of the last 12 hours. -
LAST_DAY
Time interval of the last day. -
LAST_2_DAYS
Time interval of the last 2 days. -
LAST_3_DAYS
Time interval of the last 3 days. -
LAST_7_DAYS
Time interval of the last 7 days.
-
-
Constructor Details
-
LogsQueryTimeInterval
Creates an instance ofLogsQueryTimeIntervalusing the provided duration. The duration is the interval that starts from the provided duration and ends at the current time.- Parameters:
duration- the duration for this query time span.
-
LogsQueryTimeInterval
Creates an instance ofLogsQueryTimeIntervalusing the start and endOffsetDateTimes.- Parameters:
startTime- The start time of the interval.endTime- The end time of the interval.
-
LogsQueryTimeInterval
Creates an instance ofLogsQueryTimeIntervalusing the start and end duration of the interval.- Parameters:
startTime- The start time of the interval.duration- The end duration of the interval.
-
-
Method Details
-
getDuration
Returns the duration of thisLogsQueryTimeIntervalinstance.- Returns:
- the duration of this
LogsQueryTimeIntervalinstance.
-
getStartTime
Returns the start time of thisLogsQueryTimeIntervalinstance.- Returns:
- the start time of this
LogsQueryTimeIntervalinstance.
-
getEndTime
Returns the end time of thisLogsQueryTimeIntervalinstance.- Returns:
- the end time of this
LogsQueryTimeIntervalinstance.
-
parse
This method takes an ISO 8601 formatted time interval string and returns an instance ofLogsQueryTimeInterval.- Parameters:
value- The ISO 8601 formatted time interval string.- Returns:
- An instance of
LogsQueryTimeInterval. - Throws:
IllegalArgumentException- ifvalueis not in the correct format.
-
toString
-
equals
-
hashCode
-