Skip to content

Commit 9a039b5

Browse files
authored
Merge pull request #188 from ToshY/feature/187
Add support for `Origin Errors API`; Update existing API models
2 parents 5883690 + 825802a commit 9a039b5

Some content is hidden

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

55 files changed

+2048
-139
lines changed

docs/base-api.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ $bunnyHttpClient->request(
539539
'BR',
540540
'JH',
541541
],
542+
'PlayerVersion' => 1,
542543
],
543544
)
544545
);
@@ -555,6 +556,9 @@ $bunnyHttpClient->request(
555556
- `SYD` = Sydney (Oceania)
556557
- `BR` = Sao Paulo (Brazil)
557558
- `JH` = Johannesburg (Africa)
559+
- The key `PlayerVersion` has the following possible values:
560+
- `1` = Default video player
561+
- `2` = Beta video player
558562

559563
#### [Get Video Library](https://docs.bunny.net/reference/videolibrarypublic_index2)
560564

@@ -632,6 +636,9 @@ $bunnyHttpClient->request(
632636
'RemoveMetadataFromFallbackVideos' => false,
633637
'DrmVersion' => 'Basic',
634638
'PlaybackSpeeds' => '0.25,0.5,0.75,1.0,1.25,1.5,1.75,2.0,2.5,3,3.5,4',
639+
'EnableTranscribingChaptersGeneration' => false,
640+
'EnableTranscribingMomentsGeneration' => false,
641+
'ScaleVideoUsingBothDimensions' => true,
635642
],
636643
)
637644
);
@@ -2349,6 +2356,48 @@ $bunnyHttpClient->request(
23492356

23502357
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
23512358

2359+
#### Get User Audit Log
2360+
2361+
```php
2362+
$bunnyHttpClient->request(
2363+
new \ToshY\BunnyNet\Model\Api\Base\User\GetUserAuditLog(
2364+
date: (new \DateTime('-1 day'))->format('m-d-y'),
2365+
query: [
2366+
'Product' => [
2367+
'BunnyShield',
2368+
],
2369+
'ResourceType' => [
2370+
'Access Lists',
2371+
],
2372+
'ResourceId' => [
2373+
'1',
2374+
],
2375+
'ActorId' => [
2376+
'53c6cf29-c7cc-4d82-8187-56938c5e0734',
2377+
],
2378+
'Order' => [
2379+
'<key>' => '<value>',
2380+
],
2381+
'ContinuationToken' => [
2382+
'MWRiMjM0MTItMzM4Yy00NmFiLWEwYzEtN2E2ZGE2N2FiYzc4LTE3NjE4NjA0ODE4ODM=',
2383+
],
2384+
'Limit' => [
2385+
10000
2386+
]
2387+
],
2388+
)
2389+
);
2390+
```
2391+
2392+
??? note
2393+
2394+
- The key `Limit` has a value range of 1-10000.
2395+
2396+
??? warning
2397+
2398+
- The key `Limit` is currently not functional.
2399+
- The key `Order` has unknown key-value usage.
2400+
23522401
#### Get User Details
23532402

23542403
```php

docs/origin-errors-api.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Origin Errors API
2+
3+
When your origin stops responding, you shouldn’t have to dig through layers of logs or guess whether it’s DNS, timeouts, or misconfiguration.
4+
5+
Origin Errors Monitoring gives you full visibility into failed origin requests, directly in the dashboard or via API.
6+
7+
## Setup
8+
9+
```php
10+
<?php
11+
12+
require 'vendor/autoload.php';
13+
14+
use ToshY\BunnyNet\BunnyHttpClient;
15+
use ToshY\BunnyNet\Enum\Endpoint;
16+
17+
$bunnyHttpClient = new BunnyHttpClient(
18+
client: new \Symfony\Component\HttpClient\Psr18Client(),
19+
// Provide the account API key.
20+
apiKey: '2cebf4f8-4bff-429f-86f6-bce2c2163d7e89fb0a86-a1b2-463c-a142-11eba8811989',
21+
baseUrl: Endpoint::ORIGIN_ERRORS
22+
);
23+
```
24+
25+
## Usage
26+
27+
### Fetch Origin Errors
28+
29+
#### [Get Origin Errors for PullZone Id and Date](https://docs.bunny.net/reference/get-cdn-origin-errors)
30+
31+
```php
32+
$bunnyHttpClient->request(
33+
new \ToshY\BunnyNet\Model\Api\OriginErrors\GetOriginErrorLogs(
34+
pullZoneId: 1,
35+
dateTime: (new \DateTime('-1 day'))->format('m-d-y')
36+
)
37+
);
38+
```
39+
40+
## Reference
41+
42+
* [Origin Errors Blog Post](https://bunny.net/blog/no-more-502-guesswork-all-users-can-now-monitor-origin-errors/)
43+
* [Origin Errors Docs](https://docs.bunny.net/reference/get_shield-shield-zones)
44+
* [Origin Errors API](https://docs.bunny.net/reference/get-cdn-origin-errors)

0 commit comments

Comments
 (0)