This the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

  • 1:

    Working with Alert APIs

    1 -

    Silencing Rules API

    The Silencing Rules Management API provides programmatic access to silence Sysdig Alert notifications.

    REST Resource: silencingRules

    SeeĀ Sysdig REST API ConventionsĀ  for generic conventions and authentication.

    List Alert Silence Rules

    List all the active silencing rules for a user or team.

    api/v1/silencingRules
    

    No request parameters.

    Create Alert Silence Rule

    Create a new alert silence rule.

    POST /api/v1/silencingRules
    

    Request Parameters

    Field

    Description

    SilencingRuleDTO

    Specify the following:

    • customerId: The unique ID of the user. An Integer value.

    • createdOn: The timestamp at which the silencing rule is created. An Integer value.

    • durationInSec: The duration of silence rule in second. An Integer value.

    • enabled: Indicate if the silencing rule is enabled or not. A Boolean value.

    • modifiedOn: Indicate when the rule is modified. An Integer value.

    • name: The unique name of the silencing rule. A String value.

    • notificationChannelIds: The unique IDs of the notification channel. An Integer value.

    • Id: The unique ID of the silence rule. An Integer value.

    • startTs: The start time of the silence rule in milliseconds. An Integer value.

    • scope: The unique ID of the infrastructure entity to apply the scope as. For example, a particular workload or namespace, from environments that may include thousands of entities. An String value.

    • teamId: The unique ID of the team that this silencing rule belongs to. An Integer value.

    • version: The version number corresponding to the revision of the silencing rule. An Integer value.

    For example:

    {
      "id" : 69256,
      "version" : 1,
      "createdOn" : 1621613672203,
      "modifiedOn" : 1621613672203,
      "customerId" : 12,
      "teamId" : 9129,
      "name" : "test",
      "enabled" : true,
      "startTs" : 1621613669000,
      "durationInSec" : 3600,
      "scope" : "access_mode in (\"ReadWrite\")",
      "notificationChannelIds" : [ 365234 ]
    }

    List a Silence Rule

    List a specific silence rule.

    GET /api/v1/silencingRules/{silencingRuleId}
    

    Request Variables

    Field

    Description

    silencingRuleId

    The unique ID of a silence rule.

    An example:

    [ {
      "id" : 3452,
      "version" : 4,
      "createdOn" : 1617723973937,
      "modifiedOn" : 1617727511021,
      "customerId" : 1,
      "teamId" : 919,
      "name" : "Holidays",
      "enabled" : false,
      "startTs" : 1617723900000,
      "durationInSec" : 3600,
      "scope" : "cluster in (\"demoenv\")",
      "notificationChannelIds" : [ 95623 ]
    }]

    Update a Silence Rule

    Update a specific silence rule.

    PUT /api/v1/silencingRules/{silencingRuleId}
    

    Request Variables

    Field

    Description

    alertId

    Int 64

    The unique ID of the alert.

    alertSilencingRuleDTO

    Specify the following:

    • customerId: The unique ID of the user. An Integer value.

    • createdOn: The timestamp at which the silencing rule is created. An Integer value.

    • durationInSec: The duration of silence rule in second. An Integer value.

    • enabled: Indicate if the silencing rule is enabled or not. A Boolean value.

    • modifiedOn: Indicate when the rule is modified. An Integer value.

    • name: The unique name of the silencing rule. A String value.

    • notificationChannelIds: The unique IDs of the notification channel. An Integer value.

    • Id: The unique ID of the silence rule. An Integer value.

    • startTs: The start time of the silence rule in milliseconds. An Integer value.

    • scope: The unique ID of the infrastructure entity to apply the scope as. For example, a particular workload or namespace, from environments that may include thousands of entities. An String value.

    • teamId: The unique ID of the team that this silencing rule belongs to. An Integer value.

    • version: The version number corresponding to the revision of the silencing rule. An Integer value.

    For example:

    {
      "id" : 69256,
      "version" : 1,
      "createdOn" : 1621613672203,
      "modifiedOn" : 1621613672203,
      "customerId" : 12,
      "teamId" : 9129,
      "name" : "test",
      "enabled" : true,
      "startTs" : 1621613669000,
      "durationInSec" : 3600,
      "scope" : "access_mode in (\"ReadWrite\")",
      "notificationChannelIds" : [ 365234 ]
    }

    Delete a Silencing Rule

    Delete a silencing rule.

    DELETE /api/v1/silencingRules/{silencingRuleId}
    

    Request Variables

    FieldDescription
    silencingRuleIdThe unique ID of a silence rule.

    Delete All the Silencing Rules

    Delete all the requested silencing rules.

    POST /api/v1/silencingRules/delete
    

    Request Variables

    Field

    Description

    bulkRequestWrappe

    Specify the unique IDs of the silence rules.

    For example:

    {
      "silencingRules": {
        "ids": [
          c
        ]
      }
    }

    Disable Silencing Rules

    Disable all the requested silencing rules.

    PATCH /api/v1/silencingRules/disable
    

    Request Variables

    Field

    Description

    bulkRequestWrappe

    Specify the unique IDs of the silence rules.

    For example:

    {
      "silencingRules": {
        "ids": [
          9256, 34, 2345
        ]
      }
    }

    Enable Silencing Rules

    Enable all the requested silencing rules.

    PATCH /api/v1/silencingRules/enable
    

    Request Variables

    Field

    Description

    bulkRequestWrappe

    Specify the unique IDs of the silence rules.

    For example:

    {
      "silencingRules": {
        "ids": [
          6920, 23
        ]
      }
    }