F5® SPK API Specifications¶
API (1.0.0)
Download OpenAPI specification:
API to handle qkview operations
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"
}
Create a new qkview
Request Body schema: application/jsonoptional
| timeout | string The length of time to wait before timing out the qkview collection. Must be a valid Go duration string, for example 1h
|
| namespace | string The namespace from which the qkview should be 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.
|
| 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:
character-range:
Requires pattern to match all of name, not just a substring. examples:
|
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.
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.
However, since the query returns true for all log lines, qkview will write the log lines in their original, unaltered format. Instead, use
You can use
Note: If a customized
| |
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 Note: If a customized
| |
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:
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:
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:
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:
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:
For example: Suppose the output of kubectl api-resources shows:
From this, we can derive the GVR for
| |
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:
To collect logs from all pods, but only from containers whose names match fluent, including logs from previous container instances:
|
Responses
Request samples
- Payload
{- "namespace": "default",
- "timeout": "1h",
- "filename": "vlan-issue",
- "prefer_ipv6": true,
- "pod_patterns": [
- "f5-f5ingress-7c7db7d6f6-gvkd6",
- "f5-tmm*",
- "f5-coremond*"
], - "log_queries": [
- {
- "file_pattern": "f5-f5ingress-7c7db7d6f6-gvkd6/f5ingress*",
- "query": "| logfmt | vlan=\"vlan101\" or namespace=\"tcpapp\""
}, - {
- "file_pattern": "f5-tmm*/*",
- "query": "|~ error"
}
], - "core_files": {
- "max_files": 2,
- "file_patterns": [
- "f5-tmm*"
], - "since": "3600s"
}, - "kube_resources": [
- {
- "group_version_resource": {
- "group": "*.k8s.io",
- "version": "v1*",
- "resource": "services"
}, - "name_patterns": [
- "*"
]
}, - {
- "group_version_resource": {
- "group": "apps",
- "version": "*",
- "resource": "pods*"
}, - "name_patterns": [
- "*"
]
}, - {
- "group_version_resource": {
- "group": "*",
- "version": "*",
- "resource": "*"
}, - "name_patterns": [
- "f5*"
]
}, - {
- "group_version_resource": {
- "group": "k8s.f5.com",
- "version": "v1",
- "resource": "bnkgatewayclasses"
}, - "name_patterns": [
- "*"
]
}, - {
- "group_version_resource": {
- "group": "gateway.k8s.f5net.com",
- "version": "v1",
- "resource": "l4routes"
}, - "name_patterns": [
- "*"
]
}, - {
- "group_version_resource": {
- "group": "gateway.networking.k8s.io",
- "version": "v1alpha2",
- "resource": "tcproutes"
}, - "name_patterns": [
- "f5*"
]
}, - {
- "group_version_resource": {
- "group": "",
- "version": "v1",
- "resource": "nodes"
}, - "name_patterns": [
- "*"
]
}
], - "kube_pod_logs": [
- {
- "pod_pattern": "*",
- "container_pattern": "*",
- "since": "1800s"
}, - {
- "pod_pattern": "*coremon*",
- "container_pattern": "*",
- "previous": true
}, - {
- "pod_pattern": "*",
- "container_pattern": "*fluent*",
- "tail": 1000
}, - {
- "pod_pattern": "*tmm*",
- "container_pattern": "f5-tmm",
- "since": "3600s",
- "tail": 500,
- "previous": true
}
]
}Response samples
- 201
- 500
{- "id": "123e4567-e89b-12d3-a456-426614174000"
}Retrieve a list of created qkviews
query Parameters
| filename | string Filter qkviews by filename |
Responses
Response samples
- 200
- 500
[- {
- "namespace": "default",
- "timeout": "1h",
- "filename": "vlan-issue",
- "prefer_ipv6": true,
- "pod_patterns": [
- "f5-f5ingress-7c7db7d6f6-gvkd6",
- "f5-tmm*",
- "f5-coremond*"
], - "log_queries": [
- {
- "file_pattern": "f5-f5ingress-7c7db7d6f6-gvkd6/f5ingress*",
- "query": "| logfmt | vlan=\"vlan101\" or namespace=\"tcpapp\""
}, - {
- "file_pattern": "f5-tmm*/*",
- "query": "|~ error"
}
], - "core_files": {
- "max_files": 2,
- "file_patterns": [
- "f5-tmm*"
], - "since": "3600s"
}, - "kube_resources": [
- {
- "group_version_resource": {
- "group": "*.k8s.io",
- "version": "v1*",
- "resource": "services"
}, - "name_patterns": [
- "*"
]
}, - {
- "group_version_resource": {
- "group": "apps",
- "version": "*",
- "resource": "pods*"
}, - "name_patterns": [
- "*"
]
}, - {
- "group_version_resource": {
- "group": "*",
- "version": "*",
- "resource": "*"
}, - "name_patterns": [
- "f5*"
]
}, - {
- "group_version_resource": {
- "group": "k8s.f5.com",
- "version": "v1",
- "resource": "bnkgatewayclasses"
}, - "name_patterns": [
- "*"
]
}, - {
- "group_version_resource": {
- "group": "gateway.k8s.f5net.com",
- "version": "v1",
- "resource": "l4routes"
}, - "name_patterns": [
- "*"
]
}, - {
- "group_version_resource": {
- "group": "gateway.networking.k8s.io",
- "version": "v1alpha2",
- "resource": "tcproutes"
}, - "name_patterns": [
- "f5*"
]
}, - {
- "group_version_resource": {
- "group": "",
- "version": "v1",
- "resource": "nodes"
}, - "name_patterns": [
- "*"
]
}
], - "kube_pod_logs": [
- {
- "pod_pattern": "*",
- "container_pattern": "*",
- "since": "1800s"
}, - {
- "pod_pattern": "*coremon*",
- "container_pattern": "*",
- "previous": true
}, - {
- "pod_pattern": "*",
- "container_pattern": "*fluent*",
- "tail": 1000
}, - {
- "pod_pattern": "*tmm*",
- "container_pattern": "f5-tmm",
- "since": "3600s",
- "tail": 500,
- "previous": true
}
]
}
]Retrieve a specific qkview by its unique identifier
path Parameters
| id required | string The unique identifier of the qkview |
Responses
Response samples
- 200
- 404
- 500
{- "namespace": "default",
- "timeout": "1h",
- "filename": "vlan-issue",
- "prefer_ipv6": true,
- "pod_patterns": [
- "f5-f5ingress-7c7db7d6f6-gvkd6",
- "f5-tmm*",
- "f5-coremond*"
], - "log_queries": [
- {
- "file_pattern": "f5-f5ingress-7c7db7d6f6-gvkd6/f5ingress*",
- "query": "| logfmt | vlan=\"vlan101\" or namespace=\"tcpapp\""
}, - {
- "file_pattern": "f5-tmm*/*",
- "query": "|~ error"
}
], - "core_files": {
- "max_files": 2,
- "file_patterns": [
- "f5-tmm*"
], - "since": "3600s"
}, - "kube_resources": [
- {
- "group_version_resource": {
- "group": "*.k8s.io",
- "version": "v1*",
- "resource": "services"
}, - "name_patterns": [
- "*"
]
}, - {
- "group_version_resource": {
- "group": "apps",
- "version": "*",
- "resource": "pods*"
}, - "name_patterns": [
- "*"
]
}, - {
- "group_version_resource": {
- "group": "*",
- "version": "*",
- "resource": "*"
}, - "name_patterns": [
- "f5*"
]
}, - {
- "group_version_resource": {
- "group": "k8s.f5.com",
- "version": "v1",
- "resource": "bnkgatewayclasses"
}, - "name_patterns": [
- "*"
]
}, - {
- "group_version_resource": {
- "group": "gateway.k8s.f5net.com",
- "version": "v1",
- "resource": "l4routes"
}, - "name_patterns": [
- "*"
]
}, - {
- "group_version_resource": {
- "group": "gateway.networking.k8s.io",
- "version": "v1alpha2",
- "resource": "tcproutes"
}, - "name_patterns": [
- "f5*"
]
}, - {
- "group_version_resource": {
- "group": "",
- "version": "v1",
- "resource": "nodes"
}, - "name_patterns": [
- "*"
]
}
], - "kube_pod_logs": [
- {
- "pod_pattern": "*",
- "container_pattern": "*",
- "since": "1800s"
}, - {
- "pod_pattern": "*coremon*",
- "container_pattern": "*",
- "previous": true
}, - {
- "pod_pattern": "*",
- "container_pattern": "*fluent*",
- "tail": 1000
}, - {
- "pod_pattern": "*tmm*",
- "container_pattern": "f5-tmm",
- "since": "3600s",
- "tail": 500,
- "previous": true
}
]
}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
- 200
- 404
- 500
{- "status": "Failed",
- "nested": {
- "qkview workflow": {
- "status": "Failed",
- "nested": {
- "endpoints": {
- "status": "Failed",
- "nested": {
- "f5-tmm-98f4b44f4-rw6c5": {
- "status": "Completed"
}, - "f5-tmm-5545b59c94-nxb2t": {
- "status": "Completed"
}, - "f5-cwc-dc9f75cbb-qgvqx": {
- "status": "Failed",
- "msgs": [
- "tasks/endpoint: Connection refused. Unable to establish a connection to the server."
]
}
}
}
}, - "tarball: vlan.tar.gz": {
- "status": "Completed"
}
}
}
}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
- 200
- 500
{- "apiVersion": "v1alpha1",
- "kind": "LogLevelList",
- "items": [
- {
- "apiVersion": "v1alpha1",
- "kind": "LogLevel",
- "metadata": {
- "name": "f5-observer",
- "annotations": {
- "logging.f5.com/containers": "f5-observer"
}
}, - "spec": {
- "containers": {
- "f5-observer": "DEBUG"
}
}
}, - {
- "apiVersion": "v1alpha1",
- "kind": "LogLevel",
- "metadata": {
- "name": "f5-observer-operator",
- "annotations": {
- "logging.f5.com/containers": "f5-observer-operator"
}
}, - "spec": {
- "containers": {
- "f5-observer-operator": "INFO"
}
}
}
]
}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
- 200
- 404
- 500
{- "apiVersion": "v1alpha1",
- "kind": "LogLevel",
- "metadata": {
- "name": "f5-observer",
- "annotations": {
- "logging.f5.com/containers": "f5-observer"
}
}, - "spec": {
- "containers": {
- "f5-observer": "DEBUG"
}
}
}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/jsonrequired
| 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
- Payload
{- "apiVersion": "v1alpha1",
- "kind": "LogLevel",
- "metadata": {
- "name": "f5-observer"
}, - "spec": {
- "containers": {
- "f5-observer": "DEBUG"
}
}
}Response samples
- 404
- 500
{- "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/jsonrequired
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
- Payload
{- "spec": {
- "containers": {
- "f5-observer": "DEBUG"
}
}
}Response samples
- 404
- 500
{- "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
- 404
- 500
{- "message": "page not found",
- "code": 404
}