Skip to content

Commit 86dd6c9

Browse files
committed
Update README
1 parent f9a5eba commit 86dd6c9

File tree

1 file changed

+42
-5
lines changed

1 file changed

+42
-5
lines changed

README.md

+42-5
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,58 @@
11
# A PHP package for seamless interaction with Kong Gateway's Admin API
22

3-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/cleaniquecoders/kong-admin-api.svg?style=flat-square)](https://packagist.org/packages/cleaniquecoders/kong-admin-api)
4-
[![Tests](https://img.shields.io/github/actions/workflow/status/cleaniquecoders/kong-admin-api/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/cleaniquecoders/kong-admin-api/actions/workflows/run-tests.yml)
5-
[![Total Downloads](https://img.shields.io/packagist/dt/cleaniquecoders/kong-admin-api.svg?style=flat-square)](https://packagist.org/packages/cleaniquecoders/kong-admin-api)
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/cleaniquecoders/kong-admin-api.svg?style=flat-square)](https://packagist.org/packages/cleaniquecoders/kong-admin-api) [![Tests](https://img.shields.io/github/actions/workflow/status/cleaniquecoders/kong-admin-api/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/cleaniquecoders/kong-admin-api/actions/workflows/run-tests.yml) [![Total Downloads](https://img.shields.io/packagist/dt/cleaniquecoders/kong-admin-api.svg?style=flat-square)](https://packagist.org/packages/cleaniquecoders/kong-admin-api)
64

75
## Installation
86

9-
You can install the package via composer:
7+
You can install the package via Composer:
108

119
```bash
1210
composer require cleaniquecoders/kong-admin-api
1311
```
1412

1513
## Usage
1614

15+
This package provides a simple and flexible way to interact with Kong Gateway's Admin API.
16+
17+
### Basic Setup
18+
19+
Instantiate the Kong Admin Client:
20+
21+
```php
22+
use CleaniqueCoders\KongAdminApi\KongAdminClient;
23+
24+
$client = new KongAdminClient('http://localhost:8001'); // Replace with your Kong Admin URL
25+
```
26+
27+
### Example: Creating a Service
28+
29+
```php
30+
$response = $client->services()->create([
31+
'name' => 'example-service',
32+
'url' => 'http://example.com',
33+
]);
34+
35+
if ($response->isSuccessful()) {
36+
echo "Service created successfully!";
37+
} else {
38+
echo "Failed to create service: " . $response->getError();
39+
}
40+
```
41+
42+
### Available Methods
43+
44+
- **Services**: Manage and configure services.
45+
- **Routes**: Define routes for services.
46+
- **Consumers**: Manage consumers for your services.
47+
- **Plugins**: Attach plugins to services, routes, or consumers.
48+
- **Certificates**: Handle SSL certificates.
49+
50+
Please refer to the official Kong Gateway documentation for detailed options and parameters for each endpoint.
51+
1752
## Testing
1853

54+
To run tests:
55+
1956
```bash
2057
composer test
2158
```
@@ -26,7 +63,7 @@ Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed re
2663

2764
## Contributing
2865

29-
Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.
66+
Please see [CONTRIBUTING](https://github.com/cleaniquecoders/kong-admin-api/blob/main/CONTRIBUTING.md) for details on how to contribute.
3067

3168
## Security Vulnerabilities
3269

0 commit comments

Comments
 (0)