Introduction
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.
IBM® Log Analysis offers log management capabilities to your IBM Cloud architecture such as log collection and log search. For details about using IBM Log Analysis, see the IBM Cloud docs.
You can use the REST API to manage views and alerts, export or stream data, and send log data.
For REPLACE_BASIC_AUTH
specify your service key.
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 logging 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 Log Analysis 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 logdna 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 Log Analysis API is in the format: https://api.{Region}.logging.cloud.ibm.com
For example, the API endpoint for Dallas is: https://api.us-south.logging.cloud.ibm.com
Example request to a Dallas endpoint:
curl -X GET ttps://api.us-south.logging.cloud.ibm.com/v1/config/presetalert -H "Authorization: $AUTH_TOKEN" -H "IBMInstanceID: $GUID" -H "SysdigTeamID: $TEAM_ID" -H "content-type: application/json"
Example request to a Dallas endpoint
#!/usr/bin/env python3
import os
import logging
from logdna 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 either aningestion key
to send logs or aservice key
to configure the service.Ingestion API key authentication
: You can use an ingestion key in the header.Service API key authentication
: You can use a service key in the header.IAM authentication
: You can use a beareraccess_token
that you obtain from the IAM Identity Services API.
servicekeyAuth
This key is used for all apis with the exception of ingest. You can obtain it following these instructions and placing the key in the header of your call.
- 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.
- 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:
- 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 Log Analysis activity, see Auditing the events for IBM Log Analysis.
Error handling
The IBM Log Analysis 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
Request
No 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
Set to
ibm
to archive to IBM Cloud Object StorageName of the bucket.
Private endpoint associated with the bucket.
API key that is needed to authenticate with the Cloud Object Storage service.
CRN of the Cloud Object Storage instance ID where the bucket is available.
Account name
Account key
Project ID
Space
Access key
Secret key
Auth URL
Expires
Username
Password provided in credentials for authorization
Tenant name
Status Code
OK
Archiving configuration not found
No Sample Response
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
Request
Request parameters
Set to
ibm
to archive to IBM Cloud Object StorageName of the bucket.
Private endpoint associated with the bucket.
API key that is needed to authenticate with the Cloud Object Storage service.
CRN of the Cloud Object Storage instance ID where the bucket is available.
Account name
Account key
Project ID
Space
Access key
Secret key
Auth URL
Expires
Username
Password provided in credentials for authorization
Tenant name
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
Set to
ibm
to archive to IBM Cloud Object StorageName of the bucket.
Private endpoint associated with the bucket.
API key that is needed to authenticate with the Cloud Object Storage service.
CRN of the Cloud Object Storage instance ID where the bucket is available.
Account name
Account key
Project ID
Space
Access key
Secret key
Auth URL
Expires
Username
Password provided in credentials for authorization
Tenant name
Status Code
OK
Bad request
An archiving configuration already exists. Cannot create a new one
No Sample Response
Update Archive Configuration
Use this method to update an existing archiving configuration.
PUT /v1/config/archiving
Request
Request parameters
Set to
ibm
to archive to IBM Cloud Object StorageName of the bucket.
Private endpoint associated with the bucket.
API key that is needed to authenticate with the Cloud Object Storage service.
CRN of the Cloud Object Storage instance ID where the bucket is available.
Account name
Account key
Project ID
Space
Access key
Secret key
Auth URL
Expires
Username
Password provided in credentials for authorization
Tenant name
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
Set to
ibm
to archive to IBM Cloud Object StorageName of the bucket.
Private endpoint associated with the bucket.
API key that is needed to authenticate with the Cloud Object Storage service.
CRN of the Cloud Object Storage instance ID where the bucket is available.
Account name
Account key
Project ID
Space
Access key
Secret key
Auth URL
Expires
Username
Password provided in credentials for authorization
Tenant name
Status Code
OK
Bad request
Existing archiving integration not found
No Sample Response
Delete Archive Configuration
Use this method to delete the archiving configuration.
DELETE /v1/config/archiving
Request
No 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);
Request
No 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);
Request
Request parameters
Name of a view.
Search query.
Comma-separated list of hosts.
Comma-separated list of applications.
Comma-separated list of log levels.
Tags that are used to dynamically group hosts.
Logical name that you can use to group views.
ID of a preset alert.
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);
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);
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}
Request
Path Parameters
ID of a view.
Request parameters
Name of a view.
Search query.
Comma-separated list of hosts.
Comma-separated list of applications.
Comma-separated list of log levels.
Tags that are used to dynamically group hosts.
Logical name that you can use to group views.
ID of a preset alert.
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);
Delete View
Use this method to delete a view and any attached alerts.
DELETE /v1/config/view/{viewId}
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);
Request
No 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);
Request
Request parameters
Name of a view.
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);
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);
Request
Path Parameters
ID of a preset alert.
Request parameters
Name of a view.
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);
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);
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);
Request
Path Parameters
Category type. Must be [views, boards, screens]
Request parameters
Name of a view.
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);
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);
Request
Path Parameters
Category type. Must be [views, boards, screens]
ID of category.
Request parameters
Name of a view.
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);
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);
Export log lines
Use this method to export logs in JSON format from a logging instance.
GET /v1/export
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);
Export log lines
Use this method to export logs in JSON format from a logging instance.
GET /v2/export
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);
Send Log Lines
Use this method to send logs to a logging instance.
Authentication
You can find instructions on authentication here. Ingestion is
similar to the other APIs, but instead of servicekey
you will use apikey
if
you are using the header style authentication.
Metadata
Meta is a field reserved for custom information associated with a log line. To add
metadata to an API call, specify the meta
field under the lines object. Metadata can be
viewed inside that line's context
WARNING: If inconsistent value types are
used, that line's metadata, will not be parsed. For example, if a line is passed
with a meta object, such as meta.myfield
of type String, any subsequent lines
with meta.myfield
must have a String as the value type for meta.myfield
.
Please be aware of service limits on this endpoint
POST /logs/ingest
Request
Query Parameters
Host name of the source.
The network mac address of the host computer.
Possible values: Value must match regular expression
^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$
Example:
01:02:03:04:ab:cd
The local IP address of the host computer.
Example:
10.0.1.111
The source UNIX timestamp in milliseconds at the time of the request. Used to calculate time drift.
Tags that are used to dynamically group hosts.
You can send multiple log lines in a request.
- lines
Text of the log line.
UNIX timestamp, including milliseconds, when the log entry was recorded.
Name of the application that generates the log line.
Set a value for the level. For example, sample values for this parameter are INFO, WARNING, ERROR.
This field is reserved for custom information that is associated with a log line. To add metadata to an API call, specify the meta field under the lines object. Metadata can be viewed inside that line's context.
curl --request POST --url 'https://logs.us-south.logging.cloud.ibm.com/logs/ingest?hostname=SOME_STRING_VALUE&mac=01%3A02%3A03%3A04%3Aab%3Acd&ip=10.0.1.111&now=SOME_STRING_VALUE&tags=SOME_STRING_VALUE' --header 'Authorization: Basic REPLACE_BASIC_AUTH' --header 'content-type: application/json' --data '{"lines":[{"timestamp":"string","line":"string","app":"string","level":"string","meta":"string"}]}'
import http.client conn = http.client.HTTPSConnection("logs.us-south.logging.cloud.ibm.com") payload = "{\"lines\":[{\"timestamp\":\"string\",\"line\":\"string\",\"app\":\"string\",\"level\":\"string\",\"meta\":\"string\"}]}" headers = { 'content-type': "application/json", 'Authorization': "Basic REPLACE_BASIC_AUTH" } conn.request("POST", "/logs/ingest?hostname=SOME_STRING_VALUE&mac=01%3A02%3A03%3A04%3Aab%3Acd&ip=10.0.1.111&now=SOME_STRING_VALUE&tags=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://logs.us-south.logging.cloud.ibm.com/logs/ingest?hostname=SOME_STRING_VALUE&mac=01%3A02%3A03%3A04%3Aab%3Acd&ip=10.0.1.111&now=SOME_STRING_VALUE&tags=SOME_STRING_VALUE" payload := strings.NewReader("{\"lines\":[{\"timestamp\":\"string\",\"line\":\"string\",\"app\":\"string\",\"level\":\"string\",\"meta\":\"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": "logs.us-south.logging.cloud.ibm.com", "port": null, "path": "/logs/ingest?hostname=SOME_STRING_VALUE&mac=01%3A02%3A03%3A04%3Aab%3Acd&ip=10.0.1.111&now=SOME_STRING_VALUE&tags=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({ lines: [ { timestamp: 'string', line: 'string', app: 'string', level: 'string', meta: 'string' } ] })); req.end();
import Foundation let headers = [ "content-type": "application/json", "Authorization": "Basic REPLACE_BASIC_AUTH" ] let parameters = ["lines": [ [ "timestamp": "string", "line": "string", "app": "string", "level": "string", "meta": "string" ] ]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://logs.us-south.logging.cloud.ibm.com/logs/ingest?hostname=SOME_STRING_VALUE&mac=01%3A02%3A03%3A04%3Aab%3Acd&ip=10.0.1.111&now=SOME_STRING_VALUE&tags=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://logs.us-south.logging.cloud.ibm.com/logs/ingest?hostname=SOME_STRING_VALUE&mac=01%3A02%3A03%3A04%3Aab%3Acd&ip=10.0.1.111&now=SOME_STRING_VALUE&tags=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 = "{\"lines\":[{\"timestamp\":\"string\",\"line\":\"string\",\"app\":\"string\",\"level\":\"string\",\"meta\":\"string\"}]}" response = http.request(request) puts response.read_body
HttpResponse<String> response = Unirest.post("https://logs.us-south.logging.cloud.ibm.com/logs/ingest?hostname=SOME_STRING_VALUE&mac=01%3A02%3A03%3A04%3Aab%3Acd&ip=10.0.1.111&now=SOME_STRING_VALUE&tags=SOME_STRING_VALUE") .header("content-type", "application/json") .header("Authorization", "Basic REPLACE_BASIC_AUTH") .body("{\"lines\":[{\"timestamp\":\"string\",\"line\":\"string\",\"app\":\"string\",\"level\":\"string\",\"meta\":\"string\"}]}") .asString();
var client = new RestClient("https://logs.us-south.logging.cloud.ibm.com/logs/ingest?hostname=SOME_STRING_VALUE&mac=01%3A02%3A03%3A04%3Aab%3Acd&ip=10.0.1.111&now=SOME_STRING_VALUE&tags=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", "{\"lines\":[{\"timestamp\":\"string\",\"line\":\"string\",\"app\":\"string\",\"level\":\"string\",\"meta\":\"string\"}]}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
Get Stream Configuration
Use this method to get an existing streaming configuration.
GET /v1/config/stream
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
List of URLs referencing Kafka broker connections via SASL_SSL
Possible values: number of items ≥ 1, length ≥ 1
Name of the relevant Kafka topic category storing log records
Possible values: length ≥ 1
Username in provided credentials to authorize access to brokers
Possible values: length ≥ 1
Enumerated (binary) string representing whether or not the stream config is active
Possible values: [
active
,inactive
]
Status Code
OK
Not Authorized
Forbidden
Not Found
Internal Server Error
{ "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
Request
Custom Headers
Allowable values: [
*/*
,application/json
]
Request parameters
List of URLs referencing Kafka broker connections via SASL_SSL
Possible values: number of items ≥ 1, length ≥ 1
Name of the relevant Kafka topic category storing log records
Possible values: length ≥ 1
Username in provided credentials to authorize access to brokers
Possible values: length ≥ 1
Password in provided credentials to authorize access to brokers
Possible values: length ≥ 1
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
List of URLs referencing Kafka broker connections via SASL_SSL
Possible values: number of items ≥ 1, length ≥ 1
Name of the relevant Kafka topic category storing log records
Possible values: length ≥ 1
Username in provided credentials to authorize access to brokers
Possible values: length ≥ 1
Enumerated (binary) string representing whether or not the stream config is active
Possible values: [
active
,inactive
]
Status Code
OK
Bad Request
Not Authorized
Not Found
Internal Server Error
{ "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
Request
Custom Headers
Allowable values: [
*/*
,application/json
]
Request parameters
List of URLs referencing Kafka broker connections via SASL_SSL
Possible values: number of items ≥ 1, length ≥ 1
Name of the relevant Kafka topic category storing log records
Possible values: length ≥ 1
Username in provided credentials to authorize access to brokers
Possible values: length ≥ 1
Password in provided credentials to authorize access to brokers
Possible values: length ≥ 1
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
List of URLs referencing Kafka broker connections via SASL_SSL
Possible values: number of items ≥ 1, length ≥ 1
Name of the relevant Kafka topic category storing log records
Possible values: length ≥ 1
Username in provided credentials to authorize access to brokers
Possible values: length ≥ 1
Enumerated (binary) string representing whether or not the stream config is active
Possible values: [
active
,inactive
]
Status Code
OK
Bad Request
Not Authorized
Conflict
Internal Server Error
{ "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." }
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
Value is
true
if stream config is succesfully removed
Status Code
OK
Not Authorized
Not Found
Internal Server Error
{ "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
Request
No 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);
Create Stream Exclusion
Use this method to create a new stream exclusion rule.
POST /v1/config/stream/exclusions
Request
Request parameters
Possible values: length ≥ 1
Comma-separated list of hosts.
Comma-separated list of applications.
Default:
false
Default:
true
Search query.
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);
Delete Stream Exclusion
Use this method to delete an existing stream exclusion
DELETE /v1/config/stream/exclusions/{id}
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);
Update Stream Exclusion
Use this method to update an existing stream exclusion rule.
PATCH /v1/config/stream/exclusions/{id}
Request
Path Parameters
Request parameters
Possible values: length ≥ 1
Comma-separated list of hosts.
Comma-separated list of applications.
Default:
false
Default:
true
Search query.
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);
Get Stream Exclusion
Use this method to get an existing stream exclusion
GET /v1/config/stream/exclusions/{id}
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);
List Exclusion Rules
Returns a list of exclusion rules. Note: This does not return usage quota rules.
GET /v1/config/ingestion/exclusions
Request
No 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);
Create Exclusion Rule
Create a new ingestion exclusion rule to help reduce log volume
POST /v1/config/ingestion/exclusions
Request
Request parameters
Possible values: length ≥ 1
Comma-separated list of hosts.
Comma-separated list of applications.
Default:
false
Default:
true
Search query.
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
Possible values: length ≥ 1
Comma-separated list of hosts.
Comma-separated list of applications.
Search query.
Possible values: length ≥ 1
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
Get Exclusion Rule
Returns an exclusion rule with the id specified.
GET /v1/config/ingestion/exclusions/{id}
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
Possible values: length ≥ 1
Comma-separated list of hosts.
Comma-separated list of applications.
Search query.
Possible values: length ≥ 1
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
Request
Path Parameters
ID of an exclusion rule.
Request parameters
Possible values: length ≥ 1
Comma-separated list of hosts.
Comma-separated list of applications.
Default:
false
Default:
true
Search query.
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
Possible values: length ≥ 1
Comma-separated list of hosts.
Comma-separated list of applications.
Search query.
Possible values: length ≥ 1
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
Delete Exclusion Rule
Use this method to delete an exclusion rule.
DELETE /v1/config/ingestion/exclusions/{id}
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);
Request
No 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);
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
Request
No 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);
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
Request
Request parameters
Example:
03290da0-79a9-4090-9189-efb853d049ec
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);
Resume Ingestion
Resumes ingestion if it has been previously suspended
POST /v1/config/ingestion/resume
Request
No 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);
List Usage By App
Lists aggregated usage information for all apps during a time period.
GET /v1/usage/apps
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);
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}
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);
List Usage by Tag
Lists aggregated usage information for all tags during a time period.
GET /v1/usage/tags
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);
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}
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);
List Usage by Host
Lists aggregated usage information for all hosts during a time period.
GET /v1/usage/hosts
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);
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}
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);
Retrieve account usage totals
Get aggregated usage information for an account's data during a time period.
GET /v2/usage
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);
Request
No 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);
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
Request
Custom Headers
A provisioned service key for your account.
Request parameters
Name of a log group.
Query that determines the data that is visible to members of a group.
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);
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);
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);
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}
Request
Custom Headers
A provisioned service key for your account.
Path Parameters
ID of a group.
Request parameters
Name of a log group.
Query that determines the data that is visible to members of a group.
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);
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
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
The ID of the key
Example:
629e3f7e62295be60488fb26
A secret key which can be used to authenticate requests to Mezmo.
Example:
7b273eb8adc962f2711ad760730debb0
A user friendly name for the key
Possible values: length ≤ 30
Example:
servergroup_0_ingestion
The type of the key
Possible values: [
ingestion
,service
]Example:
ingestion
The time the key was created as a Unix timestamp in milliseconds
Example:
1654538253244
Status Code
A list of keys is returned on success.
The supplied request is invalid or malformed.
{ "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
Request
Query Parameters
The type of key to be created
Allowable values: [
ingestion
,service
,all
]
Modifiable fields can be set in the request body.
A user friendly name for the key
Possible values: length ≤ 30
Example:
servergroup_0_ingestion
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
The ID of the key
Example:
629e3f7e62295be60488fb26
A secret key which can be used to authenticate requests to Mezmo.
Example:
7b273eb8adc962f2711ad760730debb0
A user friendly name for the key
Possible values: length ≤ 30
Example:
servergroup_0_ingestion
The type of the key
Possible values: [
ingestion
,service
]Example:
ingestion
The time the key was created as a Unix timestamp in milliseconds
Example:
1654538253244
Status Code
A new key was created successfully! The entire key resource is returned.
The supplied request is invalid or malformed.
{ "error": "\"type\" is required", "code": "BadRequest", "status": "error" }
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
The ID of the key
Example:
629e3f7e62295be60488fb26
A secret key which can be used to authenticate requests to Mezmo.
Example:
7b273eb8adc962f2711ad760730debb0
A user friendly name for the key
Possible values: length ≤ 30
Example:
servergroup_0_ingestion
The type of the key
Possible values: [
ingestion
,service
]Example:
ingestion
The time the key was created as a Unix timestamp in milliseconds
Example:
1654538253244
Status Code
The key with the supplied
id
was found, the entire resource is returned.The specified key was not found.
{ "error": "Key with id 629eb5369e5b231f51d3830f was not found", "code": "NotFound", "status": "error" }
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
The status of the request in a human-readable form
Example:
Key deleted successfully
Indicates whether the key was deleted
Example:
true
Status Code
The key was deleted successfully, a simple status is returned.
The specified key was not found.
{ "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}
Request
Path Parameters
The id of the key to update
Example:
629e3f7e62295be60488fb26
A user friendly name for the key
Possible values: length ≤ 30
Example:
servergroup_0_ingestion
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
The ID of the key
Example:
629e3f7e62295be60488fb26
A secret key which can be used to authenticate requests to Mezmo.
Example:
7b273eb8adc962f2711ad760730debb0
A user friendly name for the key
Possible values: length ≤ 30
Example:
servergroup_0_ingestion
The type of the key
Possible values: [
ingestion
,service
]Example:
ingestion
The time the key was created as a Unix timestamp in milliseconds
Example:
1654538253244
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.
{ "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" }
Request
No 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
The number of lines required in order to trigger the alert.
The number of standard deviations above the 30 day average lines in order to trigger the alert.
Determines if you want alerts to be triggered if both the max lines and standard deviation have been triggered, or if one of the thresholds has been reached.
Possible values: [
separate
,both
]Notify recipients once per hour, or once per day, (starting when the threshold is passed the first time) until the index rate drops below the thresholds. When the index rate drops below the thresholds, alerting stops.
Possible values: [
hourly
,daily
]- channels
Comma-separated list of email addresses.
PagerDuty key.
Webhook URL.
Status Code
OK
Bad request
Internal Server error occurred when trying to fetch index rate alerts
No Sample Response
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
Request
Request parameters
The number of lines required in order to trigger the alert.
The number of standard deviations above the 30 day average lines in order to trigger the alert.
Determines if you want alerts to be triggered if both the max lines and standard deviation have been triggered, or if one of the thresholds has been reached.
Allowable values: [
separate
,both
]Notify recipients once per hour, or once per day, (starting when the threshold is passed the first time) until the index rate drops below the thresholds. When the index rate drops below the thresholds, alerting stops.
Allowable values: [
hourly
,daily
]- channels
Comma-separated list of email addresses.
PagerDuty key.
Webhook URL.
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
The number of lines required in order to trigger the alert.
The number of standard deviations above the 30 day average lines in order to trigger the alert.
Determines if you want alerts to be triggered if both the max lines and standard deviation have been triggered, or if one of the thresholds has been reached.
Possible values: [
separate
,both
]Notify recipients once per hour, or once per day, (starting when the threshold is passed the first time) until the index rate drops below the thresholds. When the index rate drops below the thresholds, alerting stops.
Possible values: [
hourly
,daily
]- channels
Comma-separated list of email addresses.
PagerDuty key.
Webhook URL.
Status Code
OK
Bad request
Internal Server error occurred when trying to fetch index rate alerts