F5® SPK API Specifications

API

API (1.0.0)

Download OpenAPI specification:

API to handle qkview operations

Errors

The API uses standard HTTP status codes to indicate the success or failure of the API call. The body of the response will be JSON in the following format:

{
  "code": 404
  "message": "page not found"
}

Qkview

Create a new qkview

Request Body schema: application/json
optional
timeout
string

The length of time to wait before timing out the qkview collection.

Must be a valid Go duration string, for example 1h

If not specified, qkview will not have a timeout and will run until completion or failure.

If the timeout is reached, and the qkview had some data collected, the qkview status will be Warning and generated tarball can be downloaded.

namespace
string

The namespace from which the qkview should be collected.

If not specified, it will include all namespaces

If a namespace is specified, and fluentd and coremon are not in that namespace, and pod_pattern is left empty, the qkview process will automatically include fluentd and coremon to ensure that logs and core files for the specified namespace are collected

filename
string^[a-zA-Z0-9_-]+$
Default: "The auto-generated qkview unique identifier"

Assign the specified name to the qkview tarball.

Only alphanumeric characters, underscores, and hyphens are allowed.

If not provided, a unique auto-generated ID will be used.

prefer_ipv6
boolean
Default: false

Prefer IPv6 for communication with pods when dual-stack is enabled Otherwise, use IPv4.

pod_patterns
Array of strings (pattern)
Default: ["*"]

Pattern reports whether name or file name matches the shell pattern.

The pattern syntax is:

pattern:

{ term }

term:

'*'         matches any sequence of non-/ characters
'?'         matches any single non-/ character
'[' [ '^' ] { character-range } ']'
            character class (must be non-empty)
c           matches character c (c != '*', '?', '\\', '[')
'\\' c      matches character c

character-range:

c           matches character c (c != '\\', '-', ']')
'\\' c      matches character c
lo '-' hi   matches character c for lo <= c <= hi

Requires pattern to match all of name, not just a substring.

examples:

- f5-tmm*
- * 
- *tmm*
- [a-zA-Z]*_[0-9]*
- file[1-3].log
- /var/logs/*/*.log
Array of objects

Log Queries use LogQL; (Log Query Language) to filter, parse, and analyze logs stored in f5-fluentd, which are included in the qkview tarball.

Queries must not begin with a stream selector, as qkview automatically appends its own selector. Failing to follow this rule will result in an error, causing the qkview task to fail.

Each query is mapped to a file pattern, allowing different queries to be applied to different files.

  [
      {
          "file_pattern": "*f5ingress*/f5ingress*",
          "query": "|~ info"
      },
      {
          "file_pattern": "f5-tmm*/*",
          "query": "|~ error"
      }
  ]

The file pattern must correspond to either the absolute path or the relative path within the f5-fluentd pod.

Queries will not alter the resulting line format; log lines will be written to qkview exactly as they were originally recorded by their respective processes.

For example, the following query modifies the log line format.

| line_format "{{ .ts }} - {{ .lvl }}: {{ .msg }

However, since the query returns true for all log lines, qkview will write the log lines in their original, unaltered format.

Instead, use line_format to parse logs and achieve advanced filtering, such as extracting logs within a specific time range.

| line_format tsu='{{ 
    .ts | toDate "2006-01-02 ..." | unixEpochMillis 
  }}'
| tsu >= 1738162427598 and tsu <= 1738162427631

You can use logfmt with F5 log format log lines to parse attributes and apply attribute-based filtering.

# "ts"="2025-01-01..."|"m"="log example"|"key"="value"
| logfmt | key="value"

By default, QKView includes all logs from Fluentd.

Note: If a customized pod_pattern is used and does not include fluentd pod, no log files will be collected.

WARNING: If fluentd is running without log persistence,
         the logs will not be included in the QKView, 
         and this may cause the overall task to result
         in a warning status.
object or null
Default: null

Core file settings to include in the qkview:

By default, qkview excludes core files. This setting applies to each individual coremon, which refers to each node.

For example, if there are 3 coremons and the maximum number of files is set to 2, the total would be 3 * 2.

To limit the cores collection to a specific time interval, the 'since' parameter is used. For instance, setting since=3600s limits collection to core files generated in the last hour.

To limit the core files for a specific node, include the full coremon pod name in the pod_patterns so that qkview will exclude all other coremons, if present.

Note: If a customized pod_pattern is used and does not include coremond, while the core_file setting is enabled, no core files will be collected.

WARNING: If the core files are too large and the qkview
         tarball exceeds 4GB, it cannot be uploaded to
         iHealth.

         It is recommended to create a dedicated qkview
         for specific core files.
Array of objects

Kubernetes resources to collect and include in the qkview:

The qkview will query the Kubernetes API using the provided Group, Version, and Resource, which can be specified either as exact values or as patterns, to list all matching objects. It will then filter the objects to include by performing a match on the first match found; the object will be marshaled to YAML format and written to the tarball. Objects that do not match are discarded.

If the given Group Version Resource (GVR) is namespace-scoped, qkview will use the namespace specified in the request body.

By default, qkview collects the following:

  • v1/pods: *f5*
  • metrics.k8s.io/v1beta1/pods: *f5*
  • apiextensions.k8s.io/v1/customresourcedefinitions: *f5*
  • v1/events: *f5*

By default, QKView does not collect Custom Resources (CRs). See section below on how to include them.

The defaults are always running and cannot be excluded, but their patterns can be overridden.

In this example, the Group, Version and Resource are hardcoded, while pod name patterns are specified to match cert and f5:

  {
      "group_version_resource": {
          "group": "",
          "version": "v1",
          "resource": "pods"
      },
      "name_patterns": [
          "*cert*"
          "*f5*",
      ]
  }

In this example, the Group, Version and Resource use patterns to match all Pod resources across all API groups and all versions, with no filtering by pod name:

  {
      "group_version_resource": {
          "group": "*",
          "version": "*",
          "resource": "pods"
      },
      "name_patterns": ["*"]
  }

If GVR values or patterns are not provided, qkview will use the default GVR patterns defined in the cwc-qkview-cm ConfigMap.

Adding Custom Resources:

  • Out of performance considerations, Custom Resources (CRs) are not collected by default as they are not part of the built-in resource definitions.
  • To include a custom resource, its Group Version Resource (GVR) has to be specified in the request body under kube_resources.

Obtaining a GVR for a Custom Resource (CR): • The Kubernetes API follows a standardized structure known as Group Version Resource (GVR). If you are unsure of the specific GVR for your custom resource, you can run: kubectl api-resources This command will list all available resources with columns for:

  • NAME: the resource (R) in GVR
  • APIGROUP: the group (G) in GVR
  • VERSION: the api group version (V) in GVR

For example: Suppose the output of kubectl api-resources shows:

NAME SHORTNAMES   APIGROUP      NAMESPACED   KIND
bnkgatewayclasses k8s.f5.com/v1 true         BNKGatewayClass

From this, we can derive the GVR for kube_resources:

{
  "kube_resources": [
    {
      "group_version_resource": {
        "group": "k8s.f5.com",
        "version": "v1",
        "resource": "bnkgatewayclasses"
      },
      "name_patterns": [
        "*"
      ]
    }
  ]
}
Array of objects

Kubernetes pod logs settings to include in the qkview:

Qkview collects Kubernetes logs by default. If kube_pod_logs is not specified in the request, qkview uses the default log settings defined in the cwc-qkview-cm ConfigMap.

To collect logs from all pods whose names match otel, from all containers, limited to the last 3000 lines and only from the past hour:

pod_pattern: "*otel*",
container_pattern: "*",
since: "3600s",
tail: 3000

To collect logs from all pods, but only from containers whose names match fluent, including logs from previous container instances:

pod_pattern: "*",
container_pattern: "*fluent*",    
previous: true

Responses

Request samples

Content type
application/json
{
  • "namespace": "default",
  • "timeout": "1h",
  • "filename": "vlan-issue",
  • "prefer_ipv6": true,
  • "pod_patterns": [
    ],
  • "log_queries": [
    ],
  • "core_files": {
    },
  • "kube_resources": [
    ],
  • "kube_pod_logs": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "123e4567-e89b-12d3-a456-426614174000"
}

Retrieve a list of created qkviews

query Parameters
filename
string

Filter qkviews by filename

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Retrieve a specific qkview by its unique identifier

path Parameters
id
required
string

The unique identifier of the qkview

Responses

Response samples

Content type
application/json
{
  • "namespace": "default",
  • "timeout": "1h",
  • "filename": "vlan-issue",
  • "prefer_ipv6": true,
  • "pod_patterns": [
    ],
  • "log_queries": [
    ],
  • "core_files": {
    },
  • "kube_resources": [
    ],
  • "kube_pod_logs": [
    ]
}

Delete a specific qkview by its unique identifier

path Parameters
id
required
string

The unique identifier of the qkview

Responses

Response samples

Content type
application/json
{
  • "message": "page not found",
  • "code": 404
}

Cancel a specific qkview by its unique identifier

path Parameters
id
required
string

The unique identifier of the qkview

Responses

Response samples

Content type
application/json
{
  • "message": "page not found",
  • "code": 404
}

Download the qkview tarball

path Parameters
id
required
string

The unique identifier of the qkview

Responses

Response samples

Content type
application/json
{
  • "message": "page not found",
  • "code": 404
}

Retrieve the status of a specific qkview by its unique identifier

path Parameters
id
required
string

The unique identifier of the qkview

Responses

Response samples

Content type
application/json
{
  • "status": "Failed",
  • "nested": {
    }
}

LogLevel

List all LogLevel resources in a namespace

path Parameters
namespace
required
string

The Kubernetes namespace of the containers whose log levels will be retrieved.

Responses

Response samples

Content type
application/json
{
  • "apiVersion": "v1alpha1",
  • "kind": "LogLevelList",
  • "items": [
    ]
}

Get LogLevel resource by name

path Parameters
namespace
required
string

The Kubernetes namespace of the container whose log level will be retrieved.

name
required
string

The name of the container whose log level will be retrieved.

Responses

Response samples

Content type
application/json
{
  • "apiVersion": "v1alpha1",
  • "kind": "LogLevel",
  • "metadata": {
    },
  • "spec": {
    }
}

Replace LogLevel resource by name

path Parameters
namespace
required
string

The Kubernetes namespace of the container whose log level will be replaced.

name
required
string

The name of the container whose log level will be replaced.

Request Body schema: application/json
required
apiVersion
required
string
kind
required
string
required
object
required
object (spec)

Contains mapping of container name to its log level. The log level can be one of: DEBUG, INFO, WARN, ERROR, FATAL.

Responses

Request samples

Content type
application/json
{
  • "apiVersion": "v1alpha1",
  • "kind": "LogLevel",
  • "metadata": {
    },
  • "spec": {
    }
}

Response samples

Content type
application/json
{
  • "message": "page not found",
  • "code": 404
}

Update containers log levels by name

path Parameters
namespace
required
string

The Kubernetes namespace of the container whose log level will be updated.

name
required
string

The name of the container whose log level will be updated.

Request Body schema: application/json
required
required
object (spec)

Contains mapping of container name to its log level. The log level can be one of: DEBUG, INFO, WARN, ERROR, FATAL.

Responses

Request samples

Content type
application/json
{
  • "spec": {
    }
}

Response samples

Content type
application/json
{
  • "message": "page not found",
  • "code": 404
}

Reset LogLevel resource by name

path Parameters
namespace
required
string

The Kubernetes namespace of a deployment whose containers log levels will be reset to default

name
required
string

The name of a deployment whose containers log levels will be reset to default.

Responses

Response samples

Content type
application/json
{
  • "message": "page not found",
  • "code": 404
}