Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update API library #1530

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion turbinia/api/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,25 @@ Class | Method | HTTP request | Description
*TurbiniaConfigurationApi* | [**get_request_options**](docs/TurbiniaConfigurationApi.md#get_request_options) | **GET** /api/config/request_options | Get Request Options
*TurbiniaConfigurationApi* | [**get_version**](docs/TurbiniaConfigurationApi.md#get_version) | **GET** /api/config/version | Get Version
*TurbiniaConfigurationApi* | [**read_config**](docs/TurbiniaConfigurationApi.md#read_config) | **GET** /api/config/ | Read Config
*TurbiniaEvidenceApi* | [**download_by_evidence_id**](docs/TurbiniaEvidenceApi.md#download_by_evidence_id) | **GET** /api/evidence/download/{evidence_id} | Download By Evidence Id
*TurbiniaEvidenceApi* | [**get_evidence_attributes**](docs/TurbiniaEvidenceApi.md#get_evidence_attributes) | **GET** /api/evidence/types/{evidence_type} | Get Evidence Attributes
*TurbiniaEvidenceApi* | [**get_evidence_by_id**](docs/TurbiniaEvidenceApi.md#get_evidence_by_id) | **GET** /api/evidence/{evidence_id} | Get Evidence By Id
*TurbiniaEvidenceApi* | [**get_evidence_summary**](docs/TurbiniaEvidenceApi.md#get_evidence_summary) | **GET** /api/evidence/summary | Get Evidence Summary
*TurbiniaEvidenceApi* | [**get_evidence_types**](docs/TurbiniaEvidenceApi.md#get_evidence_types) | **GET** /api/evidence/types | Get Evidence Types
*TurbiniaEvidenceApi* | [**query_evidence**](docs/TurbiniaEvidenceApi.md#query_evidence) | **GET** /api/evidence/query | Query Evidence
*TurbiniaEvidenceApi* | [**upload_evidence**](docs/TurbiniaEvidenceApi.md#upload_evidence) | **POST** /api/evidence/upload | Upload Evidence
*TurbiniaJobsApi* | [**read_jobs**](docs/TurbiniaJobsApi.md#read_jobs) | **GET** /api/jobs/ | Read Jobs
*TurbiniaLogsApi* | [**get_logs**](docs/TurbiniaLogsApi.md#get_logs) | **GET** /api/logs/{query} | Get Logs
*TurbiniaLogsApi* | [**get_api_server_logs**](docs/TurbiniaLogsApi.md#get_api_server_logs) | **GET** /api/logs/api_server | Get Api Server Logs
*TurbiniaLogsApi* | [**get_server_logs**](docs/TurbiniaLogsApi.md#get_server_logs) | **GET** /api/logs/server | Get Server Logs
*TurbiniaLogsApi* | [**get_turbinia_logs**](docs/TurbiniaLogsApi.md#get_turbinia_logs) | **GET** /api/logs/{hostname} | Get Turbinia Logs
*TurbiniaRequestResultsApi* | [**get_plaso_file**](docs/TurbiniaRequestResultsApi.md#get_plaso_file) | **GET** /api/result/plasofile/{task_id} | Get Plaso File
*TurbiniaRequestResultsApi* | [**get_request_output**](docs/TurbiniaRequestResultsApi.md#get_request_output) | **GET** /api/result/request/{request_id} | Get Request Output
*TurbiniaRequestResultsApi* | [**get_task_output**](docs/TurbiniaRequestResultsApi.md#get_task_output) | **GET** /api/result/task/{task_id} | Get Task Output
*TurbiniaRequestsApi* | [**create_request**](docs/TurbiniaRequestsApi.md#create_request) | **POST** /api/request/ | Create Request
*TurbiniaRequestsApi* | [**get_request_report**](docs/TurbiniaRequestsApi.md#get_request_report) | **GET** /api/request/report/{request_id} | Get Request Markdown Report
*TurbiniaRequestsApi* | [**get_request_status**](docs/TurbiniaRequestsApi.md#get_request_status) | **GET** /api/request/{request_id} | Get Request Status
*TurbiniaRequestsApi* | [**get_requests_summary**](docs/TurbiniaRequestsApi.md#get_requests_summary) | **GET** /api/request/summary | Get Requests Summary
*TurbiniaTasksApi* | [**download_output_path**](docs/TurbiniaTasksApi.md#download_output_path) | **GET** /api/download/output/{file_path} | Get Task Report
*TurbiniaTasksApi* | [**get_task_report**](docs/TurbiniaTasksApi.md#get_task_report) | **GET** /api/task/report/{task_id} | Get Task Report
*TurbiniaTasksApi* | [**get_task_statistics**](docs/TurbiniaTasksApi.md#get_task_statistics) | **GET** /api/task/statistics | Get Task Statistics
*TurbiniaTasksApi* | [**get_task_status**](docs/TurbiniaTasksApi.md#get_task_status) | **GET** /api/task/{task_id} | Get Task Status
Expand Down
75 changes: 75 additions & 0 deletions turbinia/api/client/docs/TurbiniaEvidenceApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All URIs are relative to *http://localhost*

Method | HTTP request | Description
------------- | ------------- | -------------
[**download_by_evidence_id**](TurbiniaEvidenceApi.md#download_by_evidence_id) | **GET** /api/evidence/download/{evidence_id} | Download By Evidence Id
[**get_evidence_attributes**](TurbiniaEvidenceApi.md#get_evidence_attributes) | **GET** /api/evidence/types/{evidence_type} | Get Evidence Attributes
[**get_evidence_by_id**](TurbiniaEvidenceApi.md#get_evidence_by_id) | **GET** /api/evidence/{evidence_id} | Get Evidence By Id
[**get_evidence_summary**](TurbiniaEvidenceApi.md#get_evidence_summary) | **GET** /api/evidence/summary | Get Evidence Summary
Expand All @@ -12,6 +13,80 @@ Method | HTTP request | Description
[**upload_evidence**](TurbiniaEvidenceApi.md#upload_evidence) | **POST** /api/evidence/upload | Upload Evidence


# **download_by_evidence_id**
> bytearray download_by_evidence_id(evidence_id)

Download By Evidence Id

Retrieves an evidence in Redis by using its UUID. Args: evidence_id (str): The UUID of the evidence. Raises: HTTPException: if the evidence is not found. Returns: FileResponse: The evidence file.

### Example

* OAuth Authentication (oAuth2):
```python
import time
import os
import turbinia_api_lib
from turbinia_api_lib.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = turbinia_api_lib.Configuration(
host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with turbinia_api_lib.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = turbinia_api_lib.TurbiniaEvidenceApi(api_client)
evidence_id = None # object |

try:
# Download By Evidence Id
api_response = api_instance.download_by_evidence_id(evidence_id)
print("The response of TurbiniaEvidenceApi->download_by_evidence_id:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TurbiniaEvidenceApi->download_by_evidence_id: %s\n" % e)
```



### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**evidence_id** | [**object**](.md)| |

### Return type

**bytearray**

### Authorization

[oAuth2](../README.md#oAuth2)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/octet-stream, application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful Response | - |
**422** | Validation Error | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **get_evidence_attributes**
> object get_evidence_attributes(evidence_type)

Expand Down
176 changes: 164 additions & 12 deletions turbinia/api/client/docs/TurbiniaLogsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ All URIs are relative to *http://localhost*

Method | HTTP request | Description
------------- | ------------- | -------------
[**get_logs**](TurbiniaLogsApi.md#get_logs) | **GET** /api/logs/{query} | Get Logs
[**get_api_server_logs**](TurbiniaLogsApi.md#get_api_server_logs) | **GET** /api/logs/api_server | Get Api Server Logs
[**get_server_logs**](TurbiniaLogsApi.md#get_server_logs) | **GET** /api/logs/server | Get Server Logs
[**get_turbinia_logs**](TurbiniaLogsApi.md#get_turbinia_logs) | **GET** /api/logs/{hostname} | Get Turbinia Logs


# **get_logs**
> object get_logs(query)
# **get_api_server_logs**
> str get_api_server_logs(num_lines=num_lines)

Get Logs
Get Api Server Logs

Retrieve log data.

Expand Down Expand Up @@ -41,15 +43,15 @@ configuration.access_token = os.environ["ACCESS_TOKEN"]
with turbinia_api_lib.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = turbinia_api_lib.TurbiniaLogsApi(api_client)
query = 'query_example' # str |
num_lines = 500 # int | (optional) (default to 500)

try:
# Get Logs
api_response = api_instance.get_logs(query)
print("The response of TurbiniaLogsApi->get_logs:\n")
# Get Api Server Logs
api_response = api_instance.get_api_server_logs(num_lines=num_lines)
print("The response of TurbiniaLogsApi->get_api_server_logs:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TurbiniaLogsApi->get_logs: %s\n" % e)
print("Exception when calling TurbiniaLogsApi->get_api_server_logs: %s\n" % e)
```


Expand All @@ -58,11 +60,11 @@ with turbinia_api_lib.ApiClient(configuration) as api_client:

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**query** | **str**| |
**num_lines** | **int**| | [optional] [default to 500]

### Return type

**object**
**str**

### Authorization

Expand All @@ -71,7 +73,157 @@ Name | Type | Description | Notes
### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json
- **Accept**: application/text, application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful Response | - |
**422** | Validation Error | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **get_server_logs**
> str get_server_logs(num_lines=num_lines)

Get Server Logs

Retrieve log data.

### Example

* OAuth Authentication (oAuth2):
```python
import time
import os
import turbinia_api_lib
from turbinia_api_lib.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = turbinia_api_lib.Configuration(
host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with turbinia_api_lib.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = turbinia_api_lib.TurbiniaLogsApi(api_client)
num_lines = 500 # int | (optional) (default to 500)

try:
# Get Server Logs
api_response = api_instance.get_server_logs(num_lines=num_lines)
print("The response of TurbiniaLogsApi->get_server_logs:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TurbiniaLogsApi->get_server_logs: %s\n" % e)
```



### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**num_lines** | **int**| | [optional] [default to 500]

### Return type

**str**

### Authorization

[oAuth2](../README.md#oAuth2)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/text, application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful Response | - |
**422** | Validation Error | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **get_turbinia_logs**
> str get_turbinia_logs(hostname, num_lines=num_lines)

Get Turbinia Logs

Retrieve log data. Turbinia currently stores logs on plaintext files. The log files are named <hostname>.log for each instance of a worker, server or API server. In some deployments, the same file can contain all logs (e.g. running all services locally in the same container).

### Example

* OAuth Authentication (oAuth2):
```python
import time
import os
import turbinia_api_lib
from turbinia_api_lib.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = turbinia_api_lib.Configuration(
host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with turbinia_api_lib.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = turbinia_api_lib.TurbiniaLogsApi(api_client)
hostname = 'hostname_example' # str |
num_lines = 500 # int | (optional) (default to 500)

try:
# Get Turbinia Logs
api_response = api_instance.get_turbinia_logs(hostname, num_lines=num_lines)
print("The response of TurbiniaLogsApi->get_turbinia_logs:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TurbiniaLogsApi->get_turbinia_logs: %s\n" % e)
```



### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**hostname** | **str**| |
**num_lines** | **int**| | [optional] [default to 500]

### Return type

**str**

### Authorization

[oAuth2](../README.md#oAuth2)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/text, application/json

### HTTP response details
| Status code | Description | Response headers |
Expand Down
Loading