Skip to content

Commit bb4a199

Browse files
authored
Merge pull request #1069 from crowdsecurity/fix/update-let-doc-new-sdk
update tracker api + sdk doc
2 parents b9ff807 + 02bd36f commit bb4a199

11 files changed

Lines changed: 38 additions & 47 deletions

crowdsec-docs/sidebarsUnversioned.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ const sidebarsUnversionedConfig: SidebarConfig = {
165165
id: "tracker_api/api_sdks",
166166
},
167167
{
168-
type: "doc",
168+
type: "link",
169169
label: "API Reference",
170-
id: "tracker_api/api_reference",
170+
href: "https://admin.api.crowdsec.net/v1/docs#tag/Cves",
171171
},
172172
],
173173
},

crowdsec-docs/unversioned/tracker_api/api_authentication.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ CrowdSec provides official SDKs for convenient API access with typed models, aut
3838
**Quick start with the Python SDK:**
3939

4040
```bash
41-
pip install crowdsec-tracker-api
41+
pip install crowdsec_service_api
4242
```
4343

4444
```python
4545
import os
46-
from crowdsec_tracker_api import Cves, ApiKeyAuth
46+
from crowdsec_service_api import Cves, ApiKeyAuth
4747

48-
auth = ApiKeyAuth(api_key=os.getenv("CROWDSEC_TRACKER_API_KEY"))
48+
auth = ApiKeyAuth(api_key=os.getenv("CROWDSEC_SERVICE_API_KEY"))
4949
cve = Cves(auth=auth).get_cve("CVE-2024-25600")
5050
print(f"{cve.title}: Score {cve.crowdsec_score}, Phase: {cve.exploitation_phase.label}")
5151
```
@@ -71,4 +71,4 @@ The API returns standard HTTP status codes:
7171
- [Integrations & Blocklists](./api_integrations) — Create firewall integrations and subscribe to CVEs
7272
- [Browse by Vendor, Product, or Tag](./api_lookups) — Explore the coverage landscape
7373
- [SDKs & Libraries](./api_sdks) — Official SDKs for Python and more
74-
- [API Reference (Swagger)](./api_reference) — Full interactive API documentation
74+
- [API Reference](https://admin.api.crowdsec.net/v1/docs#tag/Cves) — Full interactive API documentation

crowdsec-docs/unversioned/tracker_api/api_cves.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ curl -X 'GET' \
5353

5454
```python
5555
import os
56-
from crowdsec_tracker_api import Cves, ApiKeyAuth
56+
from crowdsec_service_api import Cves, ApiKeyAuth
5757
from httpx import HTTPStatusError
5858

59-
KEY = os.getenv("CROWDSEC_TRACKER_API_KEY")
59+
KEY = os.getenv("CROWDSEC_SERVICE_API_KEY")
6060
auth = ApiKeyAuth(api_key=KEY)
6161
cves_service = Cves(auth=auth)
6262

@@ -126,10 +126,10 @@ curl -X 'GET' \
126126

127127
```python
128128
import os
129-
from crowdsec_tracker_api import Cves, ApiKeyAuth
129+
from crowdsec_service_api import Cves, ApiKeyAuth
130130
from httpx import HTTPStatusError
131131

132-
KEY = os.getenv("CROWDSEC_TRACKER_API_KEY")
132+
KEY = os.getenv("CROWDSEC_SERVICE_API_KEY")
133133
auth = ApiKeyAuth(api_key=KEY)
134134
cves_service = Cves(auth=auth)
135135

@@ -247,10 +247,10 @@ curl -X 'GET' \
247247

248248
```python
249249
import os
250-
from crowdsec_tracker_api import Cves, ApiKeyAuth
250+
from crowdsec_service_api import Cves, ApiKeyAuth
251251
from httpx import HTTPStatusError
252252

253-
KEY = os.getenv("CROWDSEC_TRACKER_API_KEY")
253+
KEY = os.getenv("CROWDSEC_SERVICE_API_KEY")
254254
auth = ApiKeyAuth(api_key=KEY)
255255
cves_service = Cves(auth=auth)
256256

crowdsec-docs/unversioned/tracker_api/api_fingerprints.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ curl -X 'GET' \
5555
import os
5656
import httpx
5757

58-
KEY = os.getenv("CROWDSEC_TRACKER_API_KEY")
58+
KEY = os.getenv("CROWDSEC_SERVICE_API_KEY")
5959
headers = {"x-api-key": KEY, "accept": "application/json"}
6060

6161
response = httpx.get(
@@ -128,7 +128,7 @@ curl -X 'GET' \
128128
import os
129129
import httpx
130130

131-
KEY = os.getenv("CROWDSEC_TRACKER_API_KEY")
131+
KEY = os.getenv("CROWDSEC_SERVICE_API_KEY")
132132
headers = {"x-api-key": KEY, "accept": "application/json"}
133133

134134
response = httpx.get(

crowdsec-docs/unversioned/tracker_api/api_integrations.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ curl -X 'POST' \
6666

6767
```python
6868
import os
69-
from crowdsec_tracker_api import (
69+
from crowdsec_service_api import (
7070
Integrations, IntegrationCreateRequest,
7171
IntegrationType, OutputFormat, ApiKeyAuth,
7272
)
7373
from httpx import HTTPStatusError
7474

75-
KEY = os.getenv("CROWDSEC_TRACKER_API_KEY")
75+
KEY = os.getenv("CROWDSEC_SERVICE_API_KEY")
7676
auth = ApiKeyAuth(api_key=KEY)
7777
integrations_service = Integrations(auth=auth)
7878

@@ -155,10 +155,10 @@ curl -X 'GET' \
155155

156156
```python
157157
import os
158-
from crowdsec_tracker_api import Integrations, ApiKeyAuth
158+
from crowdsec_service_api import Integrations, ApiKeyAuth
159159
from httpx import HTTPStatusError
160160

161-
KEY = os.getenv("CROWDSEC_TRACKER_API_KEY")
161+
KEY = os.getenv("CROWDSEC_SERVICE_API_KEY")
162162
auth = ApiKeyAuth(api_key=KEY)
163163
integrations_service = Integrations(auth=auth)
164164

@@ -216,12 +216,12 @@ curl -X 'PATCH' \
216216

217217
```python
218218
import os
219-
from crowdsec_tracker_api import (
219+
from crowdsec_service_api import (
220220
Integrations, IntegrationUpdateRequest, ApiKeyAuth,
221221
)
222222
from httpx import HTTPStatusError
223223

224-
KEY = os.getenv("CROWDSEC_TRACKER_API_KEY")
224+
KEY = os.getenv("CROWDSEC_SERVICE_API_KEY")
225225
auth = ApiKeyAuth(api_key=KEY)
226226
integrations_service = Integrations(auth=auth)
227227

@@ -279,10 +279,10 @@ curl -X 'DELETE' \
279279

280280
```python
281281
import os
282-
from crowdsec_tracker_api import Integrations, ApiKeyAuth
282+
from crowdsec_service_api import Integrations, ApiKeyAuth
283283
from httpx import HTTPStatusError
284284

285-
KEY = os.getenv("CROWDSEC_TRACKER_API_KEY")
285+
KEY = os.getenv("CROWDSEC_SERVICE_API_KEY")
286286
auth = ApiKeyAuth(api_key=KEY)
287287
integrations_service = Integrations(auth=auth)
288288

crowdsec-docs/unversioned/tracker_api/api_lookups.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ curl -X 'GET' \
4242
import os
4343
import httpx
4444

45-
KEY = os.getenv("CROWDSEC_TRACKER_API_KEY")
45+
KEY = os.getenv("CROWDSEC_SERVICE_API_KEY")
4646
headers = {"x-api-key": KEY, "accept": "application/json"}
4747

4848
response = httpx.get("https://admin.api.crowdsec.net/v1/tags", headers=headers)
@@ -150,7 +150,7 @@ curl -X 'POST' \
150150
import os
151151
import httpx
152152

153-
KEY = os.getenv("CROWDSEC_TRACKER_API_KEY")
153+
KEY = os.getenv("CROWDSEC_SERVICE_API_KEY")
154154
headers = {"x-api-key": KEY, "accept": "application/json", "Content-Type": "application/json"}
155155

156156
response = httpx.post(

crowdsec-docs/unversioned/tracker_api/api_reference.mdx

Lines changed: 0 additions & 9 deletions
This file was deleted.

crowdsec-docs/unversioned/tracker_api/api_sdks.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ The official Python SDK is the recommended way to interact with the API from Pyt
1515
### Installation
1616

1717
```bash
18-
pip install crowdsec-tracker-api
18+
pip install crowdsec_service_api
1919
```
2020

21-
**Requirements**: Python 3.8+
21+
**Requirements**: Python 3.11+
2222

23-
**Source**: [github.com/crowdsecurity/crowdsec-tracker-api-sdk-python](https://github.com/crowdsecurity/crowdsec-tracker-api-sdk-python)
23+
**Source**: [github.com/crowdsecurity/crowdsec-service-api-sdk-python](https://github.com/crowdsecurity/crowdsec-service-api-sdk-python)
2424

2525
### Authentication
2626

2727
```python
2828
import os
29-
from crowdsec_tracker_api import ApiKeyAuth, Server
29+
from crowdsec_service_api import ApiKeyAuth, Server
3030

31-
KEY = os.getenv("CROWDSEC_TRACKER_API_KEY")
31+
KEY = os.getenv("CROWDSEC_SERVICE_API_KEY")
3232

3333
# Configure authentication
3434
auth = ApiKeyAuth(api_key=KEY)
@@ -53,10 +53,10 @@ The SDK provides typed service classes for each API domain:
5353

5454
```python
5555
import os
56-
from crowdsec_tracker_api import Cves, ApiKeyAuth
56+
from crowdsec_service_api import Cves, ApiKeyAuth
5757
from httpx import HTTPStatusError
5858

59-
KEY = os.getenv("CROWDSEC_TRACKER_API_KEY")
59+
KEY = os.getenv("CROWDSEC_SERVICE_API_KEY")
6060
auth = ApiKeyAuth(api_key=KEY)
6161
cves_service = Cves(auth=auth)
6262

@@ -98,7 +98,7 @@ except HTTPStatusError as e:
9898
#### Create and manage a firewall integration
9999

100100
```python
101-
from crowdsec_tracker_api import (
101+
from crowdsec_service_api import (
102102
Integrations, IntegrationCreateRequest,
103103
IntegrationType, OutputFormat, ApiKeyAuth,
104104
)
@@ -119,6 +119,6 @@ print(f"Integration ID: {response.id}")
119119

120120
## Other Languages
121121

122-
Need the API in another language? The REST API is straightforward to call from any HTTP client — see [Authentication & Setup](./api_authentication) for the base URL and authentication details, and the [API Reference (Swagger)](./api_reference) for the full OpenAPI specification.
122+
Need the API in another language? The REST API is straightforward to call from any HTTP client — see [Authentication & Setup](./api_authentication) for the base URL and authentication details, and the [API Reference](https://admin.api.crowdsec.net/v1/docs#tag/Cves) for the full OpenAPI specification.
123123

124124
If you'd like to see an official SDK for your language, let us know on [GitHub](https://github.com/crowdsecurity) or [Discord](https://discord.gg/crowdsec).

crowdsec-docs/unversioned/tracker_api/guide_proactive.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ Here's a template for a daily check that surfaces new and trending threats for y
116116

117117
```python
118118
import os
119-
from crowdsec_tracker_api import Cves, ApiKeyAuth
119+
from crowdsec_service_api import Cves, ApiKeyAuth
120120

121-
KEY = os.getenv("CROWDSEC_TRACKER_API_KEY")
121+
KEY = os.getenv("CROWDSEC_SERVICE_API_KEY")
122122
auth = ApiKeyAuth(api_key=KEY)
123123
cves_service = Cves(auth=auth)
124124

crowdsec-docs/unversioned/tracker_api/guide_triage.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ For teams handling many alerts, consider automating the lookup:
100100

101101
```python
102102
import os
103-
from crowdsec_tracker_api import Cves, ApiKeyAuth
103+
from crowdsec_service_api import Cves, ApiKeyAuth
104104

105-
KEY = os.getenv("CROWDSEC_TRACKER_API_KEY")
105+
KEY = os.getenv("CROWDSEC_SERVICE_API_KEY")
106106
auth = ApiKeyAuth(api_key=KEY)
107107
cves_service = Cves(auth=auth)
108108

0 commit comments

Comments
 (0)