Skip to content

Commit de1c201

Browse files
Update Python SDK (#150)
[bot](2026-03-27 14:06:27) Sync SDK with OpenAPI spec Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 97ae693 commit de1c201

202 files changed

Lines changed: 5959 additions & 1900 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pip install vulncheck-sdk
4646
## Quickstart
4747

4848
```python
49+
import json
4950
import urllib.request
5051
import vulncheck_sdk
5152
import os
@@ -56,6 +57,7 @@ TOKEN = os.environ["VULNCHECK_API_TOKEN"] # Remember to store your token secure
5657
# Now let's create a configuration object
5758
configuration = vulncheck_sdk.Configuration()
5859
configuration.api_key["Bearer"] = TOKEN
60+
configuration.ignore_operation_servers = True
5961

6062
# Pass that config object to our API client and now...
6163
with vulncheck_sdk.ApiClient(configuration) as api_client:
@@ -77,10 +79,13 @@ with vulncheck_sdk.ApiClient(configuration) as api_client:
7779
print(cve)
7880

7981
# Download a Backup
82+
backup_client = vulncheck_sdk.BackupApi(api_client)
8083
index = "initial-access"
81-
api_response = endpoints_client.backup_index_get(index)
84+
raw = backup_client.backup_index_get_without_preload_content(index)
85+
response_data = json.loads(raw.read())
86+
download_url = response_data["data"][0]["url"]
8287
file_path = f"{index}.zip"
83-
with urllib.request.urlopen(api_response.data[0].url) as response:
88+
with urllib.request.urlopen(download_url) as response:
8489
with open(file_path, "wb") as file:
8590
file.write(response.read())
8691

@@ -98,6 +103,7 @@ with vulncheck_sdk.ApiClient(configuration) as api_client:
98103

99104
```python
100105
import asyncio
106+
import json
101107
import os
102108
import aiohttp
103109
import vulncheck_sdk.aio as vcaio
@@ -107,13 +113,15 @@ TOKEN = os.environ.get("VULNCHECK_API_TOKEN")
107113

108114
configuration = vcaio.Configuration()
109115
configuration.api_key["Bearer"] = TOKEN
116+
configuration.ignore_operation_servers = True
110117

111118

112119
async def run_vulnerability_checks():
113120
# Use 'async with' to manage the ApiClient connection pool
114121
async with vcaio.ApiClient(configuration) as api_client:
115122
endpoints_client = vcaio.EndpointsApi(api_client)
116123
indices_client = vcaio.IndicesApi(api_client)
124+
backup_client = vcaio.BackupApi(api_client)
117125

118126
# --- PURL Search ---
119127
# 'await' the coroutine to get results
@@ -138,11 +146,12 @@ async def run_vulnerability_checks():
138146

139147
# --- Download Backup (Async) ---
140148
index_name = "initial-access"
141-
# 'await' the coroutine to get results
142-
backup_response = await endpoints_client.backup_index_get(index_name)
149+
# 'await' the coroutine to get raw response bytes
150+
raw = await backup_client.backup_index_get_without_preload_content(index_name)
151+
response_data = json.loads(await raw.read())
143152

144-
if backup_response.data:
145-
download_url = backup_response.data[0].url
153+
if response_data.get("data"):
154+
download_url = response_data["data"][0]["url"]
146155
file_path = f"{index_name}.zip"
147156

148157
print(f"Downloading backup from {download_url}...")
@@ -314,6 +323,7 @@ if __name__ == "__main__":
314323
Download the backup for an index
315324

316325
```python
326+
import json
317327
import urllib.request
318328
import vulncheck_sdk
319329
import os
@@ -322,16 +332,19 @@ TOKEN = os.environ["VULNCHECK_API_TOKEN"]
322332

323333
configuration = vulncheck_sdk.Configuration()
324334
configuration.api_key["Bearer"] = TOKEN
335+
configuration.ignore_operation_servers = True
325336

326337
with vulncheck_sdk.ApiClient(configuration) as api_client:
327-
endpoints_client = vulncheck_sdk.EndpointsApi(api_client)
338+
backup_client = vulncheck_sdk.BackupApi(api_client)
328339

329340
index = "initial-access"
330341

331-
api_response = endpoints_client.backup_index_get(index)
342+
raw = backup_client.backup_index_get_without_preload_content(index)
343+
response_data = json.loads(raw.read())
344+
download_url = response_data["data"][0]["url"]
332345

333346
file_path = f"{index}.zip"
334-
with urllib.request.urlopen(api_response.data[0].url) as response:
347+
with urllib.request.urlopen(download_url) as response:
335348
with open(file_path, "wb") as file:
336349
file.write(response.read())
337350
```
@@ -341,6 +354,7 @@ with vulncheck_sdk.ApiClient(configuration) as api_client:
341354

342355
```python
343356
import asyncio
357+
import json
344358
import os
345359
import urllib.request
346360
import vulncheck_sdk.aio as vcaio
@@ -350,6 +364,7 @@ TOKEN = os.environ.get("VULNCHECK_API_TOKEN")
350364

351365
configuration = vcaio.Configuration()
352366
configuration.api_key["Bearer"] = TOKEN
367+
configuration.ignore_operation_servers = True
353368

354369

355370
def download_sync(url, file_path):
@@ -365,23 +380,19 @@ def download_sync(url, file_path):
365380
async def main():
366381
# Use 'async with' to manage the connection life-cycle
367382
async with vcaio.ApiClient(configuration) as api_client:
368-
endpoints_client = vcaio.EndpointsApi(api_client)
383+
backup_client = vcaio.BackupApi(api_client)
369384
index = "initial-access"
370385

371-
# 'await' the coroutine to get the actual response data
372-
api_response = await endpoints_client.backup_index_get(index)
373-
374-
if not api_response.data:
375-
print("No backup URL found.")
376-
return
386+
# 'await' the coroutine to get the raw response bytes
387+
raw = await backup_client.backup_index_get_without_preload_content(index)
388+
response_data = json.loads(await raw.read())
389+
download_url = response_data["data"][0]["url"]
377390

378-
download_url = api_response.data[0].url
379391
file_path = f"{index}.zip"
380392

381393
print(f"Downloading {index} via urllib (offloaded to thread)...")
382394

383395
# Use asyncio.to_thread to run the blocking call safely
384-
# 'await' the coroutine to get the actual response data
385396
await asyncio.to_thread(download_sync, download_url, file_path)
386397

387398
print(f"Successfully saved to {file_path}")

docs/AdvisoryASRG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Name | Type | Description | Notes
1515
**problem_type** | **str** | | [optional]
1616
**references** | **List[str]** | | [optional]
1717
**title** | **str** | | [optional]
18+
**updated_at** | **str** | | [optional]
1819
**url** | **str** | | [optional]
1920

2021
## Example

docs/AdvisoryApacheArrow.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
1010
**date_added** | **str** | | [optional]
1111
**summary** | **str** | | [optional]
1212
**title** | **str** | | [optional]
13+
**updated_at** | **str** | | [optional]
1314
**url** | **str** | | [optional]
1415

1516
## Example

docs/AdvisoryApacheSuperset.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
1010
**cve** | **List[str]** | | [optional]
1111
**date_added** | **str** | | [optional]
1212
**title** | **str** | | [optional]
13+
**updated_at** | **str** | | [optional]
1314
**url** | **str** | | [optional]
1415

1516
## Example

docs/AdvisoryCISAAlert.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,17 @@ Name | Type | Description | Notes
99
**affected_products** | **str** | | [optional]
1010
**alert_id** | **str** | | [optional]
1111
**archived** | **bool** | | [optional]
12-
**cve** | **List[str]** | | [optional]
13-
**cveexploited_itw** | **bool** | | [optional]
12+
**cve_exploited_itw** | **bool** | | [optional]
1413
**cvss** | **str** | | [optional]
15-
**date_added** | **str** | | [optional]
16-
**icsa** | **bool** | | [optional]
1714
**icsma** | **bool** | | [optional]
1815
**mitigations** | **str** | | [optional]
1916
**release_date** | **str** | | [optional]
2017
**title** | **str** | | [optional]
21-
**updated_at** | **str** | | [optional]
2218
**url** | **str** | | [optional]
2319
**vendor** | **str** | | [optional]
20+
**cve** | **List[str]** | | [optional]
21+
**date_added** | **str** | | [optional]
22+
**updated_at** | **str** | | [optional]
2423

2524
## Example
2625

docs/AdvisoryCustomCPE.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# AdvisoryCustomCPE
2+
3+
advisory.CustomCPE
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**mcpeapplicability** | [**AdvisoryMCPEApplicability**](AdvisoryMCPEApplicability.md) | | [optional]
10+
**string_value** | **str** | | [optional]
11+
12+
## Example
13+
14+
```python
15+
from vulncheck_sdk.models.advisory_custom_cpe import AdvisoryCustomCPE
16+
17+
# TODO update the JSON string below
18+
json = "{}"
19+
# create an instance of AdvisoryCustomCPE from a JSON string
20+
advisory_custom_cpe_instance = AdvisoryCustomCPE.from_json(json)
21+
# print the JSON string representation of the object
22+
print(AdvisoryCustomCPE.to_json())
23+
24+
# convert the object into a dict
25+
advisory_custom_cpe_dict = advisory_custom_cpe_instance.to_dict()
26+
# create an instance of AdvisoryCustomCPE from a dict
27+
advisory_custom_cpe_from_dict = AdvisoryCustomCPE.from_dict(advisory_custom_cpe_dict)
28+
```
29+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
30+
31+

docs/AdvisoryFastly.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
1010
**date_added** | **str** | | [optional]
1111
**summary** | **str** | | [optional]
1212
**title** | **str** | | [optional]
13+
**updated_at** | **str** | | [optional]
1314
**url** | **str** | | [optional]
1415

1516
## Example

docs/AdvisoryHaskellSADBAdvisory.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Name | Type | Description | Notes
1515
**keywords** | **List[str]** | | [optional]
1616
**references** | **Dict[str, List[str]]** | | [optional]
1717
**related_vulns** | **List[str]** | | [optional]
18+
**updated_at** | **str** | | [optional]
1819

1920
## Example
2021

docs/AdvisoryMACert.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Name | Type | Description | Notes
1717
**risks_fr** | **str** | | [optional]
1818
**solution_fr** | **str** | | [optional]
1919
**title_fr** | **str** | | [optional]
20+
**updated_at** | **str** | | [optional]
2021
**url** | **str** | | [optional]
2122

2223
## Example

docs/AdvisoryMCna.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ advisory.MCna
77
Name | Type | Description | Notes
88
------------ | ------------- | ------------- | -------------
99
**affected** | [**List[AdvisoryMAffected]**](AdvisoryMAffected.md) | | [optional]
10-
**cpe_applicability** | [**List[AdvisoryMCPEApplicability]**](AdvisoryMCPEApplicability.md) | | [optional]
10+
**cpe_applicability** | [**List[AdvisoryCustomCPE]**](AdvisoryCustomCPE.md) | | [optional]
1111
**credits** | [**List[AdvisoryCredit]**](AdvisoryCredit.md) | | [optional]
1212
**descriptions** | [**List[AdvisoryMDescriptions]**](AdvisoryMDescriptions.md) | | [optional]
1313
**impacts** | [**List[AdvisoryImpact]**](AdvisoryImpact.md) | | [optional]

0 commit comments

Comments
 (0)