# Reports

## GET /api/v1/org-unit/reports

> List reports

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Reports"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"ReportsFilterBy":{"name":"filterBy","in":"query","required":false,"description":"Filter results by a parameter. Use the format field-name operator value. Operators are == Equals, != Not equals, <= Less than or equal, >= Greater than or equal, =@ contains, !@ Does not contains, =^ Starts with and =$ Ends with. Dates are in ISO 8601 timestamp format and available for operators ==, !=, <= and >=.","schema":{"type":"array","items":{"type":"string","pattern":"^(name|createdAt|createdBy|status)(==|!=|<=|>=|=@|!@|=\\^|=\\$).+$"}},"explode":false},"ReportsSortBy":{"name":"sortBy","in":"query","required":false,"description":"Sort results by a parameters.","schema":{"$ref":"#/components/schemas/ReportFilterAndSortFields"}},"SortOrder":{"name":"sortOrder","in":"query","required":false,"description":"Sort results in descending or ascending order.","schema":{"type":"string","enum":["asc","desc"],"default":"asc"}},"Offset":{"name":"offset","in":"query","required":false,"description":"The offset of the first item returned in the collection.","schema":{"type":"integer","format":"int32"}},"Limit":{"name":"limit","in":"query","required":false,"description":"The maximum number of entries to return.","schema":{"type":"integer","format":"int32","default":50,"minimum":1,"maximum":500}},"Search":{"name":"search","in":"query","required":false,"description":"Filter results by a free text search.","schema":{"type":"string"}}},"schemas":{"ReportFilterAndSortFields":{"type":"string","enum":["name","createdAt","createdBy","status"]},"Reports":{"type":"array","items":{"$ref":"#/components/schemas/Report"}},"Report":{"allOf":[{"$ref":"#/components/schemas/ReportRequestFields"},{"$ref":"#/components/schemas/ReportCalculatedFields"}]},"ReportRequestFields":{"type":"object","required":["name","start","end"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"start":{"type":"string","format":"date-time","description":"timestamp from when to fetch data in UTC"},"end":{"type":"string","format":"date-time","description":"timestamp until when to fetch data in UTC"},"groupBy":{"$ref":"#/components/schemas/ReportGroupByOptions"},"filterBy":{"type":"array","description":"Filter results by a parameter. Use the format field-name == value.","default":[],"items":{"type":"string","pattern":"^(projectName|departmentName|clusterId)(==).+$"}}}},"ReportGroupByOptions":{"type":"string","nullable":true,"enum":["Nodepool","Project","Department","Cluster"]},"ReportCalculatedFields":{"type":"object","required":["id","tenantId","createdAt","createdBy","status","statusUpdatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"tenantId":{"type":"integer","format":"int32","description":"ID of the tenant where the project is located."},"status":{"$ref":"#/components/schemas/ReportStatus"},"statusUpdatedAt":{"type":"string","format":"date-time"},"statusMessage":{"type":"string"}}},"ReportStatus":{"type":"string","enum":["Pending","Processing","Ready","Failed"]},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/org-unit/reports":{"get":{"summary":"List reports","operationId":"list_reports","tags":["Reports"],"parameters":[{"$ref":"#/components/parameters/ReportsFilterBy"},{"$ref":"#/components/parameters/ReportsSortBy"},{"$ref":"#/components/parameters/SortOrder"},{"$ref":"#/components/parameters/Offset"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Search"}],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"type":"object","required":["reports"],"properties":{"reports":{"$ref":"#/components/schemas/Reports"}}}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## POST /api/v1/org-unit/reports

> Create a new report request.

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Reports"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"schemas":{"ReportRequestFields":{"type":"object","required":["name","start","end"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"start":{"type":"string","format":"date-time","description":"timestamp from when to fetch data in UTC"},"end":{"type":"string","format":"date-time","description":"timestamp until when to fetch data in UTC"},"groupBy":{"$ref":"#/components/schemas/ReportGroupByOptions"},"filterBy":{"type":"array","description":"Filter results by a parameter. Use the format field-name == value.","default":[],"items":{"type":"string","pattern":"^(projectName|departmentName|clusterId)(==).+$"}}}},"ReportGroupByOptions":{"type":"string","nullable":true,"enum":["Nodepool","Project","Department","Cluster"]},"Report":{"allOf":[{"$ref":"#/components/schemas/ReportRequestFields"},{"$ref":"#/components/schemas/ReportCalculatedFields"}]},"ReportCalculatedFields":{"type":"object","required":["id","tenantId","createdAt","createdBy","status","statusUpdatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"tenantId":{"type":"integer","format":"int32","description":"ID of the tenant where the project is located."},"status":{"$ref":"#/components/schemas/ReportStatus"},"statusUpdatedAt":{"type":"string","format":"date-time"},"statusMessage":{"type":"string"}}},"ReportStatus":{"type":"string","enum":["Pending","Processing","Ready","Failed"]},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/org-unit/reports":{"post":{"summary":"Create a new report request.","operationId":"create_report","tags":["Reports"],"requestBody":{"description":"Report to create.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportRequestFields"}}}},"responses":{"202":{"description":"Accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## GET /api/v1/org-unit/reports/count

> Count reports

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Reports"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"ReportsFilterBy":{"name":"filterBy","in":"query","required":false,"description":"Filter results by a parameter. Use the format field-name operator value. Operators are == Equals, != Not equals, <= Less than or equal, >= Greater than or equal, =@ contains, !@ Does not contains, =^ Starts with and =$ Ends with. Dates are in ISO 8601 timestamp format and available for operators ==, !=, <= and >=.","schema":{"type":"array","items":{"type":"string","pattern":"^(name|createdAt|createdBy|status)(==|!=|<=|>=|=@|!@|=\\^|=\\$).+$"}},"explode":false},"Search":{"name":"search","in":"query","required":false,"description":"Filter results by a free text search.","schema":{"type":"string"}}},"schemas":{"CountResponse":{"type":"object","required":["count"],"properties":{"count":{"type":"integer","format":"int64"}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/org-unit/reports/count":{"get":{"summary":"Count reports","operationId":"count_reports","tags":["Reports"],"parameters":[{"$ref":"#/components/parameters/ReportsFilterBy"},{"$ref":"#/components/parameters/Search"}],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CountResponse"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## GET /api/v1/org-unit/reports/availability

> Reports availability

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Reports"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}}},"paths":{"/api/v1/org-unit/reports/availability":{"get":{"summary":"Reports availability","operationId":"are_reports_available","tags":["Reports"],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"type":"object","required":["isAvailable"],"properties":{"isAvailable":{"type":"boolean"}}}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## GET /api/v1/org-unit/reports/{reportId}

> Get report

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Reports"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"ReportId":{"name":"reportId","in":"path","required":true,"description":"The report id","schema":{"type":"string","format":"uuid"}}},"schemas":{"Report":{"allOf":[{"$ref":"#/components/schemas/ReportRequestFields"},{"$ref":"#/components/schemas/ReportCalculatedFields"}]},"ReportRequestFields":{"type":"object","required":["name","start","end"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"start":{"type":"string","format":"date-time","description":"timestamp from when to fetch data in UTC"},"end":{"type":"string","format":"date-time","description":"timestamp until when to fetch data in UTC"},"groupBy":{"$ref":"#/components/schemas/ReportGroupByOptions"},"filterBy":{"type":"array","description":"Filter results by a parameter. Use the format field-name == value.","default":[],"items":{"type":"string","pattern":"^(projectName|departmentName|clusterId)(==).+$"}}}},"ReportGroupByOptions":{"type":"string","nullable":true,"enum":["Nodepool","Project","Department","Cluster"]},"ReportCalculatedFields":{"type":"object","required":["id","tenantId","createdAt","createdBy","status","statusUpdatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"tenantId":{"type":"integer","format":"int32","description":"ID of the tenant where the project is located."},"status":{"$ref":"#/components/schemas/ReportStatus"},"statusUpdatedAt":{"type":"string","format":"date-time"},"statusMessage":{"type":"string"}}},"ReportStatus":{"type":"string","enum":["Pending","Processing","Ready","Failed"]},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/org-unit/reports/{reportId}":{"get":{"summary":"Get report","operationId":"get_report_by_id","parameters":[{"$ref":"#/components/parameters/ReportId"}],"tags":["Reports"],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## DELETE /api/v1/org-unit/reports/{reportId}

> Delete report

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Reports"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"ReportId":{"name":"reportId","in":"path","required":true,"description":"The report id","schema":{"type":"string","format":"uuid"}}},"responses":{"204NoContent":{"description":"No Content."},"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}}},"paths":{"/api/v1/org-unit/reports/{reportId}":{"delete":{"summary":"Delete report","operationId":"delete_report_by_id","parameters":[{"$ref":"#/components/parameters/ReportId"}],"tags":["Reports"],"responses":{"204":{"$ref":"#/components/responses/204NoContent"},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## GET /api/v1/org-unit/reports/{reportId}/file

> Download report

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Reports"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"ReportId":{"name":"reportId","in":"path","required":true,"description":"The report id","schema":{"type":"string","format":"uuid"}}},"responses":{"400BadRequest":{"description":"Bad request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}}},"paths":{"/api/v1/org-unit/reports/{reportId}/file":{"get":{"summary":"Download report","operationId":"download_report_by_id","parameters":[{"$ref":"#/components/parameters/ReportId"}],"tags":["Reports"],"responses":{"200":{"description":"Executed successfully.","content":{"text/csv":{}}},"400":{"$ref":"#/components/responses/400BadRequest"},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```
