IBM Cloud API Docs

Introduction

IBM® Cloud Logs is a scalable logging service that persists logs and provides users with capabilities for querying, tailing, and visualizing logs.

Go SDK is available to make it easier to programmatically access the API from your code. The client libraries that are provided by the SDK implement best practices for using the API and reduce the amount of code that you need to write. The tab for Go includes code examples that demonstrate how to use the client libraries. For more information about using the SDK, see the IBM Cloud SDK Common project on GitHub.

Installing the Go SDK

Go modules (recommended): Add the following import in your code, and then run go build or go mod tidy

import (
	"github.com/IBM/logs-go-sdk/logsv0"
)

Go get

go get -u github.com/IBM/logs-go-sdk

View on GitHub

Endpoint URLs

The API endpoint URL is unique per region for an instance of IBM Cloud Logs. For example, when IBM Cloud Logs is hosted in Madrid (eu-es), the base URL is https://{instance_ID}.api.eu-es.logs.cloud.ibm.com

The version information is appended to the base URL to access resources. For example /v1, resulting in the URL https://{instance_ID}.api.eu-es.logs.cloud.ibm.com/v1 for Madrid (eu-es).

Base URL

https://{instance_ID}.api.{region}.logs.cloud.ibm.com

Example API request

curl -X {request_method}     -H "Authorization: Bearer {bearer_token}"     -H "Accept: application/json"     [--data "{request_body}"]     "https://{instance_ID}.api.{region}.logs.cloud.ibm.com/{method_endpoint}"

Replace {bearer_token}, {request_method}, {method_endpoint} and [optional] {request_body} in this example with the values for your particular API call.

Authentication

Authorization to the IBM Cloud Logs service REST API is enforced by an IBM Cloud® Identity and Access Management (IAM) access token. The token is used to determine the actions that a user or service ID has access to when they use the API.

Retrieving an access token is supported using an IAM Trusted Profile or IAM API key.

  • To request an access token with a Trusted Profile from within your IBM Cloud Kubernetes Service or Red Hat OpenShift cluster, run the following command:

    curl -X POST \
        -H "Content-Type: application/x-www-form-urlencoded" \
        --data "grant_type=urn:ibm:params:oauth:grant-type:cr-token" \
        --data "profile_id={trusted_profile_id}" \
        --data-urlencode "cr_token@{path_to_token}" \
        https://iam.cloud.ibm.com/identity/token
    

    Replace {trusted_profile_id} and {path_to_token} with the correct values for your environment.

  • To request an access token with an IAM api_key, run the following command:

    curl -X POST \
        -H 'Content-Type: application/x-www-form-urlencoded' \
        --data "grant_type=urn:ibm:params:oauth:grant-type:apikey" \
        --data "apikey=${IAM_API_KEY}" \
        "https://iam.cloud.ibm.com/identity/token"
    

    Replace {IAM_API_KEY} with your IAM API key.

The access token is provided in the returned JSON data in the field .access_token.

Error handling

The IBM Cloud Logs service uses standard HTTP response codes to indicate whether a method completed successfully. A 200 response always indicates success. A 400 type response indicates that a parameter validation failed and can occur if required parameters are missing or if any parameter values are invalid. A 401 or 403 response indicates that the incoming request did not contain valid authentication information. A 500 type response indicates an internal server error that is seen in an unexpected error situation.

The IBM Cloud Logs REST APIs return standard HTTP status codes to indicate the success or failure of a request. The format of the response is represented in JSON as follows:

{
    "errors": [
    {
        "code": "not_authorized",
        "message": "The specified token does not have authority to create a tenant."
    }
    ],
    "status_code": 403
}

If an operation cannot be fulfilled, an appropriate 400 or 500 series HTTP response is returned from the server. The operations that are defined in the Reference section describe example errors that might be returned from a failed request. All responses from the Identity Services REST API are in JSON format.

The following table shows the potential error codes the API might return.

HTTP error codes
HTTP Error Code Description Recovery
200 Success The request was successful.
201 Created The resource was successfully created.
204 No Content The request was successful. No response body is provided.
400 Bad Request The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all required parameters in your request.
401 Unauthorized You are not authorized to make this request. The token is either missing or expired. Get a new valid token and try again.
403 Forbidden The supplied authentication is not authorized to perform the operation. If this error persists, contact the account owner to check your permissions.
404 Not Found The requested resource can't be found.
408 Request Timeout The connection to the server timed out. Wait a few minutes, then try again.
409 conflict The requested resource conflicts with an already existing resource.
415 Bad Request Missing or wrong header
429 Rate limit exceeded Reduce the rate of requests or Wait a few minutes, then try again.
500 Internal error Error that is seen in an unexpected error situation.

Methods

Get an alert by ID

Get an alert by ID

Get an alert by ID.

GET /v1/alerts/{id}
(logs *LogsV0) GetAlert(getAlertOptions *GetAlertOptions) (result *Alert, response *core.DetailedResponse, err error)
(logs *LogsV0) GetAlertWithContext(ctx context.Context, getAlertOptions *GetAlertOptions) (result *Alert, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.alert-config.read

Auditing

Calling this method generates the following auditing event.

  • logs.alert-config.get

Request

Instantiate the GetAlertOptions struct and set the fields to provide parameter values for the GetAlert method.

Path Parameters

  • Alert ID

    Possible values: length = 36, Value must match regular expression ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

    Example: 3dc02998-0b50-4ea8-b68a-4779d716fa1f

WithContext method only

The GetAlert options.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/v1/alerts/${id}"
  • getAlertOptions := logsService.NewGetAlertOptions(
      CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"),
    )
    
    alert, response, err := logsService.GetAlert(getAlertOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(alert, "", "  ")
    fmt.Println(string(b))

Response

Alert resource model

Alert resource model.

Examples:
{
  "active_when": {
    "timeframes": [
      {
        "days_of_week": [
          "sunday",
          "monday_or_unspecified",
          "tuesday",
          "wednesday",
          "thursday",
          "friday",
          "saturday"
        ],
        "range": {
          "end": {
            "hours": 18,
            "minutes": 29,
            "seconds": 59
          },
          "start": {
            "hours": 18,
            "minutes": 30
          }
        }
      }
    ]
  },
  "condition": {
    "more_than": {
      "evaluation_window": "rolling_or_unspecified",
      "parameters": {
        "group_by": [
          "coralogix.metadata.applicationName"
        ],
        "ignore_infinity": true,
        "relative_timeframe": "hour_or_unspecified",
        "threshold": 1,
        "timeframe": "timeframe_10_min"
      }
    }
  },
  "description": "Alert if the number of logs reaches a threshold",
  "filters": {
    "filter_type": "text_or_unspecified",
    "metadata": {},
    "severities": [
      "info"
    ],
    "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
  },
  "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7",
  "incident_settings": {
    "notify_on": "triggered_only",
    "retriggering_period_seconds": 300,
    "use_as_notification_settings": true
  },
  "is_active": true,
  "meta_labels": [
    {
      "key": "env",
      "value": "dev"
    }
  ],
  "name": "Test alert",
  "notification_groups": [
    {
      "group_by_fields": [
        "coralogix.metadata.applicationName"
      ]
    }
  ],
  "severity": "info_or_unspecified",
  "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4"
}

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "active_when": {
        "timeframes": [
          {
            "days_of_week": [
              "sunday",
              "monday_or_unspecified",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday"
            ],
            "range": {
              "end": {
                "hours": 18,
                "minutes": 29,
                "seconds": 59
              },
              "start": {
                "hours": 18,
                "minutes": 30
              }
            }
          }
        ]
      },
      "condition": {
        "more_than": {
          "evaluation_window": "rolling_or_unspecified",
          "parameters": {
            "group_by": [
              "coralogix.metadata.applicationName"
            ],
            "ignore_infinity": true,
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 1,
            "timeframe": "timeframe_10_min"
          }
        }
      },
      "description": "Alert if the number of logs reaches a threshold",
      "filters": {
        "filter_type": "text_or_unspecified",
        "metadata": {},
        "severities": [
          "info"
        ],
        "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
      },
      "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 300,
        "use_as_notification_settings": true
      },
      "is_active": true,
      "meta_labels": [
        {
          "key": "env",
          "value": "dev"
        }
      ],
      "name": "Test alert",
      "notification_groups": [
        {
          "group_by_fields": [
            "coralogix.metadata.applicationName"
          ]
        }
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4"
    }
  • {
      "active_when": {
        "timeframes": [
          {
            "days_of_week": [
              "sunday",
              "monday_or_unspecified",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday"
            ],
            "range": {
              "end": {
                "hours": 18,
                "minutes": 29,
                "seconds": 59
              },
              "start": {
                "hours": 18,
                "minutes": 30
              }
            }
          }
        ]
      },
      "condition": {
        "more_than": {
          "evaluation_window": "rolling_or_unspecified",
          "parameters": {
            "group_by": [
              "coralogix.metadata.applicationName"
            ],
            "ignore_infinity": true,
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 1,
            "timeframe": "timeframe_10_min"
          }
        }
      },
      "description": "Alert if the number of logs reaches a threshold",
      "filters": {
        "filter_type": "text_or_unspecified",
        "metadata": {},
        "severities": [
          "info"
        ],
        "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
      },
      "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 300,
        "use_as_notification_settings": true
      },
      "is_active": true,
      "meta_labels": [
        {
          "key": "env",
          "value": "dev"
        }
      ],
      "name": "Test alert",
      "notification_groups": [
        {
          "group_by_fields": [
            "coralogix.metadata.applicationName"
          ]
        }
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Update an alert

Update an alert

Update an alert.

PUT /v1/alerts/{id}
(logs *LogsV0) UpdateAlert(updateAlertOptions *UpdateAlertOptions) (result *Alert, response *core.DetailedResponse, err error)
(logs *LogsV0) UpdateAlertWithContext(ctx context.Context, updateAlertOptions *UpdateAlertOptions) (result *Alert, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.alert-config.manage

Auditing

Calling this method generates the following auditing event.

  • logs.alert-config.update

Request

Instantiate the UpdateAlertOptions struct and set the fields to provide parameter values for the UpdateAlert method.

Path Parameters

  • Alert ID

    Possible values: length = 36, Value must match regular expression ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

    Example: 3dc02998-0b50-4ea8-b68a-4779d716fa1f

Alert to create/update

Examples:
{
  "active_when": {
    "timeframes": [
      {
        "days_of_week": [
          "sunday",
          "monday_or_unspecified",
          "tuesday",
          "wednesday",
          "thursday",
          "friday",
          "saturday"
        ],
        "range": {
          "end": {
            "hours": 18,
            "minutes": 29,
            "seconds": 59
          },
          "start": {
            "hours": 18,
            "minutes": 30,
            "seconds": 0
          }
        }
      }
    ]
  },
  "condition": {
    "more_than": {
      "evaluation_window": "rolling_or_unspecified",
      "parameters": {
        "cardinality_fields": [],
        "group_by": [
          "coralogix.metadata.applicationName"
        ],
        "ignore_infinity": true,
        "notify_group_by_only_alerts": true,
        "relative_timeframe": "hour_or_unspecified",
        "threshold": 1,
        "timeframe": "timeframe_10_min"
      }
    }
  },
  "description": "Alert if the number of logs reaches a threshold",
  "filters": {
    "filter_type": "text_or_unspecified",
    "metadata": {},
    "ratio_alerts": [],
    "severities": [
      "info"
    ],
    "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
  },
  "incident_settings": {
    "notify_on": "triggered_only",
    "retriggering_period_seconds": 300,
    "use_as_notification_settings": true
  },
  "is_active": true,
  "meta_labels": [
    {
      "key": "env",
      "value": "dev"
    }
  ],
  "meta_labels_strings": [],
  "name": "Test alert",
  "notification_groups": [
    {
      "group_by_fields": [
        "coralogix.metadata.applicationName"
      ],
      "notifications": []
    }
  ],
  "severity": "info_or_unspecified"
}

WithContext method only

The UpdateAlert options.

  • curl -X PUT --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data   '{
        "active_when": {
          "timeframes": [
            {
              "days_of_week": [
                "sunday",
                "monday_or_unspecified",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday"
              ],
              "range": {
                "end": {
                  "hours": 18,
                  "minutes": 29,
                  "seconds": 59
                },
                "start": {
                  "hours": 18,
                  "minutes": 30,
                  "seconds": 0
                }
              }
            }
          ]
        },
        "condition": {
          "more_than": {
            "evaluation_window": "rolling_or_unspecified",
            "parameters": {
              "cardinality_fields": [],
              "group_by": [
                "coralogix.metadata.applicationName"
              ],
              "ignore_infinity": true,
              "notify_group_by_only_alerts": true,
              "relative_timeframe": "hour_or_unspecified",
              "threshold": 1,
              "timeframe": "timeframe_10_min"
            }
          }
        },
        "description": "Alert if the number of logs reaches a threshold",
        "filters": {
          "filter_type": "text_or_unspecified",
          "metadata": {},
          "ratio_alerts": [],
          "severities": [
            "info"
          ],
          "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
        },
        "incident_settings": {
          "notify_on": "triggered_only",
          "retriggering_period_seconds": 300,
          "use_as_notification_settings": true
        },
        "is_active": true,
        "meta_labels": [
          {
            "key": "env",
            "value": "dev"
          }
        ],
        "meta_labels_strings": [],
        "name": "Test alert",
        "notification_groups": [
          {
            "group_by_fields": [
              "coralogix.metadata.applicationName"
            ],
            "notifications": []
          }
        ],
        "severity": "info_or_unspecified"
      }'   "${base_url}/v1/alerts/${id}"
  • alertsV2ConditionParametersModel := &logsv0.AlertsV2ConditionParameters{
      Threshold: core.Float64Ptr(float64(1)),
      Timeframe: core.StringPtr("timeframe_10_min"),
      GroupBy: []string{"coralogix.metadata.applicationName"},
      IgnoreInfinity: core.BoolPtr(true),
      RelativeTimeframe: core.StringPtr("hour_or_unspecified"),
      CardinalityFields: []string{},
    }
    
    alertsV2MoreThanConditionModel := &logsv0.AlertsV2MoreThanCondition{
      Parameters: alertsV2ConditionParametersModel,
      EvaluationWindow: core.StringPtr("rolling_or_unspecified"),
    }
    
    alertsV2AlertConditionModel := &logsv0.AlertsV2AlertConditionConditionMoreThan{
      MoreThan: alertsV2MoreThanConditionModel,
    }
    
    alertsV2AlertNotificationModel := &logsv0.AlertsV2AlertNotificationIntegrationTypeIntegrationID{
    }
    
    alertsV2AlertNotificationGroupsModel := &logsv0.AlertsV2AlertNotificationGroups{
      GroupByFields: []string{"coralogix.metadata.applicationName"},
      Notifications: []logsv0.AlertsV2AlertNotificationIntf{alertsV2AlertNotificationModel},
    }
    
    alertsV1AlertFiltersMetadataFiltersModel := &logsv0.AlertsV1AlertFiltersMetadataFilters{
    }
    
    alertsV1AlertFiltersModel := &logsv0.AlertsV1AlertFilters{
      Severities: []string{"info"},
      Metadata: alertsV1AlertFiltersMetadataFiltersModel,
      Text: core.StringPtr("initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"),
      FilterType: core.StringPtr("text_or_unspecified"),
    }
    
    alertsV1TimeModel := &logsv0.AlertsV1Time{
      Hours: core.Int64Ptr(int64(18)),
      Minutes: core.Int64Ptr(int64(30)),
      Seconds: core.Int64Ptr(int64(0)),
    }
    
    alertsV1TimeRangeModel := &logsv0.AlertsV1TimeRange{
      Start: alertsV1TimeModel,
      End: alertsV1TimeModel,
    }
    
    alertsV1AlertActiveTimeframeModel := &logsv0.AlertsV1AlertActiveTimeframe{
      DaysOfWeek: []string{"sunday", "monday_or_unspecified", "tuesday", "wednesday", "thursday", "friday", "saturday"},
      Range: alertsV1TimeRangeModel,
    }
    
    alertsV1AlertActiveWhenModel := &logsv0.AlertsV1AlertActiveWhen{
      Timeframes: []logsv0.AlertsV1AlertActiveTimeframe{*alertsV1AlertActiveTimeframeModel},
    }
    
    alertsV1MetaLabelModel := &logsv0.AlertsV1MetaLabel{
      Key: core.StringPtr("env"),
      Value: core.StringPtr("dev"),
    }
    
    alertsV2AlertIncidentSettingsModel := &logsv0.AlertsV2AlertIncidentSettings{
      RetriggeringPeriodSeconds: core.Int64Ptr(int64(300)),
      NotifyOn: core.StringPtr("triggered_only"),
      UseAsNotificationSettings: core.BoolPtr(true),
    }
    
    updateAlertOptions := logsService.NewUpdateAlertOptions(
      CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"),
      "Test alert",
      true,
      "info_or_unspecified",
      alertsV2AlertConditionModel,
      []logsv0.AlertsV2AlertNotificationGroups{*alertsV2AlertNotificationGroupsModel},
      alertsV1AlertFiltersModel,
    )
    updateAlertOptions.SetDescription("Alert if the number of logs reaches a threshold")
    updateAlertOptions.SetActiveWhen(alertsV1AlertActiveWhenModel)
    updateAlertOptions.SetMetaLabels([]logsv0.AlertsV1MetaLabel{*alertsV1MetaLabelModel})
    updateAlertOptions.SetMetaLabelsStrings([]string{})
    updateAlertOptions.SetIncidentSettings(alertsV2AlertIncidentSettingsModel)
    
    alert, response, err := logsService.UpdateAlert(updateAlertOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(alert, "", "  ")
    fmt.Println(string(b))

Response

Alert resource model

Alert resource model.

Examples:
{
  "active_when": {
    "timeframes": [
      {
        "days_of_week": [
          "sunday",
          "monday_or_unspecified",
          "tuesday",
          "wednesday",
          "thursday",
          "friday",
          "saturday"
        ],
        "range": {
          "end": {
            "hours": 18,
            "minutes": 29,
            "seconds": 59
          },
          "start": {
            "hours": 18,
            "minutes": 30
          }
        }
      }
    ]
  },
  "condition": {
    "more_than": {
      "evaluation_window": "rolling_or_unspecified",
      "parameters": {
        "group_by": [
          "coralogix.metadata.applicationName"
        ],
        "ignore_infinity": true,
        "relative_timeframe": "hour_or_unspecified",
        "threshold": 1,
        "timeframe": "timeframe_10_min"
      }
    }
  },
  "description": "Alert if the number of logs reaches a threshold",
  "filters": {
    "filter_type": "text_or_unspecified",
    "metadata": {},
    "severities": [
      "info"
    ],
    "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
  },
  "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7",
  "incident_settings": {
    "notify_on": "triggered_only",
    "retriggering_period_seconds": 300,
    "use_as_notification_settings": true
  },
  "is_active": true,
  "meta_labels": [
    {
      "key": "env",
      "value": "dev"
    }
  ],
  "name": "Test alert",
  "notification_groups": [
    {
      "group_by_fields": [
        "coralogix.metadata.applicationName"
      ]
    }
  ],
  "severity": "info_or_unspecified",
  "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4"
}

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "active_when": {
        "timeframes": [
          {
            "days_of_week": [
              "sunday",
              "monday_or_unspecified",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday"
            ],
            "range": {
              "end": {
                "hours": 18,
                "minutes": 29,
                "seconds": 59
              },
              "start": {
                "hours": 18,
                "minutes": 30
              }
            }
          }
        ]
      },
      "condition": {
        "more_than": {
          "evaluation_window": "rolling_or_unspecified",
          "parameters": {
            "group_by": [
              "coralogix.metadata.applicationName"
            ],
            "ignore_infinity": true,
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 1,
            "timeframe": "timeframe_10_min"
          }
        }
      },
      "description": "Alert if the number of logs reaches a threshold",
      "filters": {
        "filter_type": "text_or_unspecified",
        "metadata": {},
        "severities": [
          "info"
        ],
        "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
      },
      "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 300,
        "use_as_notification_settings": true
      },
      "is_active": true,
      "meta_labels": [
        {
          "key": "env",
          "value": "dev"
        }
      ],
      "name": "Test alert",
      "notification_groups": [
        {
          "group_by_fields": [
            "coralogix.metadata.applicationName"
          ]
        }
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4"
    }
  • {
      "active_when": {
        "timeframes": [
          {
            "days_of_week": [
              "sunday",
              "monday_or_unspecified",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday"
            ],
            "range": {
              "end": {
                "hours": 18,
                "minutes": 29,
                "seconds": 59
              },
              "start": {
                "hours": 18,
                "minutes": 30
              }
            }
          }
        ]
      },
      "condition": {
        "more_than": {
          "evaluation_window": "rolling_or_unspecified",
          "parameters": {
            "group_by": [
              "coralogix.metadata.applicationName"
            ],
            "ignore_infinity": true,
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 1,
            "timeframe": "timeframe_10_min"
          }
        }
      },
      "description": "Alert if the number of logs reaches a threshold",
      "filters": {
        "filter_type": "text_or_unspecified",
        "metadata": {},
        "severities": [
          "info"
        ],
        "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
      },
      "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 300,
        "use_as_notification_settings": true
      },
      "is_active": true,
      "meta_labels": [
        {
          "key": "env",
          "value": "dev"
        }
      ],
      "name": "Test alert",
      "notification_groups": [
        {
          "group_by_fields": [
            "coralogix.metadata.applicationName"
          ]
        }
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Delete an alert

Delete an alert

Delete an alert.

DELETE /v1/alerts/{id}
(logs *LogsV0) DeleteAlert(deleteAlertOptions *DeleteAlertOptions) (response *core.DetailedResponse, err error)
(logs *LogsV0) DeleteAlertWithContext(ctx context.Context, deleteAlertOptions *DeleteAlertOptions) (response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.alert-config.manage

Auditing

Calling this method generates the following auditing event.

  • logs.alert-config.delete

Request

Instantiate the DeleteAlertOptions struct and set the fields to provide parameter values for the DeleteAlert method.

Path Parameters

  • Alert ID

    Possible values: length = 36, Value must match regular expression ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

    Example: 3dc02998-0b50-4ea8-b68a-4779d716fa1f

WithContext method only

The DeleteAlert options.

  • curl -X DELETE --location --header "Authorization: Bearer ${iam_token}"   "${base_url}/v1/alerts/${id}"
  • deleteAlertOptions := logsService.NewDeleteAlertOptions(
      CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"),
    )
    
    response, err := logsService.DeleteAlert(deleteAlertOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteAlert(): %d\n", response.StatusCode)
    }

Response

Status Code

  • No Content

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

List alerts

List alerts

List alerts.

GET /v1/alerts
(logs *LogsV0) GetAlerts(getAlertsOptions *GetAlertsOptions) (result *AlertCollection, response *core.DetailedResponse, err error)
(logs *LogsV0) GetAlertsWithContext(ctx context.Context, getAlertsOptions *GetAlertsOptions) (result *AlertCollection, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.alert-config.read

Auditing

Calling this method generates the following auditing event.

  • logs.alert-config.list

Request

No Request Parameters

This method does not accept any request parameters.

WithContext method only

No Request Parameters

This method does not accept any request parameters.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/v1/alerts"
  • getAlertsOptions := logsService.NewGetAlertsOptions()
    
    alertCollection, response, err := logsService.GetAlerts(getAlertsOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(alertCollection, "", "  ")
    fmt.Println(string(b))

Response

Alerts collection

Alerts collection.

Examples:
{
  "alerts": [
    {
      "active_when": {
        "timeframes": [
          {
            "days_of_week": [
              "sunday",
              "monday_or_unspecified",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday"
            ],
            "range": {
              "end": {
                "hours": 18,
                "minutes": 29,
                "seconds": 59
              },
              "start": {
                "hours": 18,
                "minutes": 30
              }
            }
          }
        ]
      },
      "condition": {
        "more_than": {
          "evaluation_window": "rolling_or_unspecified",
          "parameters": {
            "group_by": [
              "coralogix.metadata.applicationName"
            ],
            "ignore_infinity": true,
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 1,
            "timeframe": "timeframe_10_min"
          }
        }
      },
      "description": "Alert if the number of logs reaches a threshold",
      "filters": {
        "filter_type": "text_or_unspecified",
        "metadata": {},
        "severities": [
          "info"
        ],
        "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
      },
      "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 300,
        "use_as_notification_settings": true
      },
      "is_active": true,
      "meta_labels": [
        {
          "key": "env",
          "value": "dev"
        }
      ],
      "name": "Test alert",
      "notification_groups": [
        {
          "group_by_fields": [
            "coralogix.metadata.applicationName"
          ]
        }
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4"
    },
    {
      "active_when": {
        "timeframes": [
          {
            "days_of_week": [
              "thursday",
              "wednesday"
            ],
            "range": {
              "end": {
                "hours": 18,
                "minutes": 30
              },
              "start": {
                "hours": 6,
                "minutes": 30
              }
            }
          }
        ]
      },
      "condition": {
        "unique_count": {
          "parameters": {
            "cardinality_fields": [
              "remote_addr_geoip.country_name"
            ],
            "ignore_infinity": true,
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 2,
            "timeframe": "timeframe_10_min"
          }
        }
      },
      "description": "Example of unique count alert from terraform",
      "filters": {
        "filter_type": "unique_count",
        "metadata": {},
        "severities": [
          "info"
        ]
      },
      "id": "5c334366-571a-4431-80ae-3086bf91c575",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 600,
        "use_as_notification_settings": false
      },
      "is_active": true,
      "name": "Unique count alert example",
      "notification_groups": [
        {
          "notifications": [
            {
              "notify_on": "triggered_and_resolved",
              "recipients": {
                "emails": [
                  "example@coralogix.com"
                ]
              },
              "retriggering_period_seconds": 60
            }
          ]
        }
      ],
      "severity": "warning",
      "unique_identifier": "e6e01065-7eac-4f5f-8e24-2ee4c7122ab9"
    },
    {
      "active_when": {
        "timeframes": [
          {
            "days_of_week": [
              "thursday",
              "wednesday"
            ],
            "range": {
              "end": {
                "hours": 18,
                "minutes": 30
              },
              "start": {
                "hours": 6,
                "minutes": 30
              }
            }
          }
        ]
      },
      "condition": {
        "unique_count": {
          "parameters": {
            "cardinality_fields": [
              "remote_addr_geoip.country_name"
            ],
            "ignore_infinity": true,
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 2,
            "timeframe": "timeframe_10_min"
          }
        }
      },
      "description": "Example of unique count alert from terraform",
      "filters": {
        "filter_type": "unique_count",
        "metadata": {},
        "severities": [
          "info"
        ]
      },
      "id": "ffea3734-56eb-4f25-a59a-2d9889c71f46",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 600,
        "use_as_notification_settings": false
      },
      "is_active": true,
      "name": "Unique count alert example",
      "notification_groups": [
        {
          "notifications": [
            {
              "notify_on": "triggered_and_resolved",
              "recipients": {
                "emails": [
                  "example@coralogix.com"
                ]
              },
              "retriggering_period_seconds": 60
            }
          ]
        }
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "39246ad5-19a0-43fd-aa76-e6ff075e864b"
    },
    {
      "condition": {
        "more_than_usual": {
          "parameters": {
            "ignore_infinity": true,
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 10,
            "timeframe": "timeframe_5_min_or_unspecified"
          }
        }
      },
      "description": "OKTA audit extension pack",
      "filters": {
        "filter_type": "text_or_unspecified",
        "metadata": {},
        "text": "legacyEventType:\\\"login failed\\\""
      },
      "id": "b2f843d7-4721-4ce2-ac0d-ea0443bbe372",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 60,
        "use_as_notification_settings": false
      },
      "is_active": true,
      "name": "More than usual login failures",
      "notification_groups": [
        {}
      ],
      "severity": "info_or_unspecified",
      "show_in_insight": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 60
      },
      "unique_identifier": "4fa3710a-c91d-4d6e-8359-41a44c45a141"
    },
    {
      "condition": {
        "more_than_usual": {
          "parameters": {
            "ignore_infinity": true,
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 10,
            "timeframe": "timeframe_5_min_or_unspecified"
          }
        }
      },
      "description": "OKTA audit extension pack",
      "filters": {
        "filter_type": "text_or_unspecified",
        "metadata": {},
        "text": "legacyEventType:\\\"login failed\\\""
      },
      "id": "1a02193d-856b-4f84-ab4e-9918ac136244",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 60,
        "use_as_notification_settings": false
      },
      "is_active": true,
      "name": "More than usual login failures",
      "notification_groups": [
        {}
      ],
      "severity": "info_or_unspecified",
      "show_in_insight": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 60
      },
      "unique_identifier": "bd851dfb-2aa4-4ed7-97ec-922f01f98036"
    },
    {
      "active_when": {
        "timeframes": [
          {
            "days_of_week": [
              "thursday",
              "wednesday"
            ],
            "range": {
              "end": {
                "hours": 18,
                "minutes": 30
              },
              "start": {
                "hours": 6,
                "minutes": 30
              }
            }
          }
        ]
      },
      "condition": {
        "unique_count": {
          "parameters": {
            "cardinality_fields": [
              "remote_addr_geoip.country_name"
            ],
            "ignore_infinity": true,
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 2,
            "timeframe": "timeframe_10_min"
          }
        }
      },
      "description": "Example of unique count alert from terraform",
      "filters": {
        "filter_type": "unique_count",
        "metadata": {},
        "severities": [
          "info"
        ]
      },
      "id": "29f24d53-f219-4245-a2b9-009e98bd8c4e",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 600,
        "use_as_notification_settings": false
      },
      "is_active": true,
      "name": "Unique count alert example",
      "notification_groups": [
        {
          "notifications": [
            {
              "notify_on": "triggered_and_resolved",
              "recipients": {
                "emails": [
                  "example@coralogix.com"
                ]
              },
              "retriggering_period_seconds": 60
            }
          ]
        }
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "e09735d3-a472-4df7-9d2c-2bfe851c436e"
    },
    {
      "active_when": {
        "timeframes": [
          {
            "days_of_week": [
              "thursday",
              "wednesday"
            ],
            "range": {
              "end": {
                "hours": 18,
                "minutes": 30
              },
              "start": {
                "hours": 6,
                "minutes": 30
              }
            }
          }
        ]
      },
      "condition": {
        "unique_count": {
          "parameters": {
            "cardinality_fields": [
              "remote_addr_geoip.country_name"
            ],
            "ignore_infinity": true,
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 2,
            "timeframe": "timeframe_10_min"
          }
        }
      },
      "description": "Example of unique count alert from terraform",
      "filters": {
        "filter_type": "unique_count",
        "metadata": {},
        "severities": [
          "info"
        ]
      },
      "id": "3d57bc5b-28b3-4ffe-9ece-049457760edc",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 600,
        "use_as_notification_settings": false
      },
      "is_active": true,
      "name": "Unique count alert example",
      "notification_groups": [
        {
          "notifications": [
            {
              "notify_on": "triggered_and_resolved",
              "recipients": {
                "emails": [
                  "example@coralogix.com"
                ]
              },
              "retriggering_period_seconds": 60
            }
          ]
        }
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "f6f8d470-7793-44d2-82ef-34f95f01b8fa"
    },
    {
      "active_when": {
        "timeframes": [
          {
            "days_of_week": [
              "monday_or_unspecified",
              "wednesday"
            ],
            "range": {
              "end": {
                "hours": 18,
                "minutes": 30
              },
              "start": {
                "hours": 6,
                "minutes": 30
              }
            }
          }
        ]
      },
      "condition": {
        "unique_count": {
          "parameters": {
            "cardinality_fields": [
              "remote_addr_geoip.country_name"
            ],
            "ignore_infinity": true,
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 2,
            "timeframe": "timeframe_10_min"
          }
        }
      },
      "description": "Example of unique count alert from terraform",
      "filters": {
        "filter_type": "unique_count",
        "metadata": {},
        "severities": [
          "info"
        ]
      },
      "id": "861320bc-33a1-4dfc-9180-0d0afecb68de",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 600,
        "use_as_notification_settings": false
      },
      "is_active": true,
      "name": "Unique count alert example",
      "notification_groups": [
        {
          "notifications": [
            {
              "notify_on": "triggered_and_resolved",
              "recipients": {
                "emails": [
                  "example@coralogix.com"
                ]
              },
              "retriggering_period_seconds": 60
            }
          ]
        }
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "06facfcf-dfdd-49b0-8078-a07448d0cd54"
    },
    {
      "active_when": {},
      "condition": {
        "more_than_usual": {
          "parameters": {
            "group_by": [
              "access_mode"
            ],
            "ignore_infinity": true,
            "metric_alert_promql_parameters": {
              "non_null_percentage": 10,
              "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
              "sample_threshold_percentage": 20,
              "swap_null_values": false
            },
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 0,
            "timeframe": "timeframe_5_min_or_unspecified"
          }
        }
      },
      "description": "asd",
      "filters": {
        "filter_type": "metric",
        "metadata": {}
      },
      "id": "060f9814-f7fe-4955-96fd-2c6e790a391b",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 900,
        "use_as_notification_settings": true
      },
      "is_active": false,
      "name": "test more than usual 112",
      "notification_groups": [
        {}
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "1ccd73dc-eb4b-437b-b2c1-273457b03424"
    },
    {
      "active_when": {},
      "condition": {
        "more_than_usual": {
          "parameters": {
            "group_by": [
              "access_mode"
            ],
            "ignore_infinity": true,
            "metric_alert_promql_parameters": {
              "non_null_percentage": 10,
              "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
              "sample_threshold_percentage": 20,
              "swap_null_values": false
            },
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 0,
            "timeframe": "timeframe_5_min_or_unspecified"
          }
        }
      },
      "description": "asd",
      "filters": {
        "filter_type": "metric",
        "metadata": {}
      },
      "id": "70b27d7d-0c54-4f2f-8254-a9a828571fe9",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 900,
        "use_as_notification_settings": true
      },
      "is_active": false,
      "name": "test more than usual 12",
      "notification_groups": [
        {}
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "934260b6-cfcd-463a-b25f-54015411df6c"
    },
    {
      "active_when": {},
      "condition": {
        "more_than_usual": {
          "parameters": {
            "group_by": [
              "access_mode"
            ],
            "ignore_infinity": true,
            "metric_alert_promql_parameters": {
              "non_null_percentage": 10,
              "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
              "sample_threshold_percentage": 20,
              "swap_null_values": false
            },
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 0,
            "timeframe": "timeframe_5_min_or_unspecified"
          }
        }
      },
      "description": "asd",
      "filters": {
        "filter_type": "metric",
        "metadata": {}
      },
      "id": "4c2132ca-2f2e-4ea5-8089-810ffad38f82",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 900,
        "use_as_notification_settings": true
      },
      "is_active": false,
      "name": "test more than usual 12",
      "notification_groups": [
        {}
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "f98c3d0e-9ed0-4b0d-a8c4-698ecbfd3c1c"
    },
    {
      "active_when": {},
      "condition": {
        "more_than_usual": {
          "parameters": {
            "group_by": [
              "access_mode"
            ],
            "ignore_infinity": true,
            "metric_alert_promql_parameters": {
              "non_null_percentage": 10,
              "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
              "sample_threshold_percentage": 20,
              "swap_null_values": false
            },
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 0,
            "timeframe": "timeframe_5_min_or_unspecified"
          }
        }
      },
      "description": "asd",
      "filters": {
        "filter_type": "metric",
        "metadata": {}
      },
      "id": "ba301f45-c955-4cef-b8b7-fae3d4da26d6",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 900,
        "use_as_notification_settings": true
      },
      "is_active": false,
      "name": "test more than usual 12",
      "notification_groups": [
        {}
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "258464d8-e26b-4ecb-8b58-07138fe2b44d"
    },
    {
      "active_when": {},
      "condition": {
        "more_than_usual": {
          "parameters": {
            "group_by": [
              "access_mode"
            ],
            "ignore_infinity": true,
            "metric_alert_promql_parameters": {
              "non_null_percentage": 10,
              "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
              "sample_threshold_percentage": 20,
              "swap_null_values": false
            },
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 0,
            "timeframe": "timeframe_5_min_or_unspecified"
          }
        }
      },
      "description": "asd",
      "filters": {
        "filter_type": "metric",
        "metadata": {}
      },
      "id": "a32c5827-d31d-4699-8701-c14d905d007b",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 900,
        "use_as_notification_settings": true
      },
      "is_active": false,
      "name": "test more than usual 12",
      "notification_groups": [
        {}
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "37368b5b-c5e7-4670-9902-8a70cca08a56"
    },
    {
      "active_when": {},
      "condition": {
        "more_than_usual": {
          "parameters": {
            "group_by": [
              "access_mode"
            ],
            "ignore_infinity": true,
            "metric_alert_promql_parameters": {
              "non_null_percentage": 10,
              "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
              "sample_threshold_percentage": 20,
              "swap_null_values": false
            },
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 0,
            "timeframe": "timeframe_5_min_or_unspecified"
          }
        }
      },
      "description": "asd",
      "filters": {
        "filter_type": "metric",
        "metadata": {}
      },
      "id": "64971da5-a32a-4310-9137-e07ee4d549ab",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 900,
        "use_as_notification_settings": true
      },
      "is_active": false,
      "name": "test more than usual 12",
      "notification_groups": [
        {}
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "c757edc0-ff3a-4dd8-af7a-b06a9feab84d"
    },
    {
      "active_when": {},
      "condition": {
        "more_than_usual": {
          "parameters": {
            "group_by": [
              "access_mode"
            ],
            "ignore_infinity": true,
            "metric_alert_promql_parameters": {
              "non_null_percentage": 10,
              "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
              "sample_threshold_percentage": 20,
              "swap_null_values": false
            },
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 0,
            "timeframe": "timeframe_5_min_or_unspecified"
          }
        }
      },
      "description": "asd",
      "filters": {
        "filter_type": "metric",
        "metadata": {}
      },
      "id": "6b6c9073-94c5-4c43-984d-71e29e6025ba",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 900,
        "use_as_notification_settings": true
      },
      "is_active": false,
      "name": "test more than usual 12",
      "notification_groups": [
        {}
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "243ad4d6-ad2e-4c5d-8f12-712d3a089912"
    },
    {
      "active_when": {},
      "condition": {
        "more_than_usual": {
          "parameters": {
            "group_by": [
              "access_mode"
            ],
            "ignore_infinity": true,
            "metric_alert_promql_parameters": {
              "non_null_percentage": 10,
              "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
              "sample_threshold_percentage": 20,
              "swap_null_values": false
            },
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 0,
            "timeframe": "timeframe_5_min_or_unspecified"
          }
        }
      },
      "description": "asd",
      "filters": {
        "filter_type": "metric",
        "metadata": {}
      },
      "id": "002822dd-361d-48c6-b5d2-8f4bfcbdf9da",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 900,
        "use_as_notification_settings": true
      },
      "is_active": false,
      "name": "test more than usual 12",
      "notification_groups": [
        {}
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "d0a39163-dc38-4ae4-a62b-af51362c916d"
    }
  ]
}

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "alerts": [
        {
          "active_when": {
            "timeframes": [
              {
                "days_of_week": [
                  "sunday",
                  "monday_or_unspecified",
                  "tuesday",
                  "wednesday",
                  "thursday",
                  "friday",
                  "saturday"
                ],
                "range": {
                  "end": {
                    "hours": 18,
                    "minutes": 29,
                    "seconds": 59
                  },
                  "start": {
                    "hours": 18,
                    "minutes": 30
                  }
                }
              }
            ]
          },
          "condition": {
            "more_than": {
              "evaluation_window": "rolling_or_unspecified",
              "parameters": {
                "group_by": [
                  "coralogix.metadata.applicationName"
                ],
                "ignore_infinity": true,
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 1,
                "timeframe": "timeframe_10_min"
              }
            }
          },
          "description": "Alert if the number of logs reaches a threshold",
          "filters": {
            "filter_type": "text_or_unspecified",
            "metadata": {},
            "severities": [
              "info"
            ],
            "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
          },
          "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 300,
            "use_as_notification_settings": true
          },
          "is_active": true,
          "meta_labels": [
            {
              "key": "env",
              "value": "dev"
            }
          ],
          "name": "Test alert",
          "notification_groups": [
            {
              "group_by_fields": [
                "coralogix.metadata.applicationName"
              ]
            }
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4"
        },
        {
          "active_when": {
            "timeframes": [
              {
                "days_of_week": [
                  "thursday",
                  "wednesday"
                ],
                "range": {
                  "end": {
                    "hours": 18,
                    "minutes": 30
                  },
                  "start": {
                    "hours": 6,
                    "minutes": 30
                  }
                }
              }
            ]
          },
          "condition": {
            "unique_count": {
              "parameters": {
                "cardinality_fields": [
                  "remote_addr_geoip.country_name"
                ],
                "ignore_infinity": true,
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 2,
                "timeframe": "timeframe_10_min"
              }
            }
          },
          "description": "Example of unique count alert from terraform",
          "filters": {
            "filter_type": "unique_count",
            "metadata": {},
            "severities": [
              "info"
            ]
          },
          "id": "5c334366-571a-4431-80ae-3086bf91c575",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 600,
            "use_as_notification_settings": false
          },
          "is_active": true,
          "name": "Unique count alert example",
          "notification_groups": [
            {
              "notifications": [
                {
                  "notify_on": "triggered_and_resolved",
                  "recipients": {
                    "emails": [
                      "example@coralogix.com"
                    ]
                  },
                  "retriggering_period_seconds": 60
                }
              ]
            }
          ],
          "severity": "warning",
          "unique_identifier": "e6e01065-7eac-4f5f-8e24-2ee4c7122ab9"
        },
        {
          "active_when": {
            "timeframes": [
              {
                "days_of_week": [
                  "thursday",
                  "wednesday"
                ],
                "range": {
                  "end": {
                    "hours": 18,
                    "minutes": 30
                  },
                  "start": {
                    "hours": 6,
                    "minutes": 30
                  }
                }
              }
            ]
          },
          "condition": {
            "unique_count": {
              "parameters": {
                "cardinality_fields": [
                  "remote_addr_geoip.country_name"
                ],
                "ignore_infinity": true,
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 2,
                "timeframe": "timeframe_10_min"
              }
            }
          },
          "description": "Example of unique count alert from terraform",
          "filters": {
            "filter_type": "unique_count",
            "metadata": {},
            "severities": [
              "info"
            ]
          },
          "id": "ffea3734-56eb-4f25-a59a-2d9889c71f46",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 600,
            "use_as_notification_settings": false
          },
          "is_active": true,
          "name": "Unique count alert example",
          "notification_groups": [
            {
              "notifications": [
                {
                  "notify_on": "triggered_and_resolved",
                  "recipients": {
                    "emails": [
                      "example@coralogix.com"
                    ]
                  },
                  "retriggering_period_seconds": 60
                }
              ]
            }
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "39246ad5-19a0-43fd-aa76-e6ff075e864b"
        },
        {
          "condition": {
            "more_than_usual": {
              "parameters": {
                "ignore_infinity": true,
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 10,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "OKTA audit extension pack",
          "filters": {
            "filter_type": "text_or_unspecified",
            "metadata": {},
            "text": "legacyEventType:\\\"login failed\\\""
          },
          "id": "b2f843d7-4721-4ce2-ac0d-ea0443bbe372",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 60,
            "use_as_notification_settings": false
          },
          "is_active": true,
          "name": "More than usual login failures",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "show_in_insight": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 60
          },
          "unique_identifier": "4fa3710a-c91d-4d6e-8359-41a44c45a141"
        },
        {
          "condition": {
            "more_than_usual": {
              "parameters": {
                "ignore_infinity": true,
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 10,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "OKTA audit extension pack",
          "filters": {
            "filter_type": "text_or_unspecified",
            "metadata": {},
            "text": "legacyEventType:\\\"login failed\\\""
          },
          "id": "1a02193d-856b-4f84-ab4e-9918ac136244",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 60,
            "use_as_notification_settings": false
          },
          "is_active": true,
          "name": "More than usual login failures",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "show_in_insight": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 60
          },
          "unique_identifier": "bd851dfb-2aa4-4ed7-97ec-922f01f98036"
        },
        {
          "active_when": {
            "timeframes": [
              {
                "days_of_week": [
                  "thursday",
                  "wednesday"
                ],
                "range": {
                  "end": {
                    "hours": 18,
                    "minutes": 30
                  },
                  "start": {
                    "hours": 6,
                    "minutes": 30
                  }
                }
              }
            ]
          },
          "condition": {
            "unique_count": {
              "parameters": {
                "cardinality_fields": [
                  "remote_addr_geoip.country_name"
                ],
                "ignore_infinity": true,
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 2,
                "timeframe": "timeframe_10_min"
              }
            }
          },
          "description": "Example of unique count alert from terraform",
          "filters": {
            "filter_type": "unique_count",
            "metadata": {},
            "severities": [
              "info"
            ]
          },
          "id": "29f24d53-f219-4245-a2b9-009e98bd8c4e",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 600,
            "use_as_notification_settings": false
          },
          "is_active": true,
          "name": "Unique count alert example",
          "notification_groups": [
            {
              "notifications": [
                {
                  "notify_on": "triggered_and_resolved",
                  "recipients": {
                    "emails": [
                      "example@coralogix.com"
                    ]
                  },
                  "retriggering_period_seconds": 60
                }
              ]
            }
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "e09735d3-a472-4df7-9d2c-2bfe851c436e"
        },
        {
          "active_when": {
            "timeframes": [
              {
                "days_of_week": [
                  "thursday",
                  "wednesday"
                ],
                "range": {
                  "end": {
                    "hours": 18,
                    "minutes": 30
                  },
                  "start": {
                    "hours": 6,
                    "minutes": 30
                  }
                }
              }
            ]
          },
          "condition": {
            "unique_count": {
              "parameters": {
                "cardinality_fields": [
                  "remote_addr_geoip.country_name"
                ],
                "ignore_infinity": true,
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 2,
                "timeframe": "timeframe_10_min"
              }
            }
          },
          "description": "Example of unique count alert from terraform",
          "filters": {
            "filter_type": "unique_count",
            "metadata": {},
            "severities": [
              "info"
            ]
          },
          "id": "3d57bc5b-28b3-4ffe-9ece-049457760edc",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 600,
            "use_as_notification_settings": false
          },
          "is_active": true,
          "name": "Unique count alert example",
          "notification_groups": [
            {
              "notifications": [
                {
                  "notify_on": "triggered_and_resolved",
                  "recipients": {
                    "emails": [
                      "example@coralogix.com"
                    ]
                  },
                  "retriggering_period_seconds": 60
                }
              ]
            }
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "f6f8d470-7793-44d2-82ef-34f95f01b8fa"
        },
        {
          "active_when": {
            "timeframes": [
              {
                "days_of_week": [
                  "monday_or_unspecified",
                  "wednesday"
                ],
                "range": {
                  "end": {
                    "hours": 18,
                    "minutes": 30
                  },
                  "start": {
                    "hours": 6,
                    "minutes": 30
                  }
                }
              }
            ]
          },
          "condition": {
            "unique_count": {
              "parameters": {
                "cardinality_fields": [
                  "remote_addr_geoip.country_name"
                ],
                "ignore_infinity": true,
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 2,
                "timeframe": "timeframe_10_min"
              }
            }
          },
          "description": "Example of unique count alert from terraform",
          "filters": {
            "filter_type": "unique_count",
            "metadata": {},
            "severities": [
              "info"
            ]
          },
          "id": "861320bc-33a1-4dfc-9180-0d0afecb68de",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 600,
            "use_as_notification_settings": false
          },
          "is_active": true,
          "name": "Unique count alert example",
          "notification_groups": [
            {
              "notifications": [
                {
                  "notify_on": "triggered_and_resolved",
                  "recipients": {
                    "emails": [
                      "example@coralogix.com"
                    ]
                  },
                  "retriggering_period_seconds": 60
                }
              ]
            }
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "06facfcf-dfdd-49b0-8078-a07448d0cd54"
        },
        {
          "active_when": {},
          "condition": {
            "more_than_usual": {
              "parameters": {
                "group_by": [
                  "access_mode"
                ],
                "ignore_infinity": true,
                "metric_alert_promql_parameters": {
                  "non_null_percentage": 10,
                  "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
                  "sample_threshold_percentage": 20,
                  "swap_null_values": false
                },
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 0,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "asd",
          "filters": {
            "filter_type": "metric",
            "metadata": {}
          },
          "id": "060f9814-f7fe-4955-96fd-2c6e790a391b",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 900,
            "use_as_notification_settings": true
          },
          "is_active": false,
          "name": "test more than usual 112",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "1ccd73dc-eb4b-437b-b2c1-273457b03424"
        },
        {
          "active_when": {},
          "condition": {
            "more_than_usual": {
              "parameters": {
                "group_by": [
                  "access_mode"
                ],
                "ignore_infinity": true,
                "metric_alert_promql_parameters": {
                  "non_null_percentage": 10,
                  "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
                  "sample_threshold_percentage": 20,
                  "swap_null_values": false
                },
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 0,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "asd",
          "filters": {
            "filter_type": "metric",
            "metadata": {}
          },
          "id": "70b27d7d-0c54-4f2f-8254-a9a828571fe9",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 900,
            "use_as_notification_settings": true
          },
          "is_active": false,
          "name": "test more than usual 12",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "934260b6-cfcd-463a-b25f-54015411df6c"
        },
        {
          "active_when": {},
          "condition": {
            "more_than_usual": {
              "parameters": {
                "group_by": [
                  "access_mode"
                ],
                "ignore_infinity": true,
                "metric_alert_promql_parameters": {
                  "non_null_percentage": 10,
                  "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
                  "sample_threshold_percentage": 20,
                  "swap_null_values": false
                },
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 0,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "asd",
          "filters": {
            "filter_type": "metric",
            "metadata": {}
          },
          "id": "4c2132ca-2f2e-4ea5-8089-810ffad38f82",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 900,
            "use_as_notification_settings": true
          },
          "is_active": false,
          "name": "test more than usual 12",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "f98c3d0e-9ed0-4b0d-a8c4-698ecbfd3c1c"
        },
        {
          "active_when": {},
          "condition": {
            "more_than_usual": {
              "parameters": {
                "group_by": [
                  "access_mode"
                ],
                "ignore_infinity": true,
                "metric_alert_promql_parameters": {
                  "non_null_percentage": 10,
                  "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
                  "sample_threshold_percentage": 20,
                  "swap_null_values": false
                },
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 0,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "asd",
          "filters": {
            "filter_type": "metric",
            "metadata": {}
          },
          "id": "ba301f45-c955-4cef-b8b7-fae3d4da26d6",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 900,
            "use_as_notification_settings": true
          },
          "is_active": false,
          "name": "test more than usual 12",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "258464d8-e26b-4ecb-8b58-07138fe2b44d"
        },
        {
          "active_when": {},
          "condition": {
            "more_than_usual": {
              "parameters": {
                "group_by": [
                  "access_mode"
                ],
                "ignore_infinity": true,
                "metric_alert_promql_parameters": {
                  "non_null_percentage": 10,
                  "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
                  "sample_threshold_percentage": 20,
                  "swap_null_values": false
                },
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 0,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "asd",
          "filters": {
            "filter_type": "metric",
            "metadata": {}
          },
          "id": "a32c5827-d31d-4699-8701-c14d905d007b",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 900,
            "use_as_notification_settings": true
          },
          "is_active": false,
          "name": "test more than usual 12",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "37368b5b-c5e7-4670-9902-8a70cca08a56"
        },
        {
          "active_when": {},
          "condition": {
            "more_than_usual": {
              "parameters": {
                "group_by": [
                  "access_mode"
                ],
                "ignore_infinity": true,
                "metric_alert_promql_parameters": {
                  "non_null_percentage": 10,
                  "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
                  "sample_threshold_percentage": 20,
                  "swap_null_values": false
                },
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 0,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "asd",
          "filters": {
            "filter_type": "metric",
            "metadata": {}
          },
          "id": "64971da5-a32a-4310-9137-e07ee4d549ab",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 900,
            "use_as_notification_settings": true
          },
          "is_active": false,
          "name": "test more than usual 12",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "c757edc0-ff3a-4dd8-af7a-b06a9feab84d"
        },
        {
          "active_when": {},
          "condition": {
            "more_than_usual": {
              "parameters": {
                "group_by": [
                  "access_mode"
                ],
                "ignore_infinity": true,
                "metric_alert_promql_parameters": {
                  "non_null_percentage": 10,
                  "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
                  "sample_threshold_percentage": 20,
                  "swap_null_values": false
                },
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 0,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "asd",
          "filters": {
            "filter_type": "metric",
            "metadata": {}
          },
          "id": "6b6c9073-94c5-4c43-984d-71e29e6025ba",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 900,
            "use_as_notification_settings": true
          },
          "is_active": false,
          "name": "test more than usual 12",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "243ad4d6-ad2e-4c5d-8f12-712d3a089912"
        },
        {
          "active_when": {},
          "condition": {
            "more_than_usual": {
              "parameters": {
                "group_by": [
                  "access_mode"
                ],
                "ignore_infinity": true,
                "metric_alert_promql_parameters": {
                  "non_null_percentage": 10,
                  "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
                  "sample_threshold_percentage": 20,
                  "swap_null_values": false
                },
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 0,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "asd",
          "filters": {
            "filter_type": "metric",
            "metadata": {}
          },
          "id": "002822dd-361d-48c6-b5d2-8f4bfcbdf9da",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 900,
            "use_as_notification_settings": true
          },
          "is_active": false,
          "name": "test more than usual 12",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "d0a39163-dc38-4ae4-a62b-af51362c916d"
        }
      ]
    }
  • {
      "alerts": [
        {
          "active_when": {
            "timeframes": [
              {
                "days_of_week": [
                  "sunday",
                  "monday_or_unspecified",
                  "tuesday",
                  "wednesday",
                  "thursday",
                  "friday",
                  "saturday"
                ],
                "range": {
                  "end": {
                    "hours": 18,
                    "minutes": 29,
                    "seconds": 59
                  },
                  "start": {
                    "hours": 18,
                    "minutes": 30
                  }
                }
              }
            ]
          },
          "condition": {
            "more_than": {
              "evaluation_window": "rolling_or_unspecified",
              "parameters": {
                "group_by": [
                  "coralogix.metadata.applicationName"
                ],
                "ignore_infinity": true,
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 1,
                "timeframe": "timeframe_10_min"
              }
            }
          },
          "description": "Alert if the number of logs reaches a threshold",
          "filters": {
            "filter_type": "text_or_unspecified",
            "metadata": {},
            "severities": [
              "info"
            ],
            "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
          },
          "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 300,
            "use_as_notification_settings": true
          },
          "is_active": true,
          "meta_labels": [
            {
              "key": "env",
              "value": "dev"
            }
          ],
          "name": "Test alert",
          "notification_groups": [
            {
              "group_by_fields": [
                "coralogix.metadata.applicationName"
              ]
            }
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4"
        },
        {
          "active_when": {
            "timeframes": [
              {
                "days_of_week": [
                  "thursday",
                  "wednesday"
                ],
                "range": {
                  "end": {
                    "hours": 18,
                    "minutes": 30
                  },
                  "start": {
                    "hours": 6,
                    "minutes": 30
                  }
                }
              }
            ]
          },
          "condition": {
            "unique_count": {
              "parameters": {
                "cardinality_fields": [
                  "remote_addr_geoip.country_name"
                ],
                "ignore_infinity": true,
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 2,
                "timeframe": "timeframe_10_min"
              }
            }
          },
          "description": "Example of unique count alert from terraform",
          "filters": {
            "filter_type": "unique_count",
            "metadata": {},
            "severities": [
              "info"
            ]
          },
          "id": "5c334366-571a-4431-80ae-3086bf91c575",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 600,
            "use_as_notification_settings": false
          },
          "is_active": true,
          "name": "Unique count alert example",
          "notification_groups": [
            {
              "notifications": [
                {
                  "notify_on": "triggered_and_resolved",
                  "recipients": {
                    "emails": [
                      "example@coralogix.com"
                    ]
                  },
                  "retriggering_period_seconds": 60
                }
              ]
            }
          ],
          "severity": "warning",
          "unique_identifier": "e6e01065-7eac-4f5f-8e24-2ee4c7122ab9"
        },
        {
          "active_when": {
            "timeframes": [
              {
                "days_of_week": [
                  "thursday",
                  "wednesday"
                ],
                "range": {
                  "end": {
                    "hours": 18,
                    "minutes": 30
                  },
                  "start": {
                    "hours": 6,
                    "minutes": 30
                  }
                }
              }
            ]
          },
          "condition": {
            "unique_count": {
              "parameters": {
                "cardinality_fields": [
                  "remote_addr_geoip.country_name"
                ],
                "ignore_infinity": true,
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 2,
                "timeframe": "timeframe_10_min"
              }
            }
          },
          "description": "Example of unique count alert from terraform",
          "filters": {
            "filter_type": "unique_count",
            "metadata": {},
            "severities": [
              "info"
            ]
          },
          "id": "ffea3734-56eb-4f25-a59a-2d9889c71f46",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 600,
            "use_as_notification_settings": false
          },
          "is_active": true,
          "name": "Unique count alert example",
          "notification_groups": [
            {
              "notifications": [
                {
                  "notify_on": "triggered_and_resolved",
                  "recipients": {
                    "emails": [
                      "example@coralogix.com"
                    ]
                  },
                  "retriggering_period_seconds": 60
                }
              ]
            }
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "39246ad5-19a0-43fd-aa76-e6ff075e864b"
        },
        {
          "condition": {
            "more_than_usual": {
              "parameters": {
                "ignore_infinity": true,
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 10,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "OKTA audit extension pack",
          "filters": {
            "filter_type": "text_or_unspecified",
            "metadata": {},
            "text": "legacyEventType:\\\"login failed\\\""
          },
          "id": "b2f843d7-4721-4ce2-ac0d-ea0443bbe372",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 60,
            "use_as_notification_settings": false
          },
          "is_active": true,
          "name": "More than usual login failures",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "show_in_insight": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 60
          },
          "unique_identifier": "4fa3710a-c91d-4d6e-8359-41a44c45a141"
        },
        {
          "condition": {
            "more_than_usual": {
              "parameters": {
                "ignore_infinity": true,
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 10,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "OKTA audit extension pack",
          "filters": {
            "filter_type": "text_or_unspecified",
            "metadata": {},
            "text": "legacyEventType:\\\"login failed\\\""
          },
          "id": "1a02193d-856b-4f84-ab4e-9918ac136244",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 60,
            "use_as_notification_settings": false
          },
          "is_active": true,
          "name": "More than usual login failures",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "show_in_insight": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 60
          },
          "unique_identifier": "bd851dfb-2aa4-4ed7-97ec-922f01f98036"
        },
        {
          "active_when": {
            "timeframes": [
              {
                "days_of_week": [
                  "thursday",
                  "wednesday"
                ],
                "range": {
                  "end": {
                    "hours": 18,
                    "minutes": 30
                  },
                  "start": {
                    "hours": 6,
                    "minutes": 30
                  }
                }
              }
            ]
          },
          "condition": {
            "unique_count": {
              "parameters": {
                "cardinality_fields": [
                  "remote_addr_geoip.country_name"
                ],
                "ignore_infinity": true,
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 2,
                "timeframe": "timeframe_10_min"
              }
            }
          },
          "description": "Example of unique count alert from terraform",
          "filters": {
            "filter_type": "unique_count",
            "metadata": {},
            "severities": [
              "info"
            ]
          },
          "id": "29f24d53-f219-4245-a2b9-009e98bd8c4e",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 600,
            "use_as_notification_settings": false
          },
          "is_active": true,
          "name": "Unique count alert example",
          "notification_groups": [
            {
              "notifications": [
                {
                  "notify_on": "triggered_and_resolved",
                  "recipients": {
                    "emails": [
                      "example@coralogix.com"
                    ]
                  },
                  "retriggering_period_seconds": 60
                }
              ]
            }
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "e09735d3-a472-4df7-9d2c-2bfe851c436e"
        },
        {
          "active_when": {
            "timeframes": [
              {
                "days_of_week": [
                  "thursday",
                  "wednesday"
                ],
                "range": {
                  "end": {
                    "hours": 18,
                    "minutes": 30
                  },
                  "start": {
                    "hours": 6,
                    "minutes": 30
                  }
                }
              }
            ]
          },
          "condition": {
            "unique_count": {
              "parameters": {
                "cardinality_fields": [
                  "remote_addr_geoip.country_name"
                ],
                "ignore_infinity": true,
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 2,
                "timeframe": "timeframe_10_min"
              }
            }
          },
          "description": "Example of unique count alert from terraform",
          "filters": {
            "filter_type": "unique_count",
            "metadata": {},
            "severities": [
              "info"
            ]
          },
          "id": "3d57bc5b-28b3-4ffe-9ece-049457760edc",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 600,
            "use_as_notification_settings": false
          },
          "is_active": true,
          "name": "Unique count alert example",
          "notification_groups": [
            {
              "notifications": [
                {
                  "notify_on": "triggered_and_resolved",
                  "recipients": {
                    "emails": [
                      "example@coralogix.com"
                    ]
                  },
                  "retriggering_period_seconds": 60
                }
              ]
            }
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "f6f8d470-7793-44d2-82ef-34f95f01b8fa"
        },
        {
          "active_when": {
            "timeframes": [
              {
                "days_of_week": [
                  "monday_or_unspecified",
                  "wednesday"
                ],
                "range": {
                  "end": {
                    "hours": 18,
                    "minutes": 30
                  },
                  "start": {
                    "hours": 6,
                    "minutes": 30
                  }
                }
              }
            ]
          },
          "condition": {
            "unique_count": {
              "parameters": {
                "cardinality_fields": [
                  "remote_addr_geoip.country_name"
                ],
                "ignore_infinity": true,
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 2,
                "timeframe": "timeframe_10_min"
              }
            }
          },
          "description": "Example of unique count alert from terraform",
          "filters": {
            "filter_type": "unique_count",
            "metadata": {},
            "severities": [
              "info"
            ]
          },
          "id": "861320bc-33a1-4dfc-9180-0d0afecb68de",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 600,
            "use_as_notification_settings": false
          },
          "is_active": true,
          "name": "Unique count alert example",
          "notification_groups": [
            {
              "notifications": [
                {
                  "notify_on": "triggered_and_resolved",
                  "recipients": {
                    "emails": [
                      "example@coralogix.com"
                    ]
                  },
                  "retriggering_period_seconds": 60
                }
              ]
            }
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "06facfcf-dfdd-49b0-8078-a07448d0cd54"
        },
        {
          "active_when": {},
          "condition": {
            "more_than_usual": {
              "parameters": {
                "group_by": [
                  "access_mode"
                ],
                "ignore_infinity": true,
                "metric_alert_promql_parameters": {
                  "non_null_percentage": 10,
                  "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
                  "sample_threshold_percentage": 20,
                  "swap_null_values": false
                },
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 0,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "asd",
          "filters": {
            "filter_type": "metric",
            "metadata": {}
          },
          "id": "060f9814-f7fe-4955-96fd-2c6e790a391b",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 900,
            "use_as_notification_settings": true
          },
          "is_active": false,
          "name": "test more than usual 112",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "1ccd73dc-eb4b-437b-b2c1-273457b03424"
        },
        {
          "active_when": {},
          "condition": {
            "more_than_usual": {
              "parameters": {
                "group_by": [
                  "access_mode"
                ],
                "ignore_infinity": true,
                "metric_alert_promql_parameters": {
                  "non_null_percentage": 10,
                  "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
                  "sample_threshold_percentage": 20,
                  "swap_null_values": false
                },
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 0,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "asd",
          "filters": {
            "filter_type": "metric",
            "metadata": {}
          },
          "id": "70b27d7d-0c54-4f2f-8254-a9a828571fe9",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 900,
            "use_as_notification_settings": true
          },
          "is_active": false,
          "name": "test more than usual 12",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "934260b6-cfcd-463a-b25f-54015411df6c"
        },
        {
          "active_when": {},
          "condition": {
            "more_than_usual": {
              "parameters": {
                "group_by": [
                  "access_mode"
                ],
                "ignore_infinity": true,
                "metric_alert_promql_parameters": {
                  "non_null_percentage": 10,
                  "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
                  "sample_threshold_percentage": 20,
                  "swap_null_values": false
                },
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 0,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "asd",
          "filters": {
            "filter_type": "metric",
            "metadata": {}
          },
          "id": "4c2132ca-2f2e-4ea5-8089-810ffad38f82",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 900,
            "use_as_notification_settings": true
          },
          "is_active": false,
          "name": "test more than usual 12",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "f98c3d0e-9ed0-4b0d-a8c4-698ecbfd3c1c"
        },
        {
          "active_when": {},
          "condition": {
            "more_than_usual": {
              "parameters": {
                "group_by": [
                  "access_mode"
                ],
                "ignore_infinity": true,
                "metric_alert_promql_parameters": {
                  "non_null_percentage": 10,
                  "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
                  "sample_threshold_percentage": 20,
                  "swap_null_values": false
                },
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 0,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "asd",
          "filters": {
            "filter_type": "metric",
            "metadata": {}
          },
          "id": "ba301f45-c955-4cef-b8b7-fae3d4da26d6",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 900,
            "use_as_notification_settings": true
          },
          "is_active": false,
          "name": "test more than usual 12",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "258464d8-e26b-4ecb-8b58-07138fe2b44d"
        },
        {
          "active_when": {},
          "condition": {
            "more_than_usual": {
              "parameters": {
                "group_by": [
                  "access_mode"
                ],
                "ignore_infinity": true,
                "metric_alert_promql_parameters": {
                  "non_null_percentage": 10,
                  "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
                  "sample_threshold_percentage": 20,
                  "swap_null_values": false
                },
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 0,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "asd",
          "filters": {
            "filter_type": "metric",
            "metadata": {}
          },
          "id": "a32c5827-d31d-4699-8701-c14d905d007b",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 900,
            "use_as_notification_settings": true
          },
          "is_active": false,
          "name": "test more than usual 12",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "37368b5b-c5e7-4670-9902-8a70cca08a56"
        },
        {
          "active_when": {},
          "condition": {
            "more_than_usual": {
              "parameters": {
                "group_by": [
                  "access_mode"
                ],
                "ignore_infinity": true,
                "metric_alert_promql_parameters": {
                  "non_null_percentage": 10,
                  "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
                  "sample_threshold_percentage": 20,
                  "swap_null_values": false
                },
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 0,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "asd",
          "filters": {
            "filter_type": "metric",
            "metadata": {}
          },
          "id": "64971da5-a32a-4310-9137-e07ee4d549ab",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 900,
            "use_as_notification_settings": true
          },
          "is_active": false,
          "name": "test more than usual 12",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "c757edc0-ff3a-4dd8-af7a-b06a9feab84d"
        },
        {
          "active_when": {},
          "condition": {
            "more_than_usual": {
              "parameters": {
                "group_by": [
                  "access_mode"
                ],
                "ignore_infinity": true,
                "metric_alert_promql_parameters": {
                  "non_null_percentage": 10,
                  "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
                  "sample_threshold_percentage": 20,
                  "swap_null_values": false
                },
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 0,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "asd",
          "filters": {
            "filter_type": "metric",
            "metadata": {}
          },
          "id": "6b6c9073-94c5-4c43-984d-71e29e6025ba",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 900,
            "use_as_notification_settings": true
          },
          "is_active": false,
          "name": "test more than usual 12",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "243ad4d6-ad2e-4c5d-8f12-712d3a089912"
        },
        {
          "active_when": {},
          "condition": {
            "more_than_usual": {
              "parameters": {
                "group_by": [
                  "access_mode"
                ],
                "ignore_infinity": true,
                "metric_alert_promql_parameters": {
                  "non_null_percentage": 10,
                  "promql_text": "sum(_firehose_processing_error_count_created) by (access_mode)",
                  "sample_threshold_percentage": 20,
                  "swap_null_values": false
                },
                "relative_timeframe": "hour_or_unspecified",
                "threshold": 0,
                "timeframe": "timeframe_5_min_or_unspecified"
              }
            }
          },
          "description": "asd",
          "filters": {
            "filter_type": "metric",
            "metadata": {}
          },
          "id": "002822dd-361d-48c6-b5d2-8f4bfcbdf9da",
          "incident_settings": {
            "notify_on": "triggered_only",
            "retriggering_period_seconds": 900,
            "use_as_notification_settings": true
          },
          "is_active": false,
          "name": "test more than usual 12",
          "notification_groups": [
            {}
          ],
          "severity": "info_or_unspecified",
          "unique_identifier": "d0a39163-dc38-4ae4-a62b-af51362c916d"
        }
      ]
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Create an alert

Create an alert

Create an alert.

POST /v1/alerts
(logs *LogsV0) CreateAlert(createAlertOptions *CreateAlertOptions) (result *Alert, response *core.DetailedResponse, err error)
(logs *LogsV0) CreateAlertWithContext(ctx context.Context, createAlertOptions *CreateAlertOptions) (result *Alert, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.alert-config.manage

Auditing

Calling this method generates the following auditing event.

  • logs.alert-config.create

Request

Instantiate the CreateAlertOptions struct and set the fields to provide parameter values for the CreateAlert method.

Alert to create/update

Examples:
{
  "active_when": {
    "timeframes": [
      {
        "days_of_week": [
          "sunday",
          "monday_or_unspecified",
          "tuesday",
          "wednesday",
          "thursday",
          "friday",
          "saturday"
        ],
        "range": {
          "end": {
            "hours": 18,
            "minutes": 29,
            "seconds": 59
          },
          "start": {
            "hours": 18,
            "minutes": 30,
            "seconds": 0
          }
        }
      }
    ]
  },
  "condition": {
    "more_than": {
      "evaluation_window": "rolling_or_unspecified",
      "parameters": {
        "cardinality_fields": [],
        "group_by": [
          "coralogix.metadata.applicationName"
        ],
        "ignore_infinity": true,
        "notify_group_by_only_alerts": true,
        "relative_timeframe": "hour_or_unspecified",
        "threshold": 1,
        "timeframe": "timeframe_10_min"
      }
    }
  },
  "description": "Alert if the number of logs reaches a threshold",
  "filters": {
    "filter_type": "text_or_unspecified",
    "metadata": {},
    "ratio_alerts": [],
    "severities": [
      "info"
    ],
    "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
  },
  "incident_settings": {
    "notify_on": "triggered_only",
    "retriggering_period_seconds": 300,
    "use_as_notification_settings": true
  },
  "is_active": true,
  "meta_labels": [
    {
      "key": "env",
      "value": "dev"
    }
  ],
  "meta_labels_strings": [],
  "name": "Test alert",
  "notification_groups": [
    {
      "group_by_fields": [
        "coralogix.metadata.applicationName"
      ],
      "notifications": []
    }
  ],
  "severity": "info_or_unspecified"
}

WithContext method only

The CreateAlert options.

  • curl -X POST --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data   '{
        "active_when": {
          "timeframes": [
            {
              "days_of_week": [
                "sunday",
                "monday_or_unspecified",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday"
              ],
              "range": {
                "end": {
                  "hours": 18,
                  "minutes": 29,
                  "seconds": 59
                },
                "start": {
                  "hours": 18,
                  "minutes": 30,
                  "seconds": 0
                }
              }
            }
          ]
        },
        "condition": {
          "more_than": {
            "evaluation_window": "rolling_or_unspecified",
            "parameters": {
              "cardinality_fields": [],
              "group_by": [
                "coralogix.metadata.applicationName"
              ],
              "ignore_infinity": true,
              "notify_group_by_only_alerts": true,
              "relative_timeframe": "hour_or_unspecified",
              "threshold": 1,
              "timeframe": "timeframe_10_min"
            }
          }
        },
        "description": "Alert if the number of logs reaches a threshold",
        "filters": {
          "filter_type": "text_or_unspecified",
          "metadata": {},
          "ratio_alerts": [],
          "severities": [
            "info"
          ],
          "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
        },
        "incident_settings": {
          "notify_on": "triggered_only",
          "retriggering_period_seconds": 300,
          "use_as_notification_settings": true
        },
        "is_active": true,
        "meta_labels": [
          {
            "key": "env",
            "value": "dev"
          }
        ],
        "meta_labels_strings": [],
        "name": "Test alert",
        "notification_groups": [
          {
            "group_by_fields": [
              "coralogix.metadata.applicationName"
            ],
            "notifications": []
          }
        ],
        "severity": "info_or_unspecified"
      }'   "${base_url}/v1/alerts"
  • alertsV2ConditionParametersModel := &logsv0.AlertsV2ConditionParameters{
      Threshold: core.Float64Ptr(float64(1)),
      Timeframe: core.StringPtr("timeframe_10_min"),
      GroupBy: []string{"coralogix.metadata.applicationName"},
      IgnoreInfinity: core.BoolPtr(true),
      RelativeTimeframe: core.StringPtr("hour_or_unspecified"),
      CardinalityFields: []string{},
    }
    
    alertsV2MoreThanConditionModel := &logsv0.AlertsV2MoreThanCondition{
      Parameters: alertsV2ConditionParametersModel,
      EvaluationWindow: core.StringPtr("rolling_or_unspecified"),
    }
    
    alertsV2AlertConditionModel := &logsv0.AlertsV2AlertConditionConditionMoreThan{
      MoreThan: alertsV2MoreThanConditionModel,
    }
    
    alertsV2AlertNotificationModel := &logsv0.AlertsV2AlertNotificationIntegrationTypeIntegrationID{
    }
    
    alertsV2AlertNotificationGroupsModel := &logsv0.AlertsV2AlertNotificationGroups{
      GroupByFields: []string{"coralogix.metadata.applicationName"},
      Notifications: []logsv0.AlertsV2AlertNotificationIntf{alertsV2AlertNotificationModel},
    }
    
    alertsV1AlertFiltersMetadataFiltersModel := &logsv0.AlertsV1AlertFiltersMetadataFilters{
    }
    
    alertsV1AlertFiltersModel := &logsv0.AlertsV1AlertFilters{
      Severities: []string{"info"},
      Metadata: alertsV1AlertFiltersMetadataFiltersModel,
      Text: core.StringPtr("initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"),
      FilterType: core.StringPtr("text_or_unspecified"),
    }
    
    alertsV1TimeModel := &logsv0.AlertsV1Time{
      Hours: core.Int64Ptr(int64(18)),
      Minutes: core.Int64Ptr(int64(30)),
      Seconds: core.Int64Ptr(int64(0)),
    }
    
    alertsV1TimeRangeModel := &logsv0.AlertsV1TimeRange{
      Start: alertsV1TimeModel,
      End: alertsV1TimeModel,
    }
    
    alertsV1AlertActiveTimeframeModel := &logsv0.AlertsV1AlertActiveTimeframe{
      DaysOfWeek: []string{"sunday", "monday_or_unspecified", "tuesday", "wednesday", "thursday", "friday", "saturday"},
      Range: alertsV1TimeRangeModel,
    }
    
    alertsV1AlertActiveWhenModel := &logsv0.AlertsV1AlertActiveWhen{
      Timeframes: []logsv0.AlertsV1AlertActiveTimeframe{*alertsV1AlertActiveTimeframeModel},
    }
    
    alertsV1MetaLabelModel := &logsv0.AlertsV1MetaLabel{
      Key: core.StringPtr("env"),
      Value: core.StringPtr("dev"),
    }
    
    alertsV2AlertIncidentSettingsModel := &logsv0.AlertsV2AlertIncidentSettings{
      RetriggeringPeriodSeconds: core.Int64Ptr(int64(300)),
      NotifyOn: core.StringPtr("triggered_only"),
      UseAsNotificationSettings: core.BoolPtr(true),
    }
    
    createAlertOptions := logsService.NewCreateAlertOptions(
      "Test alert",
      true,
      "info_or_unspecified",
      alertsV2AlertConditionModel,
      []logsv0.AlertsV2AlertNotificationGroups{*alertsV2AlertNotificationGroupsModel},
      alertsV1AlertFiltersModel,
    )
    createAlertOptions.SetDescription("Alert if the number of logs reaches a threshold")
    createAlertOptions.SetActiveWhen(alertsV1AlertActiveWhenModel)
    createAlertOptions.SetMetaLabels([]logsv0.AlertsV1MetaLabel{*alertsV1MetaLabelModel})
    createAlertOptions.SetMetaLabelsStrings([]string{})
    createAlertOptions.SetIncidentSettings(alertsV2AlertIncidentSettingsModel)
    
    alert, response, err := logsService.CreateAlert(createAlertOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(alert, "", "  ")
    fmt.Println(string(b))

Response

Alert resource model

Alert resource model.

Examples:
{
  "active_when": {
    "timeframes": [
      {
        "days_of_week": [
          "sunday",
          "monday_or_unspecified",
          "tuesday",
          "wednesday",
          "thursday",
          "friday",
          "saturday"
        ],
        "range": {
          "end": {
            "hours": 18,
            "minutes": 29,
            "seconds": 59
          },
          "start": {
            "hours": 18,
            "minutes": 30
          }
        }
      }
    ]
  },
  "condition": {
    "more_than": {
      "evaluation_window": "rolling_or_unspecified",
      "parameters": {
        "group_by": [
          "coralogix.metadata.applicationName"
        ],
        "ignore_infinity": true,
        "relative_timeframe": "hour_or_unspecified",
        "threshold": 1,
        "timeframe": "timeframe_10_min"
      }
    }
  },
  "description": "Alert if the number of logs reaches a threshold",
  "filters": {
    "filter_type": "text_or_unspecified",
    "metadata": {},
    "severities": [
      "info"
    ],
    "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
  },
  "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7",
  "incident_settings": {
    "notify_on": "triggered_only",
    "retriggering_period_seconds": 300,
    "use_as_notification_settings": true
  },
  "is_active": true,
  "meta_labels": [
    {
      "key": "env",
      "value": "dev"
    }
  ],
  "name": "Test alert",
  "notification_groups": [
    {
      "group_by_fields": [
        "coralogix.metadata.applicationName"
      ]
    }
  ],
  "severity": "info_or_unspecified",
  "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4"
}

Status Code

  • Created

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "active_when": {
        "timeframes": [
          {
            "days_of_week": [
              "sunday",
              "monday_or_unspecified",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday"
            ],
            "range": {
              "end": {
                "hours": 18,
                "minutes": 29,
                "seconds": 59
              },
              "start": {
                "hours": 18,
                "minutes": 30
              }
            }
          }
        ]
      },
      "condition": {
        "more_than": {
          "evaluation_window": "rolling_or_unspecified",
          "parameters": {
            "group_by": [
              "coralogix.metadata.applicationName"
            ],
            "ignore_infinity": true,
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 1,
            "timeframe": "timeframe_10_min"
          }
        }
      },
      "description": "Alert if the number of logs reaches a threshold",
      "filters": {
        "filter_type": "text_or_unspecified",
        "metadata": {},
        "severities": [
          "info"
        ],
        "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
      },
      "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 300,
        "use_as_notification_settings": true
      },
      "is_active": true,
      "meta_labels": [
        {
          "key": "env",
          "value": "dev"
        }
      ],
      "name": "Test alert",
      "notification_groups": [
        {
          "group_by_fields": [
            "coralogix.metadata.applicationName"
          ]
        }
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4"
    }
  • {
      "active_when": {
        "timeframes": [
          {
            "days_of_week": [
              "sunday",
              "monday_or_unspecified",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday"
            ],
            "range": {
              "end": {
                "hours": 18,
                "minutes": 29,
                "seconds": 59
              },
              "start": {
                "hours": 18,
                "minutes": 30
              }
            }
          }
        ]
      },
      "condition": {
        "more_than": {
          "evaluation_window": "rolling_or_unspecified",
          "parameters": {
            "group_by": [
              "coralogix.metadata.applicationName"
            ],
            "ignore_infinity": true,
            "relative_timeframe": "hour_or_unspecified",
            "threshold": 1,
            "timeframe": "timeframe_10_min"
          }
        }
      },
      "description": "Alert if the number of logs reaches a threshold",
      "filters": {
        "filter_type": "text_or_unspecified",
        "metadata": {},
        "severities": [
          "info"
        ],
        "text": "initiator.id.keyword:iam-ServiceId-10820fd6-c3fe-414e-8fd5-44ce95f7d34d AND action.keyword:cloud-object-storage.object.create"
      },
      "id": "4cc95bd2-81fa-4239-acfd-d2e8032bddc7",
      "incident_settings": {
        "notify_on": "triggered_only",
        "retriggering_period_seconds": 300,
        "use_as_notification_settings": true
      },
      "is_active": true,
      "meta_labels": [
        {
          "key": "env",
          "value": "dev"
        }
      ],
      "name": "Test alert",
      "notification_groups": [
        {
          "group_by_fields": [
            "coralogix.metadata.applicationName"
          ]
        }
      ],
      "severity": "info_or_unspecified",
      "unique_identifier": "a100339c-5b09-4fe7-9a3e-18745c377ce4"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Gets rule group by groupid

Gets rule group by groupid

Gets rule group by groupid.

GET /v1/rule_groups/{group_id}
(logs *LogsV0) GetRuleGroup(getRuleGroupOptions *GetRuleGroupOptions) (result *RuleGroup, response *core.DetailedResponse, err error)
(logs *LogsV0) GetRuleGroupWithContext(ctx context.Context, getRuleGroupOptions *GetRuleGroupOptions) (result *RuleGroup, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.parsing-rule.get

Auditing

Calling this method generates the following auditing event.

  • logs.parsing-rule.read

Request

Instantiate the GetRuleGroupOptions struct and set the fields to provide parameter values for the GetRuleGroup method.

Path Parameters

  • The group ID

    Possible values: length = 36, Value must match regular expression ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

    Example: 3dc02998-0b50-4ea8-b68a-4779d716fa1f

WithContext method only

The GetRuleGroup options.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/v1/rule_groups/${group_id}"
  • getRuleGroupOptions := logsService.NewGetRuleGroupOptions(
      CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"),
    )
    
    ruleGroup, response, err := logsService.GetRuleGroup(getRuleGroupOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(ruleGroup, "", "  ")
    fmt.Println(string(b))

Response

Parsing rule group

Parsing rule group.

Examples:
{
  "description": "mysql audit logs parser",
  "enabled": true,
  "hidden": false,
  "id": "dae394d9-027a-4f95-a441-c7f3d4ea857d",
  "name": "mysql-extractrule",
  "order": 39,
  "rule_matchers": [
    {
      "subsystem_name": {
        "value": "mysql"
      }
    }
  ],
  "rule_subgroups": [
    {
      "enabled": true,
      "id": "7a4770de-b2db-4e68-a891-68a43e9fea3c",
      "order": 1,
      "rules": [
        {
          "description": "mysql-parse",
          "enabled": true,
          "id": "d032de36-1dd2-410d-a992-fc150337df83",
          "name": "mysql-parse",
          "order": 1,
          "parameters": {
            "parse_parameters": {
              "destination_field": "text",
              "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
            }
          },
          "source_field": "text"
        }
      ]
    }
  ]
}

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "description": "mysql audit logs parser",
      "enabled": true,
      "hidden": false,
      "id": "dae394d9-027a-4f95-a441-c7f3d4ea857d",
      "name": "mysql-extractrule",
      "order": 39,
      "rule_matchers": [
        {
          "subsystem_name": {
            "value": "mysql"
          }
        }
      ],
      "rule_subgroups": [
        {
          "enabled": true,
          "id": "7a4770de-b2db-4e68-a891-68a43e9fea3c",
          "order": 1,
          "rules": [
            {
              "description": "mysql-parse",
              "enabled": true,
              "id": "d032de36-1dd2-410d-a992-fc150337df83",
              "name": "mysql-parse",
              "order": 1,
              "parameters": {
                "parse_parameters": {
                  "destination_field": "text",
                  "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
                }
              },
              "source_field": "text"
            }
          ]
        }
      ]
    }
  • {
      "description": "mysql audit logs parser",
      "enabled": true,
      "hidden": false,
      "id": "dae394d9-027a-4f95-a441-c7f3d4ea857d",
      "name": "mysql-extractrule",
      "order": 39,
      "rule_matchers": [
        {
          "subsystem_name": {
            "value": "mysql"
          }
        }
      ],
      "rule_subgroups": [
        {
          "enabled": true,
          "id": "7a4770de-b2db-4e68-a891-68a43e9fea3c",
          "order": 1,
          "rules": [
            {
              "description": "mysql-parse",
              "enabled": true,
              "id": "d032de36-1dd2-410d-a992-fc150337df83",
              "name": "mysql-parse",
              "order": 1,
              "parameters": {
                "parse_parameters": {
                  "destination_field": "text",
                  "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
                }
              },
              "source_field": "text"
            }
          ]
        }
      ]
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Updates rule group by groupid

Updates rule group by groupid

Updates rule group by groupid.

PUT /v1/rule_groups/{group_id}
(logs *LogsV0) UpdateRuleGroup(updateRuleGroupOptions *UpdateRuleGroupOptions) (result *RuleGroup, response *core.DetailedResponse, err error)
(logs *LogsV0) UpdateRuleGroupWithContext(ctx context.Context, updateRuleGroupOptions *UpdateRuleGroupOptions) (result *RuleGroup, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.parsing-rule.manage

Auditing

Calling this method generates the following auditing event.

  • logs.parsing-rule.update

Request

Instantiate the UpdateRuleGroupOptions struct and set the fields to provide parameter values for the UpdateRuleGroup method.

Path Parameters

  • The group ID

    Possible values: length = 36, Value must match regular expression ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

    Example: 3dc02998-0b50-4ea8-b68a-4779d716fa1f

Request model for CreateRuleGroup rpc

Examples:
{
  "description": "mysql audit logs parser",
  "enabled": true,
  "hidden": false,
  "name": "mysql-extractrule",
  "order": 39,
  "rule_matchers": [
    {
      "subsystem_name": {
        "value": "mysql"
      }
    }
  ],
  "rule_subgroups": [
    {
      "enabled": true,
      "order": 1,
      "rules": [
        {
          "description": "mysql-parse",
          "enabled": true,
          "name": "mysql-parse",
          "order": 1,
          "parameters": {
            "parse_parameters": {
              "destination_field": "text",
              "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
            }
          },
          "source_field": "text"
        }
      ]
    }
  ]
}

WithContext method only

The UpdateRuleGroup options.

  • curl -X PUT --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data   '{
        "description": "mysql audit logs parser",
        "enabled": true,
        "hidden": false,
        "name": "mysql-extractrule",
        "order": 39,
        "rule_matchers": [
          {
            "subsystem_name": {
              "value": "mysql"
            }
          }
        ],
        "rule_subgroups": [
          {
            "enabled": true,
            "order": 1,
            "rules": [
              {
                "description": "mysql-parse",
                "enabled": true,
                "name": "mysql-parse",
                "order": 1,
                "parameters": {
                  "parse_parameters": {
                    "destination_field": "text",
                    "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),?(?P<object>.*)?,(?P<returnCode>[0-9]+)"
                  }
                },
                "source_field": "text"
              }
            ]
          }
        ]
      }'   "${base_url}/v1/rule_groups/${group_id}"
  • rulesV1ParseParametersModel := &logsv0.RulesV1ParseParameters{
      DestinationField: core.StringPtr("text"),
      Rule: core.StringPtr("(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"),
    }
    
    rulesV1RuleParametersModel := &logsv0.RulesV1RuleParametersRuleParametersParseParameters{
      ParseParameters: rulesV1ParseParametersModel,
    }
    
    rulesV1CreateRuleGroupRequestCreateRuleSubgroupCreateRuleModel := &logsv0.RulesV1CreateRuleGroupRequestCreateRuleSubgroupCreateRule{
      Name: core.StringPtr("mysql-parse"),
      Description: core.StringPtr("mysql-parse"),
      SourceField: core.StringPtr("text"),
      Parameters: rulesV1RuleParametersModel,
      Enabled: core.BoolPtr(true),
      Order: core.Int64Ptr(int64(1)),
    }
    
    rulesV1CreateRuleGroupRequestCreateRuleSubgroupModel := &logsv0.RulesV1CreateRuleGroupRequestCreateRuleSubgroup{
      Rules: []logsv0.RulesV1CreateRuleGroupRequestCreateRuleSubgroupCreateRule{*rulesV1CreateRuleGroupRequestCreateRuleSubgroupCreateRuleModel},
      Enabled: core.BoolPtr(true),
      Order: core.Int64Ptr(int64(1)),
    }
    
    rulesV1SubsystemNameConstraintModel := &logsv0.RulesV1SubsystemNameConstraint{
      Value: core.StringPtr("mysql"),
    }
    
    rulesV1RuleMatcherModel := &logsv0.RulesV1RuleMatcherConstraintSubsystemName{
      SubsystemName: rulesV1SubsystemNameConstraintModel,
    }
    
    updateRuleGroupOptions := logsService.NewUpdateRuleGroupOptions(
      CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"),
      "mysql-extractrule",
      []logsv0.RulesV1CreateRuleGroupRequestCreateRuleSubgroup{*rulesV1CreateRuleGroupRequestCreateRuleSubgroupModel},
    )
    updateRuleGroupOptions.SetDescription("mysql audit logs parser")
    updateRuleGroupOptions.SetEnabled(true)
    updateRuleGroupOptions.SetRuleMatchers([]logsv0.RulesV1RuleMatcherIntf{rulesV1RuleMatcherModel})
    updateRuleGroupOptions.SetOrder(int64(39))
    
    ruleGroup, response, err := logsService.UpdateRuleGroup(updateRuleGroupOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(ruleGroup, "", "  ")
    fmt.Println(string(b))

Response

Parsing rule group

Parsing rule group.

Examples:
{
  "description": "mysql audit logs parser",
  "enabled": true,
  "hidden": false,
  "id": "dae394d9-027a-4f95-a441-c7f3d4ea857d",
  "name": "mysql-extractrule",
  "order": 39,
  "rule_matchers": [
    {
      "subsystem_name": {
        "value": "mysql"
      }
    }
  ],
  "rule_subgroups": [
    {
      "enabled": true,
      "id": "7a4770de-b2db-4e68-a891-68a43e9fea3c",
      "order": 1,
      "rules": [
        {
          "description": "mysql-parse",
          "enabled": true,
          "id": "d032de36-1dd2-410d-a992-fc150337df83",
          "name": "mysql-parse",
          "order": 1,
          "parameters": {
            "parse_parameters": {
              "destination_field": "text",
              "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
            }
          },
          "source_field": "text"
        }
      ]
    }
  ]
}

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "description": "mysql audit logs parser",
      "enabled": true,
      "hidden": false,
      "id": "dae394d9-027a-4f95-a441-c7f3d4ea857d",
      "name": "mysql-extractrule",
      "order": 39,
      "rule_matchers": [
        {
          "subsystem_name": {
            "value": "mysql"
          }
        }
      ],
      "rule_subgroups": [
        {
          "enabled": true,
          "id": "7a4770de-b2db-4e68-a891-68a43e9fea3c",
          "order": 1,
          "rules": [
            {
              "description": "mysql-parse",
              "enabled": true,
              "id": "d032de36-1dd2-410d-a992-fc150337df83",
              "name": "mysql-parse",
              "order": 1,
              "parameters": {
                "parse_parameters": {
                  "destination_field": "text",
                  "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
                }
              },
              "source_field": "text"
            }
          ]
        }
      ]
    }
  • {
      "description": "mysql audit logs parser",
      "enabled": true,
      "hidden": false,
      "id": "dae394d9-027a-4f95-a441-c7f3d4ea857d",
      "name": "mysql-extractrule",
      "order": 39,
      "rule_matchers": [
        {
          "subsystem_name": {
            "value": "mysql"
          }
        }
      ],
      "rule_subgroups": [
        {
          "enabled": true,
          "id": "7a4770de-b2db-4e68-a891-68a43e9fea3c",
          "order": 1,
          "rules": [
            {
              "description": "mysql-parse",
              "enabled": true,
              "id": "d032de36-1dd2-410d-a992-fc150337df83",
              "name": "mysql-parse",
              "order": 1,
              "parameters": {
                "parse_parameters": {
                  "destination_field": "text",
                  "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
                }
              },
              "source_field": "text"
            }
          ]
        }
      ]
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Deletes rule group by groupid

Deletes rule group by groupid

Deletes rule group by groupid.

DELETE /v1/rule_groups/{group_id}
(logs *LogsV0) DeleteRuleGroup(deleteRuleGroupOptions *DeleteRuleGroupOptions) (response *core.DetailedResponse, err error)
(logs *LogsV0) DeleteRuleGroupWithContext(ctx context.Context, deleteRuleGroupOptions *DeleteRuleGroupOptions) (response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.parsing-rule.manage

Auditing

Calling this method generates the following auditing event.

  • logs.parsing-rule.delete

Request

Instantiate the DeleteRuleGroupOptions struct and set the fields to provide parameter values for the DeleteRuleGroup method.

Path Parameters

  • The group ID

    Possible values: length = 36, Value must match regular expression ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

    Example: 3dc02998-0b50-4ea8-b68a-4779d716fa1f

WithContext method only

The DeleteRuleGroup options.

  • curl -X DELETE --location --header "Authorization: Bearer ${iam_token}"   "${base_url}/v1/rule_groups/${group_id}"
  • deleteRuleGroupOptions := logsService.NewDeleteRuleGroupOptions(
      CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"),
    )
    
    response, err := logsService.DeleteRuleGroup(deleteRuleGroupOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteRuleGroup(): %d\n", response.StatusCode)
    }

Response

Status Code

  • No Content

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Gets all rule groups

Gets all rule groups

Gets all rule groups.

GET /v1/rule_groups
(logs *LogsV0) ListRuleGroups(listRuleGroupsOptions *ListRuleGroupsOptions) (result *RuleGroupCollection, response *core.DetailedResponse, err error)
(logs *LogsV0) ListRuleGroupsWithContext(ctx context.Context, listRuleGroupsOptions *ListRuleGroupsOptions) (result *RuleGroupCollection, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.parsing-rule.read

Auditing

Calling this method generates the following auditing event.

  • logs.parsing-rule.list

Request

No Request Parameters

This method does not accept any request parameters.

WithContext method only

No Request Parameters

This method does not accept any request parameters.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/v1/rule_groups"
  • listRuleGroupsOptions := logsService.NewListRuleGroupsOptions()
    
    ruleGroupCollection, response, err := logsService.ListRuleGroups(listRuleGroupsOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(ruleGroupCollection, "", "  ")
    fmt.Println(string(b))

Response

Response model for ListRuleGroups rpc

Response model for ListRuleGroups rpc.

Examples:
{
  "rulegroups": [
    {
      "description": "mysql audit logs  parser",
      "enabled": true,
      "hidden": false,
      "id": "a2ddf5dd-f77f-4bea-b782-4068c510e15d",
      "name": "mysql-extractrule",
      "order": 5,
      "rule_matchers": [
        {
          "subsystem_name": {
            "value": "mysql"
          }
        }
      ],
      "rule_subgroups": [
        {
          "enabled": true,
          "id": "2df585fe-be27-4062-aa42-e740193bfc75",
          "order": 1,
          "rules": [
            {
              "description": "mysql-parse",
              "enabled": true,
              "id": "bd585f17-278a-4908-b05b-54fd6bf693be",
              "name": "mysql-parse",
              "order": 1,
              "parameters": {
                "parse_parameters": {
                  "destination_field": "text",
                  "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
                }
              },
              "source_field": "text"
            }
          ]
        }
      ]
    }
  ]
}

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "rulegroups": [
        {
          "description": "mysql audit logs  parser",
          "enabled": true,
          "hidden": false,
          "id": "a2ddf5dd-f77f-4bea-b782-4068c510e15d",
          "name": "mysql-extractrule",
          "order": 5,
          "rule_matchers": [
            {
              "subsystem_name": {
                "value": "mysql"
              }
            }
          ],
          "rule_subgroups": [
            {
              "enabled": true,
              "id": "2df585fe-be27-4062-aa42-e740193bfc75",
              "order": 1,
              "rules": [
                {
                  "description": "mysql-parse",
                  "enabled": true,
                  "id": "bd585f17-278a-4908-b05b-54fd6bf693be",
                  "name": "mysql-parse",
                  "order": 1,
                  "parameters": {
                    "parse_parameters": {
                      "destination_field": "text",
                      "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
                    }
                  },
                  "source_field": "text"
                }
              ]
            }
          ]
        }
      ]
    }
  • {
      "rulegroups": [
        {
          "description": "mysql audit logs  parser",
          "enabled": true,
          "hidden": false,
          "id": "a2ddf5dd-f77f-4bea-b782-4068c510e15d",
          "name": "mysql-extractrule",
          "order": 5,
          "rule_matchers": [
            {
              "subsystem_name": {
                "value": "mysql"
              }
            }
          ],
          "rule_subgroups": [
            {
              "enabled": true,
              "id": "2df585fe-be27-4062-aa42-e740193bfc75",
              "order": 1,
              "rules": [
                {
                  "description": "mysql-parse",
                  "enabled": true,
                  "id": "bd585f17-278a-4908-b05b-54fd6bf693be",
                  "name": "mysql-parse",
                  "order": 1,
                  "parameters": {
                    "parse_parameters": {
                      "destination_field": "text",
                      "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
                    }
                  },
                  "source_field": "text"
                }
              ]
            }
          ]
        }
      ]
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Creates rule group

Creates rule group

Creates rule group.

POST /v1/rule_groups
(logs *LogsV0) CreateRuleGroup(createRuleGroupOptions *CreateRuleGroupOptions) (result *RuleGroup, response *core.DetailedResponse, err error)
(logs *LogsV0) CreateRuleGroupWithContext(ctx context.Context, createRuleGroupOptions *CreateRuleGroupOptions) (result *RuleGroup, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.parsing-rule.manage

Auditing

Calling this method generates the following auditing event.

  • logs.parsing-rule.create

Request

Instantiate the CreateRuleGroupOptions struct and set the fields to provide parameter values for the CreateRuleGroup method.

Request model for CreateRuleGroup rpc

Examples:
{
  "description": "mysql audit logs  parser",
  "enabled": true,
  "hidden": false,
  "name": "mysql-extractrule",
  "order": 39,
  "rule_matchers": [
    {
      "subsystem_name": {
        "value": "mysql"
      }
    }
  ],
  "rule_subgroups": [
    {
      "enabled": true,
      "order": 1,
      "rules": [
        {
          "description": "mysql-parse",
          "enabled": true,
          "name": "mysql-parse",
          "order": 1,
          "parameters": {
            "parse_parameters": {
              "destination_field": "text",
              "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
            }
          },
          "source_field": "text"
        }
      ]
    }
  ]
}

WithContext method only

The CreateRuleGroup options.

  • curl -X POST --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data   '{
        "description": "mysql audit logs  parser",
        "enabled": true,
        "hidden": false,
        "name": "mysql-extractrule",
        "order": 39,
        "rule_matchers": [
          {
            "subsystem_name": {
              "value": "mysql"
            }
          }
        ],
        "rule_subgroups": [
          {
            "enabled": true,
            "order": 1,
            "rules": [
              {
                "description": "mysql-parse",
                "enabled": true,
                "name": "mysql-parse",
                "order": 1,
                "parameters": {
                  "parse_parameters": {
                    "destination_field": "text",
                    "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),?(?P<object>.*)?,(?P<returnCode>[0-9]+)"
                  }
                },
                "source_field": "text"
              }
            ]
          }
        ]
      }'   "${base_url}/v1/rule_groups"
  • rulesV1ParseParametersModel := &logsv0.RulesV1ParseParameters{
      DestinationField: core.StringPtr("text"),
      Rule: core.StringPtr("(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"),
    }
    
    rulesV1RuleParametersModel := &logsv0.RulesV1RuleParametersRuleParametersParseParameters{
      ParseParameters: rulesV1ParseParametersModel,
    }
    
    rulesV1CreateRuleGroupRequestCreateRuleSubgroupCreateRuleModel := &logsv0.RulesV1CreateRuleGroupRequestCreateRuleSubgroupCreateRule{
      Name: core.StringPtr("mysql-parse"),
      Description: core.StringPtr("mysql-parse"),
      SourceField: core.StringPtr("text"),
      Parameters: rulesV1RuleParametersModel,
      Enabled: core.BoolPtr(true),
      Order: core.Int64Ptr(int64(1)),
    }
    
    rulesV1CreateRuleGroupRequestCreateRuleSubgroupModel := &logsv0.RulesV1CreateRuleGroupRequestCreateRuleSubgroup{
      Rules: []logsv0.RulesV1CreateRuleGroupRequestCreateRuleSubgroupCreateRule{*rulesV1CreateRuleGroupRequestCreateRuleSubgroupCreateRuleModel},
      Enabled: core.BoolPtr(true),
      Order: core.Int64Ptr(int64(1)),
    }
    
    rulesV1SubsystemNameConstraintModel := &logsv0.RulesV1SubsystemNameConstraint{
      Value: core.StringPtr("mysql"),
    }
    
    rulesV1RuleMatcherModel := &logsv0.RulesV1RuleMatcherConstraintSubsystemName{
      SubsystemName: rulesV1SubsystemNameConstraintModel,
    }
    
    createRuleGroupOptions := logsService.NewCreateRuleGroupOptions(
      "mysql-extractrule",
      []logsv0.RulesV1CreateRuleGroupRequestCreateRuleSubgroup{*rulesV1CreateRuleGroupRequestCreateRuleSubgroupModel},
    )
    createRuleGroupOptions.SetDescription("mysql audit logs  parser")
    createRuleGroupOptions.SetEnabled(true)
    createRuleGroupOptions.SetRuleMatchers([]logsv0.RulesV1RuleMatcherIntf{rulesV1RuleMatcherModel})
    createRuleGroupOptions.SetOrder(int64(39))
    
    ruleGroup, response, err := logsService.CreateRuleGroup(createRuleGroupOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(ruleGroup, "", "  ")
    fmt.Println(string(b))

Response

Parsing rule group

Parsing rule group.

Examples:
{
  "description": "mysql audit logs parser",
  "enabled": true,
  "hidden": false,
  "id": "dae394d9-027a-4f95-a441-c7f3d4ea857d",
  "name": "mysql-extractrule",
  "order": 39,
  "rule_matchers": [
    {
      "subsystem_name": {
        "value": "mysql"
      }
    }
  ],
  "rule_subgroups": [
    {
      "enabled": true,
      "id": "7a4770de-b2db-4e68-a891-68a43e9fea3c",
      "order": 1,
      "rules": [
        {
          "description": "mysql-parse",
          "enabled": true,
          "id": "d032de36-1dd2-410d-a992-fc150337df83",
          "name": "mysql-parse",
          "order": 1,
          "parameters": {
            "parse_parameters": {
              "destination_field": "text",
              "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
            }
          },
          "source_field": "text"
        }
      ]
    }
  ]
}

Status Code

  • Created

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "description": "mysql audit logs parser",
      "enabled": true,
      "hidden": false,
      "id": "dae394d9-027a-4f95-a441-c7f3d4ea857d",
      "name": "mysql-extractrule",
      "order": 39,
      "rule_matchers": [
        {
          "subsystem_name": {
            "value": "mysql"
          }
        }
      ],
      "rule_subgroups": [
        {
          "enabled": true,
          "id": "7a4770de-b2db-4e68-a891-68a43e9fea3c",
          "order": 1,
          "rules": [
            {
              "description": "mysql-parse",
              "enabled": true,
              "id": "d032de36-1dd2-410d-a992-fc150337df83",
              "name": "mysql-parse",
              "order": 1,
              "parameters": {
                "parse_parameters": {
                  "destination_field": "text",
                  "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
                }
              },
              "source_field": "text"
            }
          ]
        }
      ]
    }
  • {
      "description": "mysql audit logs parser",
      "enabled": true,
      "hidden": false,
      "id": "dae394d9-027a-4f95-a441-c7f3d4ea857d",
      "name": "mysql-extractrule",
      "order": 39,
      "rule_matchers": [
        {
          "subsystem_name": {
            "value": "mysql"
          }
        }
      ],
      "rule_subgroups": [
        {
          "enabled": true,
          "id": "7a4770de-b2db-4e68-a891-68a43e9fea3c",
          "order": 1,
          "rules": [
            {
              "description": "mysql-parse",
              "enabled": true,
              "id": "d032de36-1dd2-410d-a992-fc150337df83",
              "name": "mysql-parse",
              "order": 1,
              "parameters": {
                "parse_parameters": {
                  "destination_field": "text",
                  "rule": "(?P<timestamp>[^,]+),(?P<hostname>[^,]+),(?P<username>[^,]+),(?P<ip>[^,]+),(?P<connectionId>[0-9]+),(?P<queryId>[0-9]+),(?P<operation>[^,]+),(?P<database>[^,]+),'?(?P<object>.*)'?,(?P<returnCode>[0-9]+)"
                }
              },
              "source_field": "text"
            }
          ]
        }
      ]
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

List Outbound Integrations.

List Outbound Integrations.

List Outbound Integrations.

GET /v1/outgoing_webhooks
(logs *LogsV0) ListOutgoingWebhooks(listOutgoingWebhooksOptions *ListOutgoingWebhooksOptions) (result *OutgoingWebhookCollection, response *core.DetailedResponse, err error)
(logs *LogsV0) ListOutgoingWebhooksWithContext(ctx context.Context, listOutgoingWebhooksOptions *ListOutgoingWebhooksOptions) (result *OutgoingWebhookCollection, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.webhook.read

Auditing

Calling this method generates the following auditing event.

  • logs.webhook.list

Request

Instantiate the ListOutgoingWebhooksOptions struct and set the fields to provide parameter values for the ListOutgoingWebhooks method.

Query Parameters

  • The type of the deployed Outbound Integrations to list.

    Allowable values: [ibm_event_notifications]

    Example: ibm_event_notifications

WithContext method only

The ListOutgoingWebhooks options.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/v1/outgoing_webhooks?type=ibm_event_notifications"
  • listOutgoingWebhooksOptions := logsService.NewListOutgoingWebhooksOptions()
    listOutgoingWebhooksOptions.SetType("ibm_event_notifications")
    
    outgoingWebhookCollection, response, err := logsService.ListOutgoingWebhooks(listOutgoingWebhooksOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(outgoingWebhookCollection, "", "  ")
    fmt.Println(string(b))

Response

Response for listing Outbound Integrations of a specified type.

Response for listing Outbound Integrations of a specified type.

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Create an Outbound Integration.

Create an Outbound Integration.

Create an Outbound Integration.

POST /v1/outgoing_webhooks
(logs *LogsV0) CreateOutgoingWebhook(createOutgoingWebhookOptions *CreateOutgoingWebhookOptions) (result OutgoingWebhookIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) CreateOutgoingWebhookWithContext(ctx context.Context, createOutgoingWebhookOptions *CreateOutgoingWebhookOptions) (result OutgoingWebhookIntf, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.webhook.manage

Auditing

Calling this method generates the following auditing event.

  • logs.webhook.crete

Request

Instantiate the CreateOutgoingWebhookOptions struct and set the fields to provide parameter values for the CreateOutgoingWebhook method.

The input data of the Outbound Integration.

WithContext method only

The CreateOutgoingWebhook options.

  • curl -X POST --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data   '{
        "type": "ibm_event_notifications",
        "name": "Event Notifications Integration"
      }'   "${base_url}/v1/outgoing_webhooks"
  • outgoingWebhookPrototypeModel := &logsv0.OutgoingWebhookPrototypeOutgoingWebhooksV1OutgoingWebhookInputDataConfigIbmEventNotifications{
      Type: core.StringPtr("ibm_event_notifications"),
      Name: core.StringPtr("Event Notifications Integration"),
    }
    
    createOutgoingWebhookOptions := logsService.NewCreateOutgoingWebhookOptions(
      outgoingWebhookPrototypeModel,
    )
    
    outgoingWebhook, response, err := logsService.CreateOutgoingWebhook(createOutgoingWebhookOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(outgoingWebhook, "", "  ")
    fmt.Println(string(b))

Response

The Outbound Integration

The Outbound Integration.

Status Code

  • Created

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Gets an Outbound Integration by ID.

Gets an Outbound Integration by ID.

Gets an Outbound Integration by ID.

GET /v1/outgoing_webhooks/{id}
(logs *LogsV0) GetOutgoingWebhook(getOutgoingWebhookOptions *GetOutgoingWebhookOptions) (result OutgoingWebhookIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) GetOutgoingWebhookWithContext(ctx context.Context, getOutgoingWebhookOptions *GetOutgoingWebhookOptions) (result OutgoingWebhookIntf, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.webhook.read

Auditing

Calling this method generates the following auditing event.

  • logs.webhook.get

Request

Instantiate the GetOutgoingWebhookOptions struct and set the fields to provide parameter values for the GetOutgoingWebhook method.

Path Parameters

  • The ID of the Outbound Integration to delete.

    Possible values: length = 36, Value must match regular expression ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

    Example: 585bea36-bdd1-4bfb-9a26-51f1f8a12660

WithContext method only

The GetOutgoingWebhook options.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/v1/outgoing_webhooks/${id}"
  • getOutgoingWebhookOptions := logsService.NewGetOutgoingWebhookOptions(
      CreateMockUUID("585bea36-bdd1-4bfb-9a26-51f1f8a12660"),
    )
    
    outgoingWebhook, response, err := logsService.GetOutgoingWebhook(getOutgoingWebhookOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(outgoingWebhook, "", "  ")
    fmt.Println(string(b))

Response

The Outbound Integration

The Outbound Integration.

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Update an Outbound Integration.

Update an Outbound Integration.

Update an Outbound Integration.

PUT /v1/outgoing_webhooks/{id}
(logs *LogsV0) UpdateOutgoingWebhook(updateOutgoingWebhookOptions *UpdateOutgoingWebhookOptions) (result OutgoingWebhookIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) UpdateOutgoingWebhookWithContext(ctx context.Context, updateOutgoingWebhookOptions *UpdateOutgoingWebhookOptions) (result OutgoingWebhookIntf, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.webhook.manage

Auditing

Calling this method generates the following auditing event.

  • logs.webhook.update

Request

Instantiate the UpdateOutgoingWebhookOptions struct and set the fields to provide parameter values for the UpdateOutgoingWebhook method.

Path Parameters

  • The ID of the Outbound Integration to delete.

    Possible values: length = 36, Value must match regular expression ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

    Example: 585bea36-bdd1-4bfb-9a26-51f1f8a12660

The input data of the Outbound Integration.

WithContext method only

The UpdateOutgoingWebhook options.

  • curl -X PUT --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data   '{
        "type": "ibm_event_notifications",
        "name": "Event Notifications Integration"
      }'   "${base_url}/v1/outgoing_webhooks/${id}"
  • outgoingWebhookPrototypeModel := &logsv0.OutgoingWebhookPrototypeOutgoingWebhooksV1OutgoingWebhookInputDataConfigIbmEventNotifications{
      Type: core.StringPtr("ibm_event_notifications"),
      Name: core.StringPtr("Event Notifications Integration"),
    }
    
    updateOutgoingWebhookOptions := logsService.NewUpdateOutgoingWebhookOptions(
      CreateMockUUID("585bea36-bdd1-4bfb-9a26-51f1f8a12660"),
      outgoingWebhookPrototypeModel,
    )
    
    outgoingWebhook, response, err := logsService.UpdateOutgoingWebhook(updateOutgoingWebhookOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(outgoingWebhook, "", "  ")
    fmt.Println(string(b))

Response

The Outbound Integration

The Outbound Integration.

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Delete an Outbound Integration.

Delete an Outbound Integration.

Delete an Outbound Integration.

DELETE /v1/outgoing_webhooks/{id}
(logs *LogsV0) DeleteOutgoingWebhook(deleteOutgoingWebhookOptions *DeleteOutgoingWebhookOptions) (response *core.DetailedResponse, err error)
(logs *LogsV0) DeleteOutgoingWebhookWithContext(ctx context.Context, deleteOutgoingWebhookOptions *DeleteOutgoingWebhookOptions) (response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.webhook.manage

Auditing

Calling this method generates the following auditing event.

  • logs.webhook.delete

Request

Instantiate the DeleteOutgoingWebhookOptions struct and set the fields to provide parameter values for the DeleteOutgoingWebhook method.

Path Parameters

  • The ID of the Outbound Integration to delete.

    Possible values: length = 36, Value must match regular expression ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

    Example: 585bea36-bdd1-4bfb-9a26-51f1f8a12660

WithContext method only

The DeleteOutgoingWebhook options.

  • curl -X DELETE --location --header "Authorization: Bearer ${iam_token}"   "${base_url}/v1/outgoing_webhooks/${id}"
  • deleteOutgoingWebhookOptions := logsService.NewDeleteOutgoingWebhookOptions(
      CreateMockUUID("585bea36-bdd1-4bfb-9a26-51f1f8a12660"),
    )
    
    response, err := logsService.DeleteOutgoingWebhook(deleteOutgoingWebhookOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteOutgoingWebhook(): %d\n", response.StatusCode)
    }

Response

Status Code

  • No Content

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Gets policy by id

Gets policy by id

Gets policy by id.

GET /v1/policies/{id}
(logs *LogsV0) GetPolicy(getPolicyOptions *GetPolicyOptions) (result PolicyIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) GetPolicyWithContext(ctx context.Context, getPolicyOptions *GetPolicyOptions) (result PolicyIntf, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.logs-tco-policy.read

Auditing

Calling this method generates the following auditing event.

  • logs.logs-tco-policy.get

Request

Instantiate the GetPolicyOptions struct and set the fields to provide parameter values for the GetPolicy method.

Path Parameters

  • ID of policy

    Possible values: length = 36, Value must match regular expression ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

    Example: 3dc02998-0b50-4ea8-b68a-4779d716fa1f

WithContext method only

The GetPolicy options.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/v1/policies/${id}"
  • getPolicyOptions := logsService.NewGetPolicyOptions(
      CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"),
    )
    
    policy, response, err := logsService.GetPolicy(getPolicyOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(policy, "", "  ")
    fmt.Println(string(b))

Response

Policy resource model

Policy resource model.

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "application_rule": {
        "name": "policy-test",
        "rule_type_id": "is"
      },
      "company_id": 192,
      "created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)",
      "deleted": false,
      "description": "Medium policy",
      "enabled": true,
      "id": "ac91d47c-faf1-4761-831d-b393f81a3fdc",
      "log_rules": {
        "severities": [
          "debug",
          "verbose",
          "info",
          "warning",
          "error"
        ]
      },
      "name": "Med_policy",
      "order": 2,
      "priority": "type_high",
      "subsystem_rule": {
        "name": "policy-test",
        "rule_type_id": "is"
      },
      "updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)"
    }
  • {
      "application_rule": {
        "name": "policy-test",
        "rule_type_id": "is"
      },
      "company_id": 192,
      "created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)",
      "deleted": false,
      "description": "Medium policy",
      "enabled": true,
      "id": "ac91d47c-faf1-4761-831d-b393f81a3fdc",
      "log_rules": {
        "severities": [
          "debug",
          "verbose",
          "info",
          "warning",
          "error"
        ]
      },
      "name": "Med_policy",
      "order": 2,
      "priority": "type_high",
      "subsystem_rule": {
        "name": "policy-test",
        "rule_type_id": "is"
      },
      "updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Updates an existing policy

Updates an existing policy

Updates an existing policy.

PUT /v1/policies/{id}
(logs *LogsV0) UpdatePolicy(updatePolicyOptions *UpdatePolicyOptions) (result PolicyIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) UpdatePolicyWithContext(ctx context.Context, updatePolicyOptions *UpdatePolicyOptions) (result PolicyIntf, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.logs-tco-policy.manage

Auditing

Calling this method generates the following auditing event.

  • logs.logs-tco-policy.update

Request

Instantiate the UpdatePolicyOptions struct and set the fields to provide parameter values for the UpdatePolicy method.

Path Parameters

  • ID of policy

    Possible values: length = 36, Value must match regular expression ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

    Example: 3dc02998-0b50-4ea8-b68a-4779d716fa1f

Create policy request

Examples:
{
  "application_rule": {
    "name": "policy-test",
    "rule_type_id": "is"
  },
  "deleted": false,
  "description": "Medium policy",
  "enabled": true,
  "log_rules": {
    "severities": [
      "debug",
      "verbose",
      "info",
      "warning",
      "error"
    ]
  },
  "name": "Med_policy",
  "order": 2,
  "priority": "type_high",
  "subsystem_rule": {
    "name": "policy-test",
    "rule_type_id": "is"
  }
}

WithContext method only

The UpdatePolicy options.

  • curl -X PUT --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data   '{
        "application_rule": {
          "name": "policy-test",
          "rule_type_id": "is"
        },
        "deleted": false,
        "description": "Medium policy",
        "enabled": true,
        "log_rules": {
          "severities": [
            "debug",
            "verbose",
            "info",
            "warning",
            "error"
          ]
        },
        "name": "Med_policy",
        "order": 2,
        "priority": "type_high",
        "subsystem_rule": {
          "name": "policy-test",
          "rule_type_id": "is"
        }
      }'   "${base_url}/v1/policies/${id}"
  • quotaV1RuleModel := &logsv0.QuotaV1Rule{
      RuleTypeID: core.StringPtr("is"),
      Name: core.StringPtr("policy-test"),
    }
    
    quotaV1LogRulesModel := &logsv0.QuotaV1LogRules{
      Severities: []string{"debug", "verbose", "info", "warning", "error"},
    }
    
    policyPrototypeModel := &logsv0.PolicyPrototypeQuotaV1CreatePolicyRequestSourceTypeRulesLogRules{
      Name: core.StringPtr("Med_policy"),
      Description: core.StringPtr("Medium policy"),
      Priority: core.StringPtr("type_high"),
      ApplicationRule: quotaV1RuleModel,
      SubsystemRule: quotaV1RuleModel,
      LogRules: quotaV1LogRulesModel,
    }
    
    updatePolicyOptions := logsService.NewUpdatePolicyOptions(
      CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"),
      policyPrototypeModel,
    )
    
    policy, response, err := logsService.UpdatePolicy(updatePolicyOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(policy, "", "  ")
    fmt.Println(string(b))

Response

Policy resource model

Policy resource model.

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "application_rule": {
        "name": "policy-test",
        "rule_type_id": "is"
      },
      "company_id": 192,
      "created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)",
      "deleted": false,
      "description": "Medium policy",
      "enabled": true,
      "id": "ac91d47c-faf1-4761-831d-b393f81a3fdc",
      "log_rules": {
        "severities": [
          "debug",
          "verbose",
          "info",
          "warning",
          "error"
        ]
      },
      "name": "Med_policy",
      "order": 2,
      "priority": "type_high",
      "subsystem_rule": {
        "name": "policy-test",
        "rule_type_id": "is"
      },
      "updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)"
    }
  • {
      "application_rule": {
        "name": "policy-test",
        "rule_type_id": "is"
      },
      "company_id": 192,
      "created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)",
      "deleted": false,
      "description": "Medium policy",
      "enabled": true,
      "id": "ac91d47c-faf1-4761-831d-b393f81a3fdc",
      "log_rules": {
        "severities": [
          "debug",
          "verbose",
          "info",
          "warning",
          "error"
        ]
      },
      "name": "Med_policy",
      "order": 2,
      "priority": "type_high",
      "subsystem_rule": {
        "name": "policy-test",
        "rule_type_id": "is"
      },
      "updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Deletes an existing policy

Deletes an existing policy

Deletes an existing policy.

DELETE /v1/policies/{id}
(logs *LogsV0) DeletePolicy(deletePolicyOptions *DeletePolicyOptions) (response *core.DetailedResponse, err error)
(logs *LogsV0) DeletePolicyWithContext(ctx context.Context, deletePolicyOptions *DeletePolicyOptions) (response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.logs-tco-policy.manage

Auditing

Calling this method generates the following auditing event.

  • logs.logs-tco-policy.delete

Request

Instantiate the DeletePolicyOptions struct and set the fields to provide parameter values for the DeletePolicy method.

Path Parameters

  • ID of policy

    Possible values: length = 36, Value must match regular expression ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

    Example: 3dc02998-0b50-4ea8-b68a-4779d716fa1f

WithContext method only

The DeletePolicy options.

  • curl -X DELETE --location --header "Authorization: Bearer ${iam_token}"   "${base_url}/v1/policies/${id}"
  • deletePolicyOptions := logsService.NewDeletePolicyOptions(
      CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"),
    )
    
    response, err := logsService.DeletePolicy(deletePolicyOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeletePolicy(): %d\n", response.StatusCode)
    }

Response

Status Code

  • No Content

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Gets policies

Gets policies

Gets policies.

GET /v1/policies
(logs *LogsV0) GetCompanyPolicies(getCompanyPoliciesOptions *GetCompanyPoliciesOptions) (result *PolicyCollection, response *core.DetailedResponse, err error)
(logs *LogsV0) GetCompanyPoliciesWithContext(ctx context.Context, getCompanyPoliciesOptions *GetCompanyPoliciesOptions) (result *PolicyCollection, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.logs-tco-policy.read

Auditing

Calling this method generates the following auditing event.

  • logs.logs-tco-policy.list

Request

Instantiate the GetCompanyPoliciesOptions struct and set the fields to provide parameter values for the GetCompanyPolicies method.

Query Parameters

  • Optionally filter only enabled policies

    Example: true

  • Source type to filter policies by

    Allowable values: [unspecified,logs]

    Example: logs

WithContext method only

The GetCompanyPolicies options.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/v1/policies?enabled_only=true&source_type=logs"
  • getCompanyPoliciesOptions := logsService.NewGetCompanyPoliciesOptions()
    getCompanyPoliciesOptions.SetEnabledOnly(true)
    getCompanyPoliciesOptions.SetSourceType("logs")
    
    policyCollection, response, err := logsService.GetCompanyPolicies(getCompanyPoliciesOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(policyCollection, "", "  ")
    fmt.Println(string(b))

Response

Response to get company policies request

Response to get company policies request.

Examples:
{
  "policies": [
    {
      "application_rule": {
        "name": "policy-test",
        "rule_type_id": "is"
      },
      "company_id": 192,
      "created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)",
      "deleted": false,
      "description": "Medium policy",
      "enabled": true,
      "id": "ac91d47c-faf1-4761-831d-b393f81a3fdc",
      "log_rules": {
        "severities": [
          "debug",
          "verbose",
          "info",
          "warning",
          "error"
        ]
      },
      "name": "Med_policy",
      "order": 2,
      "priority": "type_high",
      "subsystem_rule": {
        "name": "policy-test",
        "rule_type_id": "is"
      },
      "updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)"
    }
  ]
}

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "policies": [
        {
          "application_rule": {
            "name": "policy-test",
            "rule_type_id": "is"
          },
          "company_id": 192,
          "created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)",
          "deleted": false,
          "description": "Medium policy",
          "enabled": true,
          "id": "ac91d47c-faf1-4761-831d-b393f81a3fdc",
          "log_rules": {
            "severities": [
              "debug",
              "verbose",
              "info",
              "warning",
              "error"
            ]
          },
          "name": "Med_policy",
          "order": 2,
          "priority": "type_high",
          "subsystem_rule": {
            "name": "policy-test",
            "rule_type_id": "is"
          },
          "updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)"
        }
      ]
    }
  • {
      "policies": [
        {
          "application_rule": {
            "name": "policy-test",
            "rule_type_id": "is"
          },
          "company_id": 192,
          "created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)",
          "deleted": false,
          "description": "Medium policy",
          "enabled": true,
          "id": "ac91d47c-faf1-4761-831d-b393f81a3fdc",
          "log_rules": {
            "severities": [
              "debug",
              "verbose",
              "info",
              "warning",
              "error"
            ]
          },
          "name": "Med_policy",
          "order": 2,
          "priority": "type_high",
          "subsystem_rule": {
            "name": "policy-test",
            "rule_type_id": "is"
          },
          "updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)"
        }
      ]
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Creates a new policy

Creates a new policy

Creates a new policy.

POST /v1/policies
(logs *LogsV0) CreatePolicy(createPolicyOptions *CreatePolicyOptions) (result PolicyIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) CreatePolicyWithContext(ctx context.Context, createPolicyOptions *CreatePolicyOptions) (result PolicyIntf, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.logs-tco-policy.manage

Auditing

Calling this method generates the following auditing event.

  • logs.logs-tco-policy.create

Request

Instantiate the CreatePolicyOptions struct and set the fields to provide parameter values for the CreatePolicy method.

Create policy request

Examples:
{
  "application_rule": {
    "name": "policy-test",
    "rule_type_id": "is"
  },
  "deleted": false,
  "description": "Medium Policy",
  "enabled": true,
  "log_rules": {
    "severities": [
      "debug",
      "verbose",
      "info",
      "warning",
      "error"
    ]
  },
  "name": "Med_policy",
  "order": 2,
  "priority": "type_high",
  "subsystem_rule": {
    "name": "policy-test",
    "rule_type_id": "is"
  }
}

WithContext method only

The CreatePolicy options.

  • curl -X POST --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data   '{
        "application_rule": {
          "name": "policy-test",
          "rule_type_id": "is"
        },
        "deleted": false,
        "description": "Medium Policy",
        "enabled": true,
        "log_rules": {
          "severities": [
            "debug",
            "verbose",
            "info",
            "warning",
            "error"
          ]
        },
        "name": "Med_policy",
        "order": 2,
        "priority": "type_high",
        "subsystem_rule": {
          "name": "policy-test",
          "rule_type_id": "is"
        }
      }'   "${base_url}/v1/policies"
  • quotaV1RuleModel := &logsv0.QuotaV1Rule{
      RuleTypeID: core.StringPtr("is"),
      Name: core.StringPtr("policy-test"),
    }
    
    quotaV1LogRulesModel := &logsv0.QuotaV1LogRules{
      Severities: []string{"debug", "verbose", "info", "warning", "error"},
    }
    
    policyPrototypeModel := &logsv0.PolicyPrototypeQuotaV1CreatePolicyRequestSourceTypeRulesLogRules{
      Name: core.StringPtr("Med_policy"),
      Description: core.StringPtr("Medium Policy"),
      Priority: core.StringPtr("type_high"),
      ApplicationRule: quotaV1RuleModel,
      SubsystemRule: quotaV1RuleModel,
      LogRules: quotaV1LogRulesModel,
    }
    
    createPolicyOptions := logsService.NewCreatePolicyOptions(
      policyPrototypeModel,
    )
    
    policy, response, err := logsService.CreatePolicy(createPolicyOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(policy, "", "  ")
    fmt.Println(string(b))

Response

Policy resource model

Policy resource model.

Status Code

  • Created

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "application_rule": {
        "name": "policy-test",
        "rule_type_id": "is"
      },
      "company_id": 192,
      "created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)",
      "deleted": false,
      "description": "Medium policy",
      "enabled": true,
      "id": "ac91d47c-faf1-4761-831d-b393f81a3fdc",
      "log_rules": {
        "severities": [
          "debug",
          "verbose",
          "info",
          "warning",
          "error"
        ]
      },
      "name": "Med_policy",
      "order": 2,
      "priority": "type_high",
      "subsystem_rule": {
        "name": "policy-test",
        "rule_type_id": "is"
      },
      "updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)"
    }
  • {
      "application_rule": {
        "name": "policy-test",
        "rule_type_id": "is"
      },
      "company_id": 192,
      "created_at": "Tue Feb 06 2024 11:22:58 GMT+0000 (Coordinated Universal Time)",
      "deleted": false,
      "description": "Medium policy",
      "enabled": true,
      "id": "ac91d47c-faf1-4761-831d-b393f81a3fdc",
      "log_rules": {
        "severities": [
          "debug",
          "verbose",
          "info",
          "warning",
          "error"
        ]
      },
      "name": "Med_policy",
      "order": 2,
      "priority": "type_high",
      "subsystem_rule": {
        "name": "policy-test",
        "rule_type_id": "is"
      },
      "updated_at": "Thu Feb 15 2024 12:30:42 GMT+0000 (Coordinated Universal Time)"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Lists event to metrics definitions

Lists event to metrics definitions

Lists event to metrics definitions.

GET /v1/events2metrics
(logs *LogsV0) ListE2m(listE2mOptions *ListE2mOptions) (result *Event2MetricCollection, response *core.DetailedResponse, err error)
(logs *LogsV0) ListE2mWithContext(ctx context.Context, listE2mOptions *ListE2mOptions) (result *Event2MetricCollection, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.events2metrics.read

Auditing

Calling this method generates the following auditing event.

  • logs.events2metrics.list

Request

No Request Parameters

This method does not accept any request parameters.

WithContext method only

No Request Parameters

This method does not accept any request parameters.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/v1/events2metrics"
  • listE2mOptions := logsService.NewListE2mOptions()
    
    event2MetricCollection, response, err := logsService.ListE2m(listE2mOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(event2MetricCollection, "", "  ")
    fmt.Println(string(b))

Response

Represents response of

Represents response of.

Examples:
{
  "events2metrics": [
    {
      "create_time": "2024-03-11T10:38:21.000Z",
      "description": "Test e2m updated",
      "id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de",
      "is_internal": true,
      "logs_query": {
        "lucene": "logs"
      },
      "name": "test em2",
      "permutations": {
        "limit": 1
      },
      "type": "logs2metrics",
      "update_time": "2024-03-11T10:38:21.000Z"
    }
  ]
}

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "events2metrics": [
        {
          "create_time": "2024-03-11T10:38:21.000Z",
          "description": "Test e2m updated",
          "id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de",
          "is_internal": true,
          "logs_query": {
            "lucene": "logs"
          },
          "name": "test em2",
          "permutations": {
            "limit": 1
          },
          "type": "logs2metrics",
          "update_time": "2024-03-11T10:38:21.000Z"
        }
      ]
    }
  • {
      "events2metrics": [
        {
          "create_time": "2024-03-11T10:38:21.000Z",
          "description": "Test e2m updated",
          "id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de",
          "is_internal": true,
          "logs_query": {
            "lucene": "logs"
          },
          "name": "test em2",
          "permutations": {
            "limit": 1
          },
          "type": "logs2metrics",
          "update_time": "2024-03-11T10:38:21.000Z"
        }
      ]
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Creates event to metrics definitions

Creates event to metrics definitions

Creates event to metrics definitions.

POST /v1/events2metrics
(logs *LogsV0) CreateE2m(createE2mOptions *CreateE2mOptions) (result Event2MetricIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) CreateE2mWithContext(ctx context.Context, createE2mOptions *CreateE2mOptions) (result Event2MetricIntf, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.events2metrics.manage

Auditing

Calling this method generates the following auditing event.

  • logs.events2metrics.update

Request

Instantiate the CreateE2mOptions struct and set the fields to provide parameter values for the CreateE2m method.

E2M Create message

Examples:
{
  "description": "Test e2m",
  "logs_query": {
    "lucene": "logs"
  },
  "name": "test em2",
  "permutations_limit": 1,
  "type": "logs2metrics"
}

WithContext method only

The CreateE2m options.

  • curl -X POST --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data   '{
        "description": "Test e2m",
        "logs_query": {
          "lucene": "logs"
        },
        "name": "test em2",
        "permutations_limit": 1,
        "type": "logs2metrics"
      }'   "${base_url}/v1/events2metrics"
  • apisLogs2metricsV2LogsQueryModel := &logsv0.ApisLogs2metricsV2LogsQuery{
      Lucene: core.StringPtr("logs"),
    }
    
    event2MetricPrototypeModel := &logsv0.Event2MetricPrototypeApisEvents2metricsV2E2mCreateParamsQueryLogsQuery{
      Name: core.StringPtr("test em2"),
      Description: core.StringPtr("Test e2m"),
      PermutationsLimit: core.Int64Ptr(int64(1)),
      Type: core.StringPtr("logs2metrics"),
      LogsQuery: apisLogs2metricsV2LogsQueryModel,
    }
    
    createE2mOptions := logsService.NewCreateE2mOptions(
      event2MetricPrototypeModel,
    )
    
    event2Metric, response, err := logsService.CreateE2m(createE2mOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(event2Metric, "", "  ")
    fmt.Println(string(b))

Response

E2M represents the Event to metrics base model.

E2M represents the Event to metrics base model.

Status Code

  • Created

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "create_time": "2024-03-11T10:38:21.000Z",
      "description": "Test e2m updated",
      "id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de",
      "is_internal": true,
      "logs_query": {
        "lucene": "logs"
      },
      "name": "test em2",
      "permutations": {
        "limit": 1
      },
      "type": "logs2metrics",
      "update_time": "2024-03-11T10:38:21.000Z"
    }
  • {
      "create_time": "2024-03-11T10:38:21.000Z",
      "description": "Test e2m updated",
      "id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de",
      "is_internal": true,
      "logs_query": {
        "lucene": "logs"
      },
      "name": "test em2",
      "permutations": {
        "limit": 1
      },
      "type": "logs2metrics",
      "update_time": "2024-03-11T10:38:21.000Z"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Gets event to metrics definitions by id

Gets event to metrics definitions by id

Gets event to metrics definitions by id.

GET /v1/events2metrics/{id}
(logs *LogsV0) GetE2m(getE2mOptions *GetE2mOptions) (result Event2MetricIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) GetE2mWithContext(ctx context.Context, getE2mOptions *GetE2mOptions) (result Event2MetricIntf, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.events2metrics.read

Auditing

Calling this method generates the following auditing event.

  • logs.events2metrics.get

Request

Instantiate the GetE2mOptions struct and set the fields to provide parameter values for the GetE2m method.

Path Parameters

  • ID of e2m to be deleted

    Possible values: 1 ≤ length ≤ 4096, Value must match regular expression ^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$

    Example: d6a3658e-78d2-47d0-9b81-b2c551f01b09

WithContext method only

The GetE2m options.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/v1/events2metrics/${id}"
  • getE2mOptions := logsService.NewGetE2mOptions(
      "d6a3658e-78d2-47d0-9b81-b2c551f01b09",
    )
    
    event2Metric, response, err := logsService.GetE2m(getE2mOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(event2Metric, "", "  ")
    fmt.Println(string(b))

Response

E2M represents the Event to metrics base model.

E2M represents the Event to metrics base model.

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "create_time": "2024-03-11T10:38:21.000Z",
      "description": "Test e2m updated",
      "id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de",
      "is_internal": true,
      "logs_query": {
        "lucene": "logs"
      },
      "name": "test em2",
      "permutations": {
        "limit": 1
      },
      "type": "logs2metrics",
      "update_time": "2024-03-11T10:38:21.000Z"
    }
  • {
      "create_time": "2024-03-11T10:38:21.000Z",
      "description": "Test e2m updated",
      "id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de",
      "is_internal": true,
      "logs_query": {
        "lucene": "logs"
      },
      "name": "test em2",
      "permutations": {
        "limit": 1
      },
      "type": "logs2metrics",
      "update_time": "2024-03-11T10:38:21.000Z"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Updates event to metrics definitions

Updates event to metrics definitions

Updates event to metrics definitions.

PUT /v1/events2metrics/{id}
(logs *LogsV0) ReplaceE2m(replaceE2mOptions *ReplaceE2mOptions) (result Event2MetricIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) ReplaceE2mWithContext(ctx context.Context, replaceE2mOptions *ReplaceE2mOptions) (result Event2MetricIntf, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.events2metrics.manage

Auditing

Calling this method generates the following auditing event.

  • logs.events2metrics.update

Request

Instantiate the ReplaceE2mOptions struct and set the fields to provide parameter values for the ReplaceE2m method.

Path Parameters

  • ID of e2m to be deleted

    Possible values: 1 ≤ length ≤ 4096, Value must match regular expression ^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$

    Example: d6a3658e-78d2-47d0-9b81-b2c551f01b09

E2M Create message

Examples:
{
  "description": "Test e2m updated",
  "logs_query": {
    "lucene": "logs"
  },
  "name": "test em2",
  "permutations_limit": 1,
  "type": "logs2metrics"
}

WithContext method only

The ReplaceE2m options.

  • curl -X PUT --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data   '{
        "description": "Test e2m updated",
        "logs_query": {
          "lucene": "logs"
        },
        "name": "test em2",
        "permutations_limit": 1,
        "type": "logs2metrics"
      }'   "${base_url}/v1/events2metrics/${id}"
  • apisLogs2metricsV2LogsQueryModel := &logsv0.ApisLogs2metricsV2LogsQuery{
      Lucene: core.StringPtr("logs"),
    }
    
    event2MetricPrototypeModel := &logsv0.Event2MetricPrototypeApisEvents2metricsV2E2mCreateParamsQueryLogsQuery{
      Name: core.StringPtr("test em2"),
      Description: core.StringPtr("Test e2m updated"),
      PermutationsLimit: core.Int64Ptr(int64(1)),
      Type: core.StringPtr("logs2metrics"),
      LogsQuery: apisLogs2metricsV2LogsQueryModel,
    }
    
    replaceE2mOptions := logsService.NewReplaceE2mOptions(
      "d6a3658e-78d2-47d0-9b81-b2c551f01b09",
      event2MetricPrototypeModel,
    )
    
    event2Metric, response, err := logsService.ReplaceE2m(replaceE2mOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(event2Metric, "", "  ")
    fmt.Println(string(b))

Response

E2M represents the Event to metrics base model.

E2M represents the Event to metrics base model.

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "create_time": "2024-03-11T10:38:21.000Z",
      "description": "Test e2m updated",
      "id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de",
      "is_internal": true,
      "logs_query": {
        "lucene": "logs"
      },
      "name": "test em2",
      "permutations": {
        "limit": 1
      },
      "type": "logs2metrics",
      "update_time": "2024-03-11T10:38:21.000Z"
    }
  • {
      "create_time": "2024-03-11T10:38:21.000Z",
      "description": "Test e2m updated",
      "id": "93bde7ad-651f-48f5-96dd-e7d6b2c2a9de",
      "is_internal": true,
      "logs_query": {
        "lucene": "logs"
      },
      "name": "test em2",
      "permutations": {
        "limit": 1
      },
      "type": "logs2metrics",
      "update_time": "2024-03-11T10:38:21.000Z"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Deletes event to metrics definitions by id

Deletes event to metrics definitions by id

Deletes event to metrics definitions by id.

DELETE /v1/events2metrics/{id}
(logs *LogsV0) DeleteE2m(deleteE2mOptions *DeleteE2mOptions) (response *core.DetailedResponse, err error)
(logs *LogsV0) DeleteE2mWithContext(ctx context.Context, deleteE2mOptions *DeleteE2mOptions) (response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.events2metrics.manage

Auditing

Calling this method generates the following auditing event.

  • logs.events2metrics.delete

Request

Instantiate the DeleteE2mOptions struct and set the fields to provide parameter values for the DeleteE2m method.

Path Parameters

  • ID of e2m to be deleted

    Possible values: 1 ≤ length ≤ 4096, Value must match regular expression ^[A-Za-z0-9_\.,\-"{}()\[\]=!:#/$|' ]+$

    Example: d6a3658e-78d2-47d0-9b81-b2c551f01b09

WithContext method only

The DeleteE2m options.

  • curl -X DELETE --location --header "Authorization: Bearer ${iam_token}"   "${base_url}/v1/events2metrics/${id}"
  • deleteE2mOptions := logsService.NewDeleteE2mOptions(
      "d6a3658e-78d2-47d0-9b81-b2c551f01b09",
    )
    
    response, err := logsService.DeleteE2m(deleteE2mOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteE2m(): %d\n", response.StatusCode)
    }

Response

Status Code

  • No Content

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Run a query to search the logs

Run a query to search the logs

Run a query to search the logs.

POST /v1/query
(logs *LogsV0) Query(queryOptions *QueryOptions) (result QueryResponseStreamItemIntf, response *core.DetailedResponse, err error)
(logs *LogsV0) QueryWithContext(ctx context.Context, queryOptions *QueryOptions) (result QueryResponseStreamItemIntf, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following actions. You can check your access by going to Users > User > Access.

  • logs.logs-data-api-high.read

  • logs.logs-data-api-low.read

Auditing

Calling this method generates the following auditing event.

  • logs.logs-data.search

Request

Instantiate the QueryOptions struct and set the fields to provide parameter values for the Query method.

Query request

WithContext method only

The Query options.

  • curl -X POST --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: text/event-stream"   --header "Content-Type: application/json"   --data '{
        "query": "source logs | limit 10",
        "metadata": {
            "start_date": "2024-05-01T20:47:12.940Z",
            "end_date": "2024-05-02T22:47:12.940Z",
            "tier": "frequent_search",
            "syntax": "dataprime",
            "limit": 100,
            "strict_fields_validation": false
        }
      }'   "{base_url}/v1/query"
  • queryOptions := logsv0.QueryOptions{
      Query: core.StringPtr("source logs | limit 10"),
      Metadata: &logsv0.ApisDataprimeV1Metadata{
        StartDate: CreateDateTime("2024-03-01T20:47:12.940Z"),
        EndDate:   CreateDateTime("2024-03-06T20:47:12.940Z"),
        Tier:      core.StringPtr("frequent_search"),
        Syntax:    core.StringPtr("dataprime"),
      },
    }
    
    var wg sync.WaitGroup
    
    wg.Add(1.)
    
    go func() {
      logsService.QueryWithContext(context.Background(), &queryOptions, callBack{})
      wg.Done()
    }()
    
    wg.Wait()

Response

Response for a text query.

Response for a text query.

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Lists all company public views

Lists all company public views

Lists all company public views.

GET /v1/views
(logs *LogsV0) ListViews(listViewsOptions *ListViewsOptions) (result *ViewCollection, response *core.DetailedResponse, err error)
(logs *LogsV0) ListViewsWithContext(ctx context.Context, listViewsOptions *ListViewsOptions) (result *ViewCollection, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following actions. You can check your access by going to Users > User > Access.

  • logs.shared-view.read

  • logs.private-view.read

Auditing

Calling this method generates the following auditing event.

  • logs.view.list

Request

No Request Parameters

This method does not accept any request parameters.

WithContext method only

No Request Parameters

This method does not accept any request parameters.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/v1/views"
  • listViewsOptions := logsService.NewListViewsOptions()
    
    viewCollection, response, err := logsService.ListViews(listViewsOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(viewCollection, "", "  ")
    fmt.Println(string(b))

Response

List of views

List of views.

Examples:
{
  "views": [
    {
      "filters": {
        "filters": [
          {
            "name": "applicationName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "subsystemName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "operationName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "serviceName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "severity",
            "selected_values": {
              "demo": true
            }
          }
        ]
      },
      "id": 52,
      "name": "Logs view",
      "search_query": {
        "query": "logs"
      },
      "time_selection": {
        "custom_selection": {
          "from_time": "2024-01-25T11:31:43.152Z",
          "to_time": "2024-01-25T11:37:13.238Z"
        }
      }
    }
  ]
}

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "views": [
        {
          "filters": {
            "filters": [
              {
                "name": "applicationName",
                "selected_values": {
                  "demo": true
                }
              },
              {
                "name": "subsystemName",
                "selected_values": {
                  "demo": true
                }
              },
              {
                "name": "operationName",
                "selected_values": {
                  "demo": true
                }
              },
              {
                "name": "serviceName",
                "selected_values": {
                  "demo": true
                }
              },
              {
                "name": "severity",
                "selected_values": {
                  "demo": true
                }
              }
            ]
          },
          "id": 52,
          "name": "Logs view",
          "search_query": {
            "query": "logs"
          },
          "time_selection": {
            "custom_selection": {
              "from_time": "2024-01-25T11:31:43.152Z",
              "to_time": "2024-01-25T11:37:13.238Z"
            }
          }
        }
      ]
    }
  • {
      "views": [
        {
          "filters": {
            "filters": [
              {
                "name": "applicationName",
                "selected_values": {
                  "demo": true
                }
              },
              {
                "name": "subsystemName",
                "selected_values": {
                  "demo": true
                }
              },
              {
                "name": "operationName",
                "selected_values": {
                  "demo": true
                }
              },
              {
                "name": "serviceName",
                "selected_values": {
                  "demo": true
                }
              },
              {
                "name": "severity",
                "selected_values": {
                  "demo": true
                }
              }
            ]
          },
          "id": 52,
          "name": "Logs view",
          "search_query": {
            "query": "logs"
          },
          "time_selection": {
            "custom_selection": {
              "from_time": "2024-01-25T11:31:43.152Z",
              "to_time": "2024-01-25T11:37:13.238Z"
            }
          }
        }
      ]
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Creates a new view

Creates a new view

Creates a new view.

POST /v1/views
(logs *LogsV0) CreateView(createViewOptions *CreateViewOptions) (result *View, response *core.DetailedResponse, err error)
(logs *LogsV0) CreateViewWithContext(ctx context.Context, createViewOptions *CreateViewOptions) (result *View, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following actions. You can check your access by going to Users > User > Access.

  • logs.shared-view.manage

  • logs.private-view.manage

Auditing

Calling this method generates the following auditing event.

  • logs.view.create

Request

Instantiate the CreateViewOptions struct and set the fields to provide parameter values for the CreateView method.

Request to create/update a view

Examples:
{
  "filters": {
    "filters": [
      {
        "name": "applicationName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "subsystemName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "operationName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "serviceName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "severity",
        "selected_values": {
          "demo": true
        }
      }
    ]
  },
  "name": "Logs view",
  "search_query": {
    "query": "logs"
  },
  "time_selection": {
    "custom_selection": {
      "from_time": "2024-01-25T11:31:43.152Z",
      "to_time": "2024-01-25T11:37:13.238Z"
    }
  }
}

WithContext method only

The CreateView options.

  • curl -X POST --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data   '{
        "filters": {
          "filters": [
            {
              "name": "applicationName",
              "selected_values": {
                "demo": true
              }
            },
            {
              "name": "subsystemName",
              "selected_values": {
                "demo": true
              }
            },
            {
              "name": "operationName",
              "selected_values": {
                "demo": true
              }
            },
            {
              "name": "serviceName",
              "selected_values": {
                "demo": true
              }
            },
            {
              "name": "severity",
              "selected_values": {
                "demo": true
              }
            }
          ]
        },
        "name": "Logs view",
        "search_query": {
          "query": "logs"
        },
        "time_selection": {
          "custom_selection": {
            "from_time": "2024-01-25T11:31:43.152Z",
            "to_time": "2024-01-25T11:37:13.238Z"
          }
        }
      }'   "${base_url}/v1/views"
  • apisViewsV1CustomTimeSelectionModel := &logsv0.ApisViewsV1CustomTimeSelection{
      FromTime: CreateMockDateTime("2024-01-25T11:31:43.152Z"),
      ToTime: CreateMockDateTime("2024-01-25T11:37:13.238Z"),
    }
    
    apisViewsV1TimeSelectionModel := &logsv0.ApisViewsV1TimeSelectionSelectionTypeCustomSelection{
      CustomSelection: apisViewsV1CustomTimeSelectionModel,
    }
    
    apisViewsV1SearchQueryModel := &logsv0.ApisViewsV1SearchQuery{
      Query: core.StringPtr("logs"),
    }
    
    apisViewsV1FilterModel := &logsv0.ApisViewsV1Filter{
      Name: core.StringPtr("applicationName"),
      SelectedValues: map[string]bool{"key1": true},
    }
    
    apisViewsV1SelectedFiltersModel := &logsv0.ApisViewsV1SelectedFilters{
      Filters: []logsv0.ApisViewsV1Filter{*apisViewsV1FilterModel},
    }
    
    createViewOptions := logsService.NewCreateViewOptions(
      "Logs view",
      apisViewsV1TimeSelectionModel,
    )
    createViewOptions.SetSearchQuery(apisViewsV1SearchQueryModel)
    createViewOptions.SetFilters(apisViewsV1SelectedFiltersModel)
    
    view, response, err := logsService.CreateView(createViewOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(view, "", "  ")
    fmt.Println(string(b))

Response

View

View.

Examples:
{
  "filters": {
    "filters": [
      {
        "name": "applicationName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "subsystemName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "operationName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "serviceName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "severity",
        "selected_values": {
          "demo": true
        }
      }
    ]
  },
  "id": 52,
  "name": "Logs view",
  "search_query": {
    "query": "logs"
  },
  "time_selection": {
    "custom_selection": {
      "from_time": "2024-01-25T11:31:43.152Z",
      "to_time": "2024-01-25T11:37:13.238Z"
    }
  }
}

Status Code

  • Created

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "filters": {
        "filters": [
          {
            "name": "applicationName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "subsystemName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "operationName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "serviceName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "severity",
            "selected_values": {
              "demo": true
            }
          }
        ]
      },
      "id": 52,
      "name": "Logs view",
      "search_query": {
        "query": "logs"
      },
      "time_selection": {
        "custom_selection": {
          "from_time": "2024-01-25T11:31:43.152Z",
          "to_time": "2024-01-25T11:37:13.238Z"
        }
      }
    }
  • {
      "filters": {
        "filters": [
          {
            "name": "applicationName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "subsystemName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "operationName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "serviceName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "severity",
            "selected_values": {
              "demo": true
            }
          }
        ]
      },
      "id": 52,
      "name": "Logs view",
      "search_query": {
        "query": "logs"
      },
      "time_selection": {
        "custom_selection": {
          "from_time": "2024-01-25T11:31:43.152Z",
          "to_time": "2024-01-25T11:37:13.238Z"
        }
      }
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Gets a view by ID

Gets a view by ID

Gets a view by ID.

GET /v1/views/{id}
(logs *LogsV0) GetView(getViewOptions *GetViewOptions) (result *View, response *core.DetailedResponse, err error)
(logs *LogsV0) GetViewWithContext(ctx context.Context, getViewOptions *GetViewOptions) (result *View, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following actions. You can check your access by going to Users > User > Access.

  • logs.shared-view.read

  • logs.private-view.read

Auditing

Calling this method generates the following auditing event.

  • logs.view.get

Request

Instantiate the GetViewOptions struct and set the fields to provide parameter values for the GetView method.

Path Parameters

  • View ID

    Example: 52

WithContext method only

The GetView options.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/v1/views/${id}"
  • getViewOptions := logsService.NewGetViewOptions(
      int64(52),
    )
    
    view, response, err := logsService.GetView(getViewOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(view, "", "  ")
    fmt.Println(string(b))

Response

View

View.

Examples:
{
  "filters": {
    "filters": [
      {
        "name": "applicationName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "subsystemName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "operationName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "serviceName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "severity",
        "selected_values": {
          "demo": true
        }
      }
    ]
  },
  "id": 52,
  "name": "Logs view",
  "search_query": {
    "query": "logs"
  },
  "time_selection": {
    "custom_selection": {
      "from_time": "2024-01-25T11:31:43.152Z",
      "to_time": "2024-01-25T11:37:13.238Z"
    }
  }
}

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "filters": {
        "filters": [
          {
            "name": "applicationName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "subsystemName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "operationName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "serviceName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "severity",
            "selected_values": {
              "demo": true
            }
          }
        ]
      },
      "id": 52,
      "name": "Logs view",
      "search_query": {
        "query": "logs"
      },
      "time_selection": {
        "custom_selection": {
          "from_time": "2024-01-25T11:31:43.152Z",
          "to_time": "2024-01-25T11:37:13.238Z"
        }
      }
    }
  • {
      "filters": {
        "filters": [
          {
            "name": "applicationName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "subsystemName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "operationName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "serviceName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "severity",
            "selected_values": {
              "demo": true
            }
          }
        ]
      },
      "id": 52,
      "name": "Logs view",
      "search_query": {
        "query": "logs"
      },
      "time_selection": {
        "custom_selection": {
          "from_time": "2024-01-25T11:31:43.152Z",
          "to_time": "2024-01-25T11:37:13.238Z"
        }
      }
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Replaces an existing view

Replaces an existing view

Replaces an existing view.

PUT /v1/views/{id}
(logs *LogsV0) ReplaceView(replaceViewOptions *ReplaceViewOptions) (result *View, response *core.DetailedResponse, err error)
(logs *LogsV0) ReplaceViewWithContext(ctx context.Context, replaceViewOptions *ReplaceViewOptions) (result *View, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following actions. You can check your access by going to Users > User > Access.

  • logs.shared-view.manage

  • logs.private-view.manage

Auditing

Calling this method generates the following auditing event.

  • logs.view.update

Request

Instantiate the ReplaceViewOptions struct and set the fields to provide parameter values for the ReplaceView method.

Path Parameters

  • View ID

    Example: 52

Request to create/update a view

Examples:
{
  "filters": {
    "filters": [
      {
        "name": "applicationName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "subsystemName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "operationName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "serviceName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "severity",
        "selected_values": {
          "demo": true
        }
      }
    ]
  },
  "name": "Logs view",
  "search_query": {
    "query": "logs new"
  },
  "time_selection": {
    "custom_selection": {
      "from_time": "2024-01-25T11:31:43.152Z",
      "to_time": "2024-01-25T11:37:13.238Z"
    }
  }
}

WithContext method only

The ReplaceView options.

  • curl -X PUT --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data   '{
        "filters": {
          "filters": [
            {
              "name": "applicationName",
              "selected_values": {
                "demo": true
              }
            },
            {
              "name": "subsystemName",
              "selected_values": {
                "demo": true
              }
            },
            {
              "name": "operationName",
              "selected_values": {
                "demo": true
              }
            },
            {
              "name": "serviceName",
              "selected_values": {
                "demo": true
              }
            },
            {
              "name": "severity",
              "selected_values": {
                "demo": true
              }
            }
          ]
        },
        "name": "Logs view",
        "search_query": {
          "query": "logs new"
        },
        "time_selection": {
          "custom_selection": {
            "from_time": "2024-01-25T11:31:43.152Z",
            "to_time": "2024-01-25T11:37:13.238Z"
          }
        }
      }'   "${base_url}/v1/views/${id}"
  • apisViewsV1CustomTimeSelectionModel := &logsv0.ApisViewsV1CustomTimeSelection{
      FromTime: CreateMockDateTime("2024-01-25T11:31:43.152Z"),
      ToTime: CreateMockDateTime("2024-01-25T11:37:13.238Z"),
    }
    
    apisViewsV1TimeSelectionModel := &logsv0.ApisViewsV1TimeSelectionSelectionTypeCustomSelection{
      CustomSelection: apisViewsV1CustomTimeSelectionModel,
    }
    
    apisViewsV1SearchQueryModel := &logsv0.ApisViewsV1SearchQuery{
      Query: core.StringPtr("logs new"),
    }
    
    apisViewsV1FilterModel := &logsv0.ApisViewsV1Filter{
      Name: core.StringPtr("applicationName"),
      SelectedValues: map[string]bool{"key1": true},
    }
    
    apisViewsV1SelectedFiltersModel := &logsv0.ApisViewsV1SelectedFilters{
      Filters: []logsv0.ApisViewsV1Filter{*apisViewsV1FilterModel},
    }
    
    replaceViewOptions := logsService.NewReplaceViewOptions(
      int64(52),
      "Logs view",
      apisViewsV1TimeSelectionModel,
    )
    replaceViewOptions.SetSearchQuery(apisViewsV1SearchQueryModel)
    replaceViewOptions.SetFilters(apisViewsV1SelectedFiltersModel)
    
    view, response, err := logsService.ReplaceView(replaceViewOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(view, "", "  ")
    fmt.Println(string(b))

Response

View

View.

Examples:
{
  "filters": {
    "filters": [
      {
        "name": "applicationName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "subsystemName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "operationName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "serviceName",
        "selected_values": {
          "demo": true
        }
      },
      {
        "name": "severity",
        "selected_values": {
          "demo": true
        }
      }
    ]
  },
  "id": 52,
  "name": "Logs view",
  "search_query": {
    "query": "logs"
  },
  "time_selection": {
    "custom_selection": {
      "from_time": "2024-01-25T11:31:43.152Z",
      "to_time": "2024-01-25T11:37:13.238Z"
    }
  }
}

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "filters": {
        "filters": [
          {
            "name": "applicationName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "subsystemName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "operationName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "serviceName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "severity",
            "selected_values": {
              "demo": true
            }
          }
        ]
      },
      "id": 52,
      "name": "Logs view",
      "search_query": {
        "query": "logs"
      },
      "time_selection": {
        "custom_selection": {
          "from_time": "2024-01-25T11:31:43.152Z",
          "to_time": "2024-01-25T11:37:13.238Z"
        }
      }
    }
  • {
      "filters": {
        "filters": [
          {
            "name": "applicationName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "subsystemName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "operationName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "serviceName",
            "selected_values": {
              "demo": true
            }
          },
          {
            "name": "severity",
            "selected_values": {
              "demo": true
            }
          }
        ]
      },
      "id": 52,
      "name": "Logs view",
      "search_query": {
        "query": "logs"
      },
      "time_selection": {
        "custom_selection": {
          "from_time": "2024-01-25T11:31:43.152Z",
          "to_time": "2024-01-25T11:37:13.238Z"
        }
      }
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Deletes a view by ID

Deletes a view by ID

Deletes a view by ID.

DELETE /v1/views/{id}
(logs *LogsV0) DeleteView(deleteViewOptions *DeleteViewOptions) (response *core.DetailedResponse, err error)
(logs *LogsV0) DeleteViewWithContext(ctx context.Context, deleteViewOptions *DeleteViewOptions) (response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following actions. You can check your access by going to Users > User > Access.

  • logs.shared-view.manage

  • logs.private-view.manage

Auditing

Calling this method generates the following auditing event.

  • logs.view.delete

Request

Instantiate the DeleteViewOptions struct and set the fields to provide parameter values for the DeleteView method.

Path Parameters

  • View ID

    Example: 52

WithContext method only

The DeleteView options.

  • curl -X DELETE --location --header "Authorization: Bearer ${iam_token}"   "${base_url}/v1/views/${id}"
  • deleteViewOptions := logsService.NewDeleteViewOptions(
      int64(52),
    )
    
    response, err := logsService.DeleteView(deleteViewOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteView(): %d\n", response.StatusCode)
    }

Response

Status Code

  • No Content

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

List view's folders

List view's folders

List view's folders.

GET /v1/view_folders
(logs *LogsV0) ListViewFolders(listViewFoldersOptions *ListViewFoldersOptions) (result *ViewFolderCollection, response *core.DetailedResponse, err error)
(logs *LogsV0) ListViewFoldersWithContext(ctx context.Context, listViewFoldersOptions *ListViewFoldersOptions) (result *ViewFolderCollection, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.shared-view.read

Auditing

Calling this method generates the following auditing event.

  • logs.view-folder.list

Request

No Request Parameters

This method does not accept any request parameters.

WithContext method only

No Request Parameters

This method does not accept any request parameters.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/v1/view_folders"
  • listViewFoldersOptions := logsService.NewListViewFoldersOptions()
    
    viewFolderCollection, response, err := logsService.ListViewFolders(listViewFoldersOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(viewFolderCollection, "", "  ")
    fmt.Println(string(b))

Response

List view's folders response

List view's folders response.

Examples:
{
  "view_folders": [
    {
      "id": "0cd4ed54-9b59-4eef-b329-151a167e2304",
      "name": "My Folder"
    }
  ]
}

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "view_folders": [
        {
          "id": "0cd4ed54-9b59-4eef-b329-151a167e2304",
          "name": "My Folder"
        }
      ]
    }
  • {
      "view_folders": [
        {
          "id": "0cd4ed54-9b59-4eef-b329-151a167e2304",
          "name": "My Folder"
        }
      ]
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Create view folder

Create view folder

Create view folder.

POST /v1/view_folders
(logs *LogsV0) CreateViewFolder(createViewFolderOptions *CreateViewFolderOptions) (result *ViewFolder, response *core.DetailedResponse, err error)
(logs *LogsV0) CreateViewFolderWithContext(ctx context.Context, createViewFolderOptions *CreateViewFolderOptions) (result *ViewFolder, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.shared-view.manage

Auditing

Calling this method generates the following auditing event.

  • logs.view-folder.create

Request

Instantiate the CreateViewFolderOptions struct and set the fields to provide parameter values for the CreateViewFolder method.

Create view folder

Examples:
{
  "name": "My Folder"
}

WithContext method only

The CreateViewFolder options.

  • curl -X POST --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data   '{
        "name": "My Folder"
      }'   "${base_url}/v1/view_folders"
  • createViewFolderOptions := logsService.NewCreateViewFolderOptions(
      "My Folder",
    )
    
    viewFolder, response, err := logsService.CreateViewFolder(createViewFolderOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(viewFolder, "", "  ")
    fmt.Println(string(b))

Response

View folder

View folder.

Examples:
{
  "id": "0cd4ed54-9b59-4eef-b329-151a167e2304",
  "name": "My Folder"
}

Status Code

  • Created

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "id": "0cd4ed54-9b59-4eef-b329-151a167e2304",
      "name": "My Folder"
    }
  • {
      "id": "0cd4ed54-9b59-4eef-b329-151a167e2304",
      "name": "My Folder"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Get view folder

Get view folder

Get view folder.

GET /v1/view_folders/{id}
(logs *LogsV0) GetViewFolder(getViewFolderOptions *GetViewFolderOptions) (result *ViewFolder, response *core.DetailedResponse, err error)
(logs *LogsV0) GetViewFolderWithContext(ctx context.Context, getViewFolderOptions *GetViewFolderOptions) (result *ViewFolder, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.shared-view.read

Auditing

Calling this method generates the following auditing event.

  • logs.view-folder.get

Request

Instantiate the GetViewFolderOptions struct and set the fields to provide parameter values for the GetViewFolder method.

Path Parameters

  • Folder ID

    Possible values: length = 36, Value must match regular expression ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

    Example: 3dc02998-0b50-4ea8-b68a-4779d716fa1f

WithContext method only

The GetViewFolder options.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/v1/view_folders/${id}"
  • getViewFolderOptions := logsService.NewGetViewFolderOptions(
      CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"),
    )
    
    viewFolder, response, err := logsService.GetViewFolder(getViewFolderOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(viewFolder, "", "  ")
    fmt.Println(string(b))

Response

View folder

View folder.

Examples:
{
  "id": "0cd4ed54-9b59-4eef-b329-151a167e2304",
  "name": "My Folder"
}

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "id": "0cd4ed54-9b59-4eef-b329-151a167e2304",
      "name": "My Folder"
    }
  • {
      "id": "0cd4ed54-9b59-4eef-b329-151a167e2304",
      "name": "My Folder"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Replaces an existing view folder

Replaces an existing view folder

Replaces an existing view folder.

PUT /v1/view_folders/{id}
(logs *LogsV0) ReplaceViewFolder(replaceViewFolderOptions *ReplaceViewFolderOptions) (result *ViewFolder, response *core.DetailedResponse, err error)
(logs *LogsV0) ReplaceViewFolderWithContext(ctx context.Context, replaceViewFolderOptions *ReplaceViewFolderOptions) (result *ViewFolder, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.shared-view.manage

Auditing

Calling this method generates the following auditing event.

  • logs.view-folder.update

Request

Instantiate the ReplaceViewFolderOptions struct and set the fields to provide parameter values for the ReplaceViewFolder method.

Path Parameters

  • Folder ID

    Possible values: length = 36, Value must match regular expression ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

    Example: 3dc02998-0b50-4ea8-b68a-4779d716fa1f

Create view folder

Examples:
{
  "name": "My Folder"
}

WithContext method only

The ReplaceViewFolder options.

  • curl -X PUT --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data   '{
        "name": "My Folder"
      }'   "${base_url}/v1/view_folders/${id}"
  • replaceViewFolderOptions := logsService.NewReplaceViewFolderOptions(
      CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"),
      "My Folder",
    )
    
    viewFolder, response, err := logsService.ReplaceViewFolder(replaceViewFolderOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(viewFolder, "", "  ")
    fmt.Println(string(b))

Response

View folder

View folder.

Examples:
{
  "id": "0cd4ed54-9b59-4eef-b329-151a167e2304",
  "name": "My Folder"
}

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "id": "0cd4ed54-9b59-4eef-b329-151a167e2304",
      "name": "My Folder"
    }
  • {
      "id": "0cd4ed54-9b59-4eef-b329-151a167e2304",
      "name": "My Folder"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Deletes a view folder by ID

Deletes a view folder by ID

Deletes a view folder by ID.

DELETE /v1/view_folders/{id}
(logs *LogsV0) DeleteViewFolder(deleteViewFolderOptions *DeleteViewFolderOptions) (response *core.DetailedResponse, err error)
(logs *LogsV0) DeleteViewFolderWithContext(ctx context.Context, deleteViewFolderOptions *DeleteViewFolderOptions) (response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.shared-view.manage

Auditing

Calling this method generates the following auditing event.

  • logs.view-folder.delete

Request

Instantiate the DeleteViewFolderOptions struct and set the fields to provide parameter values for the DeleteViewFolder method.

Path Parameters

  • Folder ID

    Possible values: length = 36, Value must match regular expression ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

    Example: 3dc02998-0b50-4ea8-b68a-4779d716fa1f

WithContext method only

The DeleteViewFolder options.

  • curl -X DELETE --location --header "Authorization: Bearer ${iam_token}"   "${base_url}/v1/view_folders/${id}"
  • deleteViewFolderOptions := logsService.NewDeleteViewFolderOptions(
      CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"),
    )
    
    response, err := logsService.DeleteViewFolder(deleteViewFolderOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteViewFolder(): %d\n", response.StatusCode)
    }

Response

Status Code

  • No Content

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

List service instance's Data Access Rules with provided ids

List service instance's Data Access Rules with provided ids

List service instance's Data Access Rules with provided ids.

GET /v1/data_access_rules
(logs *LogsV0) ListDataAccessRules(listDataAccessRulesOptions *ListDataAccessRulesOptions) (result *DataAccessRuleCollection, response *core.DetailedResponse, err error)
(logs *LogsV0) ListDataAccessRulesWithContext(ctx context.Context, listDataAccessRulesOptions *ListDataAccessRulesOptions) (result *DataAccessRuleCollection, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.data-access-rule.read

Auditing

Calling this method generates the following auditing event.

  • logs.data-access-rule.list

Request

Instantiate the ListDataAccessRulesOptions struct and set the fields to provide parameter values for the ListDataAccessRules method.

Query Parameters

  • Array of data access rule IDs

    Possible values: 0 ≤ number of items ≤ 4096, length = 36, Value must match regular expression ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

    Examples:
    [
      "4f966911-4bda-407e-b069-477394effa59"
    ]

WithContext method only

The ListDataAccessRules options.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/v1/data_access_rules?id=4f966911-4bda-407e-b069-477394effa59"
  • listDataAccessRulesOptions := logsService.NewListDataAccessRulesOptions()
    listDataAccessRulesOptions.SetID([]strfmt.UUID{"4f966911-4bda-407e-b069-477394effa59"})
    
    dataAccessRuleCollection, response, err := logsService.ListDataAccessRules(listDataAccessRulesOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(dataAccessRuleCollection, "", "  ")
    fmt.Println(string(b))

Response

Get Data Access Rules Response

Get Data Access Rules Response.

Examples:
{
  "data_access_rules": [
    {
      "default_expression": "<v1> foo == 'bar'",
      "description": "Data Access Rule intended for testing",
      "display_name": "Test Data Access Rule",
      "filters": [
        {
          "entity_type": "logs",
          "expression": "<v1> foo == 'bar'"
        }
      ],
      "id": "c7780bc1-4767-4c84-b23d-403dc1c923ff"
    }
  ]
}

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "data_access_rules": [
        {
          "default_expression": "<v1> foo == 'bar'",
          "description": "Data Access Rule intended for testing",
          "display_name": "Test Data Access Rule",
          "filters": [
            {
              "entity_type": "logs",
              "expression": "<v1> foo == 'bar'"
            }
          ],
          "id": "c7780bc1-4767-4c84-b23d-403dc1c923ff"
        }
      ]
    }
  • {
      "data_access_rules": [
        {
          "default_expression": "<v1> foo == 'bar'",
          "description": "Data Access Rule intended for testing",
          "display_name": "Test Data Access Rule",
          "filters": [
            {
              "entity_type": "logs",
              "expression": "<v1> foo == 'bar'"
            }
          ],
          "id": "c7780bc1-4767-4c84-b23d-403dc1c923ff"
        }
      ]
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Create a Data Access Rule

Create a Data Access Rule

Create a Data Access Rule.

POST /v1/data_access_rules
(logs *LogsV0) CreateDataAccessRule(createDataAccessRuleOptions *CreateDataAccessRuleOptions) (result *DataAccessRule, response *core.DetailedResponse, err error)
(logs *LogsV0) CreateDataAccessRuleWithContext(ctx context.Context, createDataAccessRuleOptions *CreateDataAccessRuleOptions) (result *DataAccessRule, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.data-access-rule.manage

Auditing

Calling this method generates the following auditing event.

  • log.data-access-rule.create

Request

Instantiate the CreateDataAccessRuleOptions struct and set the fields to provide parameter values for the CreateDataAccessRule method.

Create Data Access Rule Request

Examples:
{
  "default_expression": "<v1> foo == 'bar'",
  "description": "Data Access Rule intended for testing",
  "display_name": "Test Data Access Rule",
  "filters": [
    {
      "entity_type": "logs",
      "expression": "<v1> foo == 'bar'"
    }
  ]
}

WithContext method only

The CreateDataAccessRule options.

  • curl -X POST --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data   '{
        "default_expression": "<v1>true",
        "description": "Data Access Rule intended for testing",
        "display_name": "Test Data Access Rule",
        "filters": [
          {
            "entity_type": "logs",
            "expression": "<v1> foo == bar"
          }
        ]
      }'   "${base_url}/v1/data_access_rules"
  • dataAccessRuleFilterModel := &logsv0.DataAccessRuleFilter{
      EntityType: core.StringPtr("logs"),
      Expression: core.StringPtr("<v1> foo == 'bar'"),
    }
    
    createDataAccessRuleOptions := logsService.NewCreateDataAccessRuleOptions(
      "Test Data Access Rule",
      []logsv0.DataAccessRuleFilter{*dataAccessRuleFilterModel},
      "<v1>true",
    )
    createDataAccessRuleOptions.SetDescription("Data Access Rule intended for testing")
    
    dataAccessRule, response, err := logsService.CreateDataAccessRule(createDataAccessRuleOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(dataAccessRule, "", "  ")
    fmt.Println(string(b))

Response

Data Access Rule details

Data Access Rule details.

Examples:
{
  "default_expression": "<v1> foo == 'bar'",
  "description": "Data Access Rule intended for testing",
  "display_name": "Test Data Access Rule",
  "filters": [
    {
      "entity_type": "logs",
      "expression": "<v1> foo == 'bar'"
    }
  ],
  "id": "c7780bc1-4767-4c84-b23d-403dc1c923ff"
}

Status Code

  • Created

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "default_expression": "<v1> foo == 'bar'",
      "description": "Data Access Rule intended for testing",
      "display_name": "Test Data Access Rule",
      "filters": [
        {
          "entity_type": "logs",
          "expression": "<v1> foo == 'bar'"
        }
      ],
      "id": "c7780bc1-4767-4c84-b23d-403dc1c923ff"
    }
  • {
      "default_expression": "<v1> foo == 'bar'",
      "description": "Data Access Rule intended for testing",
      "display_name": "Test Data Access Rule",
      "filters": [
        {
          "entity_type": "logs",
          "expression": "<v1> foo == 'bar'"
        }
      ],
      "id": "c7780bc1-4767-4c84-b23d-403dc1c923ff"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Update a Data Access Rule

Update a Data Access Rule

Update a Data Access Rule.

PUT /v1/data_access_rules/{id}
(logs *LogsV0) UpdateDataAccessRule(updateDataAccessRuleOptions *UpdateDataAccessRuleOptions) (result *DataAccessRule, response *core.DetailedResponse, err error)
(logs *LogsV0) UpdateDataAccessRuleWithContext(ctx context.Context, updateDataAccessRuleOptions *UpdateDataAccessRuleOptions) (result *DataAccessRule, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.data-access-rule.manage

Auditing

Calling this method generates the following auditing event.

  • logs.data-access-rule.update

Request

Instantiate the UpdateDataAccessRuleOptions struct and set the fields to provide parameter values for the UpdateDataAccessRule method.

Path Parameters

  • ID of Data Access Rule to be deleted

    Possible values: length = 36, Value must match regular expression ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

    Example: 3dc02998-0b50-4ea8-b68a-4779d716fa1f

Create Data Access Rule Request

Examples:
{
  "default_expression": "<v1> foo == 'bar'",
  "description": "Data Access Rule intended for testing",
  "display_name": "Test Data Access Rule",
  "filters": [
    {
      "entity_type": "logs",
      "expression": "<v1> foo == 'bar'"
    }
  ]
}

WithContext method only

The UpdateDataAccessRule options.

  • curl -X PUT --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data   '{
        "default_expression": "<v1>true",
        "description": "Data Access Rule intended for testing",
        "display_name": "Test Data Access Rule",
        "filters": [
          {
            "entity_type": "logs",
            "expression": "<v1> foo == bar"
          }
        ]
      }'   "${base_url}/v1/data_access_rules/${id}"
  • dataAccessRuleFilterModel := &logsv0.DataAccessRuleFilter{
      EntityType: core.StringPtr("logs"),
      Expression: core.StringPtr("<v1> foo == 'bar'"),
    }
    
    updateDataAccessRuleOptions := logsService.NewUpdateDataAccessRuleOptions(
      CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"),
      "Test Data Access Rule",
      []logsv0.DataAccessRuleFilter{*dataAccessRuleFilterModel},
      "<v1>true",
    )
    updateDataAccessRuleOptions.SetDescription("Data Access Rule intended for testing")
    
    dataAccessRule, response, err := logsService.UpdateDataAccessRule(updateDataAccessRuleOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(dataAccessRule, "", "  ")
    fmt.Println(string(b))

Response

Data Access Rule details

Data Access Rule details.

Examples:
{
  "default_expression": "<v1> foo == 'bar'",
  "description": "Data Access Rule intended for testing",
  "display_name": "Test Data Access Rule",
  "filters": [
    {
      "entity_type": "logs",
      "expression": "<v1> foo == 'bar'"
    }
  ],
  "id": "c7780bc1-4767-4c84-b23d-403dc1c923ff"
}

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "default_expression": "<v1> foo == 'bar'",
      "description": "Data Access Rule intended for testing",
      "display_name": "Test Data Access Rule",
      "filters": [
        {
          "entity_type": "logs",
          "expression": "<v1> foo == 'bar'"
        }
      ],
      "id": "c7780bc1-4767-4c84-b23d-403dc1c923ff"
    }
  • {
      "default_expression": "<v1> foo == 'bar'",
      "description": "Data Access Rule intended for testing",
      "display_name": "Test Data Access Rule",
      "filters": [
        {
          "entity_type": "logs",
          "expression": "<v1> foo == 'bar'"
        }
      ],
      "id": "c7780bc1-4767-4c84-b23d-403dc1c923ff"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Delete a Data Access Rule

Delete a Data Access Rule

Delete a Data Access Rule.

DELETE /v1/data_access_rules/{id}
(logs *LogsV0) DeleteDataAccessRule(deleteDataAccessRuleOptions *DeleteDataAccessRuleOptions) (response *core.DetailedResponse, err error)
(logs *LogsV0) DeleteDataAccessRuleWithContext(ctx context.Context, deleteDataAccessRuleOptions *DeleteDataAccessRuleOptions) (response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.data-access-rule.manage

Auditing

Calling this method generates the following auditing event.

  • logs.data-access-rule.delete

Request

Instantiate the DeleteDataAccessRuleOptions struct and set the fields to provide parameter values for the DeleteDataAccessRule method.

Path Parameters

  • ID of Data Access Rule to be deleted

    Possible values: length = 36, Value must match regular expression ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

    Example: 3dc02998-0b50-4ea8-b68a-4779d716fa1f

WithContext method only

The DeleteDataAccessRule options.

  • curl -X DELETE --location --header "Authorization: Bearer ${iam_token}"   "${base_url}/v1/data_access_rules/${id}"
  • deleteDataAccessRuleOptions := logsService.NewDeleteDataAccessRuleOptions(
      CreateMockUUID("3dc02998-0b50-4ea8-b68a-4779d716fa1f"),
    )
    
    response, err := logsService.DeleteDataAccessRule(deleteDataAccessRuleOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from DeleteDataAccessRule(): %d\n", response.StatusCode)
    }

Response

Status Code

  • No Content

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

List all enrichments

List all enrichments

List all enrichments.

GET /v1/enrichments
(logs *LogsV0) GetEnrichments(getEnrichmentsOptions *GetEnrichmentsOptions) (result *EntrichmentCollection, response *core.DetailedResponse, err error)
(logs *LogsV0) GetEnrichmentsWithContext(ctx context.Context, getEnrichmentsOptions *GetEnrichmentsOptions) (result *EntrichmentCollection, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following actions. You can check your access by going to Users > User > Access.

  • logs.geo-enrichment.read

  • logs.custom-enrichment.read

  • logs.security-enrichment.read

  • logs.custom-enrichment-data.read

Auditing

Calling this method generates the following auditing event.

  • logs.enrichment.list

Request

No Request Parameters

This method does not accept any request parameters.

WithContext method only

No Request Parameters

This method does not accept any request parameters.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/v1/enrichments"
  • getEnrichmentsOptions := logsService.NewGetEnrichmentsOptions()
    
    entrichmentCollection, response, err := logsService.GetEnrichments(getEnrichmentsOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(entrichmentCollection, "", "  ")
    fmt.Println(string(b))

Response

The enrichments collection

The enrichments collection.

Examples:
{
  "enrichments": [
    {
      "enrichment_type": {
        "geo_ip": {}
      },
      "field_name": "ip",
      "id": 3
    },
    {
      "enrichment_type": {
        "geo_ip": {}
      },
      "field_name": "client_ip",
      "id": 6
    },
    {
      "enrichment_type": {
        "suspicious_ip": {}
      },
      "field_name": "client_ip",
      "id": 23
    },
    {
      "enrichment_type": {
        "custom_enrichment": {
          "id": 17
        }
      },
      "field_name": "phone_code",
      "id": 24
    }
  ]
}

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "enrichments": [
        {
          "enrichment_type": {
            "geo_ip": {}
          },
          "field_name": "ip",
          "id": 3
        },
        {
          "enrichment_type": {
            "geo_ip": {}
          },
          "field_name": "client_ip",
          "id": 6
        },
        {
          "enrichment_type": {
            "suspicious_ip": {}
          },
          "field_name": "client_ip",
          "id": 23
        },
        {
          "enrichment_type": {
            "custom_enrichment": {
              "id": 17
            }
          },
          "field_name": "phone_code",
          "id": 24
        }
      ]
    }
  • {
      "enrichments": [
        {
          "enrichment_type": {
            "geo_ip": {}
          },
          "field_name": "ip",
          "id": 3
        },
        {
          "enrichment_type": {
            "geo_ip": {}
          },
          "field_name": "client_ip",
          "id": 6
        },
        {
          "enrichment_type": {
            "suspicious_ip": {}
          },
          "field_name": "client_ip",
          "id": 23
        },
        {
          "enrichment_type": {
            "custom_enrichment": {
              "id": 17
            }
          },
          "field_name": "phone_code",
          "id": 24
        }
      ]
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Create an enrichment

Create an enrichment

Create an enrichment.

POST /v1/enrichments
(logs *LogsV0) CreateEnrichment(createEnrichmentOptions *CreateEnrichmentOptions) (result *Enrichment, response *core.DetailedResponse, err error)
(logs *LogsV0) CreateEnrichmentWithContext(ctx context.Context, createEnrichmentOptions *CreateEnrichmentOptions) (result *Enrichment, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following actions. You can check your access by going to Users > User > Access.

  • logs.geo-enrichment.manage

  • logs.custom-enrichment.manage

  • logs.security-enrichment.manage

Auditing

Calling this method generates the following auditing events.

  • logs.geo-enrichment.create

  • logs.custom-enrichment.create

  • logs.security-enrichment.create

Request

Instantiate the CreateEnrichmentOptions struct and set the fields to provide parameter values for the CreateEnrichment method.

The model use to create an enrichment

Examples:
{
  "enrichment_type": {
    "geo_ip": {}
  },
  "field_name": "ip"
}

WithContext method only

The CreateEnrichment options.

  • curl -X POST --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data   '{
        "enrichment_type": {
          "geo_ip": {}
        },
        "field_name": "ip"
      }'   "${base_url}/v1/enrichments"
  • enrichmentV1GeoIpTypeEmptyModel := &logsv0.EnrichmentV1GeoIpTypeEmpty{
    }
    
    enrichmentV1EnrichmentTypeModel := &logsv0.EnrichmentV1EnrichmentTypeTypeGeoIp{
      GeoIp: enrichmentV1GeoIpTypeEmptyModel,
    }
    
    createEnrichmentOptions := logsService.NewCreateEnrichmentOptions(
      "ip",
      enrichmentV1EnrichmentTypeModel,
    )
    
    enrichment, response, err := logsService.CreateEnrichment(createEnrichmentOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(enrichment, "", "  ")
    fmt.Println(string(b))

Response

The enrichments

The enrichments.

Status Code

  • Created

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Delete enrichments

Delete enrichments

Delete enrichments.

DELETE /v1/enrichments/{id}
(logs *LogsV0) RemoveEnrichments(removeEnrichmentsOptions *RemoveEnrichmentsOptions) (response *core.DetailedResponse, err error)
(logs *LogsV0) RemoveEnrichmentsWithContext(ctx context.Context, removeEnrichmentsOptions *RemoveEnrichmentsOptions) (response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following actions. You can check your access by going to Users > User > Access.

  • logs.geo-enrichment.manage

  • logs.custom-enrichment.manage

  • logs.security-enrichment.manage

Auditing

Calling this method generates the following auditing events.

  • logs.geo-enrichment.delete

  • logs.custom-enrichment.delete

  • logs.security-enrichment.delete

Request

Instantiate the RemoveEnrichmentsOptions struct and set the fields to provide parameter values for the RemoveEnrichments method.

Path Parameters

  • The enrichment ID

    Possible values: 0 ≤ value ≤ 4294967295

    Example: 1

WithContext method only

The RemoveEnrichments options.

  • curl -X DELETE --location --header "Authorization: Bearer ${iam_token}"   "${base_url}/v1/enrichments/${id}"
  • removeEnrichmentsOptions := logsService.NewRemoveEnrichmentsOptions(
      int64(1),
    )
    
    response, err := logsService.RemoveEnrichments(removeEnrichmentsOptions)
    if err != nil {
      panic(err)
    }
    if response.StatusCode != 204 {
      fmt.Printf("\nUnexpected response status code received from RemoveEnrichments(): %d\n", response.StatusCode)
    }

Response

Status Code

  • No Content

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Get data usage metrics export status

Get data usage metrics export status

Get data usage metrics export status.

GET /v1/data_usage
(logs *LogsV0) GetDataUsageMetricsExportStatus(getDataUsageMetricsExportStatusOptions *GetDataUsageMetricsExportStatusOptions) (result *DataUsageMetricsExportStatus, response *core.DetailedResponse, err error)
(logs *LogsV0) GetDataUsageMetricsExportStatusWithContext(ctx context.Context, getDataUsageMetricsExportStatusOptions *GetDataUsageMetricsExportStatusOptions) (result *DataUsageMetricsExportStatus, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.data-usage.manage

Auditing

Calling this method generates the following auditing event.

  • logs.data-usage-to-metrics.enable

Request

No Request Parameters

This method does not accept any request parameters.

WithContext method only

No Request Parameters

This method does not accept any request parameters.

  • curl -X GET --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   "${base_url}/v1/data_usage"
  • getDataUsageMetricsExportStatusOptions := logsService.NewGetDataUsageMetricsExportStatusOptions()
    
    dataUsageMetricsExportStatus, response, err := logsService.GetDataUsageMetricsExportStatus(getDataUsageMetricsExportStatusOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(dataUsageMetricsExportStatus, "", "  ")
    fmt.Println(string(b))

Response

The data usage metrics export status

The data usage metrics export status.

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }

Update data usage metrics export status

Update data usage metrics export status

Update data usage metrics export status.

PUT /v1/data_usage
(logs *LogsV0) UpdateDataUsageMetricsExportStatus(updateDataUsageMetricsExportStatusOptions *UpdateDataUsageMetricsExportStatusOptions) (result *DataUsageMetricsExportStatus, response *core.DetailedResponse, err error)
(logs *LogsV0) UpdateDataUsageMetricsExportStatusWithContext(ctx context.Context, updateDataUsageMetricsExportStatusOptions *UpdateDataUsageMetricsExportStatusOptions) (result *DataUsageMetricsExportStatus, response *core.DetailedResponse, err error)

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • logs.data-usage.manage

Auditing

Calling this method generates the following auditing event.

  • logs.data-usage-to-metrics.enable

Request

Instantiate the UpdateDataUsageMetricsExportStatusOptions struct and set the fields to provide parameter values for the UpdateDataUsageMetricsExportStatus method.

The data usage metrics export status

WithContext method only

The UpdateDataUsageMetricsExportStatus options.

  • curl -X PUT --location --header "Authorization: Bearer ${iam_token}"   --header "Accept: application/json"   --header "Content-Type: application/json"   --data   '{
        "enabled": true
      }'   "${base_url}/v1/data_usage"
  • updateDataUsageMetricsExportStatusOptions := logsService.NewUpdateDataUsageMetricsExportStatusOptions(
      true,
    )
    
    dataUsageMetricsExportStatus, response, err := logsService.UpdateDataUsageMetricsExportStatus(updateDataUsageMetricsExportStatusOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(dataUsageMetricsExportStatus, "", "  ")
    fmt.Println(string(b))

Response

The data usage metrics export status

The data usage metrics export status.

Status Code

  • OK

  • Bad Request

  • Unauthorized

  • Forbidden

  • Not Found

  • Unknown

  • Conflict

  • Too Many Requests

  • Internal Server Error

Example responses
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "bad_request_or_unspecified",
          "message": "Bad request"
        }
      ],
      "status_code": 400,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthenticated",
          "message": "Unauthenticated"
        }
      ],
      "status_code": 401,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "unauthorized",
          "message": "Forbidden"
        }
      ],
      "status_code": 403,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "not_found",
          "message": "Not found"
        }
      ],
      "status_code": 404,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "deadline_exceeded",
          "message": "Request timeout"
        }
      ],
      "status_code": 408,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "conflict",
          "message": "Conflict, resource already exists"
        }
      ],
      "status_code": 409,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "resource_exhausted",
          "message": "Rate limit exceeded"
        }
      ],
      "status_code": 429,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
  • {
      "errors": [
        {
          "code": "method_internal_error",
          "message": "Internal server error"
        }
      ],
      "status_code": 500,
      "trace": "4199a60c-d9f9-4eb0-93e7-6faaa002062e"
    }
id=curlclassName=tab-item-selected