8000 feat(api): api update · cloudflare/cloudflare-python@edfddf3 · GitHub
[go: up one dir, main page]

Skip to content

Commit edfddf3

Browse files
feat(api): api update
1 parent b895d14 commit edfddf3

File tree

5 files changed

+44
-2
lines changed

5 files changed

+44
-2
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1714
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d02621102fb6653950138279ee4f697d6eaab9e1b301042df4ca051471bdc5d7.yml
3-
openapi_spec_hash: 5464e62b37cd3314b5b6a6022a4374c6
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9221a48296b668b8c1c1f997c0b787668309f68d426b6c8c752c89db2c23ca45.yml
3+
openapi_spec_hash: 3de1dc2a2f0adbecece3c004fe3d1c38
44
config_hash: 98bbabfdd42fef2a932029e37455475f

src/cloudflare/resources/logpush/jobs.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def create(
8484
]
8585
| NotGiven = NOT_GIVEN,
8686
enabled: bool | NotGiven = NOT_GIVEN,
87+
filter: Optional[str] | NotGiven = NOT_GIVEN,
8788
frequency: Optional[Literal["high", "low"]] | NotGiven = NOT_GIVEN,
8889
kind: Optional[Literal["edge"]] | NotGiven = NOT_GIVEN,
8990
logpull_options: Optional[str] | NotGiven = NOT_GIVEN,
@@ -117,6 +118,10 @@ def create(
117118
118119
enabled: Flag that indicates if the job is enabled.
119120
121+
filter: The filters to select the events to include and/or remove from your logs. For
122+
more information, refer to
123+
[Filters](https://developers.cloudflare.com/logs/reference/filters/).
124+
120125
frequency: This field is deprecated. Please use `max_upload_*` parameters instead. The
121126
frequency at which Cloudflare sends batches of logs to your destination. Setting
122127
frequency to high sends your logs in larger quantities of smaller files. Setting
@@ -185,6 +190,7 @@ def create(
185190
"destination_conf": destination_conf,
186191
"dataset": dataset,
187192
"enabled": enabled,
193+
"filter": filter,
188194
"frequency": frequency,
189195
"kind": kind,
190196
"logpull_options": logpull_options,
@@ -215,6 +221,7 @@ def update(
215221
zone_id: str | NotGiven = NOT_GIVEN,
216222
destination_conf: str | NotGiven = NOT_GIVEN,
217223
enabled: bool | NotGiven = NOT_GIVEN,
224+
filter: Optional[str] | NotGiven = NOT_GIVEN,
218225
frequency: Optional[Literal["high", "low"]] | NotGiven = NOT_GIVEN,
219226
kind: Optional[Literal["edge"]] | NotGiven = NOT_GIVEN,
220227
logpull_options: Optional[str] | NotGiven = NOT_GIVEN,
@@ -247,6 +254,10 @@ def update(
247254
248255
enabled: Flag that indicates if the job is enabled.
249256
257+
filter: The filters to select the events to include and/or remove from your logs. For
258+
more information, refer to
259+
[Filters](https://developers.cloudflare.com/logs/reference/filters/).
260+
250261
frequency: This field is deprecated. Please use `max_upload_*` parameters instead. The
251262
frequency at which Cloudflare sends batches of logs to your destination. Setting
252263
frequency to high sends your logs in larger quantities of smaller files. Setting
@@ -314,6 +325,7 @@ def update(
314325
{
315326
"destination_conf": destination_conf,
316327
"enabled": enabled,
328+
"filter": filter,
317329
"frequency": frequency,
318330
"kind": kind,
319331
"logpull_options": logpull_options,
@@ -552,6 +564,7 @@ async def create(
552564
]
553565
| NotGiven = NOT_GIVEN,
554566
enabled: bool | NotGiven = NOT_GIVEN,
567+
filter: Optional[str] | NotGiven = NOT_GIVEN,
555568
frequency: Optional[Literal["high", "low"]] | NotGiven = NOT_GIVEN,
556569
kind: Optional[Literal["edge"]] | NotGiven = NOT_GIVEN,
557570
logpull_options: Optional[str] | NotGiven = NOT_GIVEN,
@@ -585,6 +598,10 @@ async def create(
585598
586599
enabled: Flag that indicates if the job is enabled.
587600
601+
filter: The filters to select the events to include and/or remove from your logs. For
602+
more information, refer to
603+
[Filters](https://developers.cloudflare.com/logs/reference/filters/).
604+
588605
frequency: This field is deprecated. Please use `max_upload_*` parameters instead. The
589606
frequency at which Cloudflare sends batches of logs to your destination. Setting
590607
frequency to high sends your logs in larger quantities of smaller files. Setting
@@ -653,6 +670,7 @@ async def create(
653670
"destination_conf": destination_conf,
654671
"dataset": dataset,
655672
"enabled": enabled,
673+
"filter": filter,
656674
"frequency": frequency,
657675
"kind": kind,
658676
"logpull_options": logpull_options,
@@ -683,6 +701,7 @@ async def update(
683701
zone_id: str | NotGiven = NOT_GIVEN,
684702
destination_conf: str | NotGiven = NOT_GIVEN,
685703
enabled: bool | NotGiven = NOT_GIVEN,
704+
filter: Optional[str] | NotGiven = NOT_GIVEN,
686705
frequency: Optional[Literal["high", "low"]] | NotGiven = NOT_GIVEN,
687706
kind: Optional[Literal["edge"]] | NotGiven = NOT_GIVEN,
688707
logpull_options: Optional[str] | NotGiven = NOT_GIVEN,
@@ -715,6 +734,10 @@ async def update(
715734
716735
enabled: Flag that indicates if the job is enabled.
717736
737+
filter: The filters to select the events to include and/or remove from your logs. For
738+
more information, refer to
739+
[Filters](https://developers.cloudflare.com/logs/reference/filters/).
740+
718741
frequency: This field is deprecated. Please use `max_upload_*` parameters instead. The
719742
frequency at which Cloudflare sends batches of logs to your destination. Setting
720743
frequency to high sends your logs in larger quantities of smaller files. Setting
@@ -782,6 +805,7 @@ async def update(
782805
{
783806
"destination_conf": destination_conf,
784807
"enabled": enabled,
808+
"filter": filter,
785809
"frequency": frequency,
786810
"kind": kind,
787811
"logpull_options": logpull_options,

src/cloudflare/types/logpush/job_create_params.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ class JobCreateParams(TypedDict, total=False):
6161
enabled: bool
6262
"""Flag that indicates if the job is enabled."""
6363

64+
filter: Optional[str]
65+
"""The filters to select the events to include and/or remove from your logs.
66+
67+
For more information, refer to
68+
[Filters](https://developers.cloudflare.com/logs/reference/filters/).
69+
"""
70+
6471
frequency: Optional[Literal["high", "low"]]
6572
"""This field is deprecated.
6673

src/cloudflare/types/logpush/job_update_params.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ class JobUpdateParams(TypedDict, total=False):
2727
enabled: bool
2828
"""Flag that indicates if the job is enabled."""
2929

30+
filter: Optional[str]
31+
"""The filters to select the events to include and/or remove from your logs.
32+
33+
For more information, refer to
34+
[Filters](https://developers.cloudflare.com/logs/reference/filters/).
35+
"""
36+
3037
frequency: Optional[Literal["high", "low"]]
3138
"""This field is deprecated.
3239

tests/api_resources/logpush/test_jobs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
3535
account_id="account_id",
3636
dataset="http_requests",
3737
enabled=False,
38+
filter='{"where":{"and":[{"key":"ClientRequestPath","operator":"contains","value":"/static"},{"key":"ClientRequestHost","operator":"eq","value":"example.com"}]}}',
3839
frequency="high",
3940
kind="edge",
4041
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
@@ -120,6 +121,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
120121
account_id="account_id",
121122
destination_conf="s3://mybucket/logs?region=us-west-2",
122123
enabled=False,
124+
filter='{"where":{"and":[{"key":"ClientRequestPath","operator":"contains","value":"/static"},{"key":"ClientRequestHost","operator":"eq","value":"example.com"}]}}',
123125
frequency="high",
124126
kind="edge",
125127
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
@@ -386,6 +388,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
386388
account_id="account_id",
387389
dataset="http_requests",
388390
enabled=False,
391+
filter='{"where":{"and":[{"key":"ClientRequestPath","operator":"contains","value":"/static"},{"key":"ClientRequestHost","operator":"eq","value":"example.com"}]}}',
389392
frequency="high",
390393
kind="edge",
391394
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
@@ -471,6 +474,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
471474
account_id="account_id",
472475
destination_conf="s3://mybucket/logs?region=us-west-2",
473476
enabled=False,
477+
filter='{"where":{"and":[{"key":"ClientRequestPath","operator":"contains","value":"/static"},{"key":"ClientRequestHost","operator":"eq","value":"example.com"}]}}',
474478
frequency="high",
475479
kind="edge",
476480
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",

0 commit comments

Comments
 (0)
0