Skip to content

Commit 748f5f6

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#395)
1 parent 4f2b676 commit 748f5f6

File tree

8 files changed

+288
-30
lines changed

8 files changed

+288
-30
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1259
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9e7278b59ca6d3312a49ec919b139cdc626476b556f93923d70aeaf39c5c7bcf.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-66dffe82f1ae82ccb13bf0b382257be6906f416a22d1ca4ea74464cfff324775.yml

src/cloudflare/resources/logpush/datasets/fields.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ def get(
5151
key-value pairs, where keys are field names, and values are descriptions.
5252
5353
Args:
54-
dataset_id: Name of the dataset.
54+
dataset_id: Name of the dataset. A list of supported datasets can be found on the
55+
[Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).
5556
5657
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
5758
@@ -120,7 +121,8 @@ async def get(
120121
key-value pairs, where keys are field names, and values are descriptions.
121122
122123
Args:
123-
dataset_id: Name of the dataset.
124+
dataset_id: Name of the dataset. A list of supported datasets can be found on the
125+
[Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).
124126
125127
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
126128

src/cloudflare/resources/logpush/datasets/jobs.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def get(
5050
Lists Logpush jobs for an account or zone for a dataset.
5151
5252
Args:
53-
dataset_id: Name of the dataset.
53+
dataset_id: Name of the dataset. A list of supported datasets can be found on the
54+
[Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).
5455
5556
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
5657
@@ -117,7 +118,8 @@ async def get(
117118
Lists Logpush jobs for an account or zone for a dataset.
118119
119120
Args:
120-
dataset_id: Name of the dataset.
121+
dataset_id: Name of the dataset. A list of supported datasets can be found on the
122+
[Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).
121123
122124
account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
123125

src/cloudflare/resources/logpush/jobs.py

Lines changed: 136 additions & 14 deletions
Large diffs are not rendered by default.

src/cloudflare/types/logpush/job_create_params.py

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,29 @@ class JobCreateParams(TypedDict, total=False):
2525
"""The Zone ID to use for this endpoint. Mutually exclusive with the Account ID."""
2626

2727
dataset: Optional[str]
28-
"""Name of the dataset."""
28+
"""Name of the dataset.
29+
30+
A list of supported datasets can be found on the
31+
[Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).
32+
"""
2933

3034
enabled: bool
3135
"""Flag that indicates if the job is enabled."""
3236

3337
frequency: Optional[Literal["high", "low"]]
34-
"""The frequency at which Cloudflare sends batches of logs to your destination.
38+
"""This field is deprecated.
39+
40+
Please use `max_upload_*` parameters instead. The frequency at which Cloudflare
41+
sends batches of logs to your destination. Setting frequency to high sends your
42+
logs in larger quantities of smaller files. Setting frequency to low sends logs
43+
in smaller quantities of larger files.
44+
"""
3545

36-
Setting frequency to high sends your logs in larger quantities of smaller files.
37-
Setting frequency to low sends logs in smaller quantities of larger files.
46+
kind: Optional[Literal["edge"]]
47+
"""
48+
The kind parameter (optional) is used to differentiate between Logpush and Edge
49+
Log Delivery jobs. Currently, Edge Log Delivery is only supported for the
50+
`http_requests` dataset.
3851
"""
3952

4053
logpull_options: Optional[str]
@@ -46,6 +59,33 @@ class JobCreateParams(TypedDict, total=False):
4659
keep on making this call for you, setting start and end times appropriately.
4760
"""
4861

62+
max_upload_bytes: Optional[int]
63+
"""The maximum uncompressed file size of a batch of logs.
64+
65+
This setting value must be between `5 MB` and `1 GB`, or `0` to disable it. Note
66+
that you cannot set a minimum file size; this means that log files may be much
67+
smaller than this batch size. This parameter is not available for jobs with
68+
`edge` as its kind.
69+
"""
70+
71+
max_upload_interval_seconds: Optional[int]
72+
"""The maximum interval in seconds for log batches.
73+
74+
This setting must be between 30 and 300 seconds (5 minutes), or `0` to disable
75+
it. Note that you cannot specify a minimum interval for log batches; this means
76+
that log files may be sent in shorter intervals than this. This parameter is
77+
only used for jobs with `edge` as its kind.
78+
"""
79+
80+
max_upload_records: Optional[int]
81+
"""The maximum number of log lines per batch.
82+
83+
This setting must be between 1000 and 1,000,000 lines, or `0` to disable it.
84+
Note that you cannot specify a minimum number of log lines per batch; this means
85+
that log files may contain many fewer lines than this. This parameter is not
86+
available for jobs with `edge` as its kind.
87+
"""
88+
4989
name: Optional[str]
5090
"""Optional human readable job name.
5191

src/cloudflare/types/logpush/job_update_params.py

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,19 @@ class JobUpdateParams(TypedDict, total=False):
2828
"""Flag that indicates if the job is enabled."""
2929

3030
frequency: Optional[Literal["high", "low"]]
31-
"""The frequency at which Cloudflare sends batches of logs to your destination.
31+
"""This field is deprecated.
32+
33+
Please use `max_upload_*` parameters instead. The frequency at which Cloudflare
34+
sends batches of logs to your destination. Setting frequency to high sends your
35+
logs in larger quantities of smaller files. Setting frequency to low sends logs
36+
in smaller quantities of larger files.
37+
"""
3238

33-
Setting frequency to high sends your logs in larger quantities of smaller files.
34-
Setting frequency to low sends logs in smaller quantities of larger files.
39+
kind: Optional[Literal["edge"]]
40+
"""
41+
The kind parameter (optional) is used to differentiate between Logpush and Edge
42+
Log Delivery jobs. Currently, Edge Log Delivery is only supported for the
43+
`http_requests` dataset.
3544
"""
3645

3746
logpull_options: Optional[str]
@@ -43,6 +52,33 @@ class JobUpdateParams(TypedDict, total=False):
4352
keep on making this call for you, setting start and end times appropriately.
4453
"""
4554

55+
max_upload_bytes: Optional[int]
56+
"""The maximum uncompressed file size of a batch of logs.
57+
58+
This setting value must be between `5 MB` and `1 GB`, or `0` to disable it. Note
59+
that you cannot set a minimum file size; this means that log files may be much
60+
smaller than this batch size. This parameter is not available for jobs with
61+
`edge` as its kind.
62+
"""
63+
64+
max_upload_interval_seconds: Optional[int]
65+
"""The maximum interval in seconds for log batches.
66+
67+
This setting must be between 30 and 300 seconds (5 minutes), or `0` to disable
68+
it. Note that you cannot specify a minimum interval for log batches; this means
69+
that log files may be sent in shorter intervals than this. This parameter is
70+
only used for jobs with `edge` as its kind.
71+
"""
72+
73+
max_upload_records: Optional[int]
74+
"""The maximum number of log lines per batch.
75+
76+
This setting must be between 1000 and 1,000,000 lines, or `0` to disable it.
77+
Note that you cannot specify a minimum number of log lines per batch; this means
78+
that log files may contain many fewer lines than this. This parameter is not
79+
available for jobs with `edge` as its kind.
80+
"""
81+
4682
output_options: Optional[OutputOptionsParam]
4783
"""The structured replacement for `logpull_options`.
4884

src/cloudflare/types/logpush/logpush_job.py

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ class LogpushJob(BaseModel):
1515
"""Unique id of the job."""
1616

1717
dataset: Optional[str] = None
18-
"""Name of the dataset."""
18+
"""Name of the dataset.
19+
20+
A list of supported datasets can be found on the
21+
[Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).
22+
"""
1923

2024
destination_conf: Optional[str] = None
2125
"""Uniquely identifies a resource (such as an s3 bucket) where data will be pushed.
@@ -36,10 +40,19 @@ class LogpushJob(BaseModel):
3640
"""
3741

3842
frequency: Optional[Literal["high", "low"]] = None
39-
"""The frequency at which Cloudflare sends batches of logs to your destination.
43+
"""This field is deprecated.
44+
45+
Please use `max_upload_*` parameters instead. The frequency at which Cloudflare
46+
sends batches of logs to your destination. Setting frequency to high sends your
47+
logs in larger quantities of smaller files. Setting frequency to low sends logs
48+
in smaller quantities of larger files.
49+
"""
4050

41-
Setting frequency to high sends your logs in larger quantities of smaller files.
42-
Setting frequency to low sends logs in smaller quantities of larger files.
51+
kind: Optional[Literal["edge"]] = None
52+
"""
53+
The kind parameter (optional) is used to differentiate between Logpush and Edge
54+
Log Delivery jobs. Currently, Edge Log Delivery is only supported for the
55+
`http_requests` dataset.
4356
"""
4457

4558
last_complete: Optional[datetime] = None
@@ -68,6 +81,33 @@ class LogpushJob(BaseModel):
6881
keep on making this call for you, setting start and end times appropriately.
6982
"""
7083

84+
max_upload_bytes: Optional[int] = None
85+
"""The maximum uncompressed file size of a batch of logs.
86+
87+
This setting value must be between `5 MB` and `1 GB`, or `0` to disable it. Note
88+
that you cannot set a minimum file size; this means that log files may be much
89+
smaller than this batch size. This parameter is not available for jobs with
90+
`edge` as its kind.
91+
"""
92+
93+
max_upload_interval_seconds: Optional[int] = None
94+
"""The maximum interval in seconds for log batches.
95+
96+
This setting must be between 30 and 300 seconds (5 minutes), or `0` to disable
97+
it. Note that you cannot specify a minimum interval for log batches; this means
98+
that log files may be sent in shorter intervals than this. This parameter is
99+
only used for jobs with `edge` as its kind.
100+
"""
101+
102+
max_upload_records: Optional[int] = None
103+
"""The maximum number of log lines per batch.
104+
105+
This setting must be between 1000 and 1,000,000 lines, or `0` to disable it.
106+
Note that you cannot specify a minimum number of log lines per batch; this means
107+
that log files may contain many fewer lines than this. This parameter is not
108+
available for jobs with `edge` as its kind.
109+
"""
110+
71111
name: Optional[str] = None
72112
"""Optional human readable job name.
73113

tests/api_resources/logpush/test_jobs.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
3636
dataset="http_requests",
3737
enabled=False,
3838
frequency="high",
39+
kind="edge",
3940
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
41+
max_upload_bytes=5000000,
42+
max_upload_interval_seconds=30,
43+
max_upload_records=1000,
4044
name="example.com",
4145
output_options={
4246
"cve_2021_4428": True,
@@ -117,7 +121,11 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None:
117121
destination_conf="s3://mybucket/logs?region=us-west-2",
118122
enabled=False,
119123
frequency="high",
124+
kind="edge",
120125
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
126+
max_upload_bytes=5000000,
127+
max_upload_interval_seconds=30,
128+
max_upload_records=1000,
121129
output_options={
122130
"cve_2021_4428": True,
123131
"batch_prefix": "string",
@@ -378,7 +386,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
378386
dataset="http_requests",
379387
enabled=False,
380388
frequency="high",
389+
kind="edge",
381390
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
391+
max_upload_bytes=5000000,
392+
max_upload_interval_seconds=30,
393+
max_upload_records=1000,
382394
name="example.com",
383395
output_options={
384396
"cve_2021_4428": True,
@@ -459,7 +471,11 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare
459471
destination_conf="s3://mybucket/logs?region=us-west-2",
460472
enabled=False,
461473
frequency="high",
474+
kind="edge",
462475
logpull_options="fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339",
476+
max_upload_bytes=5000000,
477+
max_upload_interval_seconds=30,
478+
max_upload_records=1000,
463479
output_options={
464480
"cve_2021_4428": True,
465481
"batch_prefix": "string",

0 commit comments

Comments
 (0)