From 334f552d65b7ba1a12372abe6087e17dcc35163b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D7=A0=CF=85=CE=B1=CE=B7=20=D7=A0=CF=85=CE=B1=CE=B7=D1=95?= =?UTF-8?q?=CF=83=CE=B7?= Date: Fri, 6 Mar 2026 13:52:38 -0800 Subject: [PATCH] feat(file): add 400 response handling for file get/delete MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire JSON400 error responses into checkError for Get and Delete methods so validation errors (e.g., invalid file names) surface as typed ValidationError to callers. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- docs/gen/gen.md | 316 ++++++------ docs/gen/osapi.md | 2 +- pkg/osapi/file.go | 2 + pkg/osapi/file_public_test.go | 34 ++ pkg/osapi/gen/api.yaml | 916 +++++++++++++++++----------------- pkg/osapi/gen/client.gen.go | 16 + 6 files changed, 676 insertions(+), 610 deletions(-) diff --git a/docs/gen/gen.md b/docs/gen/gen.md index 00d42aa..f262fee 100644 --- a/docs/gen/gen.md +++ b/docs/gen/gen.md @@ -1609,7 +1609,7 @@ func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithRes NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling -### func \(\*ClientWithResponses\) [DeleteFileByNameWithResponse]() +### func \(\*ClientWithResponses\) [DeleteFileByNameWithResponse]() ```go func (c *ClientWithResponses) DeleteFileByNameWithResponse(ctx context.Context, name FileName, reqEditors ...RequestEditorFn) (*DeleteFileByNameResponse, error) @@ -1618,7 +1618,7 @@ func (c *ClientWithResponses) DeleteFileByNameWithResponse(ctx context.Context, DeleteFileByNameWithResponse request returning \*DeleteFileByNameResponse -### func \(\*ClientWithResponses\) [DeleteJobByIDWithResponse]() +### func \(\*ClientWithResponses\) [DeleteJobByIDWithResponse]() ```go func (c *ClientWithResponses) DeleteJobByIDWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteJobByIDResponse, error) @@ -1627,7 +1627,7 @@ func (c *ClientWithResponses) DeleteJobByIDWithResponse(ctx context.Context, id DeleteJobByIDWithResponse request returning \*DeleteJobByIDResponse -### func \(\*ClientWithResponses\) [DrainAgentWithResponse]() +### func \(\*ClientWithResponses\) [DrainAgentWithResponse]() ```go func (c *ClientWithResponses) DrainAgentWithResponse(ctx context.Context, hostname string, reqEditors ...RequestEditorFn) (*DrainAgentResponse, error) @@ -1636,7 +1636,7 @@ func (c *ClientWithResponses) DrainAgentWithResponse(ctx context.Context, hostna DrainAgentWithResponse request returning \*DrainAgentResponse -### func \(\*ClientWithResponses\) [GetAgentDetailsWithResponse]() +### func \(\*ClientWithResponses\) [GetAgentDetailsWithResponse]() ```go func (c *ClientWithResponses) GetAgentDetailsWithResponse(ctx context.Context, hostname string, reqEditors ...RequestEditorFn) (*GetAgentDetailsResponse, error) @@ -1645,7 +1645,7 @@ func (c *ClientWithResponses) GetAgentDetailsWithResponse(ctx context.Context, h GetAgentDetailsWithResponse request returning \*GetAgentDetailsResponse -### func \(\*ClientWithResponses\) [GetAgentWithResponse]() +### func \(\*ClientWithResponses\) [GetAgentWithResponse]() ```go func (c *ClientWithResponses) GetAgentWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAgentResponse, error) @@ -1654,7 +1654,7 @@ func (c *ClientWithResponses) GetAgentWithResponse(ctx context.Context, reqEdito GetAgentWithResponse request returning \*GetAgentResponse -### func \(\*ClientWithResponses\) [GetAuditExportWithResponse]() +### func \(\*ClientWithResponses\) [GetAuditExportWithResponse]() ```go func (c *ClientWithResponses) GetAuditExportWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAuditExportResponse, error) @@ -1663,7 +1663,7 @@ func (c *ClientWithResponses) GetAuditExportWithResponse(ctx context.Context, re GetAuditExportWithResponse request returning \*GetAuditExportResponse -### func \(\*ClientWithResponses\) [GetAuditLogByIDWithResponse]() +### func \(\*ClientWithResponses\) [GetAuditLogByIDWithResponse]() ```go func (c *ClientWithResponses) GetAuditLogByIDWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetAuditLogByIDResponse, error) @@ -1672,7 +1672,7 @@ func (c *ClientWithResponses) GetAuditLogByIDWithResponse(ctx context.Context, i GetAuditLogByIDWithResponse request returning \*GetAuditLogByIDResponse -### func \(\*ClientWithResponses\) [GetAuditLogsWithResponse]() +### func \(\*ClientWithResponses\) [GetAuditLogsWithResponse]() ```go func (c *ClientWithResponses) GetAuditLogsWithResponse(ctx context.Context, params *GetAuditLogsParams, reqEditors ...RequestEditorFn) (*GetAuditLogsResponse, error) @@ -1681,7 +1681,7 @@ func (c *ClientWithResponses) GetAuditLogsWithResponse(ctx context.Context, para GetAuditLogsWithResponse request returning \*GetAuditLogsResponse -### func \(\*ClientWithResponses\) [GetFileByNameWithResponse]() +### func \(\*ClientWithResponses\) [GetFileByNameWithResponse]() ```go func (c *ClientWithResponses) GetFileByNameWithResponse(ctx context.Context, name FileName, reqEditors ...RequestEditorFn) (*GetFileByNameResponse, error) @@ -1690,7 +1690,7 @@ func (c *ClientWithResponses) GetFileByNameWithResponse(ctx context.Context, nam GetFileByNameWithResponse request returning \*GetFileByNameResponse -### func \(\*ClientWithResponses\) [GetFilesWithResponse]() +### func \(\*ClientWithResponses\) [GetFilesWithResponse]() ```go func (c *ClientWithResponses) GetFilesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFilesResponse, error) @@ -1699,7 +1699,7 @@ func (c *ClientWithResponses) GetFilesWithResponse(ctx context.Context, reqEdito GetFilesWithResponse request returning \*GetFilesResponse -### func \(\*ClientWithResponses\) [GetHealthReadyWithResponse]() +### func \(\*ClientWithResponses\) [GetHealthReadyWithResponse]() ```go func (c *ClientWithResponses) GetHealthReadyWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthReadyResponse, error) @@ -1708,7 +1708,7 @@ func (c *ClientWithResponses) GetHealthReadyWithResponse(ctx context.Context, re GetHealthReadyWithResponse request returning \*GetHealthReadyResponse -### func \(\*ClientWithResponses\) [GetHealthStatusWithResponse]() +### func \(\*ClientWithResponses\) [GetHealthStatusWithResponse]() ```go func (c *ClientWithResponses) GetHealthStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthStatusResponse, error) @@ -1717,7 +1717,7 @@ func (c *ClientWithResponses) GetHealthStatusWithResponse(ctx context.Context, r GetHealthStatusWithResponse request returning \*GetHealthStatusResponse -### func \(\*ClientWithResponses\) [GetHealthWithResponse]() +### func \(\*ClientWithResponses\) [GetHealthWithResponse]() ```go func (c *ClientWithResponses) GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error) @@ -1726,7 +1726,7 @@ func (c *ClientWithResponses) GetHealthWithResponse(ctx context.Context, reqEdit GetHealthWithResponse request returning \*GetHealthResponse -### func \(\*ClientWithResponses\) [GetJobByIDWithResponse]() +### func \(\*ClientWithResponses\) [GetJobByIDWithResponse]() ```go func (c *ClientWithResponses) GetJobByIDWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetJobByIDResponse, error) @@ -1735,7 +1735,7 @@ func (c *ClientWithResponses) GetJobByIDWithResponse(ctx context.Context, id ope GetJobByIDWithResponse request returning \*GetJobByIDResponse -### func \(\*ClientWithResponses\) [GetJobStatusWithResponse]() +### func \(\*ClientWithResponses\) [GetJobStatusWithResponse]() ```go func (c *ClientWithResponses) GetJobStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetJobStatusResponse, error) @@ -1744,7 +1744,7 @@ func (c *ClientWithResponses) GetJobStatusWithResponse(ctx context.Context, reqE GetJobStatusWithResponse request returning \*GetJobStatusResponse -### func \(\*ClientWithResponses\) [GetJobWithResponse]() +### func \(\*ClientWithResponses\) [GetJobWithResponse]() ```go func (c *ClientWithResponses) GetJobWithResponse(ctx context.Context, params *GetJobParams, reqEditors ...RequestEditorFn) (*GetJobResponse, error) @@ -1753,7 +1753,7 @@ func (c *ClientWithResponses) GetJobWithResponse(ctx context.Context, params *Ge GetJobWithResponse request returning \*GetJobResponse -### func \(\*ClientWithResponses\) [GetNodeDiskWithResponse]() +### func \(\*ClientWithResponses\) [GetNodeDiskWithResponse]() ```go func (c *ClientWithResponses) GetNodeDiskWithResponse(ctx context.Context, hostname Hostname, reqEditors ...RequestEditorFn) (*GetNodeDiskResponse, error) @@ -1762,7 +1762,7 @@ func (c *ClientWithResponses) GetNodeDiskWithResponse(ctx context.Context, hostn GetNodeDiskWithResponse request returning \*GetNodeDiskResponse -### func \(\*ClientWithResponses\) [GetNodeHostnameWithResponse]() +### func \(\*ClientWithResponses\) [GetNodeHostnameWithResponse]() ```go func (c *ClientWithResponses) GetNodeHostnameWithResponse(ctx context.Context, hostname Hostname, reqEditors ...RequestEditorFn) (*GetNodeHostnameResponse, error) @@ -1771,7 +1771,7 @@ func (c *ClientWithResponses) GetNodeHostnameWithResponse(ctx context.Context, h GetNodeHostnameWithResponse request returning \*GetNodeHostnameResponse -### func \(\*ClientWithResponses\) [GetNodeLoadWithResponse]() +### func \(\*ClientWithResponses\) [GetNodeLoadWithResponse]() ```go func (c *ClientWithResponses) GetNodeLoadWithResponse(ctx context.Context, hostname Hostname, reqEditors ...RequestEditorFn) (*GetNodeLoadResponse, error) @@ -1780,7 +1780,7 @@ func (c *ClientWithResponses) GetNodeLoadWithResponse(ctx context.Context, hostn GetNodeLoadWithResponse request returning \*GetNodeLoadResponse -### func \(\*ClientWithResponses\) [GetNodeMemoryWithResponse]() +### func \(\*ClientWithResponses\) [GetNodeMemoryWithResponse]() ```go func (c *ClientWithResponses) GetNodeMemoryWithResponse(ctx context.Context, hostname Hostname, reqEditors ...RequestEditorFn) (*GetNodeMemoryResponse, error) @@ -1789,7 +1789,7 @@ func (c *ClientWithResponses) GetNodeMemoryWithResponse(ctx context.Context, hos GetNodeMemoryWithResponse request returning \*GetNodeMemoryResponse -### func \(\*ClientWithResponses\) [GetNodeNetworkDNSByInterfaceWithResponse]() +### func \(\*ClientWithResponses\) [GetNodeNetworkDNSByInterfaceWithResponse]() ```go func (c *ClientWithResponses) GetNodeNetworkDNSByInterfaceWithResponse(ctx context.Context, hostname Hostname, interfaceName string, reqEditors ...RequestEditorFn) (*GetNodeNetworkDNSByInterfaceResponse, error) @@ -1798,7 +1798,7 @@ func (c *ClientWithResponses) GetNodeNetworkDNSByInterfaceWithResponse(ctx conte GetNodeNetworkDNSByInterfaceWithResponse request returning \*GetNodeNetworkDNSByInterfaceResponse -### func \(\*ClientWithResponses\) [GetNodeOSWithResponse]() +### func \(\*ClientWithResponses\) [GetNodeOSWithResponse]() ```go func (c *ClientWithResponses) GetNodeOSWithResponse(ctx context.Context, hostname Hostname, reqEditors ...RequestEditorFn) (*GetNodeOSResponse, error) @@ -1807,7 +1807,7 @@ func (c *ClientWithResponses) GetNodeOSWithResponse(ctx context.Context, hostnam GetNodeOSWithResponse request returning \*GetNodeOSResponse -### func \(\*ClientWithResponses\) [GetNodeStatusWithResponse]() +### func \(\*ClientWithResponses\) [GetNodeStatusWithResponse]() ```go func (c *ClientWithResponses) GetNodeStatusWithResponse(ctx context.Context, hostname Hostname, reqEditors ...RequestEditorFn) (*GetNodeStatusResponse, error) @@ -1816,7 +1816,7 @@ func (c *ClientWithResponses) GetNodeStatusWithResponse(ctx context.Context, hos GetNodeStatusWithResponse request returning \*GetNodeStatusResponse -### func \(\*ClientWithResponses\) [GetNodeUptimeWithResponse]() +### func \(\*ClientWithResponses\) [GetNodeUptimeWithResponse]() ```go func (c *ClientWithResponses) GetNodeUptimeWithResponse(ctx context.Context, hostname Hostname, reqEditors ...RequestEditorFn) (*GetNodeUptimeResponse, error) @@ -1825,7 +1825,7 @@ func (c *ClientWithResponses) GetNodeUptimeWithResponse(ctx context.Context, hos GetNodeUptimeWithResponse request returning \*GetNodeUptimeResponse -### func \(\*ClientWithResponses\) [GetVersionWithResponse]() +### func \(\*ClientWithResponses\) [GetVersionWithResponse]() ```go func (c *ClientWithResponses) GetVersionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetVersionResponse, error) @@ -1834,7 +1834,7 @@ func (c *ClientWithResponses) GetVersionWithResponse(ctx context.Context, reqEdi GetVersionWithResponse request returning \*GetVersionResponse -### func \(\*ClientWithResponses\) [PostFileWithBodyWithResponse]() +### func \(\*ClientWithResponses\) [PostFileWithBodyWithResponse]() ```go func (c *ClientWithResponses) PostFileWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFileResponse, error) @@ -1843,7 +1843,7 @@ func (c *ClientWithResponses) PostFileWithBodyWithResponse(ctx context.Context, PostFileWithBodyWithResponse request with arbitrary body returning \*PostFileResponse -### func \(\*ClientWithResponses\) [PostFileWithResponse]() +### func \(\*ClientWithResponses\) [PostFileWithResponse]() ```go func (c *ClientWithResponses) PostFileWithResponse(ctx context.Context, body PostFileJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFileResponse, error) @@ -1852,7 +1852,7 @@ func (c *ClientWithResponses) PostFileWithResponse(ctx context.Context, body Pos -### func \(\*ClientWithResponses\) [PostJobWithBodyWithResponse]() +### func \(\*ClientWithResponses\) [PostJobWithBodyWithResponse]() ```go func (c *ClientWithResponses) PostJobWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostJobResponse, error) @@ -1861,7 +1861,7 @@ func (c *ClientWithResponses) PostJobWithBodyWithResponse(ctx context.Context, c PostJobWithBodyWithResponse request with arbitrary body returning \*PostJobResponse -### func \(\*ClientWithResponses\) [PostJobWithResponse]() +### func \(\*ClientWithResponses\) [PostJobWithResponse]() ```go func (c *ClientWithResponses) PostJobWithResponse(ctx context.Context, body PostJobJSONRequestBody, reqEditors ...RequestEditorFn) (*PostJobResponse, error) @@ -1870,7 +1870,7 @@ func (c *ClientWithResponses) PostJobWithResponse(ctx context.Context, body Post -### func \(\*ClientWithResponses\) [PostNodeCommandExecWithBodyWithResponse]() +### func \(\*ClientWithResponses\) [PostNodeCommandExecWithBodyWithResponse]() ```go func (c *ClientWithResponses) PostNodeCommandExecWithBodyWithResponse(ctx context.Context, hostname Hostname, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostNodeCommandExecResponse, error) @@ -1879,7 +1879,7 @@ func (c *ClientWithResponses) PostNodeCommandExecWithBodyWithResponse(ctx contex PostNodeCommandExecWithBodyWithResponse request with arbitrary body returning \*PostNodeCommandExecResponse -### func \(\*ClientWithResponses\) [PostNodeCommandExecWithResponse]() +### func \(\*ClientWithResponses\) [PostNodeCommandExecWithResponse]() ```go func (c *ClientWithResponses) PostNodeCommandExecWithResponse(ctx context.Context, hostname Hostname, body PostNodeCommandExecJSONRequestBody, reqEditors ...RequestEditorFn) (*PostNodeCommandExecResponse, error) @@ -1888,7 +1888,7 @@ func (c *ClientWithResponses) PostNodeCommandExecWithResponse(ctx context.Contex -### func \(\*ClientWithResponses\) [PostNodeCommandShellWithBodyWithResponse]() +### func \(\*ClientWithResponses\) [PostNodeCommandShellWithBodyWithResponse]() ```go func (c *ClientWithResponses) PostNodeCommandShellWithBodyWithResponse(ctx context.Context, hostname Hostname, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostNodeCommandShellResponse, error) @@ -1897,7 +1897,7 @@ func (c *ClientWithResponses) PostNodeCommandShellWithBodyWithResponse(ctx conte PostNodeCommandShellWithBodyWithResponse request with arbitrary body returning \*PostNodeCommandShellResponse -### func \(\*ClientWithResponses\) [PostNodeCommandShellWithResponse]() +### func \(\*ClientWithResponses\) [PostNodeCommandShellWithResponse]() ```go func (c *ClientWithResponses) PostNodeCommandShellWithResponse(ctx context.Context, hostname Hostname, body PostNodeCommandShellJSONRequestBody, reqEditors ...RequestEditorFn) (*PostNodeCommandShellResponse, error) @@ -1906,7 +1906,7 @@ func (c *ClientWithResponses) PostNodeCommandShellWithResponse(ctx context.Conte -### func \(\*ClientWithResponses\) [PostNodeFileDeployWithBodyWithResponse]() +### func \(\*ClientWithResponses\) [PostNodeFileDeployWithBodyWithResponse]() ```go func (c *ClientWithResponses) PostNodeFileDeployWithBodyWithResponse(ctx context.Context, hostname Hostname, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostNodeFileDeployResponse, error) @@ -1915,7 +1915,7 @@ func (c *ClientWithResponses) PostNodeFileDeployWithBodyWithResponse(ctx context PostNodeFileDeployWithBodyWithResponse request with arbitrary body returning \*PostNodeFileDeployResponse -### func \(\*ClientWithResponses\) [PostNodeFileDeployWithResponse]() +### func \(\*ClientWithResponses\) [PostNodeFileDeployWithResponse]() ```go func (c *ClientWithResponses) PostNodeFileDeployWithResponse(ctx context.Context, hostname Hostname, body PostNodeFileDeployJSONRequestBody, reqEditors ...RequestEditorFn) (*PostNodeFileDeployResponse, error) @@ -1924,7 +1924,7 @@ func (c *ClientWithResponses) PostNodeFileDeployWithResponse(ctx context.Context -### func \(\*ClientWithResponses\) [PostNodeFileStatusWithBodyWithResponse]() +### func \(\*ClientWithResponses\) [PostNodeFileStatusWithBodyWithResponse]() ```go func (c *ClientWithResponses) PostNodeFileStatusWithBodyWithResponse(ctx context.Context, hostname Hostname, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostNodeFileStatusResponse, error) @@ -1933,7 +1933,7 @@ func (c *ClientWithResponses) PostNodeFileStatusWithBodyWithResponse(ctx context PostNodeFileStatusWithBodyWithResponse request with arbitrary body returning \*PostNodeFileStatusResponse -### func \(\*ClientWithResponses\) [PostNodeFileStatusWithResponse]() +### func \(\*ClientWithResponses\) [PostNodeFileStatusWithResponse]() ```go func (c *ClientWithResponses) PostNodeFileStatusWithResponse(ctx context.Context, hostname Hostname, body PostNodeFileStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*PostNodeFileStatusResponse, error) @@ -1942,7 +1942,7 @@ func (c *ClientWithResponses) PostNodeFileStatusWithResponse(ctx context.Context -### func \(\*ClientWithResponses\) [PostNodeNetworkPingWithBodyWithResponse]() +### func \(\*ClientWithResponses\) [PostNodeNetworkPingWithBodyWithResponse]() ```go func (c *ClientWithResponses) PostNodeNetworkPingWithBodyWithResponse(ctx context.Context, hostname Hostname, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostNodeNetworkPingResponse, error) @@ -1951,7 +1951,7 @@ func (c *ClientWithResponses) PostNodeNetworkPingWithBodyWithResponse(ctx contex PostNodeNetworkPingWithBodyWithResponse request with arbitrary body returning \*PostNodeNetworkPingResponse -### func \(\*ClientWithResponses\) [PostNodeNetworkPingWithResponse]() +### func \(\*ClientWithResponses\) [PostNodeNetworkPingWithResponse]() ```go func (c *ClientWithResponses) PostNodeNetworkPingWithResponse(ctx context.Context, hostname Hostname, body PostNodeNetworkPingJSONRequestBody, reqEditors ...RequestEditorFn) (*PostNodeNetworkPingResponse, error) @@ -1960,7 +1960,7 @@ func (c *ClientWithResponses) PostNodeNetworkPingWithResponse(ctx context.Contex -### func \(\*ClientWithResponses\) [PutNodeNetworkDNSWithBodyWithResponse]() +### func \(\*ClientWithResponses\) [PutNodeNetworkDNSWithBodyWithResponse]() ```go func (c *ClientWithResponses) PutNodeNetworkDNSWithBodyWithResponse(ctx context.Context, hostname Hostname, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutNodeNetworkDNSResponse, error) @@ -1969,7 +1969,7 @@ func (c *ClientWithResponses) PutNodeNetworkDNSWithBodyWithResponse(ctx context. PutNodeNetworkDNSWithBodyWithResponse request with arbitrary body returning \*PutNodeNetworkDNSResponse -### func \(\*ClientWithResponses\) [PutNodeNetworkDNSWithResponse]() +### func \(\*ClientWithResponses\) [PutNodeNetworkDNSWithResponse]() ```go func (c *ClientWithResponses) PutNodeNetworkDNSWithResponse(ctx context.Context, hostname Hostname, body PutNodeNetworkDNSJSONRequestBody, reqEditors ...RequestEditorFn) (*PutNodeNetworkDNSResponse, error) @@ -1978,7 +1978,7 @@ func (c *ClientWithResponses) PutNodeNetworkDNSWithResponse(ctx context.Context, -### func \(\*ClientWithResponses\) [RetryJobByIDWithBodyWithResponse]() +### func \(\*ClientWithResponses\) [RetryJobByIDWithBodyWithResponse]() ```go func (c *ClientWithResponses) RetryJobByIDWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RetryJobByIDResponse, error) @@ -1987,7 +1987,7 @@ func (c *ClientWithResponses) RetryJobByIDWithBodyWithResponse(ctx context.Conte RetryJobByIDWithBodyWithResponse request with arbitrary body returning \*RetryJobByIDResponse -### func \(\*ClientWithResponses\) [RetryJobByIDWithResponse]() +### func \(\*ClientWithResponses\) [RetryJobByIDWithResponse]() ```go func (c *ClientWithResponses) RetryJobByIDWithResponse(ctx context.Context, id openapi_types.UUID, body RetryJobByIDJSONRequestBody, reqEditors ...RequestEditorFn) (*RetryJobByIDResponse, error) @@ -1996,7 +1996,7 @@ func (c *ClientWithResponses) RetryJobByIDWithResponse(ctx context.Context, id o -### func \(\*ClientWithResponses\) [UndrainAgentWithResponse]() +### func \(\*ClientWithResponses\) [UndrainAgentWithResponse]() ```go func (c *ClientWithResponses) UndrainAgentWithResponse(ctx context.Context, hostname string, reqEditors ...RequestEditorFn) (*UndrainAgentResponse, error) @@ -2404,7 +2404,7 @@ const ( ``` -## type [DeleteFileByNameResponse]() +## type [DeleteFileByNameResponse]() @@ -2413,6 +2413,7 @@ type DeleteFileByNameResponse struct { Body []byte HTTPResponse *http.Response JSON200 *FileDeleteResponse + JSON400 *ErrorResponse JSON401 *ErrorResponse JSON403 *ErrorResponse JSON404 *ErrorResponse @@ -2421,7 +2422,7 @@ type DeleteFileByNameResponse struct { ``` -### func [ParseDeleteFileByNameResponse]() +### func [ParseDeleteFileByNameResponse]() ```go func ParseDeleteFileByNameResponse(rsp *http.Response) (*DeleteFileByNameResponse, error) @@ -2430,7 +2431,7 @@ func ParseDeleteFileByNameResponse(rsp *http.Response) (*DeleteFileByNameRespons ParseDeleteFileByNameResponse parses an HTTP response from a DeleteFileByNameWithResponse call -### func \(DeleteFileByNameResponse\) [Status]() +### func \(DeleteFileByNameResponse\) [Status]() ```go func (r DeleteFileByNameResponse) Status() string @@ -2439,7 +2440,7 @@ func (r DeleteFileByNameResponse) Status() string Status returns HTTPResponse.Status -### func \(DeleteFileByNameResponse\) [StatusCode]() +### func \(DeleteFileByNameResponse\) [StatusCode]() ```go func (r DeleteFileByNameResponse) StatusCode() int @@ -2448,7 +2449,7 @@ func (r DeleteFileByNameResponse) StatusCode() int StatusCode returns HTTPResponse.StatusCode -## type [DeleteJobByIDResponse]() +## type [DeleteJobByIDResponse]() @@ -2465,7 +2466,7 @@ type DeleteJobByIDResponse struct { ``` -### func [ParseDeleteJobByIDResponse]() +### func [ParseDeleteJobByIDResponse]() ```go func ParseDeleteJobByIDResponse(rsp *http.Response) (*DeleteJobByIDResponse, error) @@ -2474,7 +2475,7 @@ func ParseDeleteJobByIDResponse(rsp *http.Response) (*DeleteJobByIDResponse, err ParseDeleteJobByIDResponse parses an HTTP response from a DeleteJobByIDWithResponse call -### func \(DeleteJobByIDResponse\) [Status]() +### func \(DeleteJobByIDResponse\) [Status]() ```go func (r DeleteJobByIDResponse) Status() string @@ -2483,7 +2484,7 @@ func (r DeleteJobByIDResponse) Status() string Status returns HTTPResponse.Status -### func \(DeleteJobByIDResponse\) [StatusCode]() +### func \(DeleteJobByIDResponse\) [StatusCode]() ```go func (r DeleteJobByIDResponse) StatusCode() int @@ -2572,7 +2573,7 @@ type DrainAgentResponse struct { ``` -### func [ParseDrainAgentResponse]() +### func [ParseDrainAgentResponse]() ```go func ParseDrainAgentResponse(rsp *http.Response) (*DrainAgentResponse, error) @@ -2844,7 +2845,7 @@ type GetAgentDetailsResponse struct { ``` -### func [ParseGetAgentDetailsResponse]() +### func [ParseGetAgentDetailsResponse]() ```go func ParseGetAgentDetailsResponse(rsp *http.Response) (*GetAgentDetailsResponse, error) @@ -2887,7 +2888,7 @@ type GetAgentResponse struct { ``` -### func [ParseGetAgentResponse]() +### func [ParseGetAgentResponse]() ```go func ParseGetAgentResponse(rsp *http.Response) (*GetAgentResponse, error) @@ -2930,7 +2931,7 @@ type GetAuditExportResponse struct { ``` -### func [ParseGetAuditExportResponse]() +### func [ParseGetAuditExportResponse]() ```go func ParseGetAuditExportResponse(rsp *http.Response) (*GetAuditExportResponse, error) @@ -2974,7 +2975,7 @@ type GetAuditLogByIDResponse struct { ``` -### func [ParseGetAuditLogByIDResponse]() +### func [ParseGetAuditLogByIDResponse]() ```go func ParseGetAuditLogByIDResponse(rsp *http.Response) (*GetAuditLogByIDResponse, error) @@ -3033,7 +3034,7 @@ type GetAuditLogsResponse struct { ``` -### func [ParseGetAuditLogsResponse]() +### func [ParseGetAuditLogsResponse]() ```go func ParseGetAuditLogsResponse(rsp *http.Response) (*GetAuditLogsResponse, error) @@ -3060,7 +3061,7 @@ func (r GetAuditLogsResponse) StatusCode() int StatusCode returns HTTPResponse.StatusCode -## type [GetFileByNameResponse]() +## type [GetFileByNameResponse]() @@ -3069,6 +3070,7 @@ type GetFileByNameResponse struct { Body []byte HTTPResponse *http.Response JSON200 *FileInfoResponse + JSON400 *ErrorResponse JSON401 *ErrorResponse JSON403 *ErrorResponse JSON404 *ErrorResponse @@ -3077,7 +3079,7 @@ type GetFileByNameResponse struct { ``` -### func [ParseGetFileByNameResponse]() +### func [ParseGetFileByNameResponse]() ```go func ParseGetFileByNameResponse(rsp *http.Response) (*GetFileByNameResponse, error) @@ -3086,7 +3088,7 @@ func ParseGetFileByNameResponse(rsp *http.Response) (*GetFileByNameResponse, err ParseGetFileByNameResponse parses an HTTP response from a GetFileByNameWithResponse call -### func \(GetFileByNameResponse\) [Status]() +### func \(GetFileByNameResponse\) [Status]() ```go func (r GetFileByNameResponse) Status() string @@ -3095,7 +3097,7 @@ func (r GetFileByNameResponse) Status() string Status returns HTTPResponse.Status -### func \(GetFileByNameResponse\) [StatusCode]() +### func \(GetFileByNameResponse\) [StatusCode]() ```go func (r GetFileByNameResponse) StatusCode() int @@ -3120,7 +3122,7 @@ type GetFilesResponse struct { ``` -### func [ParseGetFilesResponse]() +### func [ParseGetFilesResponse]() ```go func ParseGetFilesResponse(rsp *http.Response) (*GetFilesResponse, error) @@ -3147,7 +3149,7 @@ func (r GetFilesResponse) StatusCode() int StatusCode returns HTTPResponse.StatusCode -## type [GetHealthReadyResponse]() +## type [GetHealthReadyResponse]() @@ -3161,7 +3163,7 @@ type GetHealthReadyResponse struct { ``` -### func [ParseGetHealthReadyResponse]() +### func [ParseGetHealthReadyResponse]() ```go func ParseGetHealthReadyResponse(rsp *http.Response) (*GetHealthReadyResponse, error) @@ -3170,7 +3172,7 @@ func ParseGetHealthReadyResponse(rsp *http.Response) (*GetHealthReadyResponse, e ParseGetHealthReadyResponse parses an HTTP response from a GetHealthReadyWithResponse call -### func \(GetHealthReadyResponse\) [Status]() +### func \(GetHealthReadyResponse\) [Status]() ```go func (r GetHealthReadyResponse) Status() string @@ -3179,7 +3181,7 @@ func (r GetHealthReadyResponse) Status() string Status returns HTTPResponse.Status -### func \(GetHealthReadyResponse\) [StatusCode]() +### func \(GetHealthReadyResponse\) [StatusCode]() ```go func (r GetHealthReadyResponse) StatusCode() int @@ -3188,7 +3190,7 @@ func (r GetHealthReadyResponse) StatusCode() int StatusCode returns HTTPResponse.StatusCode -## type [GetHealthResponse]() +## type [GetHealthResponse]() @@ -3201,7 +3203,7 @@ type GetHealthResponse struct { ``` -### func [ParseGetHealthResponse]() +### func [ParseGetHealthResponse]() ```go func ParseGetHealthResponse(rsp *http.Response) (*GetHealthResponse, error) @@ -3210,7 +3212,7 @@ func ParseGetHealthResponse(rsp *http.Response) (*GetHealthResponse, error) ParseGetHealthResponse parses an HTTP response from a GetHealthWithResponse call -### func \(GetHealthResponse\) [Status]() +### func \(GetHealthResponse\) [Status]() ```go func (r GetHealthResponse) Status() string @@ -3219,7 +3221,7 @@ func (r GetHealthResponse) Status() string Status returns HTTPResponse.Status -### func \(GetHealthResponse\) [StatusCode]() +### func \(GetHealthResponse\) [StatusCode]() ```go func (r GetHealthResponse) StatusCode() int @@ -3228,7 +3230,7 @@ func (r GetHealthResponse) StatusCode() int StatusCode returns HTTPResponse.StatusCode -## type [GetHealthStatusResponse]() +## type [GetHealthStatusResponse]() @@ -3244,7 +3246,7 @@ type GetHealthStatusResponse struct { ``` -### func [ParseGetHealthStatusResponse]() +### func [ParseGetHealthStatusResponse]() ```go func ParseGetHealthStatusResponse(rsp *http.Response) (*GetHealthStatusResponse, error) @@ -3253,7 +3255,7 @@ func ParseGetHealthStatusResponse(rsp *http.Response) (*GetHealthStatusResponse, ParseGetHealthStatusResponse parses an HTTP response from a GetHealthStatusWithResponse call -### func \(GetHealthStatusResponse\) [Status]() +### func \(GetHealthStatusResponse\) [Status]() ```go func (r GetHealthStatusResponse) Status() string @@ -3262,7 +3264,7 @@ func (r GetHealthStatusResponse) Status() string Status returns HTTPResponse.Status -### func \(GetHealthStatusResponse\) [StatusCode]() +### func \(GetHealthStatusResponse\) [StatusCode]() ```go func (r GetHealthStatusResponse) StatusCode() int @@ -3271,7 +3273,7 @@ func (r GetHealthStatusResponse) StatusCode() int StatusCode returns HTTPResponse.StatusCode -## type [GetJobByIDResponse]() +## type [GetJobByIDResponse]() @@ -3289,7 +3291,7 @@ type GetJobByIDResponse struct { ``` -### func [ParseGetJobByIDResponse]() +### func [ParseGetJobByIDResponse]() ```go func ParseGetJobByIDResponse(rsp *http.Response) (*GetJobByIDResponse, error) @@ -3298,7 +3300,7 @@ func ParseGetJobByIDResponse(rsp *http.Response) (*GetJobByIDResponse, error) ParseGetJobByIDResponse parses an HTTP response from a GetJobByIDWithResponse call -### func \(GetJobByIDResponse\) [Status]() +### func \(GetJobByIDResponse\) [Status]() ```go func (r GetJobByIDResponse) Status() string @@ -3307,7 +3309,7 @@ func (r GetJobByIDResponse) Status() string Status returns HTTPResponse.Status -### func \(GetJobByIDResponse\) [StatusCode]() +### func \(GetJobByIDResponse\) [StatusCode]() ```go func (r GetJobByIDResponse) StatusCode() int @@ -3355,7 +3357,7 @@ const ( ``` -## type [GetJobResponse]() +## type [GetJobResponse]() @@ -3372,7 +3374,7 @@ type GetJobResponse struct { ``` -### func [ParseGetJobResponse]() +### func [ParseGetJobResponse]() ```go func ParseGetJobResponse(rsp *http.Response) (*GetJobResponse, error) @@ -3381,7 +3383,7 @@ func ParseGetJobResponse(rsp *http.Response) (*GetJobResponse, error) ParseGetJobResponse parses an HTTP response from a GetJobWithResponse call -### func \(GetJobResponse\) [Status]() +### func \(GetJobResponse\) [Status]() ```go func (r GetJobResponse) Status() string @@ -3390,7 +3392,7 @@ func (r GetJobResponse) Status() string Status returns HTTPResponse.Status -### func \(GetJobResponse\) [StatusCode]() +### func \(GetJobResponse\) [StatusCode]() ```go func (r GetJobResponse) StatusCode() int @@ -3399,7 +3401,7 @@ func (r GetJobResponse) StatusCode() int StatusCode returns HTTPResponse.StatusCode -## type [GetJobStatusResponse]() +## type [GetJobStatusResponse]() @@ -3415,7 +3417,7 @@ type GetJobStatusResponse struct { ``` -### func [ParseGetJobStatusResponse]() +### func [ParseGetJobStatusResponse]() ```go func ParseGetJobStatusResponse(rsp *http.Response) (*GetJobStatusResponse, error) @@ -3424,7 +3426,7 @@ func ParseGetJobStatusResponse(rsp *http.Response) (*GetJobStatusResponse, error ParseGetJobStatusResponse parses an HTTP response from a GetJobStatusWithResponse call -### func \(GetJobStatusResponse\) [Status]() +### func \(GetJobStatusResponse\) [Status]() ```go func (r GetJobStatusResponse) Status() string @@ -3433,7 +3435,7 @@ func (r GetJobStatusResponse) Status() string Status returns HTTPResponse.Status -### func \(GetJobStatusResponse\) [StatusCode]() +### func \(GetJobStatusResponse\) [StatusCode]() ```go func (r GetJobStatusResponse) StatusCode() int @@ -3442,7 +3444,7 @@ func (r GetJobStatusResponse) StatusCode() int StatusCode returns HTTPResponse.StatusCode -## type [GetNodeDiskResponse]() +## type [GetNodeDiskResponse]() @@ -3459,7 +3461,7 @@ type GetNodeDiskResponse struct { ``` -### func [ParseGetNodeDiskResponse]() +### func [ParseGetNodeDiskResponse]() ```go func ParseGetNodeDiskResponse(rsp *http.Response) (*GetNodeDiskResponse, error) @@ -3468,7 +3470,7 @@ func ParseGetNodeDiskResponse(rsp *http.Response) (*GetNodeDiskResponse, error) ParseGetNodeDiskResponse parses an HTTP response from a GetNodeDiskWithResponse call -### func \(GetNodeDiskResponse\) [Status]() +### func \(GetNodeDiskResponse\) [Status]() ```go func (r GetNodeDiskResponse) Status() string @@ -3477,7 +3479,7 @@ func (r GetNodeDiskResponse) Status() string Status returns HTTPResponse.Status -### func \(GetNodeDiskResponse\) [StatusCode]() +### func \(GetNodeDiskResponse\) [StatusCode]() ```go func (r GetNodeDiskResponse) StatusCode() int @@ -3486,7 +3488,7 @@ func (r GetNodeDiskResponse) StatusCode() int StatusCode returns HTTPResponse.StatusCode -## type [GetNodeHostnameResponse]() +## type [GetNodeHostnameResponse]() @@ -3503,7 +3505,7 @@ type GetNodeHostnameResponse struct { ``` -### func [ParseGetNodeHostnameResponse]() +### func [ParseGetNodeHostnameResponse]() ```go func ParseGetNodeHostnameResponse(rsp *http.Response) (*GetNodeHostnameResponse, error) @@ -3512,7 +3514,7 @@ func ParseGetNodeHostnameResponse(rsp *http.Response) (*GetNodeHostnameResponse, ParseGetNodeHostnameResponse parses an HTTP response from a GetNodeHostnameWithResponse call -### func \(GetNodeHostnameResponse\) [Status]() +### func \(GetNodeHostnameResponse\) [Status]() ```go func (r GetNodeHostnameResponse) Status() string @@ -3521,7 +3523,7 @@ func (r GetNodeHostnameResponse) Status() string Status returns HTTPResponse.Status -### func \(GetNodeHostnameResponse\) [StatusCode]() +### func \(GetNodeHostnameResponse\) [StatusCode]() ```go func (r GetNodeHostnameResponse) StatusCode() int @@ -3530,7 +3532,7 @@ func (r GetNodeHostnameResponse) StatusCode() int StatusCode returns HTTPResponse.StatusCode -## type [GetNodeLoadResponse]() +## type [GetNodeLoadResponse]() @@ -3547,7 +3549,7 @@ type GetNodeLoadResponse struct { ``` -### func [ParseGetNodeLoadResponse]() +### func [ParseGetNodeLoadResponse]() ```go func ParseGetNodeLoadResponse(rsp *http.Response) (*GetNodeLoadResponse, error) @@ -3556,7 +3558,7 @@ func ParseGetNodeLoadResponse(rsp *http.Response) (*GetNodeLoadResponse, error) ParseGetNodeLoadResponse parses an HTTP response from a GetNodeLoadWithResponse call -### func \(GetNodeLoadResponse\) [Status]() +### func \(GetNodeLoadResponse\) [Status]() ```go func (r GetNodeLoadResponse) Status() string @@ -3565,7 +3567,7 @@ func (r GetNodeLoadResponse) Status() string Status returns HTTPResponse.Status -### func \(GetNodeLoadResponse\) [StatusCode]() +### func \(GetNodeLoadResponse\) [StatusCode]() ```go func (r GetNodeLoadResponse) StatusCode() int @@ -3574,7 +3576,7 @@ func (r GetNodeLoadResponse) StatusCode() int StatusCode returns HTTPResponse.StatusCode -## type [GetNodeMemoryResponse]() +## type [GetNodeMemoryResponse]() @@ -3591,7 +3593,7 @@ type GetNodeMemoryResponse struct { ``` -### func [ParseGetNodeMemoryResponse]() +### func [ParseGetNodeMemoryResponse]() ```go func ParseGetNodeMemoryResponse(rsp *http.Response) (*GetNodeMemoryResponse, error) @@ -3600,7 +3602,7 @@ func ParseGetNodeMemoryResponse(rsp *http.Response) (*GetNodeMemoryResponse, err ParseGetNodeMemoryResponse parses an HTTP response from a GetNodeMemoryWithResponse call -### func \(GetNodeMemoryResponse\) [Status]() +### func \(GetNodeMemoryResponse\) [Status]() ```go func (r GetNodeMemoryResponse) Status() string @@ -3609,7 +3611,7 @@ func (r GetNodeMemoryResponse) Status() string Status returns HTTPResponse.Status -### func \(GetNodeMemoryResponse\) [StatusCode]() +### func \(GetNodeMemoryResponse\) [StatusCode]() ```go func (r GetNodeMemoryResponse) StatusCode() int @@ -3618,7 +3620,7 @@ func (r GetNodeMemoryResponse) StatusCode() int StatusCode returns HTTPResponse.StatusCode -## type [GetNodeNetworkDNSByInterfaceResponse]() +## type [GetNodeNetworkDNSByInterfaceResponse]() @@ -3635,7 +3637,7 @@ type GetNodeNetworkDNSByInterfaceResponse struct { ``` -### func [ParseGetNodeNetworkDNSByInterfaceResponse]() +### func [ParseGetNodeNetworkDNSByInterfaceResponse]() ```go func ParseGetNodeNetworkDNSByInterfaceResponse(rsp *http.Response) (*GetNodeNetworkDNSByInterfaceResponse, error) @@ -3644,7 +3646,7 @@ func ParseGetNodeNetworkDNSByInterfaceResponse(rsp *http.Response) (*GetNodeNetw ParseGetNodeNetworkDNSByInterfaceResponse parses an HTTP response from a GetNodeNetworkDNSByInterfaceWithResponse call -### func \(GetNodeNetworkDNSByInterfaceResponse\) [Status]() +### func \(GetNodeNetworkDNSByInterfaceResponse\) [Status]() ```go func (r GetNodeNetworkDNSByInterfaceResponse) Status() string @@ -3653,7 +3655,7 @@ func (r GetNodeNetworkDNSByInterfaceResponse) Status() string Status returns HTTPResponse.Status -### func \(GetNodeNetworkDNSByInterfaceResponse\) [StatusCode]() +### func \(GetNodeNetworkDNSByInterfaceResponse\) [StatusCode]() ```go func (r GetNodeNetworkDNSByInterfaceResponse) StatusCode() int @@ -3662,7 +3664,7 @@ func (r GetNodeNetworkDNSByInterfaceResponse) StatusCode() int StatusCode returns HTTPResponse.StatusCode -## type [GetNodeOSResponse]() +## type [GetNodeOSResponse]() @@ -3679,7 +3681,7 @@ type GetNodeOSResponse struct { ``` -### func [ParseGetNodeOSResponse]() +### func [ParseGetNodeOSResponse]() ```go func ParseGetNodeOSResponse(rsp *http.Response) (*GetNodeOSResponse, error) @@ -3688,7 +3690,7 @@ func ParseGetNodeOSResponse(rsp *http.Response) (*GetNodeOSResponse, error) ParseGetNodeOSResponse parses an HTTP response from a GetNodeOSWithResponse call -### func \(GetNodeOSResponse\) [Status]() +### func \(GetNodeOSResponse\) [Status]() ```go func (r GetNodeOSResponse) Status() string @@ -3697,7 +3699,7 @@ func (r GetNodeOSResponse) Status() string Status returns HTTPResponse.Status -### func \(GetNodeOSResponse\) [StatusCode]() +### func \(GetNodeOSResponse\) [StatusCode]() ```go func (r GetNodeOSResponse) StatusCode() int @@ -3706,7 +3708,7 @@ func (r GetNodeOSResponse) StatusCode() int StatusCode returns HTTPResponse.StatusCode -## type [GetNodeStatusResponse]() +## type [GetNodeStatusResponse]() @@ -3723,7 +3725,7 @@ type GetNodeStatusResponse struct { ``` -### func [ParseGetNodeStatusResponse]() +### func [ParseGetNodeStatusResponse]() ```go func ParseGetNodeStatusResponse(rsp *http.Response) (*GetNodeStatusResponse, error) @@ -3732,7 +3734,7 @@ func ParseGetNodeStatusResponse(rsp *http.Response) (*GetNodeStatusResponse, err ParseGetNodeStatusResponse parses an HTTP response from a GetNodeStatusWithResponse call -### func \(GetNodeStatusResponse\) [Status]() +### func \(GetNodeStatusResponse\) [Status]() ```go func (r GetNodeStatusResponse) Status() string @@ -3741,7 +3743,7 @@ func (r GetNodeStatusResponse) Status() string Status returns HTTPResponse.Status -### func \(GetNodeStatusResponse\) [StatusCode]() +### func \(GetNodeStatusResponse\) [StatusCode]() ```go func (r GetNodeStatusResponse) StatusCode() int @@ -3750,7 +3752,7 @@ func (r GetNodeStatusResponse) StatusCode() int StatusCode returns HTTPResponse.StatusCode -## type [GetNodeUptimeResponse]() +## type [GetNodeUptimeResponse]() @@ -3767,7 +3769,7 @@ type GetNodeUptimeResponse struct { ``` -### func [ParseGetNodeUptimeResponse]() +### func [ParseGetNodeUptimeResponse]() ```go func ParseGetNodeUptimeResponse(rsp *http.Response) (*GetNodeUptimeResponse, error) @@ -3776,7 +3778,7 @@ func ParseGetNodeUptimeResponse(rsp *http.Response) (*GetNodeUptimeResponse, err ParseGetNodeUptimeResponse parses an HTTP response from a GetNodeUptimeWithResponse call -### func \(GetNodeUptimeResponse\) [Status]() +### func \(GetNodeUptimeResponse\) [Status]() ```go func (r GetNodeUptimeResponse) Status() string @@ -3785,7 +3787,7 @@ func (r GetNodeUptimeResponse) Status() string Status returns HTTPResponse.Status -### func \(GetNodeUptimeResponse\) [StatusCode]() +### func \(GetNodeUptimeResponse\) [StatusCode]() ```go func (r GetNodeUptimeResponse) StatusCode() int @@ -3794,7 +3796,7 @@ func (r GetNodeUptimeResponse) StatusCode() int StatusCode returns HTTPResponse.StatusCode -## type [GetVersionResponse]() +## type [GetVersionResponse]() @@ -3807,7 +3809,7 @@ type GetVersionResponse struct { ``` -### func [ParseGetVersionResponse]() +### func [ParseGetVersionResponse]() ```go func ParseGetVersionResponse(rsp *http.Response) (*GetVersionResponse, error) @@ -3816,7 +3818,7 @@ func ParseGetVersionResponse(rsp *http.Response) (*GetVersionResponse, error) ParseGetVersionResponse parses an HTTP response from a GetVersionWithResponse call -### func \(GetVersionResponse\) [Status]() +### func \(GetVersionResponse\) [Status]() ```go func (r GetVersionResponse) Status() string @@ -3825,7 +3827,7 @@ func (r GetVersionResponse) Status() string Status returns HTTPResponse.Status -### func \(GetVersionResponse\) [StatusCode]() +### func \(GetVersionResponse\) [StatusCode]() ```go func (r GetVersionResponse) StatusCode() int @@ -4396,7 +4398,7 @@ type PostFileResponse struct { ``` -### func [ParsePostFileResponse]() +### func [ParsePostFileResponse]() ```go func ParsePostFileResponse(rsp *http.Response) (*PostFileResponse, error) @@ -4432,7 +4434,7 @@ type PostJobJSONRequestBody = CreateJobRequest ``` -## type [PostJobResponse]() +## type [PostJobResponse]() @@ -4449,7 +4451,7 @@ type PostJobResponse struct { ``` -### func [ParsePostJobResponse]() +### func [ParsePostJobResponse]() ```go func ParsePostJobResponse(rsp *http.Response) (*PostJobResponse, error) @@ -4458,7 +4460,7 @@ func ParsePostJobResponse(rsp *http.Response) (*PostJobResponse, error) ParsePostJobResponse parses an HTTP response from a PostJobWithResponse call -### func \(PostJobResponse\) [Status]() +### func \(PostJobResponse\) [Status]() ```go func (r PostJobResponse) Status() string @@ -4467,7 +4469,7 @@ func (r PostJobResponse) Status() string Status returns HTTPResponse.Status -### func \(PostJobResponse\) [StatusCode]() +### func \(PostJobResponse\) [StatusCode]() ```go func (r PostJobResponse) StatusCode() int @@ -4485,7 +4487,7 @@ type PostNodeCommandExecJSONRequestBody = CommandExecRequest ``` -## type [PostNodeCommandExecResponse]() +## type [PostNodeCommandExecResponse]() @@ -4502,7 +4504,7 @@ type PostNodeCommandExecResponse struct { ``` -### func [ParsePostNodeCommandExecResponse]() +### func [ParsePostNodeCommandExecResponse]() ```go func ParsePostNodeCommandExecResponse(rsp *http.Response) (*PostNodeCommandExecResponse, error) @@ -4511,7 +4513,7 @@ func ParsePostNodeCommandExecResponse(rsp *http.Response) (*PostNodeCommandExecR ParsePostNodeCommandExecResponse parses an HTTP response from a PostNodeCommandExecWithResponse call -### func \(PostNodeCommandExecResponse\) [Status]() +### func \(PostNodeCommandExecResponse\) [Status]() ```go func (r PostNodeCommandExecResponse) Status() string @@ -4520,7 +4522,7 @@ func (r PostNodeCommandExecResponse) Status() string Status returns HTTPResponse.Status -### func \(PostNodeCommandExecResponse\) [StatusCode]() +### func \(PostNodeCommandExecResponse\) [StatusCode]() ```go func (r PostNodeCommandExecResponse) StatusCode() int @@ -4538,7 +4540,7 @@ type PostNodeCommandShellJSONRequestBody = CommandShellRequest ``` -## type [PostNodeCommandShellResponse]() +## type [PostNodeCommandShellResponse]() @@ -4555,7 +4557,7 @@ type PostNodeCommandShellResponse struct { ``` -### func [ParsePostNodeCommandShellResponse]() +### func [ParsePostNodeCommandShellResponse]() ```go func ParsePostNodeCommandShellResponse(rsp *http.Response) (*PostNodeCommandShellResponse, error) @@ -4564,7 +4566,7 @@ func ParsePostNodeCommandShellResponse(rsp *http.Response) (*PostNodeCommandShel ParsePostNodeCommandShellResponse parses an HTTP response from a PostNodeCommandShellWithResponse call -### func \(PostNodeCommandShellResponse\) [Status]() +### func \(PostNodeCommandShellResponse\) [Status]() ```go func (r PostNodeCommandShellResponse) Status() string @@ -4573,7 +4575,7 @@ func (r PostNodeCommandShellResponse) Status() string Status returns HTTPResponse.Status -### func \(PostNodeCommandShellResponse\) [StatusCode]() +### func \(PostNodeCommandShellResponse\) [StatusCode]() ```go func (r PostNodeCommandShellResponse) StatusCode() int @@ -4591,7 +4593,7 @@ type PostNodeFileDeployJSONRequestBody = FileDeployRequest ``` -## type [PostNodeFileDeployResponse]() +## type [PostNodeFileDeployResponse]() @@ -4608,7 +4610,7 @@ type PostNodeFileDeployResponse struct { ``` -### func [ParsePostNodeFileDeployResponse]() +### func [ParsePostNodeFileDeployResponse]() ```go func ParsePostNodeFileDeployResponse(rsp *http.Response) (*PostNodeFileDeployResponse, error) @@ -4617,7 +4619,7 @@ func ParsePostNodeFileDeployResponse(rsp *http.Response) (*PostNodeFileDeployRes ParsePostNodeFileDeployResponse parses an HTTP response from a PostNodeFileDeployWithResponse call -### func \(PostNodeFileDeployResponse\) [Status]() +### func \(PostNodeFileDeployResponse\) [Status]() ```go func (r PostNodeFileDeployResponse) Status() string @@ -4626,7 +4628,7 @@ func (r PostNodeFileDeployResponse) Status() string Status returns HTTPResponse.Status -### func \(PostNodeFileDeployResponse\) [StatusCode]() +### func \(PostNodeFileDeployResponse\) [StatusCode]() ```go func (r PostNodeFileDeployResponse) StatusCode() int @@ -4644,7 +4646,7 @@ type PostNodeFileStatusJSONRequestBody = FileStatusRequest ``` -## type [PostNodeFileStatusResponse]() +## type [PostNodeFileStatusResponse]() @@ -4661,7 +4663,7 @@ type PostNodeFileStatusResponse struct { ``` -### func [ParsePostNodeFileStatusResponse]() +### func [ParsePostNodeFileStatusResponse]() ```go func ParsePostNodeFileStatusResponse(rsp *http.Response) (*PostNodeFileStatusResponse, error) @@ -4670,7 +4672,7 @@ func ParsePostNodeFileStatusResponse(rsp *http.Response) (*PostNodeFileStatusRes ParsePostNodeFileStatusResponse parses an HTTP response from a PostNodeFileStatusWithResponse call -### func \(PostNodeFileStatusResponse\) [Status]() +### func \(PostNodeFileStatusResponse\) [Status]() ```go func (r PostNodeFileStatusResponse) Status() string @@ -4679,7 +4681,7 @@ func (r PostNodeFileStatusResponse) Status() string Status returns HTTPResponse.Status -### func \(PostNodeFileStatusResponse\) [StatusCode]() +### func \(PostNodeFileStatusResponse\) [StatusCode]() ```go func (r PostNodeFileStatusResponse) StatusCode() int @@ -4709,7 +4711,7 @@ type PostNodeNetworkPingJSONRequestBody PostNodeNetworkPingJSONBody ``` -## type [PostNodeNetworkPingResponse]() +## type [PostNodeNetworkPingResponse]() @@ -4726,7 +4728,7 @@ type PostNodeNetworkPingResponse struct { ``` -### func [ParsePostNodeNetworkPingResponse]() +### func [ParsePostNodeNetworkPingResponse]() ```go func ParsePostNodeNetworkPingResponse(rsp *http.Response) (*PostNodeNetworkPingResponse, error) @@ -4735,7 +4737,7 @@ func ParsePostNodeNetworkPingResponse(rsp *http.Response) (*PostNodeNetworkPingR ParsePostNodeNetworkPingResponse parses an HTTP response from a PostNodeNetworkPingWithResponse call -### func \(PostNodeNetworkPingResponse\) [Status]() +### func \(PostNodeNetworkPingResponse\) [Status]() ```go func (r PostNodeNetworkPingResponse) Status() string @@ -4744,7 +4746,7 @@ func (r PostNodeNetworkPingResponse) Status() string Status returns HTTPResponse.Status -### func \(PostNodeNetworkPingResponse\) [StatusCode]() +### func \(PostNodeNetworkPingResponse\) [StatusCode]() ```go func (r PostNodeNetworkPingResponse) StatusCode() int @@ -4762,7 +4764,7 @@ type PutNodeNetworkDNSJSONRequestBody = DNSConfigUpdateRequest ``` -## type [PutNodeNetworkDNSResponse]() +## type [PutNodeNetworkDNSResponse]() @@ -4779,7 +4781,7 @@ type PutNodeNetworkDNSResponse struct { ``` -### func [ParsePutNodeNetworkDNSResponse]() +### func [ParsePutNodeNetworkDNSResponse]() ```go func ParsePutNodeNetworkDNSResponse(rsp *http.Response) (*PutNodeNetworkDNSResponse, error) @@ -4788,7 +4790,7 @@ func ParsePutNodeNetworkDNSResponse(rsp *http.Response) (*PutNodeNetworkDNSRespo ParsePutNodeNetworkDNSResponse parses an HTTP response from a PutNodeNetworkDNSWithResponse call -### func \(PutNodeNetworkDNSResponse\) [Status]() +### func \(PutNodeNetworkDNSResponse\) [Status]() ```go func (r PutNodeNetworkDNSResponse) Status() string @@ -4797,7 +4799,7 @@ func (r PutNodeNetworkDNSResponse) Status() string Status returns HTTPResponse.Status -### func \(PutNodeNetworkDNSResponse\) [StatusCode]() +### func \(PutNodeNetworkDNSResponse\) [StatusCode]() ```go func (r PutNodeNetworkDNSResponse) StatusCode() int @@ -4860,7 +4862,7 @@ type RetryJobByIDJSONRequestBody = RetryJobRequest ``` -## type [RetryJobByIDResponse]() +## type [RetryJobByIDResponse]() @@ -4878,7 +4880,7 @@ type RetryJobByIDResponse struct { ``` -### func [ParseRetryJobByIDResponse]() +### func [ParseRetryJobByIDResponse]() ```go func ParseRetryJobByIDResponse(rsp *http.Response) (*RetryJobByIDResponse, error) @@ -4887,7 +4889,7 @@ func ParseRetryJobByIDResponse(rsp *http.Response) (*RetryJobByIDResponse, error ParseRetryJobByIDResponse parses an HTTP response from a RetryJobByIDWithResponse call -### func \(RetryJobByIDResponse\) [Status]() +### func \(RetryJobByIDResponse\) [Status]() ```go func (r RetryJobByIDResponse) Status() string @@ -4896,7 +4898,7 @@ func (r RetryJobByIDResponse) Status() string Status returns HTTPResponse.Status -### func \(RetryJobByIDResponse\) [StatusCode]() +### func \(RetryJobByIDResponse\) [StatusCode]() ```go func (r RetryJobByIDResponse) StatusCode() int @@ -5031,7 +5033,7 @@ type UndrainAgentResponse struct { ``` -### func [ParseUndrainAgentResponse]() +### func [ParseUndrainAgentResponse]() ```go func ParseUndrainAgentResponse(rsp *http.Response) (*UndrainAgentResponse, error) diff --git a/docs/gen/osapi.md b/docs/gen/osapi.md index f41f635..0206fff 100644 --- a/docs/gen/osapi.md +++ b/docs/gen/osapi.md @@ -731,7 +731,7 @@ type FileService struct { ``` -### func \(\*FileService\) [Delete]() +### func \(\*FileService\) [Delete]() ```go func (s *FileService) Delete(ctx context.Context, name string) (*Response[FileDelete], error) diff --git a/pkg/osapi/file.go b/pkg/osapi/file.go index 6ecff78..ba55fcb 100644 --- a/pkg/osapi/file.go +++ b/pkg/osapi/file.go @@ -108,6 +108,7 @@ func (s *FileService) Get( if err := checkError( resp.StatusCode(), + resp.JSON400, resp.JSON401, resp.JSON403, resp.JSON404, @@ -138,6 +139,7 @@ func (s *FileService) Delete( if err := checkError( resp.StatusCode(), + resp.JSON400, resp.JSON401, resp.JSON403, resp.JSON404, diff --git a/pkg/osapi/file_public_test.go b/pkg/osapi/file_public_test.go index cd4df55..b394947 100644 --- a/pkg/osapi/file_public_test.go +++ b/pkg/osapi/file_public_test.go @@ -277,6 +277,23 @@ func (suite *FilePublicTestSuite) TestGet() { suite.Equal(512, resp.Data.Size) }, }, + { + name: "when server returns 400 returns ValidationError", + fileName: "nginx.conf", + handler: func(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusBadRequest) + _, _ = w.Write([]byte(`{"error":"invalid file name"}`)) + }, + validateFunc: func(resp *osapi.Response[osapi.FileMetadata], err error) { + suite.Error(err) + suite.Nil(resp) + + var target *osapi.ValidationError + suite.True(errors.As(err, &target)) + suite.Equal(http.StatusBadRequest, target.StatusCode) + }, + }, { name: "when server returns 404 returns NotFoundError", fileName: "missing.conf", @@ -393,6 +410,23 @@ func (suite *FilePublicTestSuite) TestDelete() { suite.True(resp.Data.Deleted) }, }, + { + name: "when server returns 400 returns ValidationError", + fileName: "old.conf", + handler: func(w http.ResponseWriter, _ *http.Request) { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusBadRequest) + _, _ = w.Write([]byte(`{"error":"invalid file name"}`)) + }, + validateFunc: func(resp *osapi.Response[osapi.FileDelete], err error) { + suite.Error(err) + suite.Nil(resp) + + var target *osapi.ValidationError + suite.True(errors.As(err, &target)) + suite.Equal(http.StatusBadRequest, target.StatusCode) + }, + }, { name: "when server returns 404 returns NotFoundError", fileName: "missing.conf", diff --git a/pkg/osapi/gen/api.yaml b/pkg/osapi/gen/api.yaml index 3fe4e38..8c79989 100644 --- a/pkg/osapi/gen/api.yaml +++ b/pkg/osapi/gen/api.yaml @@ -12,6 +12,9 @@ tags: - name: OSAPI_-_A_CRUD_API_for_managing_Linux_systems_info x-displayName: Info description: Operations related to the info endpoint. + - name: File_Management_API_file_operations + x-displayName: File + description: Object Store file management operations. - name: Health_Check_API_health x-displayName: Health description: Health check endpoints for liveness, readiness, and detailed status. @@ -33,9 +36,6 @@ tags: - name: Node_Management_API_command_operations x-displayName: Node/Command description: Command execution on a target node. - - name: File_Management_API_file_operations - x-displayName: File - description: Object Store file management operations. paths: /agent: servers: [] @@ -397,6 +397,187 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' + /file: + servers: [] + post: + summary: Upload a file + description: Upload a file to the Object Store. + tags: + - File_Management_API_file_operations + operationId: PostFile + security: + - BearerAuth: + - file:write + requestBody: + description: The file to upload. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/FileUploadRequest' + responses: + '201': + description: File uploaded successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/FileUploadResponse' + '400': + description: Invalid request payload. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '401': + description: Unauthorized - API key required + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: Forbidden - Insufficient permissions + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '500': + description: Error uploading file. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + get: + summary: List stored files + description: List all files stored in the Object Store. + tags: + - File_Management_API_file_operations + operationId: GetFiles + security: + - BearerAuth: + - file:read + responses: + '200': + description: List of stored files. + content: + application/json: + schema: + $ref: '#/components/schemas/FileListResponse' + '401': + description: Unauthorized - API key required + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: Forbidden - Insufficient permissions + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '500': + description: Error listing files. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /file/{name}: + servers: [] + get: + summary: Get file metadata + description: Get metadata for a specific file in the Object Store. + tags: + - File_Management_API_file_operations + operationId: GetFileByName + security: + - BearerAuth: + - file:read + parameters: + - $ref: '#/components/parameters/FileName' + responses: + '200': + description: File metadata. + content: + application/json: + schema: + $ref: '#/components/schemas/FileInfoResponse' + '400': + description: Invalid file name. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '401': + description: Unauthorized - API key required + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: Forbidden - Insufficient permissions + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '404': + description: File not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '500': + description: Error retrieving file metadata. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + delete: + summary: Delete a file + description: Delete a file from the Object Store. + tags: + - File_Management_API_file_operations + operationId: DeleteFileByName + security: + - BearerAuth: + - file:write + parameters: + - $ref: '#/components/parameters/FileName' + responses: + '200': + description: File deleted successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/FileDeleteResponse' + '400': + description: Invalid file name. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '401': + description: Unauthorized - API key required + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: Forbidden - Insufficient permissions + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '404': + description: File not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '500': + description: Error deleting file. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' /health: servers: [] get: @@ -1287,235 +1468,186 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - /node/{hostname}/command/exec: + /node/{hostname}/file/deploy: servers: [] post: - summary: Execute a command - description: > - Execute a command directly without a shell. This is the safer option as - it does not interpret shell metacharacters. + operationId: PostNodeFileDeploy + summary: Deploy a file from Object Store to the host tags: - - Node_Management_API_command_operations - operationId: PostNodeCommandExec + - Node_Management_API_node_operations security: - BearerAuth: - - command:execute + - file:write parameters: - $ref: '#/components/parameters/Hostname' requestBody: - description: The command to execute. required: true content: application/json: schema: - $ref: '#/components/schemas/CommandExecRequest' + $ref: '#/components/schemas/FileDeployRequest' responses: '202': - description: Command execution accepted. + description: File deploy job accepted. content: application/json: schema: - $ref: '#/components/schemas/CommandResultCollectionResponse' + $ref: '#/components/schemas/FileDeployResponse' '400': - description: Invalid request payload. + description: Invalid input. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '401': - description: Unauthorized - API key required + description: Unauthorized. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '403': - description: Forbidden - Insufficient permissions + description: Forbidden. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '500': - description: Error executing command. + description: Internal error. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - /node/{hostname}/command/shell: + /node/{hostname}/file/status: servers: [] post: - summary: Execute a shell command - description: > - Execute a command through /bin/sh -c. Supports shell features like - pipes, redirects, and variable expansion. + operationId: PostNodeFileStatus + summary: Check deployment status of a file on the host tags: - - Node_Management_API_command_operations - operationId: PostNodeCommandShell + - Node_Management_API_node_operations security: - BearerAuth: - - command:execute + - file:read parameters: - $ref: '#/components/parameters/Hostname' requestBody: - description: The shell command to execute. required: true content: application/json: schema: - $ref: '#/components/schemas/CommandShellRequest' + $ref: '#/components/schemas/FileStatusRequest' responses: - '202': - description: Shell command execution accepted. + '200': + description: File status. content: application/json: schema: - $ref: '#/components/schemas/CommandResultCollectionResponse' + $ref: '#/components/schemas/FileStatusResponse' '400': - description: Invalid request payload. + description: Invalid input. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '401': - description: Unauthorized - API key required + description: Unauthorized. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '403': - description: Forbidden - Insufficient permissions + description: Forbidden. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '500': - description: Error executing shell command. + description: Internal error. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - /node/{hostname}/file/deploy: + /node/{hostname}/command/exec: servers: [] post: - operationId: PostNodeFileDeploy - summary: Deploy a file from Object Store to the host + summary: Execute a command + description: > + Execute a command directly without a shell. This is the safer option as + it does not interpret shell metacharacters. tags: - - Node_Management_API_node_operations + - Node_Management_API_command_operations + operationId: PostNodeCommandExec security: - BearerAuth: - - 'file:write' + - command:execute parameters: - $ref: '#/components/parameters/Hostname' requestBody: + description: The command to execute. required: true content: application/json: schema: - $ref: '#/components/schemas/FileDeployRequest' + $ref: '#/components/schemas/CommandExecRequest' responses: '202': - description: File deploy job accepted. + description: Command execution accepted. content: application/json: schema: - $ref: '#/components/schemas/FileDeployResponse' + $ref: '#/components/schemas/CommandResultCollectionResponse' '400': - description: Invalid input. + description: Invalid request payload. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '401': - description: Unauthorized. + description: Unauthorized - API key required content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '403': - description: Forbidden. + description: Forbidden - Insufficient permissions content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '500': - description: Internal error. + description: Error executing command. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - /node/{hostname}/file/status: + /node/{hostname}/command/shell: servers: [] post: - operationId: PostNodeFileStatus - summary: Check deployment status of a file on the host + summary: Execute a shell command + description: > + Execute a command through /bin/sh -c. Supports shell features like + pipes, redirects, and variable expansion. tags: - - Node_Management_API_node_operations + - Node_Management_API_command_operations + operationId: PostNodeCommandShell security: - BearerAuth: - - 'file:read' + - command:execute parameters: - $ref: '#/components/parameters/Hostname' requestBody: + description: The shell command to execute. required: true content: application/json: schema: - $ref: '#/components/schemas/FileStatusRequest' - responses: - '200': - description: File status. - content: - application/json: - schema: - $ref: '#/components/schemas/FileStatusResponse' - '400': - description: Invalid input. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '401': - description: Unauthorized. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '403': - description: Forbidden. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '500': - description: Internal error. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - /file: - servers: [] - post: - summary: Upload a file - description: Upload a file to the Object Store. - tags: - - File_Management_API_file_operations - operationId: PostFile - security: - - BearerAuth: - - file:write - requestBody: - description: The file to upload. - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/FileUploadRequest' + $ref: '#/components/schemas/CommandShellRequest' responses: - '201': - description: File uploaded successfully. + '202': + description: Shell command execution accepted. content: application/json: schema: - $ref: '#/components/schemas/FileUploadResponse' + $ref: '#/components/schemas/CommandResultCollectionResponse' '400': description: Invalid request payload. content: @@ -1535,127 +1667,7 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' '500': - description: Error uploading file. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - get: - summary: List stored files - description: List all files stored in the Object Store. - tags: - - File_Management_API_file_operations - operationId: GetFiles - security: - - BearerAuth: - - file:read - responses: - '200': - description: List of stored files. - content: - application/json: - schema: - $ref: '#/components/schemas/FileListResponse' - '401': - description: Unauthorized - API key required - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '403': - description: Forbidden - Insufficient permissions - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '500': - description: Error listing files. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - /file/{name}: - servers: [] - get: - summary: Get file metadata - description: Get metadata for a specific file in the Object Store. - tags: - - File_Management_API_file_operations - operationId: GetFileByName - security: - - BearerAuth: - - file:read - parameters: - - $ref: '#/components/parameters/FileName' - responses: - '200': - description: File metadata. - content: - application/json: - schema: - $ref: '#/components/schemas/FileInfoResponse' - '401': - description: Unauthorized - API key required - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '403': - description: Forbidden - Insufficient permissions - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '404': - description: File not found. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '500': - description: Error retrieving file metadata. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - delete: - summary: Delete a file - description: Delete a file from the Object Store. - tags: - - File_Management_API_file_operations - operationId: DeleteFileByName - security: - - BearerAuth: - - file:write - parameters: - - $ref: '#/components/parameters/FileName' - responses: - '200': - description: File deleted successfully. - content: - application/json: - schema: - $ref: '#/components/schemas/FileDeleteResponse' - '401': - description: Unauthorized - API key required - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '403': - description: Forbidden - Insufficient permissions - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '404': - description: File not found. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '500': - description: Error deleting file. + description: Error executing shell command. content: application/json: schema: @@ -2020,37 +2032,142 @@ components: required: - total_items - items - HealthResponse: + FileUploadRequest: type: object properties: - status: + name: type: string - description: Health status. - example: ok + description: The name of the file. + example: nginx.conf + x-oapi-codegen-extra-tags: + validate: required,min=1,max=255 + content: + type: string + format: byte + description: Base64-encoded file content. + example: c2VydmVyIHsgbGlzdGVuIDgwOyB9 + x-oapi-codegen-extra-tags: + validate: required required: - - status - ReadyResponse: + - name + - content + FileInfo: type: object properties: - status: + name: type: string - description: Readiness status. - example: ready - error: + description: The name of the file. + example: nginx.conf + sha256: type: string - description: Error message when not ready. + description: SHA-256 hash of the file content. + example: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + size: + type: integer + description: File size in bytes. + example: 1024 required: - - status - ComponentHealth: + - name + - sha256 + - size + FileUploadResponse: type: object properties: - status: - type: string - description: Component health status. - example: ok - error: + name: type: string - description: Error message when component is unhealthy. + description: The name of the uploaded file. + example: nginx.conf + sha256: + type: string + description: SHA-256 hash of the file content. + example: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + size: + type: integer + description: File size in bytes. + example: 1024 + required: + - name + - sha256 + - size + FileListResponse: + type: object + properties: + files: + type: array + items: + $ref: '#/components/schemas/FileInfo' + description: List of stored files. + total: + type: integer + description: Total number of files. + example: 5 + required: + - files + - total + FileInfoResponse: + type: object + properties: + name: + type: string + description: The name of the file. + example: nginx.conf + sha256: + type: string + description: SHA-256 hash of the file content. + example: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + size: + type: integer + description: File size in bytes. + example: 1024 + required: + - name + - sha256 + - size + FileDeleteResponse: + type: object + properties: + name: + type: string + description: The name of the deleted file. + example: nginx.conf + deleted: + type: boolean + description: Whether the file was deleted. + example: true + required: + - name + - deleted + HealthResponse: + type: object + properties: + status: + type: string + description: Health status. + example: ok + required: + - status + ReadyResponse: + type: object + properties: + status: + type: string + description: Readiness status. + example: ready + error: + type: string + description: Error message when not ready. + required: + - status + ComponentHealth: + type: object + properties: + status: + type: string + description: Component health status. + example: ok + error: + type: string + description: Error message when component is unhealthy. required: - status NATSInfo: @@ -2809,6 +2926,93 @@ components: Accepts alphanumeric names or @fact. references. required: - interface_name + FileDeployRequest: + type: object + properties: + object_name: + type: string + description: Name of the file in the Object Store. + x-oapi-codegen-extra-tags: + validate: required,min=1,max=255 + path: + type: string + description: Destination path on the target filesystem. + x-oapi-codegen-extra-tags: + validate: required,min=1 + mode: + type: string + description: File permission mode (e.g., "0644"). + owner: + type: string + description: File owner user. + group: + type: string + description: File owner group. + content_type: + type: string + description: Content type — "raw" or "template". + enum: + - raw + - template + x-oapi-codegen-extra-tags: + validate: required,oneof=raw template + vars: + type: object + description: Template variables when content_type is "template". + additionalProperties: true + required: + - object_name + - path + - content_type + FileDeployResponse: + type: object + properties: + job_id: + type: string + description: The ID of the created job. + hostname: + type: string + description: The agent that processed the job. + changed: + type: boolean + description: Whether the file was actually written. + required: + - job_id + - hostname + - changed + FileStatusRequest: + type: object + properties: + path: + type: string + description: Filesystem path to check. + x-oapi-codegen-extra-tags: + validate: required,min=1 + required: + - path + FileStatusResponse: + type: object + properties: + job_id: + type: string + description: The ID of the created job. + hostname: + type: string + description: The agent that processed the job. + path: + type: string + description: The filesystem path. + status: + type: string + description: File state — "in-sync", "drifted", or "missing". + sha256: + type: string + description: Current SHA-256 of the file on disk. + required: + - job_id + - hostname + - path + - status CommandExecRequest: type: object properties: @@ -2904,223 +3108,31 @@ components: $ref: '#/components/schemas/CommandResultItem' required: - results - FileUploadRequest: - type: object - properties: - name: - type: string - description: The name of the file. - example: nginx.conf - x-oapi-codegen-extra-tags: - validate: required,min=1,max=255 - content: - type: string - format: byte - description: Base64-encoded file content. - example: c2VydmVyIHsgbGlzdGVuIDgwOyB9 - x-oapi-codegen-extra-tags: - validate: required - required: - - name - - content - FileInfo: - type: object - properties: - name: - type: string - description: The name of the file. - example: nginx.conf - sha256: - type: string - description: SHA-256 hash of the file content. - example: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - size: - type: integer - description: File size in bytes. - example: 1024 - required: - - name - - sha256 - - size - FileUploadResponse: - type: object - properties: - name: - type: string - description: The name of the uploaded file. - example: nginx.conf - sha256: - type: string - description: SHA-256 hash of the file content. - example: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - size: - type: integer - description: File size in bytes. - example: 1024 - required: - - name - - sha256 - - size - FileListResponse: - type: object - properties: - files: - type: array - items: - $ref: '#/components/schemas/FileInfo' - description: List of stored files. - total: - type: integer - description: Total number of files. - example: 5 - required: - - files - - total - FileInfoResponse: - type: object - properties: - name: - type: string - description: The name of the file. - example: nginx.conf - sha256: - type: string - description: SHA-256 hash of the file content. - example: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - size: - type: integer - description: File size in bytes. - example: 1024 - required: - - name - - sha256 - - size - FileDeleteResponse: - type: object - properties: - name: - type: string - description: The name of the deleted file. - example: nginx.conf - deleted: - type: boolean - description: Whether the file was deleted. - example: true - required: - - name - - deleted - FileDeployRequest: - type: object - properties: - object_name: - type: string - description: Name of the file in the Object Store. - x-oapi-codegen-extra-tags: - validate: required,min=1,max=255 - path: - type: string - description: Destination path on the target filesystem. - x-oapi-codegen-extra-tags: - validate: required,min=1 - mode: - type: string - description: File permission mode (e.g., "0644"). - owner: - type: string - description: File owner user. - group: - type: string - description: File owner group. - content_type: - type: string - description: Content type — "raw" or "template". - enum: - - raw - - template - x-oapi-codegen-extra-tags: - validate: required,oneof=raw template - vars: - type: object - description: Template variables when content_type is "template". - additionalProperties: true - required: - - object_name - - path - - content_type - FileDeployResponse: - type: object - properties: - job_id: - type: string - description: The ID of the created job. - hostname: - type: string - description: The agent that processed the job. - changed: - type: boolean - description: Whether the file was actually written. - required: - - job_id - - hostname - - changed - FileStatusRequest: - type: object - properties: - path: - type: string - description: Filesystem path to check. - x-oapi-codegen-extra-tags: - validate: required,min=1 - required: - - path - FileStatusResponse: - type: object - properties: - job_id: - type: string - description: The ID of the created job. - hostname: - type: string - description: The agent that processed the job. - path: - type: string - description: The filesystem path. - status: - type: string - description: File state — "in-sync", "drifted", or "missing". - sha256: - type: string - description: Current SHA-256 of the file on disk. - required: - - job_id - - hostname - - path - - status parameters: - Hostname: - name: hostname + FileName: + name: name in: path required: true - description: > - Target agent hostname, reserved routing value (_any, _all), or label - selector (key:value). + description: | + The name of the file in the Object Store. x-oapi-codegen-extra-tags: - validate: required,min=1,valid_target + validate: required,min=1,max=255 schema: type: string minLength: 1 - FileName: - name: name + maxLength: 255 + Hostname: + name: hostname in: path required: true description: > - The name of the file in the Object Store. + Target agent hostname, reserved routing value (_any, _all), or label + selector (key:value). x-oapi-codegen-extra-tags: - validate: required,min=1,max=255 + validate: required,min=1,valid_target schema: type: string minLength: 1 - maxLength: 255 x-tagGroups: - name: Agent Management API tags: @@ -3131,15 +3143,15 @@ x-tagGroups: - name: OSAPI - A CRUD API for managing Linux systems tags: - OSAPI_-_A_CRUD_API_for_managing_Linux_systems_info + - name: File Management API + tags: + - File_Management_API_file_operations - name: Health Check API tags: - Health_Check_API_health - name: Job Management API tags: - Job_Management_API_job_operations - - name: File Management API - tags: - - File_Management_API_file_operations - name: Node Management API tags: - Node_Management_API_node_operations diff --git a/pkg/osapi/gen/client.gen.go b/pkg/osapi/gen/client.gen.go index b9b9b25..1d82de2 100644 --- a/pkg/osapi/gen/client.gen.go +++ b/pkg/osapi/gen/client.gen.go @@ -3516,6 +3516,7 @@ type DeleteFileByNameResponse struct { Body []byte HTTPResponse *http.Response JSON200 *FileDeleteResponse + JSON400 *ErrorResponse JSON401 *ErrorResponse JSON403 *ErrorResponse JSON404 *ErrorResponse @@ -3542,6 +3543,7 @@ type GetFileByNameResponse struct { Body []byte HTTPResponse *http.Response JSON200 *FileInfoResponse + JSON400 *ErrorResponse JSON401 *ErrorResponse JSON403 *ErrorResponse JSON404 *ErrorResponse @@ -5054,6 +5056,13 @@ func ParseDeleteFileByNameResponse(rsp *http.Response) (*DeleteFileByNameRespons } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5108,6 +5117,13 @@ func ParseGetFileByNameResponse(rsp *http.Response) (*GetFileByNameResponse, err } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest ErrorResponse + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest ErrorResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil {