Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Added Service Listing rest api documentation #4861

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 144 additions & 0 deletions docs/references/rest-apis/rest-service-listing-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
!!! note

This API can also be accessed via the RequestHandler with app-id: `SVCLIST-V1`.

#### Get Service List
- Method: GET
- API PATH: `/services/serviceListing/v1/list`

##### Responses
- 200 OK status

```JSON
{
//Alphabetically ordered list of services running on kura
"servicesList": [
"HttpsKeystore",
...
...
"org.eclipse.kura.clock.ClockService",
...
...
"org.eclipse.kura.data.DataService",
...
...
]
}
```

---
#### Get Service List filtereb by interfaces
- Method: POST
- API PATH: `/services/serviceListing/v1/list/byInterface`

##### Responses
- 200 OK status

```JSON
Filter example

{
"interfacesIds": [
"org.eclipse.kura.security.keystore.KeystoreService"
]
}

```

```JSON
{
//Alphabetically ordered list of services running on kura filtered by implemented interfaces
"servicesList": [
"HttpsKeystore",
"SSLKeystore"
]
}
```

If more than one interface is present in the `interfaceIds` request body, a logic AND of those are performed.
Example:

```JSON
Filter example

{
"interfacesIds": [
"org.eclipse.kura.configuration.ConfigurableComponent",
"org.eclipse.kura.watchdog.WatchdogService"
]
}
```
```JSON
Response:
{
"servicesList": [
"org.eclipse.kura.watchdog.WatchdogService"
]
}
```

- 500 Internal Server Error
- Can occur if body json is not correctly written
```JSON
Example:

{
"interfacesIds":
}
```

- 400 Bad Status
- If body json is null
```JSON
Body:
{
}

Response:
{
"message": "Bad request. interfacesIds must not be null"
}
```
- If body json is empty
```JSON
Body:
{
"interfacesIds": [
]
}

Response:
{
"message": "Bad request. interfacesIds must not be empty"
}
```
- If body json contains null entry
```JSON
Body:
{
"interfacesIds": [
"org.eclipse.kura.configuration.ComponentConfiguration",

]
}

Response:
{
"message": "Bad request. none of the interfacesIds can be null"
}
```
- If body json contains empty entry
```JSON
Body:
{
"interfacesIds": [
"org.eclipse.kura.configuration.ComponentConfiguration",
""
]
}

Response:
{
"message": "Bad request. none of the interfacesIds can be null"
}
```
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ nav:
- Inventory: references/rest-apis/rest-inventory-api.md
- Position: references/rest-apis/rest-position-api.md
- Security: references/rest-apis/rest-security-api.md
- Service Listing: references/rest-apis/rest-service-listing-api.md
- Session: references/rest-apis/rest-session-api.md
- System: references/rest-apis/rest-system-api.md
- Tutorials:
Expand Down