> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ocpplab.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ocpplab.io/_mcp/server.

# Why a deployed charger is not running: pods, events and system logs

GET https://api.ocpplab.io/evcharger/deployment-runtime-ops/diagnostics

Read-only. Returns the charger Deployment, its pods, cluster events and container logs over a window (default: the last 15 minutes, at most 6 hours), plus a verdict such as csms_unreachable or crash_loop. Secrets in log lines are redacted. After a crash the previous container's logs are returned. download=true returns plain text.

Reference: https://docs.ocpplab.io/api-reference/evcharger/deployment-runtime-ops/diagnostics

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `deployment_id` (string, required) — Charger deployment id (UUIDv4).
- `since` (datetime, optional, nullable) — Window start (ISO 8601). Default: until - 15 minutes.
- `until` (datetime, optional, nullable) — Window end (ISO 8601). Default: now.
- `previous` (boolean, optional, nullable) — Read the previous container. Default: automatic after a crash.
- `level` (enum, optional, default: info) — Minimum log level returned.
  - Allowed values: `debug`, `info`, `warning`, `error`, `critical`
- `tail_lines` (integer, optional, default: 500) — Newest lines kept.
- `download` (boolean, optional, default: false) — Return the log lines as text/plain.

## Response

### 200

Successful Response

- `window` (DiagnosticsWindow, required)
- `verdict` (DiagnosticsVerdict, required) — Why the charger is (not) running, decided from pods, events and logs.
- `deployment` (DiagnosticsDeployment, required) — Desired vs ready instances. Infrastructure names and images are never exposed.
- `pods` (list of DiagnosticsPod, required)
- `events` (list of DiagnosticsEvent, required)
- `logs` (DiagnosticsLogs, required)
- `notes` (list of string, optional) — Parts that could not be read, e.g. events_unavailable:403.

## Errors

### 401 Unauthorized Error

Missing or invalid Bearer token

- `detail` (string, required) — Human-readable error message returned by the API.

### 403 Forbidden Error

Deployment belongs to another organization

- `any`

### 404 Not Found Error

Deployment not found

- `any`

### 422 Unprocessable Entity Error

Invalid deployment_id or time window

- `any`

## Types

### DiagnosticsWindow

- `since` (string, required)
- `until` (string, required)

### DiagnosticsVerdict

Why the charger is (not) running, decided from pods, events and logs.

- `code` (enum, required)
  - Allowed values: `stopped`, `scheduling`, `image_pull_failed`, `crash_loop`, `starting`, `csms_unreachable`, `csms_rejected`, `connected`, `unknown`
- `severity` (enum, required)
  - Allowed values: `ok`, `info`, `warning`, `error`
- `title` (string, required)
- `hint` (string, required)
- `evidence` (string, optional, nullable) — The log line or event that decided the verdict.

### DiagnosticsDeployment

Desired vs ready instances. Infrastructure names and images are never exposed.

- `replicas` (integer, required)
- `ready_replicas` (integer, required)

### DiagnosticsPod

- `ready` (boolean, required)
- `restart_count` (integer, required)
- `phase` (string, optional, nullable)
- `waiting_reason` (string, optional, nullable)
- `waiting_message` (string, optional, nullable)
- `started_at` (string, optional, nullable)
- `last_state` (DiagnosticsPodLastState, optional, nullable)

### DiagnosticsEvent

- `ts` (string, required)
- `type` (string, required)
- `message` (string, required)
- `count` (integer, required)
- `reason` (string, optional, nullable)

### DiagnosticsLogs

- `source` (enum, required) — Where the lines came from: the running container, the previous one after a crash, or history (Cloud Logging) when the window starts before the current pod or no pod exists.
  - Allowed values: `current`, `previous`, `history`, `none`
- `truncated` (boolean, required)
- `lines` (list of DiagnosticsLogLine, required)

### DiagnosticsPodLastState

- `reason` (string, optional, nullable)
- `exit_code` (integer, optional, nullable)
- `finished_at` (string, optional, nullable)

### DiagnosticsLogLine

- `ts` (string, required)
- `level` (enum, required)
  - Allowed values: `debug`, `info`, `warning`, `error`, `critical`
- `text` (string, required)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "window": {
    "since": "2026-09-29T10:45:00Z",
    "until": "2026-09-29T11:00:00Z"
  },
  "verdict": {
    "code": "csms_unreachable",
    "severity": "error",
    "title": "CSMS Unreachable",
    "hint": "Check network connectivity between charger and CSMS.",
    "evidence": "Failed to connect to CSMS endpoint at 2026-09-29T10:52:34Z"
  },
  "deployment": {
    "replicas": 2,
    "ready_replicas": 1
  },
  "pods": [
    {
      "ready": false,
      "restart_count": 3,
      "phase": "Running",
      "waiting_reason": "CrashLoopBackOff",
      "waiting_message": "Back-off restarting failed container",
      "started_at": "2026-09-29T10:30:00Z",
      "last_state": {
        "reason": "Error",
        "exit_code": 137,
        "finished_at": "2026-09-29T10:50:00Z"
      }
    }
  ],
  "events": [
    {
      "ts": "2026-09-29T10:48:00Z",
      "type": "Warning",
      "message": "0/3 nodes are available: 3 Insufficient memory.",
      "count": 2,
      "reason": "FailedScheduling"
    }
  ],
  "logs": {
    "source": "previous",
    "truncated": false,
    "lines": [
      {
        "ts": "2026-09-29T10:49:55Z",
        "level": "error",
        "text": "Connection to CSMS failed: timeout after 10s"
      }
    ]
  },
  "notes": [
    "events_unavailable:403"
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.ocpplab.io/evcharger/deployment-runtime-ops/diagnostics"

querystring = {"deployment_id":"deployment_id"}

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.get(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.ocpplab.io/evcharger/deployment-runtime-ops/diagnostics?deployment_id=deployment_id';
const options = {
  method: 'GET',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.ocpplab.io/evcharger/deployment-runtime-ops/diagnostics?deployment_id=deployment_id"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("GET", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.ocpplab.io/evcharger/deployment-runtime-ops/diagnostics?deployment_id=deployment_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.ocpplab.io/evcharger/deployment-runtime-ops/diagnostics?deployment_id=deployment_id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.ocpplab.io/evcharger/deployment-runtime-ops/diagnostics?deployment_id=deployment_id', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.ocpplab.io/evcharger/deployment-runtime-ops/diagnostics?deployment_id=deployment_id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.ocpplab.io/evcharger/deployment-runtime-ops/diagnostics?deployment_id=deployment_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
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 as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```