Expectation Incidents

An ExpectationIncident groups ongoing failure behavior for an Expectation over time.

List Expectation Incidents

SDK Method

expectation_incident.List()

Return Values

Returns a *expectation_incident.Iter and an error. Range over All() to receive files_sdk.ExpectationIncident values and errors. Check each loop error before using its resource. Next() and Err() remain supported.

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

Additional Arguments

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    expectation_incident "github.com/Files-com/files-sdk-go/v3/expectationincident"
)

expectationIncidentIterator, err := expectation_incident.List(files_sdk.ExpectationIncidentListParams{})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}

for expectationIncident, err := range expectationIncidentIterator.All() {
    if err != nil {
        var respErr files_sdk.ResponseError
        if errors.As(err, &respErr) {
            fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
        } else {
            fmt.Printf("Request failed: %v\n", err)
        }
        return
    }
    fmt.Println(expectationIncident)
}

Show Expectation Incident

SDK Method

expectation_incident.Find()

Return Values

Returns a files_sdk.ExpectationIncident value and an error.

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

ExpectationIncidentFindParams Fields

FieldDescription
Id
int64
Required
Expectation Incident ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    expectation_incident "github.com/Files-com/files-sdk-go/v3/expectationincident"
)

expectationIncident, err := expectation_incident.Find(files_sdk.ExpectationIncidentFindParams{Id: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}
fmt.Println(expectationIncident)

Resolve an expectation incident

SDK Method

expectation_incident.Resolve()

Return Values

Returns a files_sdk.ExpectationIncident value and an error.

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

ExpectationIncidentResolveParams Fields

FieldDescription
Id
int64
Required
Expectation Incident ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    expectation_incident "github.com/Files-com/files-sdk-go/v3/expectationincident"
)

expectationIncident, err := expectation_incident.Resolve(files_sdk.ExpectationIncidentResolveParams{Id: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}
fmt.Println(expectationIncident)

Snooze an expectation incident until a specified time

SDK Method

expectation_incident.Snooze()

Return Values

Returns a files_sdk.ExpectationIncident value and an error.

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

ExpectationIncidentSnoozeParams Fields

FieldDescription
Id
int64
Required
Expectation Incident ID.
SnoozedUntil
string
Required
Time until which the incident should remain snoozed.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    expectation_incident "github.com/Files-com/files-sdk-go/v3/expectationincident"
)

expectationIncident, err := expectation_incident.Snooze(files_sdk.ExpectationIncidentSnoozeParams{
  Id: 1,
  SnoozedUntil: "snoozed_until",
})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}
fmt.Println(expectationIncident)

Acknowledge an expectation incident

SDK Method

expectation_incident.Acknowledge()

Return Values

Returns a files_sdk.ExpectationIncident value and an error.

Authorization Requirement

Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.

ExpectationIncidentAcknowledgeParams Fields

FieldDescription
Id
int64
Required
Expectation Incident ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    expectation_incident "github.com/Files-com/files-sdk-go/v3/expectationincident"
)

expectationIncident, err := expectation_incident.Acknowledge(files_sdk.ExpectationIncidentAcknowledgeParams{Id: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Printf("API error (%s): %s\n", respErr.Type, respErr.ErrorMessage)
    } else {
        fmt.Printf("Request failed: %v\n", err)
    }
    return
}
fmt.Println(expectationIncident)

The ExpectationIncident Object

Some of the methods above return a ExpectationIncident object. The attributes of this object are listed below.

AttributeDescription
Id
int64
Expectation Incident ID
WorkspaceId
int64
Workspace ID. 0 means the default workspace.
ExpectationId
int64
Expectation ID.
Status
string
Incident status.
Possible values: open, acknowledged, snoozed, resolved
OpenedAt
date-time
When the incident was opened.
LastFailedAt
date-time
When the most recent failing evaluation contributing to the incident occurred.
AcknowledgedAt
date-time
When the incident was acknowledged.
SnoozedUntil
date-time
When the current snooze expires.
ResolvedAt
date-time
When the incident was resolved.
OpenedByEvaluationId
int64
Evaluation that first opened the incident.
LastEvaluationId
int64
Most recent evaluation linked to the incident.
ResolvedByEvaluationId
int64
Evaluation that resolved the incident.
Summary
object
Compact incident summary payload.
CreatedAt
date-time
Creation time.
UpdatedAt
date-time
Last update time.