IBM Cloud API Docs

Introduction

This information applies only if you use an IBM Cloud® Activity Tracker hosted event search offering.

As of 28 March 2024 the IBM Log Analysis and IBM Cloud Activity Tracker services are deprecated and will no longer be supported as of 30 March 2025. Customers will need to migrate to IBM Cloud Logs, which replaces these two services, prior to 30 March 2025. For information about IBM Cloud Logs, see the IBM Cloud Logs documentation.

You can use the IBM Cloud® Activity Tracker service to monitor the activity of your IBM Cloud account. The events that are collected comply with the Cloud Auditing Data Federation (CADF) standard. For details about using IBM Cloud Activity Tracker, see the IBM Cloud docs.

You can use the REST API to manage views and alerts, and export data.

For more information, see the following documentation:

Use the following syntax from a terminal to run a cURL command:

curl -X <METHOD> <ENDPOINT>/<API_URL> <-H HEADERS,> [-d DATA]

Where

  • <METHOD> indicates the type of REST API call that you want to make.
  • <ENDPOINT> indicates the endpoint where the logging instance is available. For more information, see endpoints. For example, the endpoint for an instance that is available in us-south is the following: https://us-south.logging.cloud.ibm.com
  • HEADERS add additional information such as information to authenticate with the IBM Cloud Activity Tracker service.
  • DATA allows you to pass additional information that might be required.

The code examples on this tab use the client library that is provided for Python.

#!/usr/bin/env python3
import os
import logging

from {{site.data.keyword.at_short}} import LogDNAHandler

apiKey = '<API-KEY>'

log = logging.getLogger('logdna')
log.setLevel(logging.INFO)

options = {
  'hostname': '<HOSTNAME>',
  'ip': '<IP>',
  'mac': '<MAC>',
  'env': '<ENVIRONMENT>',
  'level': '<PRIORITY>',
  'index_meta': True,
  'url': '<ENDPOINT>'
}

test = LogDNAHandler(apiKey, options)

log.addHandler(test)

log.warning("<SAMPLE-MSG>", {'app': '<APP-NAME>'})
log.info("<SAMPLE-MSG>", {'app': '<APP-NAME>'})

Endpoint URL

You can use public and private endpoints. To find out about the available endpoints, see REST API endpoints.

The endpoint for the IBM Cloud Activity Tracker API is in the format: https://cloud.ibm.com.logging.cloud.ibm.com/api For example, the API endpoint for Dallas is: https://us-south.logging.cloud.ibm.com/api

Example request to a Dallas endpoint:

curl -X GET https://us-south.logging.cloud.ibm.com/api/alerts/<ALERT_ID> -H "Authorization: $AUTH_TOKEN" -H "IBMInstanceID: $GUID" -H "content-type: application/json"

Example request to a Dallas endpoint

#!/usr/bin/env python3
import os
import logging

from {{site.data.keyword.at_short}} import LogDNAHandler

apiKey = '999999999999999'

log = logging.getLogger('logdna')
log.setLevel(logging.INFO)

options = {
  'hostname': 'myhost',
  'ip': '10.0.1.1',
  'mac': 'C0:FF:EE:C0:FF:EE',
  'env': 'Dallas',
  'level': 'Info',
  'index_meta': True,
  'url': 'https://logs.us-south.logging.cloud.ibm.com/logs/ingest'
}

test = LogDNAHandler(apiKey, options)

log.addHandler(test)

log.warning("Sample message 1", {'app': 'myapp'})
log.info("Sample message 2", {'app': 'myapp})

Authentication

You can choose from these authentication methods when you interact with this API.

  • Basic authentication: You can use a service key to configure the service.
  • Service API key authentication: You can use a service key in the header.
  • IAM authentication: You can use a bearer access_token that you obtain from the IAM Identity Services API.

Security scheme

Authentication to this API's methods uses one of the following security schemes.

servicekeyAuth

This key is used for all apis with the exception o ingest. You can obtain it following these instructions and placing the key in the header of your call.

Value
  • API Key
  • Header
  • servicekey

apikeyAuth

This key is used for ingestion. You can obtain it following these instructions and placing the key in the header of your call.

Value
  • API Key
  • Header
  • apikey

basicAuth

As an alternative to authenticating with a header value, you can also use basic authentication. To use either apiKey or servicekey as basic authentication, simply pass the key as the username with no password. For example:

curl https://api.logdna.com/v1/config/view -u INSERT_INGESTION_KEY:
Value
  • HTTP
  • Basic

Auditing

You can monitor API activity within your account. Whenever an API method is called, an event is generated that you can then track and audit. The specific event type is listed for each individual method. Notice that only a subset of the methods generate auditing events.

For more information about how to track IBM Cloud Activity Tracker activity, see Auditing the events for IBM Cloud Activity Tracker.

Error handling

The IBM Cloud Activity Tracker service uses standard HTTP response codes to indicate whether a method completed successfully.

  • A 200 response always indicates success.
  • A 400 type response indicates a failure.
  • A 500 type response usually indicates an internal system error.
HTTP Error Code Description
200 Success
400 Bad Request

Methods

Get Archive Configuration

Use this method to get an existing archiving configuration.

GET /v1/config/archiving

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

Request

No Request Parameters

This method does not accept any request parameters.

  • curl --request GET   --url https://api.us-south.logging.cloud.ibm.com/v1/config/archiving   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/config/archiving", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/archiving"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/archiving",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/archiving")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/archiving")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/config/archiving")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/archiving");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Archiving configuration not found

No Sample Response

This method does not specify any sample responses.

Create Archive Configuration

Use this method to configure archiving for an instance. Only one archiving configuration may exist at any time.

POST /v1/config/archiving

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

Auditing

Calling this method generates the following auditing event, depending on any listed conditions.

  • logdnaat.archive.create

    Archiving Configuration created

Request

Request parameters

  • curl --request POST   --url https://api.us-south.logging.cloud.ibm.com/v1/config/archiving   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --data '{"integration":"string","bucket":"string","endpoint":"string","apikey":"string","resourceinstanceid":"string","accountname":"string","accountkey":"string","projectid":"string","space":"string","accesskey":"string","secretkey":"string","authurl":"string","expires":"string","username":"string","password":"pa$$word","tenantname":"string"}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"integration\":\"string\",\"bucket\":\"string\",\"endpoint\":\"string\",\"apikey\":\"string\",\"resourceinstanceid\":\"string\",\"accountname\":\"string\",\"accountkey\":\"string\",\"projectid\":\"string\",\"space\":\"string\",\"accesskey\":\"string\",\"secretkey\":\"string\",\"authurl\":\"string\",\"expires\":\"string\",\"username\":\"string\",\"password\":\"pa$$word\",\"tenantname\":\"string\"}"
    
    headers = {
        'content-type': "application/json",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("POST", "/v1/config/archiving", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/archiving"
    
    	payload := strings.NewReader("{\"integration\":\"string\",\"bucket\":\"string\",\"endpoint\":\"string\",\"apikey\":\"string\",\"resourceinstanceid\":\"string\",\"accountname\":\"string\",\"accountkey\":\"string\",\"projectid\":\"string\",\"space\":\"string\",\"accesskey\":\"string\",\"secretkey\":\"string\",\"authurl\":\"string\",\"expires\":\"string\",\"username\":\"string\",\"password\":\"pa$$word\",\"tenantname\":\"string\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "POST",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/archiving",
      "headers": {
        "content-type": "application/json",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      integration: 'string',
      bucket: 'string',
      endpoint: 'string',
      apikey: 'string',
      resourceinstanceid: 'string',
      accountname: 'string',
      accountkey: 'string',
      projectid: 'string',
      space: 'string',
      accesskey: 'string',
      secretkey: 'string',
      authurl: 'string',
      expires: 'string',
      username: 'string',
      password: 'pa$$word',
      tenantname: 'string'
    }));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = [
      "integration": "string",
      "bucket": "string",
      "endpoint": "string",
      "apikey": "string",
      "resourceinstanceid": "string",
      "accountname": "string",
      "accountkey": "string",
      "projectid": "string",
      "space": "string",
      "accesskey": "string",
      "secretkey": "string",
      "authurl": "string",
      "expires": "string",
      "username": "string",
      "password": "pa$$word",
      "tenantname": "string"
    ] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/archiving")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "POST"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/archiving")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"integration\":\"string\",\"bucket\":\"string\",\"endpoint\":\"string\",\"apikey\":\"string\",\"resourceinstanceid\":\"string\",\"accountname\":\"string\",\"accountkey\":\"string\",\"projectid\":\"string\",\"space\":\"string\",\"accesskey\":\"string\",\"secretkey\":\"string\",\"authurl\":\"string\",\"expires\":\"string\",\"username\":\"string\",\"password\":\"pa$$word\",\"tenantname\":\"string\"}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.post("https://api.us-south.logging.cloud.ibm.com/v1/config/archiving")
      .header("content-type", "application/json")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"integration\":\"string\",\"bucket\":\"string\",\"endpoint\":\"string\",\"apikey\":\"string\",\"resourceinstanceid\":\"string\",\"accountname\":\"string\",\"accountkey\":\"string\",\"projectid\":\"string\",\"space\":\"string\",\"accesskey\":\"string\",\"secretkey\":\"string\",\"authurl\":\"string\",\"expires\":\"string\",\"username\":\"string\",\"password\":\"pa$$word\",\"tenantname\":\"string\"}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/archiving");
    var request = new RestRequest(Method.POST);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"integration\":\"string\",\"bucket\":\"string\",\"endpoint\":\"string\",\"apikey\":\"string\",\"resourceinstanceid\":\"string\",\"accountname\":\"string\",\"accountkey\":\"string\",\"projectid\":\"string\",\"space\":\"string\",\"accesskey\":\"string\",\"secretkey\":\"string\",\"authurl\":\"string\",\"expires\":\"string\",\"username\":\"string\",\"password\":\"pa$$word\",\"tenantname\":\"string\"}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

  • An archiving configuration already exists. Cannot create a new one

No Sample Response

This method does not specify any sample responses.

Update Archive Configuration

Use this method to update an existing archiving configuration.

PUT /v1/config/archiving

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

Auditing

Calling this method generates the following auditing event, depending on any listed conditions.

  • logdnaat.archive.update

    Archiving Configuration Updated

Request

Request parameters

  • curl --request PUT   --url https://api.us-south.logging.cloud.ibm.com/v1/config/archiving   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --data '{"integration":"string","bucket":"string","endpoint":"string","apikey":"string","resourceinstanceid":"string","accountname":"string","accountkey":"string","projectid":"string","space":"string","accesskey":"string","secretkey":"string","authurl":"string","expires":"string","username":"string","password":"pa$$word","tenantname":"string"}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"integration\":\"string\",\"bucket\":\"string\",\"endpoint\":\"string\",\"apikey\":\"string\",\"resourceinstanceid\":\"string\",\"accountname\":\"string\",\"accountkey\":\"string\",\"projectid\":\"string\",\"space\":\"string\",\"accesskey\":\"string\",\"secretkey\":\"string\",\"authurl\":\"string\",\"expires\":\"string\",\"username\":\"string\",\"password\":\"pa$$word\",\"tenantname\":\"string\"}"
    
    headers = {
        'content-type': "application/json",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("PUT", "/v1/config/archiving", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/archiving"
    
    	payload := strings.NewReader("{\"integration\":\"string\",\"bucket\":\"string\",\"endpoint\":\"string\",\"apikey\":\"string\",\"resourceinstanceid\":\"string\",\"accountname\":\"string\",\"accountkey\":\"string\",\"projectid\":\"string\",\"space\":\"string\",\"accesskey\":\"string\",\"secretkey\":\"string\",\"authurl\":\"string\",\"expires\":\"string\",\"username\":\"string\",\"password\":\"pa$$word\",\"tenantname\":\"string\"}")
    
    	req, _ := http.NewRequest("PUT", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "PUT",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/archiving",
      "headers": {
        "content-type": "application/json",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      integration: 'string',
      bucket: 'string',
      endpoint: 'string',
      apikey: 'string',
      resourceinstanceid: 'string',
      accountname: 'string',
      accountkey: 'string',
      projectid: 'string',
      space: 'string',
      accesskey: 'string',
      secretkey: 'string',
      authurl: 'string',
      expires: 'string',
      username: 'string',
      password: 'pa$$word',
      tenantname: 'string'
    }));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = [
      "integration": "string",
      "bucket": "string",
      "endpoint": "string",
      "apikey": "string",
      "resourceinstanceid": "string",
      "accountname": "string",
      "accountkey": "string",
      "projectid": "string",
      "space": "string",
      "accesskey": "string",
      "secretkey": "string",
      "authurl": "string",
      "expires": "string",
      "username": "string",
      "password": "pa$$word",
      "tenantname": "string"
    ] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/archiving")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "PUT"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/archiving")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Put.new(url)
    request["content-type"] = 'application/json'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"integration\":\"string\",\"bucket\":\"string\",\"endpoint\":\"string\",\"apikey\":\"string\",\"resourceinstanceid\":\"string\",\"accountname\":\"string\",\"accountkey\":\"string\",\"projectid\":\"string\",\"space\":\"string\",\"accesskey\":\"string\",\"secretkey\":\"string\",\"authurl\":\"string\",\"expires\":\"string\",\"username\":\"string\",\"password\":\"pa$$word\",\"tenantname\":\"string\"}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.put("https://api.us-south.logging.cloud.ibm.com/v1/config/archiving")
      .header("content-type", "application/json")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"integration\":\"string\",\"bucket\":\"string\",\"endpoint\":\"string\",\"apikey\":\"string\",\"resourceinstanceid\":\"string\",\"accountname\":\"string\",\"accountkey\":\"string\",\"projectid\":\"string\",\"space\":\"string\",\"accesskey\":\"string\",\"secretkey\":\"string\",\"authurl\":\"string\",\"expires\":\"string\",\"username\":\"string\",\"password\":\"pa$$word\",\"tenantname\":\"string\"}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/archiving");
    var request = new RestRequest(Method.PUT);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"integration\":\"string\",\"bucket\":\"string\",\"endpoint\":\"string\",\"apikey\":\"string\",\"resourceinstanceid\":\"string\",\"accountname\":\"string\",\"accountkey\":\"string\",\"projectid\":\"string\",\"space\":\"string\",\"accesskey\":\"string\",\"secretkey\":\"string\",\"authurl\":\"string\",\"expires\":\"string\",\"username\":\"string\",\"password\":\"pa$$word\",\"tenantname\":\"string\"}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

  • Existing archiving integration not found

No Sample Response

This method does not specify any sample responses.

Delete Archive Configuration

Use this method to delete the archiving configuration.

DELETE /v1/config/archiving

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

Auditing

Calling this method generates the following auditing event, depending on any listed conditions.

  • logdnaat.archive.delete

    Archiving Configuration Deleted

Request

No Request Parameters

This method does not accept any request parameters.

  • curl --request DELETE   --url https://api.us-south.logging.cloud.ibm.com/v1/config/archiving   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("DELETE", "/v1/config/archiving", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/archiving"
    
    	req, _ := http.NewRequest("DELETE", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "DELETE",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/archiving",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/archiving")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "DELETE"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/archiving")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Delete.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.delete("https://api.us-south.logging.cloud.ibm.com/v1/config/archiving")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/archiving");
    var request = new RestRequest(Method.DELETE);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Archiving configuration not found

No Sample Response

This method does not specify any sample responses.

List Views

Get a list of views.

GET /v1/config/view

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

No Request Parameters

This method does not accept any request parameters.

  • curl --request GET   --url https://api.us-south.logging.cloud.ibm.com/v1/config/view   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/config/view", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/view"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/view",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/view")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/view")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/config/view")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/view");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Create View

Use this method to create a view and attach alerts to the view.

POST /v1/config/view

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Auditing

Calling this method generates the following auditing event, depending on any listed conditions.

  • logdnaat.view.create

    Create View

Request

Request parameters

  • curl --request POST   --url https://api.us-south.logging.cloud.ibm.com/v1/config/view   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --data '{"name":"string","query":"string","hosts":["string"],"apps":["string"],"levels":["string"],"tags":["string"],"category":["string"],"presetid":"string","channels":[{"integration":"string","emails":["string"],"url":"string","key":"string","triggerlimit":"string","triggerinterval":"string","immediate":true,"terminal":true,"operator":"string","timezone":"America/Chicago, EST, Etc/UTC, etc...","method":"POST","headers":{"timestamp":"string"},"bodyTemplate":{"timestamp":"string"}}]}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"name\":\"string\",\"query\":\"string\",\"hosts\":[\"string\"],\"apps\":[\"string\"],\"levels\":[\"string\"],\"tags\":[\"string\"],\"category\":[\"string\"],\"presetid\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}"
    
    headers = {
        'content-type': "application/json",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("POST", "/v1/config/view", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/view"
    
    	payload := strings.NewReader("{\"name\":\"string\",\"query\":\"string\",\"hosts\":[\"string\"],\"apps\":[\"string\"],\"levels\":[\"string\"],\"tags\":[\"string\"],\"category\":[\"string\"],\"presetid\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "POST",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/view",
      "headers": {
        "content-type": "application/json",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      name: 'string',
      query: 'string',
      hosts: ['string'],
      apps: ['string'],
      levels: ['string'],
      tags: ['string'],
      category: ['string'],
      presetid: 'string',
      channels: [
        {
          integration: 'string',
          emails: ['string'],
          url: 'string',
          key: 'string',
          triggerlimit: 'string',
          triggerinterval: 'string',
          immediate: true,
          terminal: true,
          operator: 'string',
          timezone: 'America/Chicago, EST, Etc/UTC, etc...',
          method: 'POST',
          headers: {timestamp: 'string'},
          bodyTemplate: {timestamp: 'string'}
        }
      ]
    }));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = [
      "name": "string",
      "query": "string",
      "hosts": ["string"],
      "apps": ["string"],
      "levels": ["string"],
      "tags": ["string"],
      "category": ["string"],
      "presetid": "string",
      "channels": [
        [
          "integration": "string",
          "emails": ["string"],
          "url": "string",
          "key": "string",
          "triggerlimit": "string",
          "triggerinterval": "string",
          "immediate": true,
          "terminal": true,
          "operator": "string",
          "timezone": "America/Chicago, EST, Etc/UTC, etc...",
          "method": "POST",
          "headers": ["timestamp": "string"],
          "bodyTemplate": ["timestamp": "string"]
        ]
      ]
    ] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/view")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "POST"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/view")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"name\":\"string\",\"query\":\"string\",\"hosts\":[\"string\"],\"apps\":[\"string\"],\"levels\":[\"string\"],\"tags\":[\"string\"],\"category\":[\"string\"],\"presetid\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.post("https://api.us-south.logging.cloud.ibm.com/v1/config/view")
      .header("content-type", "application/json")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"name\":\"string\",\"query\":\"string\",\"hosts\":[\"string\"],\"apps\":[\"string\"],\"levels\":[\"string\"],\"tags\":[\"string\"],\"category\":[\"string\"],\"presetid\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/view");
    var request = new RestRequest(Method.POST);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"name\":\"string\",\"query\":\"string\",\"hosts\":[\"string\"],\"apps\":[\"string\"],\"levels\":[\"string\"],\"tags\":[\"string\"],\"category\":[\"string\"],\"presetid\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Get View

Gets the configuration for a specific view.

GET /v1/config/view/{viewId}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

Path Parameters

  • ID of a view.

  • curl --request GET   --url https://api.us-south.logging.cloud.ibm.com/v1/config/view/%7BviewId%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/config/view/%7BviewId%7D", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/view/%7BviewId%7D"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/view/%7BviewId%7D",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/view/%7BviewId%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/view/%7BviewId%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/config/view/%7BviewId%7D")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/view/%7BviewId%7D");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Update View

Use this method to update a view. You can change the view configuration details; add or remove view specific alerts; or attach and detach preset alerts.

PUT /v1/config/view/{viewId}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Auditing

Calling this method generates the following auditing event, depending on any listed conditions.

  • logdnaat.view.update

    Update View

Request

Path Parameters

  • ID of a view.

Request parameters

  • curl --request PUT   --url https://api.us-south.logging.cloud.ibm.com/v1/config/view/%7BviewId%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --data '{"name":"string","query":"string","hosts":["string"],"apps":["string"],"levels":["string"],"tags":["string"],"category":["string"],"presetid":"string","channels":[{"integration":"string","emails":["string"],"url":"string","key":"string","triggerlimit":"string","triggerinterval":"string","immediate":true,"terminal":true,"operator":"string","timezone":"America/Chicago, EST, Etc/UTC, etc...","method":"POST","headers":{"timestamp":"string"},"bodyTemplate":{"timestamp":"string"}}]}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"name\":\"string\",\"query\":\"string\",\"hosts\":[\"string\"],\"apps\":[\"string\"],\"levels\":[\"string\"],\"tags\":[\"string\"],\"category\":[\"string\"],\"presetid\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}"
    
    headers = {
        'content-type': "application/json",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("PUT", "/v1/config/view/%7BviewId%7D", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/view/%7BviewId%7D"
    
    	payload := strings.NewReader("{\"name\":\"string\",\"query\":\"string\",\"hosts\":[\"string\"],\"apps\":[\"string\"],\"levels\":[\"string\"],\"tags\":[\"string\"],\"category\":[\"string\"],\"presetid\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}")
    
    	req, _ := http.NewRequest("PUT", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "PUT",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/view/%7BviewId%7D",
      "headers": {
        "content-type": "application/json",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      name: 'string',
      query: 'string',
      hosts: ['string'],
      apps: ['string'],
      levels: ['string'],
      tags: ['string'],
      category: ['string'],
      presetid: 'string',
      channels: [
        {
          integration: 'string',
          emails: ['string'],
          url: 'string',
          key: 'string',
          triggerlimit: 'string',
          triggerinterval: 'string',
          immediate: true,
          terminal: true,
          operator: 'string',
          timezone: 'America/Chicago, EST, Etc/UTC, etc...',
          method: 'POST',
          headers: {timestamp: 'string'},
          bodyTemplate: {timestamp: 'string'}
        }
      ]
    }));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = [
      "name": "string",
      "query": "string",
      "hosts": ["string"],
      "apps": ["string"],
      "levels": ["string"],
      "tags": ["string"],
      "category": ["string"],
      "presetid": "string",
      "channels": [
        [
          "integration": "string",
          "emails": ["string"],
          "url": "string",
          "key": "string",
          "triggerlimit": "string",
          "triggerinterval": "string",
          "immediate": true,
          "terminal": true,
          "operator": "string",
          "timezone": "America/Chicago, EST, Etc/UTC, etc...",
          "method": "POST",
          "headers": ["timestamp": "string"],
          "bodyTemplate": ["timestamp": "string"]
        ]
      ]
    ] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/view/%7BviewId%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "PUT"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/view/%7BviewId%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Put.new(url)
    request["content-type"] = 'application/json'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"name\":\"string\",\"query\":\"string\",\"hosts\":[\"string\"],\"apps\":[\"string\"],\"levels\":[\"string\"],\"tags\":[\"string\"],\"category\":[\"string\"],\"presetid\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.put("https://api.us-south.logging.cloud.ibm.com/v1/config/view/%7BviewId%7D")
      .header("content-type", "application/json")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"name\":\"string\",\"query\":\"string\",\"hosts\":[\"string\"],\"apps\":[\"string\"],\"levels\":[\"string\"],\"tags\":[\"string\"],\"category\":[\"string\"],\"presetid\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/view/%7BviewId%7D");
    var request = new RestRequest(Method.PUT);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"name\":\"string\",\"query\":\"string\",\"hosts\":[\"string\"],\"apps\":[\"string\"],\"levels\":[\"string\"],\"tags\":[\"string\"],\"category\":[\"string\"],\"presetid\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Delete View

Use this method to delete a view and any attached alerts.

DELETE /v1/config/view/{viewId}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Auditing

Calling this method generates the following auditing event, depending on any listed conditions.

  • logdnaat.view.delete

    Delete View

Request

Path Parameters

  • ID of a view.

  • curl --request DELETE   --url https://api.us-south.logging.cloud.ibm.com/v1/config/view/%7BviewId%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("DELETE", "/v1/config/view/%7BviewId%7D", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/view/%7BviewId%7D"
    
    	req, _ := http.NewRequest("DELETE", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "DELETE",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/view/%7BviewId%7D",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/view/%7BviewId%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "DELETE"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/view/%7BviewId%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Delete.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.delete("https://api.us-south.logging.cloud.ibm.com/v1/config/view/%7BviewId%7D")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/view/%7BviewId%7D");
    var request = new RestRequest(Method.DELETE);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

List Preset Alerts

Returns all Preset Alerts in the account.

GET /v1/config/presetalert

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

No Request Parameters

This method does not accept any request parameters.

  • curl --request GET   --url https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/config/presetalert", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/presetalert",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Create Preset Alert

Use this method to create a preset alert.

POST /v1/config/presetalert

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Auditing

Calling this method generates the following auditing event, depending on any listed conditions.

  • logdnaat.alert.create

    Create Preset Alerts

Request

Request parameters

  • curl --request POST   --url https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --data '{"name":"string","channels":[{"integration":"string","emails":["string"],"url":"string","key":"string","triggerlimit":"string","triggerinterval":"string","immediate":true,"terminal":true,"operator":"string","timezone":"America/Chicago, EST, Etc/UTC, etc...","method":"POST","headers":{"timestamp":"string"},"bodyTemplate":{"timestamp":"string"}}]}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"name\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}"
    
    headers = {
        'content-type': "application/json",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("POST", "/v1/config/presetalert", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert"
    
    	payload := strings.NewReader("{\"name\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "POST",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/presetalert",
      "headers": {
        "content-type": "application/json",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      name: 'string',
      channels: [
        {
          integration: 'string',
          emails: ['string'],
          url: 'string',
          key: 'string',
          triggerlimit: 'string',
          triggerinterval: 'string',
          immediate: true,
          terminal: true,
          operator: 'string',
          timezone: 'America/Chicago, EST, Etc/UTC, etc...',
          method: 'POST',
          headers: {timestamp: 'string'},
          bodyTemplate: {timestamp: 'string'}
        }
      ]
    }));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = [
      "name": "string",
      "channels": [
        [
          "integration": "string",
          "emails": ["string"],
          "url": "string",
          "key": "string",
          "triggerlimit": "string",
          "triggerinterval": "string",
          "immediate": true,
          "terminal": true,
          "operator": "string",
          "timezone": "America/Chicago, EST, Etc/UTC, etc...",
          "method": "POST",
          "headers": ["timestamp": "string"],
          "bodyTemplate": ["timestamp": "string"]
        ]
      ]
    ] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "POST"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"name\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.post("https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert")
      .header("content-type", "application/json")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"name\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert");
    var request = new RestRequest(Method.POST);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"name\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Get Preset Alert

Get a specific preset alert

GET /v1/config/presetalert/{presetId}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

Path Parameters

  • ID of a preset alert.

  • curl --request GET   --url https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/%7BpresetId%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/config/presetalert/%7BpresetId%7D", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/%7BpresetId%7D"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/presetalert/%7BpresetId%7D",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/%7BpresetId%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/%7BpresetId%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/%7BpresetId%7D")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/%7BpresetId%7D");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Update Alert

Update a specific preset alert.

PUT /v1/config/presetalert/{presetId}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Auditing

Calling this method generates the following auditing event, depending on any listed conditions.

  • logdnaat.alert.update

    Update Preset Alerts

Request

Path Parameters

  • ID of a preset alert.

Request parameters

  • curl --request PUT   --url https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/%7BpresetId%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --data '{"name":"string","channels":[{"integration":"string","emails":["string"],"url":"string","key":"string","triggerlimit":"string","triggerinterval":"string","immediate":true,"terminal":true,"operator":"string","timezone":"America/Chicago, EST, Etc/UTC, etc...","method":"POST","headers":{"timestamp":"string"},"bodyTemplate":{"timestamp":"string"}}]}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"name\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}"
    
    headers = {
        'content-type': "application/json",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("PUT", "/v1/config/presetalert/%7BpresetId%7D", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/%7BpresetId%7D"
    
    	payload := strings.NewReader("{\"name\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}")
    
    	req, _ := http.NewRequest("PUT", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "PUT",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/presetalert/%7BpresetId%7D",
      "headers": {
        "content-type": "application/json",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      name: 'string',
      channels: [
        {
          integration: 'string',
          emails: ['string'],
          url: 'string',
          key: 'string',
          triggerlimit: 'string',
          triggerinterval: 'string',
          immediate: true,
          terminal: true,
          operator: 'string',
          timezone: 'America/Chicago, EST, Etc/UTC, etc...',
          method: 'POST',
          headers: {timestamp: 'string'},
          bodyTemplate: {timestamp: 'string'}
        }
      ]
    }));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = [
      "name": "string",
      "channels": [
        [
          "integration": "string",
          "emails": ["string"],
          "url": "string",
          "key": "string",
          "triggerlimit": "string",
          "triggerinterval": "string",
          "immediate": true,
          "terminal": true,
          "operator": "string",
          "timezone": "America/Chicago, EST, Etc/UTC, etc...",
          "method": "POST",
          "headers": ["timestamp": "string"],
          "bodyTemplate": ["timestamp": "string"]
        ]
      ]
    ] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/%7BpresetId%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "PUT"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/%7BpresetId%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Put.new(url)
    request["content-type"] = 'application/json'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"name\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.put("https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/%7BpresetId%7D")
      .header("content-type", "application/json")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"name\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/%7BpresetId%7D");
    var request = new RestRequest(Method.PUT);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"name\":\"string\",\"channels\":[{\"integration\":\"string\",\"emails\":[\"string\"],\"url\":\"string\",\"key\":\"string\",\"triggerlimit\":\"string\",\"triggerinterval\":\"string\",\"immediate\":true,\"terminal\":true,\"operator\":\"string\",\"timezone\":\"America/Chicago, EST, Etc/UTC, etc...\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":{\"timestamp\":\"string\"}}]}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Delete Alert

Use this method to delete a preset alert.

DELETE /v1/config/presetalert/{presetId}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Auditing

Calling this method generates the following auditing event, depending on any listed conditions.

  • logdnaat.alert.delete

    Delete Preset Alerts

Request

Path Parameters

  • ID of a preset alert.

  • curl --request DELETE   --url https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/%7BpresetId%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("DELETE", "/v1/config/presetalert/%7BpresetId%7D", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/%7BpresetId%7D"
    
    	req, _ := http.NewRequest("DELETE", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "DELETE",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/presetalert/%7BpresetId%7D",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/%7BpresetId%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "DELETE"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/%7BpresetId%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Delete.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.delete("https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/%7BpresetId%7D")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/presetalert/%7BpresetId%7D");
    var request = new RestRequest(Method.DELETE);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

List Categories

Returns all Categories of a type.

GET /v1/config/categories/{type}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

Path Parameters

  • Category type. Must be [views, boards, screens]

  • curl --request GET   --url https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/config/categories/%7Btype%7D", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/categories/%7Btype%7D",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Create New Category

Creates a new category of this type.

POST /v1/config/categories/{type}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

Path Parameters

  • Category type. Must be [views, boards, screens]

Request parameters

  • curl --request POST   --url https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --data '{"name":"string"}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"name\":\"string\"}"
    
    headers = {
        'content-type': "application/json",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("POST", "/v1/config/categories/%7Btype%7D", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D"
    
    	payload := strings.NewReader("{\"name\":\"string\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "POST",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/categories/%7Btype%7D",
      "headers": {
        "content-type": "application/json",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({name: 'string'}));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = ["name": "string"] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "POST"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"name\":\"string\"}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.post("https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D")
      .header("content-type", "application/json")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"name\":\"string\"}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D");
    var request = new RestRequest(Method.POST);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"name\":\"string\"}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Get Category

Get a specific category

GET /v1/config/categories/{type}/{id}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

Path Parameters

  • Category type. Must be [views, boards, screens]

  • ID of category.

  • curl --request GET   --url https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D/%7Bid%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/config/categories/%7Btype%7D/%7Bid%7D", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D/%7Bid%7D"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/categories/%7Btype%7D/%7Bid%7D",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D/%7Bid%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D/%7Bid%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D/%7Bid%7D")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D/%7Bid%7D");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Update Category

Update a specific category.

PUT /v1/config/categories/{type}/{id}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

Path Parameters

  • Category type. Must be [views, boards, screens]

  • ID of category.

Request parameters

  • curl --request PUT   --url https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D/%7Bid%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --data '{"name":"string"}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"name\":\"string\"}"
    
    headers = {
        'content-type': "application/json",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("PUT", "/v1/config/categories/%7Btype%7D/%7Bid%7D", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D/%7Bid%7D"
    
    	payload := strings.NewReader("{\"name\":\"string\"}")
    
    	req, _ := http.NewRequest("PUT", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "PUT",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/categories/%7Btype%7D/%7Bid%7D",
      "headers": {
        "content-type": "application/json",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({name: 'string'}));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = ["name": "string"] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D/%7Bid%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "PUT"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D/%7Bid%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Put.new(url)
    request["content-type"] = 'application/json'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"name\":\"string\"}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.put("https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D/%7Bid%7D")
      .header("content-type", "application/json")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"name\":\"string\"}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D/%7Bid%7D");
    var request = new RestRequest(Method.PUT);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"name\":\"string\"}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Delete Category

Use this method to delete a category.

DELETE /v1/config/categories/{type}/{id}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

Path Parameters

  • Category type. Must be [views, boards, screens]

  • ID of category.

  • curl --request DELETE   --url https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D/%7Bid%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("DELETE", "/v1/config/categories/%7Btype%7D/%7Bid%7D", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D/%7Bid%7D"
    
    	req, _ := http.NewRequest("DELETE", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "DELETE",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/categories/%7Btype%7D/%7Bid%7D",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D/%7Bid%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "DELETE"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D/%7Bid%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Delete.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.delete("https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D/%7Bid%7D")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/categories/%7Btype%7D/%7Bid%7D");
    var request = new RestRequest(Method.DELETE);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Export log lines

Use this method to export logs in JSON format from a logging instance.

GET /v1/export

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

  • logdna.dashboard.read

Auditing

Calling this method generates the following auditing event, depending on any listed conditions.

  • logdnaat.lines.export

    Export log lines

Request

Query Parameters

  • Start time. Set as UNIX timestamp in seconds or milliseconds.

  • End time. Set as UNIX timestamp in seconds or milliseconds.

  • Number of log lines to include in the export.

  • Comma-separated list of hosts.

  • Comma-separated list of applications.

  • Comma-separated list of log levels.

  • Search query.

  • Defines the log lines that you want to export. Valid values are head, first log lines, and tail, last log lines. If not specified, defaults to tail.

  • Specifies the email with the downloadable link of your export. By default, the log lines are streamed.

  • Use to set the subject of the email. Use to represent a space. For example, a sample value is Export logs.

  • curl --request GET   --url 'https://api.us-south.logging.cloud.ibm.com/v1/export?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&size=SOME_STRING_VALUE&hosts=SOME_STRING_VALUE&apps=SOME_STRING_VALUE&levels=SOME_STRING_VALUE&query=SOME_STRING_VALUE&prefer=SOME_STRING_VALUE&email=SOME_STRING_VALUE&emailSubject=SOME_STRING_VALUE'   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/export?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&size=SOME_STRING_VALUE&hosts=SOME_STRING_VALUE&apps=SOME_STRING_VALUE&levels=SOME_STRING_VALUE&query=SOME_STRING_VALUE&prefer=SOME_STRING_VALUE&email=SOME_STRING_VALUE&emailSubject=SOME_STRING_VALUE", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/export?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&size=SOME_STRING_VALUE&hosts=SOME_STRING_VALUE&apps=SOME_STRING_VALUE&levels=SOME_STRING_VALUE&query=SOME_STRING_VALUE&prefer=SOME_STRING_VALUE&email=SOME_STRING_VALUE&emailSubject=SOME_STRING_VALUE"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/export?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&size=SOME_STRING_VALUE&hosts=SOME_STRING_VALUE&apps=SOME_STRING_VALUE&levels=SOME_STRING_VALUE&query=SOME_STRING_VALUE&prefer=SOME_STRING_VALUE&email=SOME_STRING_VALUE&emailSubject=SOME_STRING_VALUE",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/export?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&size=SOME_STRING_VALUE&hosts=SOME_STRING_VALUE&apps=SOME_STRING_VALUE&levels=SOME_STRING_VALUE&query=SOME_STRING_VALUE&prefer=SOME_STRING_VALUE&email=SOME_STRING_VALUE&emailSubject=SOME_STRING_VALUE")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/export?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&size=SOME_STRING_VALUE&hosts=SOME_STRING_VALUE&apps=SOME_STRING_VALUE&levels=SOME_STRING_VALUE&query=SOME_STRING_VALUE&prefer=SOME_STRING_VALUE&email=SOME_STRING_VALUE&emailSubject=SOME_STRING_VALUE")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/export?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&size=SOME_STRING_VALUE&hosts=SOME_STRING_VALUE&apps=SOME_STRING_VALUE&levels=SOME_STRING_VALUE&query=SOME_STRING_VALUE&prefer=SOME_STRING_VALUE&email=SOME_STRING_VALUE&emailSubject=SOME_STRING_VALUE")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/export?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&size=SOME_STRING_VALUE&hosts=SOME_STRING_VALUE&apps=SOME_STRING_VALUE&levels=SOME_STRING_VALUE&query=SOME_STRING_VALUE&prefer=SOME_STRING_VALUE&email=SOME_STRING_VALUE&emailSubject=SOME_STRING_VALUE");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Export log lines

Use this method to export logs in JSON format from a logging instance.

GET /v2/export

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

  • logdna.dashboard.read

Auditing

Calling this method generates the following auditing event, depending on any listed conditions.

  • logdnaat.lines.export

    Export log lines

Request

Query Parameters

  • Start time (inclusive). Set as UNIX timestamp in seconds or milliseconds.

  • End time (inclusive). Set as UNIX timestamp in seconds or milliseconds.

  • Number of log lines to include in the export.

  • Comma-separated list of hosts.

  • Comma-separated list of applications.

  • Comma-separated list of log levels.

  • Search query.

  • Defines the log lines that you want to export. Valid values are head, first log lines, and tail, last log lines. If not specified, defaults to tail.

  • ID that indicates which page of results to be retrieved. Leave empty for the initial export request.

  • curl --request GET   --url 'https://api.us-south.logging.cloud.ibm.com/v2/export?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&size=SOME_STRING_VALUE&hosts=SOME_STRING_VALUE&apps=SOME_STRING_VALUE&levels=SOME_STRING_VALUE&query=SOME_STRING_VALUE&prefer=SOME_STRING_VALUE&pagination_id=SOME_STRING_VALUE'   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v2/export?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&size=SOME_STRING_VALUE&hosts=SOME_STRING_VALUE&apps=SOME_STRING_VALUE&levels=SOME_STRING_VALUE&query=SOME_STRING_VALUE&prefer=SOME_STRING_VALUE&pagination_id=SOME_STRING_VALUE", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v2/export?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&size=SOME_STRING_VALUE&hosts=SOME_STRING_VALUE&apps=SOME_STRING_VALUE&levels=SOME_STRING_VALUE&query=SOME_STRING_VALUE&prefer=SOME_STRING_VALUE&pagination_id=SOME_STRING_VALUE"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v2/export?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&size=SOME_STRING_VALUE&hosts=SOME_STRING_VALUE&apps=SOME_STRING_VALUE&levels=SOME_STRING_VALUE&query=SOME_STRING_VALUE&prefer=SOME_STRING_VALUE&pagination_id=SOME_STRING_VALUE",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v2/export?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&size=SOME_STRING_VALUE&hosts=SOME_STRING_VALUE&apps=SOME_STRING_VALUE&levels=SOME_STRING_VALUE&query=SOME_STRING_VALUE&prefer=SOME_STRING_VALUE&pagination_id=SOME_STRING_VALUE")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v2/export?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&size=SOME_STRING_VALUE&hosts=SOME_STRING_VALUE&apps=SOME_STRING_VALUE&levels=SOME_STRING_VALUE&query=SOME_STRING_VALUE&prefer=SOME_STRING_VALUE&pagination_id=SOME_STRING_VALUE")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v2/export?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&size=SOME_STRING_VALUE&hosts=SOME_STRING_VALUE&apps=SOME_STRING_VALUE&levels=SOME_STRING_VALUE&query=SOME_STRING_VALUE&prefer=SOME_STRING_VALUE&pagination_id=SOME_STRING_VALUE")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v2/export?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&size=SOME_STRING_VALUE&hosts=SOME_STRING_VALUE&apps=SOME_STRING_VALUE&levels=SOME_STRING_VALUE&query=SOME_STRING_VALUE&prefer=SOME_STRING_VALUE&pagination_id=SOME_STRING_VALUE");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Get Stream Configuration

Use this method to get an existing streaming configuration.

GET /v1/config/stream

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Auditing

Calling this method generates the following auditing events.

  • logdnaat.streaming-configuration.validate

  • logdnaat.account-streaming-setting.configure

Request

Custom Headers

  • Allowable values: [*/*,application/json]

  • curl --request GET   --url https://api.us-south.logging.cloud.ibm.com/v1/config/stream   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/config/stream", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/stream"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/stream",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/stream")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/stream")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/config/stream")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/stream");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Not Authorized

  • Forbidden

  • Not Found

  • Internal Server Error

Example responses
  • {
      "brokers": [
        "broker-1.kafka.svc00.env.eventstreams.cloud.ibm.com:9093"
      ],
      "topic": "topic",
      "user": "token",
      "status": "active"
    }
  • {
      "code": "NotAuthorized",
      "error": "Missing Credentials"
    }
  • {
      "code": "Forbidden",
      "error": "Event Streaming is unavailable on this account/plan"
    }
  • {
      "code": "NotFound",
      "error": "Not found"
    }
  • {
      "code": "ServerError",
      "error": "Database operation failed to get stream configuration."
    }

Update Stream Configuration

Use this method to update an existing streaming configuration.

PUT /v1/config/stream

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Auditing

Calling this method generates the following auditing events.

  • logdnaat.streaming-configuration.validate

  • logdnaat.ccount-streaming-setting.configure

Request

Custom Headers

  • Allowable values: [*/*,application/json]

Request parameters

  • curl --request PUT   --url https://api.us-south.logging.cloud.ibm.com/v1/config/stream   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --data '{"brokers":["string"],"topic":"string","user":"string","password":"pa$$word"}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"brokers\":[\"string\"],\"topic\":\"string\",\"user\":\"string\",\"password\":\"pa$$word\"}"
    
    headers = {
        'content-type': "application/json",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("PUT", "/v1/config/stream", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/stream"
    
    	payload := strings.NewReader("{\"brokers\":[\"string\"],\"topic\":\"string\",\"user\":\"string\",\"password\":\"pa$$word\"}")
    
    	req, _ := http.NewRequest("PUT", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "PUT",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/stream",
      "headers": {
        "content-type": "application/json",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({brokers: ['string'], topic: 'string', user: 'string', password: 'pa$$word'}));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = [
      "brokers": ["string"],
      "topic": "string",
      "user": "string",
      "password": "pa$$word"
    ] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/stream")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "PUT"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/stream")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Put.new(url)
    request["content-type"] = 'application/json'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"brokers\":[\"string\"],\"topic\":\"string\",\"user\":\"string\",\"password\":\"pa$$word\"}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.put("https://api.us-south.logging.cloud.ibm.com/v1/config/stream")
      .header("content-type", "application/json")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"brokers\":[\"string\"],\"topic\":\"string\",\"user\":\"string\",\"password\":\"pa$$word\"}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/stream");
    var request = new RestRequest(Method.PUT);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"brokers\":[\"string\"],\"topic\":\"string\",\"user\":\"string\",\"password\":\"pa$$word\"}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad Request

  • Not Authorized

  • Not Found

  • Internal Server Error

Example responses
  • {
      "brokers": [
        "broker-4.kafka.svc06.env.eventstreams.cloud.ibm.com:9093"
      ],
      "topic": "topic.overwritten",
      "user": "user.changed",
      "status": "active"
    }
  • {
      "code": "EINVAL",
      "details": {
        "message": "\"topic\" is required",
        "key": "topic"
      }
    }
  • {
      "code": "NotAuthorized",
      "error": "Missing Credentials"
    }
  • {
      "code": "NotFound",
      "error": "Streaming configuration does not exist"
    }
  • {
      "code": "ServerError",
      "error": "Database operation failed to get stream configuration."
    }

Create Stream Configuration

Use this method to create a streaming configuration.

POST /v1/config/stream

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Auditing

Calling this method generates the following auditing events.

  • logdnaat.streaming-configuration.validate

  • logdnaat.account-streaming-setting.configure

Request

Custom Headers

  • Allowable values: [*/*,application/json]

Request parameters

  • curl --request POST   --url https://api.us-south.logging.cloud.ibm.com/v1/config/stream   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --data '{"brokers":["string"],"topic":"string","user":"string","password":"pa$$word"}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"brokers\":[\"string\"],\"topic\":\"string\",\"user\":\"string\",\"password\":\"pa$$word\"}"
    
    headers = {
        'content-type': "application/json",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("POST", "/v1/config/stream", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/stream"
    
    	payload := strings.NewReader("{\"brokers\":[\"string\"],\"topic\":\"string\",\"user\":\"string\",\"password\":\"pa$$word\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "POST",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/stream",
      "headers": {
        "content-type": "application/json",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({brokers: ['string'], topic: 'string', user: 'string', password: 'pa$$word'}));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = [
      "brokers": ["string"],
      "topic": "string",
      "user": "string",
      "password": "pa$$word"
    ] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/stream")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "POST"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/stream")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"brokers\":[\"string\"],\"topic\":\"string\",\"user\":\"string\",\"password\":\"pa$$word\"}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.post("https://api.us-south.logging.cloud.ibm.com/v1/config/stream")
      .header("content-type", "application/json")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"brokers\":[\"string\"],\"topic\":\"string\",\"user\":\"string\",\"password\":\"pa$$word\"}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/stream");
    var request = new RestRequest(Method.POST);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"brokers\":[\"string\"],\"topic\":\"string\",\"user\":\"string\",\"password\":\"pa$$word\"}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad Request

  • Not Authorized

  • Conflict

  • Internal Server Error

Example responses
  • {
      "brokers": [
        "broker-1.kafka.svc00.env.eventstreams.cloud.ibm.com:9093"
      ],
      "topic": "topic",
      "user": "token",
      "status": "active"
    }
  • {
      "code": "EINVAL",
      "details": {
        "message": "\"brokers[1]\" is not allowed to be empty",
        "key": "brokers[1]"
      }
    }
  • {
      "code": "NotAuthorized",
      "error": "Missing Credentials"
    }
  • {
      "code": "Conflict",
      "error": "Streaming is already configured for this account"
    }
  • {
      "code": "ServerError",
      "error": "Database operation failed to get stream configuration."
    }

Delete Stream Configuration

Use this method to delete the stream config.

DELETE /v1/config/stream

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Auditing

Calling this method generates the following auditing event.

  • logdnaat.streaming-configuration.deactivate

Request

Custom Headers

  • Allowable values: [*/*,application/json]

  • curl --request DELETE   --url https://api.us-south.logging.cloud.ibm.com/v1/config/stream   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("DELETE", "/v1/config/stream", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/stream"
    
    	req, _ := http.NewRequest("DELETE", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "DELETE",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/stream",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/stream")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "DELETE"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/stream")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Delete.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.delete("https://api.us-south.logging.cloud.ibm.com/v1/config/stream")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/stream");
    var request = new RestRequest(Method.DELETE);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Not Authorized

  • Not Found

  • Internal Server Error

Example responses
  • {
      "deleted": true
    }
  • {
      "code": "NotAuthorized",
      "error": "Missing Credentials"
    }
  • {
      "code": "NotFound",
      "error": "Streaming configuration not found"
    }
  • {
      "code": "ServerError",
      "error": "Database operation failed to get stream configuration."
    }

List Stream Exclusions

Use this method to list existing stream exclusions

GET /v1/config/stream/exclusions

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

No Request Parameters

This method does not accept any request parameters.

  • curl --request GET   --url https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/config/stream/exclusions", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/stream/exclusions",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Forbidden

No Sample Response

This method does not specify any sample responses.

Create Stream Exclusion

Use this method to create a new stream exclusion rule.

POST /v1/config/stream/exclusions

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Auditing

Calling this method generates the following auditing event, depending on any listed conditions.

  • logdnaat.exclusion-rule.create

    Create Streaming Exclusion

Request

Request parameters

  • curl --request POST   --url https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --data '{"hosts":["string"],"apps":["string"],"title":"string","active":false,"indexonly":true,"query":"string"}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}"
    
    headers = {
        'content-type': "application/json",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("POST", "/v1/config/stream/exclusions", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions"
    
    	payload := strings.NewReader("{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "POST",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/stream/exclusions",
      "headers": {
        "content-type": "application/json",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      hosts: ['string'],
      apps: ['string'],
      title: 'string',
      active: false,
      indexonly: true,
      query: 'string'
    }));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = [
      "hosts": ["string"],
      "apps": ["string"],
      "title": "string",
      "active": false,
      "indexonly": true,
      "query": "string"
    ] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "POST"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.post("https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions")
      .header("content-type", "application/json")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions");
    var request = new RestRequest(Method.POST);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Forbidden

No Sample Response

This method does not specify any sample responses.

Delete Stream Exclusion

Use this method to delete an existing stream exclusion

DELETE /v1/config/stream/exclusions/{id}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Auditing

Calling this method generates the following auditing event, depending on any listed conditions.

  • logdnaat.exclusion-rule.delete

    Delete Streaming Exclusion

Request

Path Parameters

  • curl --request DELETE   --url https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions/%7Bid%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("DELETE", "/v1/config/stream/exclusions/%7Bid%7D", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions/%7Bid%7D"
    
    	req, _ := http.NewRequest("DELETE", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "DELETE",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/stream/exclusions/%7Bid%7D",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions/%7Bid%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "DELETE"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions/%7Bid%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Delete.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.delete("https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions/%7Bid%7D")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions/%7Bid%7D");
    var request = new RestRequest(Method.DELETE);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Forbidden

  • Not Found

No Sample Response

This method does not specify any sample responses.

Update Stream Exclusion

Use this method to update an existing stream exclusion rule.

PATCH /v1/config/stream/exclusions/{id}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Auditing

Calling this method generates the following auditing event, depending on any listed conditions.

  • logdnaat.exclusion-rule.update

    Update Streaming Exclusion

Request

Path Parameters

Request parameters

  • curl --request PATCH   --url https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions/%7Bid%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --data '{"hosts":["string"],"apps":["string"],"title":"string","active":false,"indexonly":true,"query":"string"}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}"
    
    headers = {
        'content-type': "application/json",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("PATCH", "/v1/config/stream/exclusions/%7Bid%7D", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions/%7Bid%7D"
    
    	payload := strings.NewReader("{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}")
    
    	req, _ := http.NewRequest("PATCH", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "PATCH",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/stream/exclusions/%7Bid%7D",
      "headers": {
        "content-type": "application/json",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      hosts: ['string'],
      apps: ['string'],
      title: 'string',
      active: false,
      indexonly: true,
      query: 'string'
    }));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = [
      "hosts": ["string"],
      "apps": ["string"],
      "title": "string",
      "active": false,
      "indexonly": true,
      "query": "string"
    ] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions/%7Bid%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "PATCH"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions/%7Bid%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Patch.new(url)
    request["content-type"] = 'application/json'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.patch("https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions/%7Bid%7D")
      .header("content-type", "application/json")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions/%7Bid%7D");
    var request = new RestRequest(Method.PATCH);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Forbidden

  • Not Found

No Sample Response

This method does not specify any sample responses.

Get Stream Exclusion

Use this method to get an existing stream exclusion

GET /v1/config/stream/exclusions/{id}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

Path Parameters

  • curl --request GET   --url https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions/%7Bid%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/config/stream/exclusions/%7Bid%7D", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions/%7Bid%7D"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/stream/exclusions/%7Bid%7D",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions/%7Bid%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions/%7Bid%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions/%7Bid%7D")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/stream/exclusions/%7Bid%7D");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Forbidden

  • Not Found

No Sample Response

This method does not specify any sample responses.

List Exclusion Rules

Returns a list of exclusion rules. Note: This does not return usage quota rules.

GET /v1/config/ingestion/exclusions

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

Request

No Request Parameters

This method does not accept any request parameters.

  • curl --request GET   --url https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/config/ingestion/exclusions", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/ingestion/exclusions",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Internal Server error occured when trying to fetch exclusion rules

No Sample Response

This method does not specify any sample responses.

Create Exclusion Rule

Create a new ingestion exclusion rule to help reduce log volume

POST /v1/config/ingestion/exclusions

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

Request

Request parameters

  • curl --request POST   --url https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --data '{"hosts":["string"],"apps":["string"],"title":"string","active":false,"indexonly":true,"query":"string"}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}"
    
    headers = {
        'content-type': "application/json",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("POST", "/v1/config/ingestion/exclusions", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions"
    
    	payload := strings.NewReader("{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "POST",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/ingestion/exclusions",
      "headers": {
        "content-type": "application/json",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      hosts: ['string'],
      apps: ['string'],
      title: 'string',
      active: false,
      indexonly: true,
      query: 'string'
    }));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = [
      "hosts": ["string"],
      "apps": ["string"],
      "title": "string",
      "active": false,
      "indexonly": true,
      "query": "string"
    ] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "POST"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.post("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions")
      .header("content-type", "application/json")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions");
    var request = new RestRequest(Method.POST);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request. Query inside of exclusion rule failed to parse.

  • An internal error occured when trying to create exclusion rule.

No Sample Response

This method does not specify any sample responses.

Get Exclusion Rule

Returns an exclusion rule with the id specified.

GET /v1/config/ingestion/exclusions/{id}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

Request

Path Parameters

  • ID of an exclusion rule.

  • curl --request GET   --url https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions/%7Bid%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/config/ingestion/exclusions/%7Bid%7D", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions/%7Bid%7D"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/ingestion/exclusions/%7Bid%7D",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions/%7Bid%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions/%7Bid%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions/%7Bid%7D")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions/%7Bid%7D");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Malformed ingestion exclusion rule response payload. The exclusion rule may be stored incorrectly

  • Exclusion rule not found

  • Internal Server Error. Failed to get exclusion rule

No Sample Response

This method does not specify any sample responses.

Update Exclusion Rule

Updates an existing exclusion rule

PATCH /v1/config/ingestion/exclusions/{id}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

Request

Path Parameters

  • ID of an exclusion rule.

Request parameters

  • curl --request PATCH   --url https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions/%7Bid%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --data '{"hosts":["string"],"apps":["string"],"title":"string","active":false,"indexonly":true,"query":"string"}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}"
    
    headers = {
        'content-type': "application/json",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("PATCH", "/v1/config/ingestion/exclusions/%7Bid%7D", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions/%7Bid%7D"
    
    	payload := strings.NewReader("{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}")
    
    	req, _ := http.NewRequest("PATCH", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "PATCH",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/ingestion/exclusions/%7Bid%7D",
      "headers": {
        "content-type": "application/json",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      hosts: ['string'],
      apps: ['string'],
      title: 'string',
      active: false,
      indexonly: true,
      query: 'string'
    }));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = [
      "hosts": ["string"],
      "apps": ["string"],
      "title": "string",
      "active": false,
      "indexonly": true,
      "query": "string"
    ] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions/%7Bid%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "PATCH"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions/%7Bid%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Patch.new(url)
    request["content-type"] = 'application/json'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.patch("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions/%7Bid%7D")
      .header("content-type", "application/json")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions/%7Bid%7D");
    var request = new RestRequest(Method.PATCH);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"hosts\":[\"string\"],\"apps\":[\"string\"],\"title\":\"string\",\"active\":false,\"indexonly\":true,\"query\":\"string\"}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request. The rule is invalid. Double check rule and query syntax and try again.

  • Internal server error. The rule could not be updated at this time.

No Sample Response

This method does not specify any sample responses.

Delete Exclusion Rule

Use this method to delete an exclusion rule.

DELETE /v1/config/ingestion/exclusions/{id}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

Request

Path Parameters

  • ID of an exclusion rule.

  • curl --request DELETE   --url https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions/%7Bid%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("DELETE", "/v1/config/ingestion/exclusions/%7Bid%7D", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions/%7Bid%7D"
    
    	req, _ := http.NewRequest("DELETE", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "DELETE",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/ingestion/exclusions/%7Bid%7D",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions/%7Bid%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "DELETE"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions/%7Bid%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Delete.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.delete("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions/%7Bid%7D")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/exclusions/%7Bid%7D");
    var request = new RestRequest(Method.DELETE);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Exclusion rule not found

  • Internal Server Error. Failed to delete exclusion rule.

No Sample Response

This method does not specify any sample responses.

Get Ingestion Status

Retrieve the status of ingestion

GET /v1/config/ingestion/status

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

Request

No Request Parameters

This method does not accept any request parameters.

  • curl --request GET   --url https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/status   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/config/ingestion/status", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/status"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/ingestion/status",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/status")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/status")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/status")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/status");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Failed to fetch ingestion status

No Sample Response

This method does not specify any sample responses.

Initiate Ingestion Suspension

First step in suspending ingestion for the instance. Returns a token for use in /suspend/confirm to actually stop ingestion

POST /v1/config/ingestion/suspend

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

Request

No Request Parameters

This method does not accept any request parameters.

  • curl --request POST   --url https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/suspend   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("POST", "/v1/config/ingestion/suspend", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/suspend"
    
    	req, _ := http.NewRequest("POST", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "POST",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/ingestion/suspend",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/suspend")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "POST"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/suspend")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.post("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/suspend")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/suspend");
    var request = new RestRequest(Method.POST);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • Token to be used in /suspend/confirm

No Sample Response

This method does not specify any sample responses.

Confirm Ingestion Suspension

After /suspend is called, a token is returned for use with this route as a confirmation.

POST /v1/config/ingestion/suspend/confirm

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

Request

Request parameters

  • curl --request POST   --url https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/suspend/confirm   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --data '{"token":"03290da0-79a9-4090-9189-efb853d049ec"}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"token\":\"03290da0-79a9-4090-9189-efb853d049ec\"}"
    
    headers = {
        'content-type': "application/json",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("POST", "/v1/config/ingestion/suspend/confirm", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/suspend/confirm"
    
    	payload := strings.NewReader("{\"token\":\"03290da0-79a9-4090-9189-efb853d049ec\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "POST",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/ingestion/suspend/confirm",
      "headers": {
        "content-type": "application/json",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({token: '03290da0-79a9-4090-9189-efb853d049ec'}));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = ["token": "03290da0-79a9-4090-9189-efb853d049ec"] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/suspend/confirm")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "POST"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/suspend/confirm")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"token\":\"03290da0-79a9-4090-9189-efb853d049ec\"}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.post("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/suspend/confirm")
      .header("content-type", "application/json")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"token\":\"03290da0-79a9-4090-9189-efb853d049ec\"}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/suspend/confirm");
    var request = new RestRequest(Method.POST);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"token\":\"03290da0-79a9-4090-9189-efb853d049ec\"}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad Suspend Token

  • Failed to fetch ingestion status

No Sample Response

This method does not specify any sample responses.

Resume Ingestion

Resumes ingestion if it has been previously suspended

POST /v1/config/ingestion/resume

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

Request

No Request Parameters

This method does not accept any request parameters.

  • curl --request POST   --url https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/resume   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("POST", "/v1/config/ingestion/resume", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/resume"
    
    	req, _ := http.NewRequest("POST", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "POST",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/ingestion/resume",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/resume")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "POST"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/resume")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.post("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/resume")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/ingestion/resume");
    var request = new RestRequest(Method.POST);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Failed to fetch ingestion status

No Sample Response

This method does not specify any sample responses.

List Usage By App

Lists aggregated usage information for all apps during a time period.

GET /v1/usage/apps

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

Query Parameters

  • Start date. Set as UNIX timestamp in seconds.

  • End date. Set as UNIX timestamp in seconds.

  • Maximum amount of apps to retrieve.

  • curl --request GET   --url 'https://api.us-south.logging.cloud.ibm.com/v1/usage/apps?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE'   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/usage/apps?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/usage/apps?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/usage/apps?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/usage/apps?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/usage/apps?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/usage/apps?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/usage/apps?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Get Usage By App

Gets the aggregated usage information for an app matching the name provided as a path parameter, during a time period. Returns null when not found.

GET /v1/usage/apps/{name}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

Path Parameters

  • The name of the app from which to get the aggregated usage data

Query Parameters

  • Start date. Set as UNIX timestamp in seconds.

  • End date. Set as UNIX timestamp in seconds.

  • curl --request GET   --url 'https://api.us-south.logging.cloud.ibm.com/v1/usage/apps/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE'   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/usage/apps/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/usage/apps/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/usage/apps/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/usage/apps/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/usage/apps/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/usage/apps/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/usage/apps/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

List Usage by Tag

Lists aggregated usage information for all tags during a time period.

GET /v1/usage/tags

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

Query Parameters

  • Start date. Set as UNIX timestamp in seconds.

  • End date. Set as UNIX timestamp in seconds.

  • Maximum amount of apps to retrieve.

  • curl --request GET   --url 'https://api.us-south.logging.cloud.ibm.com/v1/usage/tags?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE'   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/usage/tags?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/usage/tags?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/usage/tags?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/usage/tags?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/usage/tags?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/usage/tags?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/usage/tags?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Get Usage by Tag

Gets the aggregated usage information for a tag matching the name provided as a path parameter, during a time period. Returns null when not found.

GET /v1/usage/tags/{name}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

Path Parameters

  • The name of the app from which to get the aggregated usage data

Query Parameters

  • Start date. Set as UNIX timestamp in seconds.

  • End date. Set as UNIX timestamp in seconds.

  • curl --request GET   --url 'https://api.us-south.logging.cloud.ibm.com/v1/usage/tags/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE'   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/usage/tags/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/usage/tags/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/usage/tags/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/usage/tags/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/usage/tags/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/usage/tags/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/usage/tags/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

List Usage by Host

Lists aggregated usage information for all hosts during a time period.

GET /v1/usage/hosts

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

Query Parameters

  • Start date. Set as UNIX timestamp in seconds.

  • End date. Set as UNIX timestamp in seconds.

  • Maximum amount of apps to retrieve.

  • curl --request GET   --url 'https://api.us-south.logging.cloud.ibm.com/v1/usage/hosts?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE'   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/usage/hosts?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/usage/hosts?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/usage/hosts?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/usage/hosts?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/usage/hosts?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/usage/hosts?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/usage/hosts?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Get Usage by Host

Gets the aggregated usage information for a host matching the name provided as a path parameter, during a time period. Returns null when not found.

GET /v1/usage/hosts/{name}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

Path Parameters

  • The name of the app from which to get the aggregated usage data

Query Parameters

  • Start date. Set as UNIX timestamp in seconds.

  • End date. Set as UNIX timestamp in seconds.

  • curl --request GET   --url 'https://api.us-south.logging.cloud.ibm.com/v1/usage/hosts/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE'   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/usage/hosts/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/usage/hosts/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/usage/hosts/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/usage/hosts/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/usage/hosts/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/usage/hosts/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/usage/hosts/%7Bname%7D?from=SOME_INTEGER_VALUE&to=SOME_INTEGER_VALUE");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Retrieve account usage totals

Get aggregated usage information for an account's data during a time period.

GET /v2/usage

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

Query Parameters

  • Start time. A date-time string as defined by RFC 3339 §5.6 ("T" is required). This date-time will be used to calculate the starting day; the exact time will not be used.

    Example: 2023-01-01T12:00:00-05:00

  • End time. A date-time string as defined by RFC 3339 §5.6 ("T" is required). This date-time will be used to calculate the ending day; the exact time will not be used.

    Example: 2023-01-01T12:00:00-05:00

  • curl --request GET   --url 'https://api.us-south.logging.cloud.ibm.com/v2/usage?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE'   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v2/usage?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v2/usage?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v2/usage?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v2/usage?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v2/usage?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v2/usage?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v2/usage?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

Example responses
  • {
      "from": "2022-12-31T23:59:59.999Z",
      "to": "2023-02-01T00:00:00.000Z",
      "results": {
        "plan_bytes": 123000
      }
    }

List Groups

Use this method to list the log groups.

GET /v1/config/groups

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.

  • logdna.dashboard.manage

Request

No Request Parameters

This method does not accept any request parameters.

  • curl --request GET   --url https://api.us-south.logging.cloud.ibm.com/v1/config/groups   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/config/groups", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/groups"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/groups",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/groups")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/groups")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/config/groups")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/groups");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Create Group

Use this method to create a log group where you can scope the data that is accessible by members in that group.

POST /v1/config/groups

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.

  • logdna.dashboard.manage

Request

Custom Headers

  • A provisioned service key for your account.

Request parameters

  • curl --request POST   --url https://api.us-south.logging.cloud.ibm.com/v1/config/groups   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --header 'servicekey: SOME_STRING_VALUE'   --data '{"name":"string","accessScopes":"string"}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"name\":\"string\",\"accessScopes\":\"string\"}"
    
    headers = {
        'content-type': "application/json",
        'servicekey': "SOME_STRING_VALUE",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("POST", "/v1/config/groups", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/groups"
    
    	payload := strings.NewReader("{\"name\":\"string\",\"accessScopes\":\"string\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("servicekey", "SOME_STRING_VALUE")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "POST",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/groups",
      "headers": {
        "content-type": "application/json",
        "servicekey": "SOME_STRING_VALUE",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({name: 'string', accessScopes: 'string'}));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "servicekey": "SOME_STRING_VALUE",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = [
      "name": "string",
      "accessScopes": "string"
    ] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/groups")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "POST"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/groups")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["servicekey"] = 'SOME_STRING_VALUE'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"name\":\"string\",\"accessScopes\":\"string\"}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.post("https://api.us-south.logging.cloud.ibm.com/v1/config/groups")
      .header("content-type", "application/json")
      .header("servicekey", "SOME_STRING_VALUE")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"name\":\"string\",\"accessScopes\":\"string\"}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/groups");
    var request = new RestRequest(Method.POST);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("servicekey", "SOME_STRING_VALUE");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"name\":\"string\",\"accessScopes\":\"string\"}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Get Group

Use this method to get information on a group.

GET /v1/config/groups/{groupId}

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.

  • logdna.dashboard.manage

Request

Path Parameters

  • ID of a group.

  • curl --request GET   --url https://api.us-south.logging.cloud.ibm.com/v1/config/groups/%7BgroupId%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/config/groups/%7BgroupId%7D", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/groups/%7BgroupId%7D"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/groups/%7BgroupId%7D",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/groups/%7BgroupId%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/groups/%7BgroupId%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/config/groups/%7BgroupId%7D")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/groups/%7BgroupId%7D");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Delete Group

Use this method to list the log groups.

DELETE /v1/config/groups/{groupId}

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.

  • logdna.dashboard.manage

Request

Custom Headers

  • A provisioned service key for your account.

Path Parameters

  • ID of a group.

  • curl --request DELETE   --url https://api.us-south.logging.cloud.ibm.com/v1/config/groups/%7BgroupId%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'servicekey: SOME_STRING_VALUE'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = {
        'servicekey': "SOME_STRING_VALUE",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("DELETE", "/v1/config/groups/%7BgroupId%7D", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/groups/%7BgroupId%7D"
    
    	req, _ := http.NewRequest("DELETE", url, nil)
    
    	req.Header.Add("servicekey", "SOME_STRING_VALUE")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "DELETE",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/groups/%7BgroupId%7D",
      "headers": {
        "servicekey": "SOME_STRING_VALUE",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = [
      "servicekey": "SOME_STRING_VALUE",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/groups/%7BgroupId%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "DELETE"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/groups/%7BgroupId%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Delete.new(url)
    request["servicekey"] = 'SOME_STRING_VALUE'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.delete("https://api.us-south.logging.cloud.ibm.com/v1/config/groups/%7BgroupId%7D")
      .header("servicekey", "SOME_STRING_VALUE")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/groups/%7BgroupId%7D");
    var request = new RestRequest(Method.DELETE);
    request.AddHeader("servicekey", "SOME_STRING_VALUE");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Update Group

Use this method to modify a log group. You can change the name of the group and the access scope that defines the data that is accessible by members in that group.

PATCH /v1/config/groups/{groupId}

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.

  • logdna.dashboard.manage

Request

Custom Headers

  • A provisioned service key for your account.

Path Parameters

  • ID of a group.

Request parameters

  • curl --request PATCH   --url https://api.us-south.logging.cloud.ibm.com/v1/config/groups/%7BgroupId%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --header 'servicekey: SOME_STRING_VALUE'   --data '{"name":"string","accessScopes":"string"}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"name\":\"string\",\"accessScopes\":\"string\"}"
    
    headers = {
        'content-type': "application/json",
        'servicekey': "SOME_STRING_VALUE",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("PATCH", "/v1/config/groups/%7BgroupId%7D", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/groups/%7BgroupId%7D"
    
    	payload := strings.NewReader("{\"name\":\"string\",\"accessScopes\":\"string\"}")
    
    	req, _ := http.NewRequest("PATCH", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("servicekey", "SOME_STRING_VALUE")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "PATCH",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/groups/%7BgroupId%7D",
      "headers": {
        "content-type": "application/json",
        "servicekey": "SOME_STRING_VALUE",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({name: 'string', accessScopes: 'string'}));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "servicekey": "SOME_STRING_VALUE",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = [
      "name": "string",
      "accessScopes": "string"
    ] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/groups/%7BgroupId%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "PATCH"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/groups/%7BgroupId%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Patch.new(url)
    request["content-type"] = 'application/json'
    request["servicekey"] = 'SOME_STRING_VALUE'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"name\":\"string\",\"accessScopes\":\"string\"}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.patch("https://api.us-south.logging.cloud.ibm.com/v1/config/groups/%7BgroupId%7D")
      .header("content-type", "application/json")
      .header("servicekey", "SOME_STRING_VALUE")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"name\":\"string\",\"accessScopes\":\"string\"}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/groups/%7BgroupId%7D");
    var request = new RestRequest(Method.PATCH);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("servicekey", "SOME_STRING_VALUE");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"name\":\"string\",\"accessScopes\":\"string\"}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

No Sample Response

This method does not specify any sample responses.

Retrieve a list of all the keys

Retrieve a list of all the keys for an account. Supported key types include ingestion and service. Use the type parameter to filter which type of keys to retrieve.

GET /v1/config/keys

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

Request

Query Parameters

  • The type of key to retrieve. Defaults to "all"

    Allowable values: [ingestion,service,all]

  • curl --request GET   --url 'https://api.us-south.logging.cloud.ibm.com/v1/config/keys?type=SOME_STRING_VALUE'   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/config/keys?type=SOME_STRING_VALUE", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/keys?type=SOME_STRING_VALUE"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/keys?type=SOME_STRING_VALUE",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/keys?type=SOME_STRING_VALUE")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/keys?type=SOME_STRING_VALUE")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/config/keys?type=SOME_STRING_VALUE")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/keys?type=SOME_STRING_VALUE");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • A list of keys is returned on success.

  • The supplied request is invalid or malformed.

Example responses
  • {
      "error": "\"type\" must be one of [ingestion, service, all]",
      "code": "BadRequest",
      "status": "error"
    }

Create a new key

Create a new key of the type specified by the type parameter. If a name is not supplied, one will be auto generated.

POST /v1/config/keys

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

Auditing

Calling this method generates the following auditing events, depending on any listed conditions.

  • logdnaat.ingestion-key.create

    Create Key (when type is ingestion)

  • logdnaat.service-key.create

    Create Key (when type is service)

Request

Query Parameters

  • The type of key to be created

    Allowable values: [ingestion,service,all]

Modifiable fields can be set in the request body.

  • curl --request POST   --url 'https://api.us-south.logging.cloud.ibm.com/v1/config/keys?type=SOME_STRING_VALUE'   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --data '{"name":"servergroup_0_ingestion"}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"name\":\"servergroup_0_ingestion\"}"
    
    headers = {
        'content-type': "application/json",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("POST", "/v1/config/keys?type=SOME_STRING_VALUE", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/keys?type=SOME_STRING_VALUE"
    
    	payload := strings.NewReader("{\"name\":\"servergroup_0_ingestion\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "POST",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/keys?type=SOME_STRING_VALUE",
      "headers": {
        "content-type": "application/json",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({name: 'servergroup_0_ingestion'}));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = ["name": "servergroup_0_ingestion"] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/keys?type=SOME_STRING_VALUE")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "POST"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/keys?type=SOME_STRING_VALUE")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Post.new(url)
    request["content-type"] = 'application/json'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"name\":\"servergroup_0_ingestion\"}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.post("https://api.us-south.logging.cloud.ibm.com/v1/config/keys?type=SOME_STRING_VALUE")
      .header("content-type", "application/json")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"name\":\"servergroup_0_ingestion\"}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/keys?type=SOME_STRING_VALUE");
    var request = new RestRequest(Method.POST);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"name\":\"servergroup_0_ingestion\"}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • A new key was created successfully! The entire key resource is returned.

  • The supplied request is invalid or malformed.

Example responses
  • {
      "error": "\"type\" is required",
      "code": "BadRequest",
      "status": "error"
    }

Retrieve a specific key

Retrieves a specific key by its id.

GET /v1/config/keys/{id}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

Request

Path Parameters

  • The id of the key to retrieve

    Example: 629e3f7e62295be60488fb26

  • curl --request GET   --url https://api.us-south.logging.cloud.ibm.com/v1/config/keys/%7Bid%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/config/keys/%7Bid%7D", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/keys/%7Bid%7D"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/keys/%7Bid%7D",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/keys/%7Bid%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/keys/%7Bid%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/config/keys/%7Bid%7D")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/keys/%7Bid%7D");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • The key with the supplied id was found, the entire resource is returned.

  • The specified key was not found.

Example responses
  • {
      "error": "Key with id 629eb5369e5b231f51d3830f was not found",
      "code": "NotFound",
      "status": "error"
    }

Delete a specific key

Delete a specific key by its id.

DELETE /v1/config/keys/{id}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

Auditing

Calling this method generates the following auditing events, depending on any listed conditions.

  • logdnaat.ingestion-key.create

    Create Key (when type is ingestion)

  • logdnaat.service-key.create

    Create Key (when type is service)

Request

Path Parameters

  • The id of the key to delete

    Example: 629e3f7e62295be60488fb26

  • curl --request DELETE   --url https://api.us-south.logging.cloud.ibm.com/v1/config/keys/%7Bid%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("DELETE", "/v1/config/keys/%7Bid%7D", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/keys/%7Bid%7D"
    
    	req, _ := http.NewRequest("DELETE", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "DELETE",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/keys/%7Bid%7D",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/keys/%7Bid%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "DELETE"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/keys/%7Bid%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Delete.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.delete("https://api.us-south.logging.cloud.ibm.com/v1/config/keys/%7Bid%7D")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/keys/%7Bid%7D");
    var request = new RestRequest(Method.DELETE);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • The key was deleted successfully, a simple status is returned.

  • The specified key was not found.

Example responses
  • {
      "error": "Key with id 629eb5369e5b231f51d3830f was not found",
      "code": "NotFound",
      "status": "error"
    }

Update one or more fields of a key resource

Updates all of the fields described in the request body of the specified key. Fields left out of the body will remain unaffected.

PUT /v1/config/keys/{id}

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

Request

Path Parameters

  • The id of the key to update

    Example: 629e3f7e62295be60488fb26

  • curl --request PUT   --url https://api.us-south.logging.cloud.ibm.com/v1/config/keys/%7Bid%7D   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --data '{"name":"servergroup_0_ingestion"}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"name\":\"servergroup_0_ingestion\"}"
    
    headers = {
        'content-type': "application/json",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("PUT", "/v1/config/keys/%7Bid%7D", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/keys/%7Bid%7D"
    
    	payload := strings.NewReader("{\"name\":\"servergroup_0_ingestion\"}")
    
    	req, _ := http.NewRequest("PUT", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "PUT",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/keys/%7Bid%7D",
      "headers": {
        "content-type": "application/json",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({name: 'servergroup_0_ingestion'}));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = ["name": "servergroup_0_ingestion"] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/keys/%7Bid%7D")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "PUT"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/keys/%7Bid%7D")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Put.new(url)
    request["content-type"] = 'application/json'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"name\":\"servergroup_0_ingestion\"}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.put("https://api.us-south.logging.cloud.ibm.com/v1/config/keys/%7Bid%7D")
      .header("content-type", "application/json")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"name\":\"servergroup_0_ingestion\"}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/keys/%7Bid%7D");
    var request = new RestRequest(Method.PUT);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"name\":\"servergroup_0_ingestion\"}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • The update was successful; the key resource is returned with updated fields.

  • The supplied request is invalid or malformed.

  • The specified key was not found.

Example responses
  • {
      "error": "\"name\" length must be less than or equal to 30 characters long",
      "code": "BadRequest",
      "status": "error"
    }
  • {
      "error": "Key with id 629eb5369e5b231f51d3830f was not found",
      "code": "NotFound",
      "status": "error"
    }

Get Index Rate Alert

Gets the configuration for an Index Rate Alert

GET /v1/config/index-rate

Request

No Request Parameters

This method does not accept any request parameters.

  • curl --request GET   --url https://api.us-south.logging.cloud.ibm.com/v1/config/index-rate   --header 'Authorization: Basic REPLACE_BASIC_AUTH'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" }
    
    conn.request("GET", "/v1/config/index-rate", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/index-rate"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "GET",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/index-rate",
      "headers": {
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import Foundation
    
    let headers = ["Authorization": "Basic REPLACE_BASIC_AUTH"]
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/index-rate")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/index-rate")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.get("https://api.us-south.logging.cloud.ibm.com/v1/config/index-rate")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/index-rate");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

  • Internal Server error occurred when trying to fetch index rate alerts

No Sample Response

This method does not specify any sample responses.

Update Index Rate Alert

Use this method to update an index rate alert. You can change the alert's configuration details.

PUT /v1/config/index-rate

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.

You need one of the following IAM permissions:

  • logdna.dashboard.manage

  • logdna.dashboard.member

Request

Request parameters

  • curl --request PUT   --url https://api.us-south.logging.cloud.ibm.com/v1/config/index-rate   --header 'Authorization: Basic REPLACE_BASIC_AUTH'   --header 'content-type: application/json'   --data '{"max_lines":0,"max_z_score":0,"threshold_alert":"separate","frequency":"hourly","channels":{"email":["string"],"pagerduty":["string"],"slack":["string"],"webhook":[{"url":"string","method":"POST","headers":{"timestamp":"string"},"bodyTemplate":"string"}]},"enabled":true}'
  • import http.client
    
    conn = http.client.HTTPSConnection("api.us-south.logging.cloud.ibm.com")
    
    payload = "{\"max_lines\":0,\"max_z_score\":0,\"threshold_alert\":\"separate\",\"frequency\":\"hourly\",\"channels\":{\"email\":[\"string\"],\"pagerduty\":[\"string\"],\"slack\":[\"string\"],\"webhook\":[{\"url\":\"string\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":\"string\"}]},\"enabled\":true}"
    
    headers = {
        'content-type': "application/json",
        'Authorization': "Basic REPLACE_BASIC_AUTH"
        }
    
    conn.request("PUT", "/v1/config/index-rate", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://api.us-south.logging.cloud.ibm.com/v1/config/index-rate"
    
    	payload := strings.NewReader("{\"max_lines\":0,\"max_z_score\":0,\"threshold_alert\":\"separate\",\"frequency\":\"hourly\",\"channels\":{\"email\":[\"string\"],\"pagerduty\":[\"string\"],\"slack\":[\"string\"],\"webhook\":[{\"url\":\"string\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":\"string\"}]},\"enabled\":true}")
    
    	req, _ := http.NewRequest("PUT", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("Authorization", "Basic REPLACE_BASIC_AUTH")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • const http = require("https");
    
    const options = {
      "method": "PUT",
      "hostname": "api.us-south.logging.cloud.ibm.com",
      "port": null,
      "path": "/v1/config/index-rate",
      "headers": {
        "content-type": "application/json",
        "Authorization": "Basic REPLACE_BASIC_AUTH"
      }
    };
    
    const req = http.request(options, function (res) {
      const chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        const body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      max_lines: 0,
      max_z_score: 0,
      threshold_alert: 'separate',
      frequency: 'hourly',
      channels: {
        email: ['string'],
        pagerduty: ['string'],
        slack: ['string'],
        webhook: [
          {
            url: 'string',
            method: 'POST',
            headers: {timestamp: 'string'},
            bodyTemplate: 'string'
          }
        ]
      },
      enabled: true
    }));
    req.end();
  • import Foundation
    
    let headers = [
      "content-type": "application/json",
      "Authorization": "Basic REPLACE_BASIC_AUTH"
    ]
    let parameters = [
      "max_lines": 0,
      "max_z_score": 0,
      "threshold_alert": "separate",
      "frequency": "hourly",
      "channels": [
        "email": ["string"],
        "pagerduty": ["string"],
        "slack": ["string"],
        "webhook": [
          [
            "url": "string",
            "method": "POST",
            "headers": ["timestamp": "string"],
            "bodyTemplate": "string"
          ]
        ]
      ],
      "enabled": true
    ] as [String : Any]
    
    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
    
    let request = NSMutableURLRequest(url: NSURL(string: "https://api.us-south.logging.cloud.ibm.com/v1/config/index-rate")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "PUT"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data
    
    let session = URLSession.shared
    let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
      if (error != nil) {
        print(error)
      } else {
        let httpResponse = response as? HTTPURLResponse
        print(httpResponse)
      }
    })
    
    dataTask.resume()
  • require 'uri'
    require 'net/http'
    require 'openssl'
    
    url = URI("https://api.us-south.logging.cloud.ibm.com/v1/config/index-rate")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Put.new(url)
    request["content-type"] = 'application/json'
    request["Authorization"] = 'Basic REPLACE_BASIC_AUTH'
    request.body = "{\"max_lines\":0,\"max_z_score\":0,\"threshold_alert\":\"separate\",\"frequency\":\"hourly\",\"channels\":{\"email\":[\"string\"],\"pagerduty\":[\"string\"],\"slack\":[\"string\"],\"webhook\":[{\"url\":\"string\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":\"string\"}]},\"enabled\":true}"
    
    response = http.request(request)
    puts response.read_body
  • HttpResponse<String> response = Unirest.put("https://api.us-south.logging.cloud.ibm.com/v1/config/index-rate")
      .header("content-type", "application/json")
      .header("Authorization", "Basic REPLACE_BASIC_AUTH")
      .body("{\"max_lines\":0,\"max_z_score\":0,\"threshold_alert\":\"separate\",\"frequency\":\"hourly\",\"channels\":{\"email\":[\"string\"],\"pagerduty\":[\"string\"],\"slack\":[\"string\"],\"webhook\":[{\"url\":\"string\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":\"string\"}]},\"enabled\":true}")
      .asString();
  • var client = new RestClient("https://api.us-south.logging.cloud.ibm.com/v1/config/index-rate");
    var request = new RestRequest(Method.PUT);
    request.AddHeader("content-type", "application/json");
    request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH");
    request.AddParameter("application/json", "{\"max_lines\":0,\"max_z_score\":0,\"threshold_alert\":\"separate\",\"frequency\":\"hourly\",\"channels\":{\"email\":[\"string\"],\"pagerduty\":[\"string\"],\"slack\":[\"string\"],\"webhook\":[{\"url\":\"string\",\"method\":\"POST\",\"headers\":{\"timestamp\":\"string\"},\"bodyTemplate\":\"string\"}]},\"enabled\":true}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);

Response

Status Code

  • OK

  • Bad request

  • Internal Server error occurred when trying to fetch index rate alerts

No Sample Response

This method does not specify any sample responses.

id=curlclassName=tab-item-selected