---
title: "POST /v2/{+name}:diagnose"
method: POST
path: "/v2/{+name}:diagnose"
tags: ["projects"]
---

# POST /v2/{+name}:diagnose

`POST /v2/{+name}:diagnose`

Creates a Diagnostic File and runs Diagnostic Tool given an Instance.

## Path parameters

- `name` string, required

## Request body

- DiagnoseInstanceRequest — Request for creating a notebook instance diagnostic file.
  - `diagnosticConfig` DiagnosticConfig — Defines flags that are used to run the diagnostic tool
    - `relativePath` string — Optional. Defines the relative storage path in the Cloud Storage bucket where the diagnostic logs will be written: Default path will be the root directory of the Cloud Storage bucket (`gs://$GCS_BUCKET/$DATE_$TIME.tar.gz`) Example of full path where Log file will be written: `gs://$GCS_BUCKET/$RELATIVE_PATH/`
    - `enablePacketCaptureFlag` boolean — Optional. Enables flag to capture packets from the instance for 30 seconds
    - `enableRepairFlag` boolean — Optional. Enables flag to repair service for instance
    - `gcsBucket` string — Required. User Cloud Storage bucket location (REQUIRED). Must be formatted with path prefix (`gs://$GCS_BUCKET`). Permissions: User Managed Notebooks: - storage.buckets.writer: Must be given to the project's service account attached to VM. Google Managed Notebooks: - storage.buckets.writer: Must be given to the project's service account or user credentials attached to VM depending on authentication mode. Cloud Storage bucket Log file will be written to `gs://$GCS_BUCKET/$RELATIVE_PATH/$VM_DATE_$TIME.tar.gz`
    - `enableCopyHomeFilesFlag` boolean — Optional. Enables flag to copy all `/home/jupyter` folder contents
  - `timeoutMinutes` integer — Optional. Maximum amount of time in minutes before the operation times out.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/notebooks.md) · [All operations](https://skmtc.dev/google/apis/notebooks/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/notebooks/revisions/127a2a41b4c1/schema)
