-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from BananaOps/docs/udates-documentation
docs: add docs forr events and lock
- Loading branch information
Showing
3 changed files
with
185 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# Events Documentation | ||
|
||
## Grpc Call | ||
|
||
You can use Grpcurl to call grpc api | ||
|
||
### Create an Event | ||
|
||
```bash | ||
grpcurl --plaintext -d '{ | ||
"attributes": { | ||
"message": "deployment service serverless version v0.0.1", | ||
"priority": "1", | ||
"service": "service-event", | ||
"source": "github_action", | ||
"status": "1", | ||
"type": "1" | ||
}, | ||
"links": { | ||
"pull_request_link": "https://github.com/bananaops/tracker/pull/240" | ||
}, | ||
"title": "Deployment service lambda" | ||
}' localhost:8765 tracker.event.v1alpha1.EventService/CreateEvent | ||
|
||
``` | ||
|
||
### List Events | ||
|
||
```bash | ||
grpcurl --plaintext localhost:8765 tracker.event.v1alpha1.EventService/ListEvents | ||
|
||
``` | ||
|
||
### Get Event Id | ||
|
||
```bash | ||
grpcurl --plaintext -d '{ | ||
"id": "3ac2d880-ad52-4d50-b60d-9b44f54ae58f" | ||
}' localhost:8765 tracker.event.v1alpha1.EventService/GetEvent | ||
|
||
``` | ||
|
||
### Get Search Event | ||
|
||
```bash | ||
// With Priority P1 | ||
grpcurl --plaintext -d '{ | ||
"priority": "1" | ||
}' localhost:8765 tracker.event.v1alpha1.EventService/SearchEvents | ||
|
||
// With Priority P1 and Start Date | ||
grpcurl --plaintext -d '{ | ||
"priority": "1", | ||
"start_date": "2024-02-27" | ||
}' localhost:8765 tracker.event.v1alpha1.EventService/SearchEvents | ||
|
||
// With Priority P1 and End Date | ||
grpcurl --plaintext -d '{ | ||
"priority": "1", | ||
"end_date": "2024-02-28T15:04:05-07:00" | ||
}' localhost:8765 tracker.event.v1alpha1.EventService/SearchEvents | ||
|
||
``` | ||
|
||
## Rest Call | ||
|
||
### Create an Event | ||
|
||
```bash | ||
curl -X POST localhost:8080/api/v1alpha1/event -d ' | ||
{ | ||
"title": "Deployment service lambda", | ||
"attributes": { | ||
"message": "deployment service version v0.0.1", | ||
"source": "github_action", | ||
"type": 1, | ||
"priority": 1, | ||
"relatedId": "", | ||
"service": "service-event", | ||
"status": 1 | ||
}, | ||
"links": { | ||
"pullRequestLink": "https://github.com/bananaops/events-tracker/pull/240" | ||
} | ||
}' | ||
``` | ||
|
||
|
||
### List Events | ||
|
||
```bash | ||
curl "http://localhost:8080/api/v1alpha1/events/list" | ||
``` | ||
|
||
### Get Event Id | ||
|
||
```bash | ||
curl "localhost:8080/api/v1alpha1/event/a5fa1d90-44c9-4d4a-a436-930a9ee37e79" | ||
``` | ||
|
||
### Get Search Event | ||
|
||
```bash | ||
// With Priority P3 | ||
curl "localhost:8080/api/v1alpha1/events/search?priority=3" | ||
|
||
// With Priority P1 and Start Date | ||
curl "localhost:8080/api/v1alpha1/events/search?start_date=2024-03-01" | ||
|
||
// With Priority P1 and End Date | ||
curl "localhost:8080/api/v1alpha1/events/search?end_date=2024-03-01" | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Lock Documentation | ||
|
||
## Grpc Call | ||
|
||
You can use Grpcurl to call grpc api | ||
|
||
|
||
### Create Lock | ||
|
||
```bash | ||
grpcurl --plaintext -d '{ | ||
"service": "tracker-service", | ||
"who": "jplanckeel" | ||
}' localhost:8765 tracker.lock.v1alpha1.LockService/CreateLock | ||
``` | ||
|
||
### List Locks | ||
|
||
```bash | ||
grpcurl --plaintext localhost:8765 tracker.lock.v1alpha1.LockService/ListLocks | ||
``` | ||
|
||
### Get Lock | ||
|
||
```bash | ||
grpcurl --plaintext -d '{ | ||
"id": "2db91b8b-84ab-4e20-86e0-2104366bec5e" | ||
}' localhost:8765 tracker.lock.v1alpha1.LockService/GetLock | ||
``` | ||
|
||
### Delete Lock | ||
|
||
```bash | ||
grpcurl --plaintext -d '{ | ||
"id": "2db91b8b-84ab-4e20-86e0-2104366bec5e" | ||
}' localhost:8765 tracker.lock.v1alpha1.LockService/UnLock | ||
``` | ||
|
||
## Rest Call | ||
|
||
|
||
### Create Lock | ||
|
||
```bash | ||
curl -X POST localhost:8080/api/v1alpha1/lock -d ' | ||
{ | ||
"service": "tracker-service", | ||
"who": "jplanckeel" | ||
}' | ||
``` | ||
|
||
### List Locks | ||
|
||
```bash | ||
curl "localhost:8080/api/v1alpha1/locks/list" | ||
``` | ||
|
||
### Get Lock | ||
|
||
```bash | ||
curl "localhost:8080/api/v1alpha1/lock/57fcab51-c8ab-4f92-8d10-b41e456e8354" | ||
``` | ||
|
||
### Delete Lock | ||
|
||
```bash | ||
curl -X DELETE "localhost:8080/api/v1alpha1/unlock/e8ac122e-13cb-4abe-a127-98ec87acfb77" | ||
``` |