Skip to content

Commit

Permalink
Update API client library (#1521)
Browse files Browse the repository at this point in the history
* Update API client library

* Update version

* Update client library

* Revert this change
  • Loading branch information
jleaniz authored Aug 1, 2024
1 parent ff09074 commit b88a5dd
Show file tree
Hide file tree
Showing 19 changed files with 1,591 additions and 879 deletions.
41 changes: 22 additions & 19 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,26 @@
"postStartCommand": "/etc/init.d/redis-server start",
// Set *default* container specific settings.json values on container create.
"mounts": ["source=/dev,target=/dev,type=bind"],
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"terminal.integrated.env.linux": {
"PYTHONPATH": "${workspaceFolder}",
},
"python.pythonPath": "/usr/bin/python3",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"editor.formatOnSave": true,
"python.formatting.provider": "yapf",
"python.formatting.yapfArgs": [
"--style",
"${workspaceRoot}/.style.yapf"
],
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python"
],
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"terminal.integrated.env.linux": {
"PYTHONPATH": "${workspaceFolder}",
},
"python.pythonPath": "/usr/bin/python3",
"python.linting.enabled": true,
"editor.formatOnSave": true,
"python.formatting.provider": "yapf",
"python.formatting.yapfArgs": [
"--style",
"${workspaceRoot}/.style.yapf"
]
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python"
]
}
}
}
13 changes: 8 additions & 5 deletions turbinia/api/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:

- API version: 1.0.0
- Package version: 1.0.0
- Generator version: 7.4.0
- Generator version: 7.7.0
- Build package: org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen

## Requirements.
Expand Down Expand Up @@ -76,12 +76,12 @@ with turbinia_api_lib.ApiClient(configuration) as api_client:
api_instance = turbinia_api_lib.TurbiniaConfigurationApi(api_client)

try:
# Get Request Options
api_response = api_instance.get_request_options()
print("The response of TurbiniaConfigurationApi->get_request_options:\n")
# Download Configuration
api_response = api_instance.download_config()
print("The response of TurbiniaConfigurationApi->download_config:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling TurbiniaConfigurationApi->get_request_options: %s\n" % e)
print("Exception when calling TurbiniaConfigurationApi->download_config: %s\n" % e)

```

Expand All @@ -91,6 +91,7 @@ All URIs are relative to *http://localhost*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*TurbiniaConfigurationApi* | [**download_config**](docs/TurbiniaConfigurationApi.md#download_config) | **GET** /api/config/download | Download Configuration
*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
Expand All @@ -106,8 +107,10 @@ Class | Method | HTTP request | Description
*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* | [**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
*TurbiniaTasksApi* | [**get_workers_status**](docs/TurbiniaTasksApi.md#get_workers_status) | **GET** /api/task/workers | Get Workers Status
Expand Down
2 changes: 1 addition & 1 deletion turbinia/api/client/docs/BaseRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ print BaseRequestOptions.to_json()
# convert the object into a dict
base_request_options_dict = base_request_options_instance.to_dict()
# create an instance of BaseRequestOptions from a dict
base_request_options_form_dict = base_request_options.from_dict(base_request_options_dict)
base_request_options_from_dict = BaseRequestOptions.from_dict(base_request_options_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
2 changes: 1 addition & 1 deletion turbinia/api/client/docs/CompleteTurbiniaStats.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ print CompleteTurbiniaStats.to_json()
# convert the object into a dict
complete_turbinia_stats_dict = complete_turbinia_stats_instance.to_dict()
# create an instance of CompleteTurbiniaStats from a dict
complete_turbinia_stats_form_dict = complete_turbinia_stats.from_dict(complete_turbinia_stats_dict)
complete_turbinia_stats_from_dict = CompleteTurbiniaStats.from_dict(complete_turbinia_stats_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
2 changes: 1 addition & 1 deletion turbinia/api/client/docs/HTTPValidationError.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ print HTTPValidationError.to_json()
# convert the object into a dict
http_validation_error_dict = http_validation_error_instance.to_dict()
# create an instance of HTTPValidationError from a dict
http_validation_error_form_dict = http_validation_error.from_dict(http_validation_error_dict)
http_validation_error_from_dict = HTTPValidationError.from_dict(http_validation_error_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
2 changes: 1 addition & 1 deletion turbinia/api/client/docs/LocationInner.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ print LocationInner.to_json()
# convert the object into a dict
location_inner_dict = location_inner_instance.to_dict()
# create an instance of LocationInner from a dict
location_inner_form_dict = location_inner.from_dict(location_inner_dict)
location_inner_from_dict = LocationInner.from_dict(location_inner_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
2 changes: 1 addition & 1 deletion turbinia/api/client/docs/Request.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ print Request.to_json()
# convert the object into a dict
request_dict = request_instance.to_dict()
# create an instance of Request from a dict
request_form_dict = request.from_dict(request_dict)
request_from_dict = Request.from_dict(request_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
70 changes: 70 additions & 0 deletions turbinia/api/client/docs/TurbiniaConfigurationApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,81 @@ All URIs are relative to *http://localhost*

Method | HTTP request | Description
------------- | ------------- | -------------
[**download_config**](TurbiniaConfigurationApi.md#download_config) | **GET** /api/config/download | Download Configuration
[**get_request_options**](TurbiniaConfigurationApi.md#get_request_options) | **GET** /api/config/request_options | Get Request Options
[**get_version**](TurbiniaConfigurationApi.md#get_version) | **GET** /api/config/version | Get Version
[**read_config**](TurbiniaConfigurationApi.md#read_config) | **GET** /api/config/ | Read Config


# **download_config**
> str download_config()
Download Configuration

Downloads the Turbinia configuration.

### 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.TurbiniaConfigurationApi(api_client)

try:
# Download Configuration
api_response = api_instance.download_config()
print("The response of TurbiniaConfigurationApi->download_config:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TurbiniaConfigurationApi->download_config: %s\n" % e)
```



### Parameters
This endpoint does not need any parameter.

### Return type

**str**

### Authorization

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

### HTTP request headers

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

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

[[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_request_options**
> object get_request_options()
Expand Down
74 changes: 74 additions & 0 deletions turbinia/api/client/docs/TurbiniaRequestsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**create_request**](TurbiniaRequestsApi.md#create_request) | **POST** /api/request/ | Create Request
[**get_request_report**](TurbiniaRequestsApi.md#get_request_report) | **GET** /api/request/report/{request_id} | Get Request Markdown Report
[**get_request_status**](TurbiniaRequestsApi.md#get_request_status) | **GET** /api/request/{request_id} | Get Request Status
[**get_requests_summary**](TurbiniaRequestsApi.md#get_requests_summary) | **GET** /api/request/summary | Get Requests Summary

Expand Down Expand Up @@ -84,6 +85,79 @@ Name | Type | Description | Notes

[[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_request_report**
> str get_request_report(request_id)
Get Request Markdown Report

Retrieves the markdown report for a Turbinia Request. Args: request (Request): FastAPI request object. request_id (str): A Turbinia request identifier. Raises: HTTPException: if another exception is caught.

### 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.TurbiniaRequestsApi(api_client)
request_id = 'request_id_example' # str |

try:
# Get Request Markdown Report
api_response = api_instance.get_request_report(request_id)
print("The response of TurbiniaRequestsApi->get_request_report:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TurbiniaRequestsApi->get_request_report: %s\n" % e)
```



### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**request_id** | **str**| |

### Return type

**str**

### Authorization

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

### HTTP request headers

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

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

[[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_request_status**
> object get_request_status(request_id)
Expand Down
75 changes: 75 additions & 0 deletions turbinia/api/client/docs/TurbiniaTasksApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,86 @@ All URIs are relative to *http://localhost*

Method | HTTP request | Description
------------- | ------------- | -------------
[**get_task_report**](TurbiniaTasksApi.md#get_task_report) | **GET** /api/task/report/{task_id} | Get Task Report
[**get_task_statistics**](TurbiniaTasksApi.md#get_task_statistics) | **GET** /api/task/statistics | Get Task Statistics
[**get_task_status**](TurbiniaTasksApi.md#get_task_status) | **GET** /api/task/{task_id} | Get Task Status
[**get_workers_status**](TurbiniaTasksApi.md#get_workers_status) | **GET** /api/task/workers | Get Workers Status


# **get_task_report**
> object get_task_report(task_id)
Get Task Report

Retrieves the MarkDown report of a Turbinia task. Raises: HTTPException: if another exception is caught.

### 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.TurbiniaTasksApi(api_client)
task_id = 'task_id_example' # str |

try:
# Get Task Report
api_response = api_instance.get_task_report(task_id)
print("The response of TurbiniaTasksApi->get_task_report:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling TurbiniaTasksApi->get_task_report: %s\n" % e)
```



### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**task_id** | **str**| |

### Return type

**object**

### Authorization

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

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: 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_task_statistics**
> CompleteTurbiniaStats get_task_statistics(days=days, task_id=task_id, request_id=request_id, user=user)
Expand Down
Loading

0 comments on commit b88a5dd

Please sign in to comment.