Skip to content

Commit a73a3f5

Browse files
authored
Merge pull request #289 from felipevicens/master
Adding micro-services READMEs
2 parents eb3fa87 + 6bbfa8b commit a73a3f5

File tree

10 files changed

+153
-471
lines changed

10 files changed

+153
-471
lines changed

docker-compose.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ services:
4141
environment:
4242
- RACK_ENV=integration
4343
- CATALOGUES_URL=http://sp.int.sonata-nfv.eu:4002/catalogues
44-
extra_hosts:
45-
- "jenkins.sonata-nfv.eu:192.168.60.5"
4644
logging:
4745
driver: gelf
4846
options:
@@ -66,8 +64,6 @@ services:
6664
- CATALOGUES_URL=http://sp.int.sonata-nfv.eu:4002/catalogues
6765
depends_on:
6866
- postgres
69-
extra_hosts:
70-
- "jenkins.sonata-nfv.eu:192.168.60.5"
7167
logging:
7268
driver: gelf
7369
options:
@@ -105,8 +101,6 @@ services:
105101
environment:
106102
- RACK_ENV=integration
107103
- REPOSITORIES_URL=http://sp.int.sonata-nfv.eu:4002/records
108-
extra_hosts:
109-
- "jenkins.sonata-nfv.eu:192.168.60.5"
110104
logging:
111105
driver: gelf
112106
options:

son-gtkapi/Gemfile.lock

Lines changed: 0 additions & 137 deletions
This file was deleted.

son-gtkfnct/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ RUN bundle install
99
COPY . /app
1010
EXPOSE 5500
1111
WORKDIR /app
12+
ENV CATALOGUES_URL http://catalogues:4002/catalogues
1213
ENV PORT 5500
1314
CMD ["foreman", "start"]

son-gtkfnct/README.md

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,42 @@
11
# [SONATA](http://www.sonata-nfv.eu)'s Gatekeeper Function Management micro-service
22
[![Build Status](http://jenkins.sonata-nfv.eu/buildStatus/icon?job=son-gkeeper)](http://jenkins.sonata-nfv.eu/job/son-gkeeper)
33

4-
# Tests
4+
This is the folder of the **Functions Management** micro-service. This micro-service is used by the [`Gatekeeper API`](https://github.com/sonata-nfv/son-gkeeper/son-gtkapi).
55

6-
## Obtain a list of available functions
7-
The full list of functions registered in the Catalogues can be obrained with
6+
## Configuration
7+
The configuration of the Gatekeeper's Function Management micro-service is done mostly by defining `ENV` variables in the [`Dockerfile`](https://github.com/sonata-nfv/son-gkeeper/blob/master/son-gtkfnct/Dockerfile). These variables are:
88

9-
```curl -vi http://sp.int.sonata-nfv.eu:32001/functions```
9+
* `PORT`: the port the micro-service is to provide it's services, currently `5500`;
10+
* `CATALOGUES_URL`: the Catalogues URL, currently `http://catalogues:4002/catalogues`;
1011

11-
**Note:** For this version, no user authentication/authorization is being done. In the future, with authentication/authorization mechanisms in place, this list will be adequately filtered.
12+
Future work includes evolving the way we store these environment variables, as well as avoiding at least some of the repetition between this information and the one provided in the [`docker-compose.yml`](https://github.com/sonata-nfv/son-gkeeper/blob/master/docker-compose.yml).
1213

13-
## Obtain a list of functions with specific attribute values
14-
To obtain only the list of functions that have specific values for some of the attributes (e.g., `status=Active`), you can do this:
14+
## Usage
15+
To use this application, we write
16+
```sh
17+
$ foreman start
18+
```
1519

16-
```curl -vi http://sp.int.sonata-nfv.eu:32001/functions?status=Active```
20+
[`Foreman`](https://github.com/ddollar/foreman) is a `ruby gem` for managing applications based on a [`Procfile`](https://github.com/sonata-nfv/son-gkeeper/blob/master/son-gtkfnct/Procfile).
1721

18-
## Obtain specific attributes on a list of functions
19-
To obtain only specific attributes (e.g., only `uuid`, `vendor`, `name` and `version`), you can do this:
22+
### Implemented API
23+
The implemented API of the Gatekeeper is the following:
2024

21-
```curl -vi http://sp.int.sonata-nfv.eu:32001/functions?fields=uuid,vendor,name,version```
25+
* `/functions`:
26+
* `GET`: provides a list of functions records, available in the Repository;
27+
* `/:uuid`: provides the function record data with the given `:uuid`;
28+
* `/functions?status=active`: provides the function with the status active;
29+
* `/functions?fields=uuid,vendor,name,version`: provides the function data with the given `uuid`, `vendor`, `name` and `version`;
30+
* `/admin/logs`:
31+
* `GET`: Retrieve the currently available log file
2232

23-
**Note:** We are assuming there aren't any attributes of the entity called `fields`.
33+
**Note 1:** `PUT`and `DELETE`operations are already supported by some of the micro-services, and will be described in the next version(s);
2434

25-
## Check directly in the Catalogue
35+
**Note 2:** all `GET`operations support pagination, though this still needs some work. This pagination can be done by using the `offset` and `limit` parameters, like in:
36+
```sh
37+
$ curl <resource_url>?offset=0,limit=10
38+
```
39+
This command will result in a list of `10`values (the `limit`) of the first page (`offset` zero). These are the default values used for those parameters.
2640

27-
```curl -vi -H "Content-Type: application/json" http://sp.int.sonata-nfv.eu:4002/catalogues/vnfs```
41+
## Tests
42+
At the module level, we only do **automated unit tests**, using the `RSpec` framework (see the `./spec/`folder). For the remaining tests please see the repositorie's [`README`](https://github.com/sonata-nfv/son-gkeeper/blob/master/README.md) file.

son-gtkpkg/Gemfile.lock

Lines changed: 0 additions & 136 deletions
This file was deleted.

0 commit comments

Comments
 (0)