diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 6bdd13a0..407bc505 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -7,40 +7,42 @@ assignees: '' --- -**Describe the bug** +### Bug + +#### Describe the bug A clear and concise description of what the bug is. -**Type of use (choose between):** +#### Type of use (choose between): - `service` provided by Road2 (ex. bug with a request from the API simple/1.0.0) - `administration` of the services provided by Road2 - `other`, please add a helpful description -**Type of bug (choose between):** +#### Type of bug (choose between): - `request`, for bugs with an API - `load`, for bugs during the creation of the server - `checkConfig`, for bugs with this option -**To Reproduce** +#### To Reproduce Steps to reproduce the behavior: 1. Load server with this configuration 2. Request the server -**Expected behavior** +#### Expected behavior A clear and concise description of what you expected to happen. -**Environment (please complete the following information):** +#### Environment (please complete the following information): - OS: [e.g. Debian] - OS Version: [e.g. 11] - Node version: [e.g. 16] - Road2 commit: [sha] -**Configuration:** +#### Configuration: - the configuration was generated inside the docker image: [eg. yes/no] - if no, please, provide us the any differences you find useful -**Data:** +#### Data: Type of data: [eg. osrm, pgrouting, valhalla] Generation of the data: [eg. docker image of route-graph-generator, other] -**Additional context** +#### Additional context Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7d..206826dd 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -7,14 +7,18 @@ assignees: '' --- -**Is your feature request related to a problem? Please describe.** +### Feature + +Please, make one issue per asked feature. + +#### Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -**Describe the solution you'd like** +#### Describe the solution you'd like A clear and concise description of what you want to happen. -**Describe alternatives you've considered** +#### Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. -**Additional context** +#### Additional context Add any other context or screenshots about the feature request here. diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md new file mode 100644 index 00000000..5c7ee6c1 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -0,0 +1,24 @@ +### Need + +Please, make one PR per feature or fix, and describe the reason of it. + +What is appreciated is to link this PR to an existing issue created with a template of this project. + +### Tasks + +- [ ] Code the feature on a new branch created from develop (see next paragraph) +- [ ] Update tests + - [ ] utest/itest if modification of a classe + - [ ] rtest if modification of an API + - [ ] ctest if modification of a configuration +- [ ] Run tests + - [ ] Inside the docker provided by the project : rtest, ctest, utest, itest + - [ ] Manually if necessary +- [ ] Update the documentation + - [ ] changelog.md + - [ ] documentation directory +- [ ] If possible, rebase your branch from develop + +### Code + +Please, describe what has been done to achieve this feature or fix. \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..45625930 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people by being friendly, patient and careful in used words +* Being welcoming, respectful of differing opinions, viewpoints, and experiences in your speech and actions +* Attempting collaboration before conflict +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community +* Alerting community leaders if you notice a dangerous situation, someone in distress, or violations of this Code of Conduct, even if they seem inconsequential + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject comments, +commits, code, wiki edits, issues, pull requests, discussions and other contributions +that are not aligned to this Code of Conduct, and will communicate reasons for +moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of community spaces are issues, pull request and discussions of +the Github project. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +report.road2@ign.fr or by a report on the Github project. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: If possible, a private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. This warning could be public otherwise. +A public apology may be requested. +When written, impacts may be reported and moderated. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), +version [2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html). +Elements were taken from the Django Code of Conduct and the Citizen Code of Conduct. + + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..5447cee6 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,252 @@ +# Welcome to our contributing guide + +Thank you for your interest and for contributing to this project ! + +Before contributing, please, read and adhere to : +- the [Code of Conduct](./CODE_OF_CONDUCT.md) to keep this community healthy, approachable and respectable; +- and the [Developer's Certificate of Origin](./documentation/developers/DCO.md) if you want to add code or documentation to this project. + +In this guide you will get an overview of different contribution workflows : +- Bug reports +- Feature requests +- No-Code contributions +- Code contributions +- Pull Requests + +Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue, assessing changes, and helping you finalize your pull requests. + +## Report bugs + +If you spot a bug in the code or in any other part of this project, you can create an issue. + +But before you open a new issue, please [search](https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests#search-by-the-title-body-or-comments) for older ones that cover the same issue. If you find one, please, avoid "me too" comments. You can add a +1 emoji reaction to the issue if you want to express interest in this. + +When using the issue tracker, you will have an issue template for bugs. Don't worry if you can't answer every detail, just fill in what you can. + +When possible, try to recreate the bug inside a docker container and give us your instructions to do it. Clear and easily reproducible instructions are your best gift for us <3. + +## Request new features + +Feature requests are welcome. + +If you would love to have something new in this projet, or if you want to code it yourself, please : +- take a look to our [roadmap](https://github.com/orgs/IGNF/projects/3/views/1), +- search for existing issues about this feature, +- if there is no issue for your need, please open an issue asking for feedback. It is really important before starting any implementation. Otherwise, you risk spending a lot of time working on something that the the project's developers might not want to merge into the project. + +When using the issue tracker, you will have an issue template for features. Please, fill in what you can. It will be an area of discussions between you and the project's developers. + +But take a moment to find out whether your idea fits within the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible. + +## No-Code contributions + +Improving documentation or writing tutorials are all examples of helpful contributions that make us thankful. It is a good way to discover the project and its community. + +## Code contributions + +We really appreciate the community picking up and fixing bugs or even implementing new features. As said before, following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, we should reciprocate that respect in addressing your issue, assessing changes, and helping you finalize your pull requests. + +## Pull Requests + +### Setting up your local environment + +To get started, you will need to have `git`, `docker` and `docker-compose` installed locally. The last two are used for tests. + +#### Step 1 : Fork + +[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) the [project](https://github.com/IGNF/road2) on GitHub and clone your fork locally : + +``` +git clone git@github.com:username/road2.git +cd road2 +git remote add upstream https://github.com/IGNF/road2.git +git pull upstream +``` + +Don't forget to configure `git` so that it knows who you are : +``` +git config user.name "Random User" +git config user.email "random.user@example.com" +``` + +You can use any name/email address you prefer here. We only use the metadata generated by git using this configuration for properly attributing your changes to you in the AUTHORS file and the changelog. + +If you would like for the GitHub UI to link the commit to your account and award you the Contributor label after the changes have been merged, make sure this local email is also added to your GitHub email list. + +#### Step 2 : Branch + +As a best practice to keep your development environment as organized as possible, create local branches to work within. When you create a branch, do it directly off of the upstream **develop** branch. + +``` +git checkout upstream develop +git checkout -b my-branch +``` + +Please, create one branch (so one Pull Request) per feature or fix. + +##### Branch name guidelines + +The branch name depends on the contribution you want to do : +- `doc/*` for modifying or adding docs only, +- `feat/*` for coding new functionnalities, +- `fix/*` for fixing the code, +- `docker/*` for modifying the docker part only, +- `test/*` for modifying or adding tests only, +- `ci/*` for modifying or adding Github CI only + +### The process of making changes + +#### Step 3 : Code + +Modifying Road2 typically involves changes to one or more of a few places in the repository. + +- JavaScript code contained in the `/src` directory, +- Documentation in `/documentation` directory and in possibly the `/readme.md`, +- Tests within the `/test` directory, +- Dockerfiles and configuration in `/docker` directory, +- the `/changelog.md` must be updated. + +##### Code guidelines + +Road2 is coded in Javascript, according to ES6 features. + +Let's dive into some specificities of this project. + +###### Variables + +Variables are camel cased. + +Use `let` most of the time and avoid `var`. Use `const` only for constants (including objects). It is a way to say "I create this object to be constant, so don't change it". + +###### Functions + +Avoid unused functions. + +###### Classes + +Create a class most of the time. If you are not sure, ask us in the issue concerning your dev. + +When you create a classe, use `get` and `set` keywords to indicate which attributes are exposed, editable, or not. + +When you are using a class instance, respect its attributes (getters/setters). Avoid adding a propertie to an instance. It is better to modify a class or create a child one. For this type of modification, please, talk to us before your dev. It will avoid frustration if those modifications are not in the ways of the project. + +###### Asynchronism + +Don't make callbacks but promises. + +If you use a library with callbacks, encapsulate each one in its promise. + +We make Promises at the lowest level and then we only manage with async/await/try/catch in order to have a code that is easier to understand and easier to maintain. +The try/catch only takes place at the second level, the one using the lowest level returning a Promise. Thus, all higher levels are not at risk of having an unexpected error, but they simply manage the return of the function of level N-1. +This allows you to fully understand what is happening, especially in the case of script-type actions that have an impact on the state of the service. + +###### Try/catch + +Use try/catch as much as possible in order to control errors and the rest of the code execution. This ensures that a function always returns what it is supposed to return and that there is no unexpected error. + +###### Comments + +Comment the code as much as possible to facilitate its understanding. + +###### Logs + +There are different levels of logs. You can use each of them. The easiest way is to take a look at what is currently being done in the code. + +For instance, `fatal` is reserved for a shutdown of the server,`error` for an unexpected error, `warn` for a non-problematic event, `info` is the most used level, and `debug` is useful for adding a lot of informations like object content. + +###### Engines + +Engines are only added if they are widely used by a strong community and provide functionality not available elsewhere. + +###### APIs + +Since it is easy to add an API from a different Github project, we will only add APIs from standards, such as those from the OGC. + +#### Step 4 : Commit + +It is a best practice to keep your changes as logically grouped as possible within individual commits. There is no limit to the number of commits any single pull request may have, and many contributors find it easier to review changes that are split across multiple commits. + +``` +git add my/changed/files +git commit -m "[type of change] explicit change" +``` + +Note that multiple commits often will get squashed when they are landed. + +#### Step 5 : Rebase + +As a best practice, once you have committed your changes, it is a good idea to use `git rebase` (not `git merge`) to synchronize your work with the main repository. + +``` +git checkout upstream develop +git pull upstream develop +git checkout my-branch +git rebase develop +``` + +This ensures that your working branch has the latest changes from the develop branch of the origin repository. Moreover, your Pull Request will be easier to merge. + +#### Step 6 : Test + +Bug fixes and features should always come with tests. + +There are a lot of tests in this project. They are written to be run with the docker-compose of the project. + +The `/test` directory contains : +- unit tests : those tests must all be validated. +- integration tests : it is a WIP so create or update, and run the tests concerned by your developments. +- functionnal tests : those tests must all be validated. To run them, you will have to generate data. + +#### Step 7 : Push + +Once you are sure your commits are ready to go, with passing tests, begin the process of opening a pull request by pushing your working branch to your fork on GitHub. + +``` +git push origin my-branch +``` + +#### Step 8 : Opening the Pull Request + +From within GitHub, opening a new pull request will present you with a pull request template. Please, try to do your best at filling out the details, but feel free to skip parts if you're not sure what to put. + +Once opened, pull requests are usually reviewed within a few days. + +To get feedback on your proposed change even though it is not ready to land, use the `Convert to draft` option in the GitHub UI instead of the `wip` label. + +Breaking changes need to have a BREAKING prefix. + +#### Step 9 : Discuss and update + +You will probably get feedback or requests for changes to your pull request. This is a big part of the submission process so don't be discouraged! Some contributors may sign off on the pull request right away, others may have more detailed comments or feedback. This is a necessary part of the process in order to evaluate whether the proposed changes are correct and necessary. + +To make changes to an existing pull request, make the changes to your local branch, add a new commit with those changes, and push those to your fork. GitHub will automatically update the pull request. + +``` +git add my/changed/files +git commit +git push origin my-branch +``` + +If a git conflict arises, it is necessary to synchronize your branch with other changes that have landed upstream by using git `rebase`: + +``` +git checkout upstream develop +git pull upstream develop +git checkout my-branch +git rebase develop +git push --force origin my-branch +``` + +Important: The git push `--force` command is one of the few ways to delete history in `git`. It also complicates the review process, as it won't allow reviewers to get a quick glance on what changed. Before you use it, make sure you understand the risks. If in doubt, you can always ask for guidance in the pull request. + +There are a number of more advanced mechanisms for managing commits using `git rebase` that can be used, but are beyond the scope of this guide. + +All pull requests require "sign off" in order to land. Whenever a contributor reviews a pull request they may find specific details that they would like to see changed or fixed. These may be as simple as fixing a typo, or may involve substantive changes to the code you have written. While such requests are intended to be helpful, they may come across as abrupt or unhelpful, especially requests to change things that do not include concrete suggestions on how to change them. + +Try not to be discouraged. If you feel that a particular review is unfair, say so, or contact one of the other contributors in the project and seek their input. Often such comments are the result of the reviewer having only taken a short amount of time to review and are not ill-intended. Such issues can often be resolved with a bit of patience. That said, reviewers should be expected to be helpful in their feedback, and feedback that is simply vague, dismissive, and unhelpful is likely safe to ignore. + +#### Step 10 : Landing + +In order to land, a pull request needs to be reviewed and approved by at least two Road2 administrators and pass a CI (Continuous Integration) test run. + +When an administrator lands your pull request, GitHub might show the pull request as Closed at this point, but don't worry. If you look at the branch you raised your pull request against, you should see a commit with your name on it. Congratulations and thanks for your contribution! diff --git a/changelog.md b/changelog.md index 26d75465..c037e5d7 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,18 @@ # CHANGELOG +## 2.2.0 + +CHANGED: + - GET /admin/1.0.0/services/{service}/projections/{projection} renvoit aussi les paramétres de la projection + - Projections were added for France and a file was created to separate them from the world wide projections + - Github issue templates were modified + - Use swagger-ui-express to display simple and administration openapi documentation + +ADDED: + - A Github PR template was added + - A code of conduct was adapted from the contributor covenant + - A contributing was added + ## 2.1.1 CHANGED: diff --git a/docker/config/projections/projection.json b/docker/config/projections/france.json similarity index 79% rename from docker/config/projections/projection.json rename to docker/config/projections/france.json index e9a547b0..122c8e02 100644 --- a/docker/config/projections/projection.json +++ b/docker/config/projections/france.json @@ -1,9 +1,5 @@ { "projectionsList": [ - { - "id": "EPSG:4326", - "parameters": "+proj=longlat +datum=WGS84 +no_defs" - }, { "id": "EPSG:2154", "parameters": "+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" @@ -27,6 +23,14 @@ { "id": "EPSG:3857", "parameters": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs" + }, + { + "id": "EPSG:32620", + "parameters": "+proj=utm +zone=20 +datum=WGS84 +units=m +no_defs +type=crs" + }, + { + "id": "EPSG:4467", + "parameters": "+proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs" } ] } diff --git a/docker/config/projections/world.json b/docker/config/projections/world.json new file mode 100644 index 00000000..0f7dd43a --- /dev/null +++ b/docker/config/projections/world.json @@ -0,0 +1,8 @@ +{ + "projectionsList": [ + { + "id": "EPSG:4326", + "parameters": "+proj=longlat +datum=WGS84 +no_defs" + } + ] +} diff --git a/docker/distributions/debian/Dockerfile b/docker/distributions/debian/Dockerfile index 5fb80532..eb8dbc8d 100644 --- a/docker/distributions/debian/Dockerfile +++ b/docker/distributions/debian/Dockerfile @@ -43,6 +43,8 @@ COPY /docker/config /home/docker/config/ ### Dossier de l'application WORKDIR /home/docker/app COPY src ./src/ +### Dossier documentation apis +COPY documentation/apis ./documentation/apis ### Récupération des sources de l'application COPY *.json ./ diff --git a/documentation/apis/administration/1.0.0/api.json b/documentation/apis/administration/1.0.0/api.json new file mode 100644 index 00000000..94a168d0 --- /dev/null +++ b/documentation/apis/administration/1.0.0/api.json @@ -0,0 +1,1862 @@ +{ + "openapi": "3.0.0", + "info": { + "description": "Description de l'API d'administration de Road2.", + "version": "1.0.0", + "title": "Administration de Road2", + "contact": { + "email": "contact.geoservices@ign.fr" + } + }, + "servers": [ + { + "url": "https://localhost:8079/admin/1.0.0/", + "description": "Serveur de test local" + } + ], + "tags": [ + { + "name": "État du serveur", + "description": "Connaître l'état de l'instance globale (administrateur et services)" + }, + { + "name": "Gestion de l'administrateur", + "description": "Administrer l'administrateur" + }, + { + "name": "Gestion des services", + "description": "Administrer des services" + }, + { + "name": "Gestion des ressources", + "description": "Administrer les ressources sur un service spécifique." + }, + { + "name": "Gestion des sources", + "description": "Administrer les sources sur un service spécifique." + } + ], + "paths": { + "/version": { + "get": { + "tags": [ + "État du serveur" + ], + "summary": "Obtenir la version du serveur.", + "description": "Cette requête retourne la version de Road2 utilisée par cette instance \nde l'administrateur.\n", + "operationId": "version", + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Version de Road2 utilisée" + } + } + } + } + } + } + } + } + }, + "/health": { + "get": { + "tags": [ + "État du serveur" + ], + "summary": "Obtenir l'état du serveur.", + "description": "Cette requête retourne l'état du serveur d'administration et \nde l'ensemble des services qu'il administre. Cet état fait principalement \nréférence à la disponibilité des données. Chaque service a un état lié à la \ndisponibilité de ses sources. Chaque source a un état lié à la disponibilité de ses données. \n", + "operationId": "health", + "parameters": [ + { + "name": "verbose", + "description": "\"Par défaut, puisque verbose=false, la requête retourne seulement l'état global \nde l'administrateur et de ses services. Si on souhaite récupérer plus d'information \nsur l'état de chaque service, on met verbose à true.\"\n", + "in": "query", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "state": { + "type": "string", + "enum": [ + "green", + "yellow", + "red" + ], + "description": "\"Lorsque tout va bien: 'green'. Si un des services a \nun problème:yellow. Si aucun service n'est disponible:red. Seule information retournée\nsi verbose=false. \"\n", + "example": "green" + }, + "administrator": { + "type": "object", + "properties": { + "state": { + "type": "string", + "example": "green", + "enum": [ + "green", + "yellow", + "red" + ], + "description": "\"Pour le moment, seul green est disponible car soit le serveur est disponible pour\nrépondre aux requêtes d'administration, soit il ne l'est pas du tout.\"\n" + } + } + }, + "services": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "main", + "description": "\"Id du service pour l'administrateur\"\n" + }, + "state": { + "type": "string", + "example": "green", + "enum": [ + "green", + "yellow", + "red" + ], + "description": "\"Lorsque toutes les sources sont disponibles : 'green'. Si une des sources a \nun problème:yellow. Si aucune source n'est disponible:red.\"\n" + }, + "sources": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "bduni-idf-car-fastest", + "description": "\"Id de la source pour le service\"\n" + }, + "state": { + "type": "string", + "example": "green", + "enum": [ + "green", + "red" + ], + "description": "\"Lorsque les données sont disponibles : 'green'. Si les données ne le sont plus: 'red'.\"\n" + } + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "/configuration": { + "get": { + "tags": [ + "Gestion de l'administrateur" + ], + "summary": "Obtenir la configuration de l'administrateur.", + "description": "Cette requête retourne la configuration de l'administrateur.\n", + "operationId": "get-admin-configuration", + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/adminConfiguration" + } + } + } + } + } + }, + "patch": { + "tags": [ + "Gestion de l'administrateur" + ], + "summary": "Modifier la configuration de l'administrateur.", + "description": "Dans la configuration de l'administrateur, tout est modifiable. \nCela permet notamment de créer, modifier et supprimer les services \ngérés par cet administrateur. \n", + "operationId": "patch-admin-configuration", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/adminConfiguration" + } + } + } + }, + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/adminConfiguration" + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + } + }, + "/services": { + "get": { + "tags": [ + "Gestion des services" + ], + "summary": "Obtenir la liste des services proposés par l'administrateur", + "description": "Cette requête retourne l'ensemble des services connus par l'administrateur. \nCette liste peut être vide si aucun service n'a été configuré.\n", + "operationId": "services", + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "allOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/serviceConfiguration" + } + ] + } + } + } + } + }, + "500": { + "description": "Internal error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Gestion des services" + ], + "summary": "Créer un service.", + "description": "Si un service n'existe pas, il est possible de le créer \nen fournissant sa configuration. \n", + "operationId": "post-service", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/serviceConfiguration" + } + } + } + }, + "responses": { + "201": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "allOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/serviceConfiguration" + } + ] + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + } + }, + "/services/{service}": { + "get": { + "tags": [ + "Gestion des services" + ], + "summary": "Obtenir la configuration d'un service.", + "description": "Cette requête retourne la configuration du service demandé.\n", + "operationId": "get-service", + "parameters": [ + { + "name": "service", + "description": "Id du service concerné", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/serviceConfiguration" + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + }, + "patch": { + "tags": [ + "Gestion des services" + ], + "summary": "Modifier la configuration d'un service existant.", + "description": "Il s'agit de modifier des paramètres de configuration d'un service \ndéjà existant. Il faut fournir la configuration du service à modifier.\nSi un redémarrage du service est nécessaire, il sera de fait \ntemporairement indisponible.\n", + "operationId": "patch-service", + "parameters": [ + { + "name": "service", + "description": "Id du service concerné", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/serviceConfiguration" + } + } + } + }, + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/serviceConfiguration" + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Gestion des services" + ], + "summary": "Supprimer un service.", + "description": "Pour supprimer un service, il sera nécessaire d'avoir d'abord \nsupprimé les sources et ressources associées. Une fois supprimés, \nun service et sa configuration ne peuvent être récupérés. \n", + "operationId": "delete-service", + "parameters": [ + { + "name": "service", + "description": "Id du service concerné", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "successful operation" + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + } + }, + "/services/{service}/restart": { + "get": { + "tags": [ + "Gestion des services" + ], + "summary": "Demander le redémarage d'un service.", + "description": "Cette requête demande le redémarage du service demandé. Cette demande peut \néchouer et l'utilisateur en sera informé. \n", + "operationId": "get-service-restart", + "parameters": [ + { + "name": "service", + "description": "Id du service concerné", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/serviceConfiguration" + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + } + }, + "/services/{service}/projections/{projection}": { + "get": { + "tags": [ + "Gestion des services", + "Projection" + ], + "summary": "Récupération d'une projection supportée par un service.", + "description": "Cette requête retourne une projection supportée par un service.\n", + "operationId": "get-service-projection", + "parameters": [ + { + "name": "service", + "description": "Id du service concerné", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "projection", + "description": "Id de la projection concernée", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/projectionConfiguration" + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "500": { + "description": "Internal server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + } + }, + "/services/{service}/resources": { + "get": { + "tags": [ + "Gestion des ressources" + ], + "summary": "Obtenir la liste des ressources proposées par un service.", + "description": "Cette requête retourne la liste des ressources sur le service indiqué.\n", + "operationId": "get-resources", + "parameters": [ + { + "name": "service", + "in": "path", + "description": "Id du service concerné", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "source", + "description": "Filtre pour avoir les ressources qui utilisent cette source\n", + "in": "query", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "resources": { + "type": "array", + "items": { + "$ref": "#/components/schemas/resourceConfiguration" + } + } + } + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Gestion des ressources" + ], + "summary": "Intégrer une nouvelle ressource. Il faut fournir la configuration de la ressource à intégrer.", + "description": "Les sources indiquées doivent déjà exister.", + "operationId": "post-resource", + "parameters": [ + { + "name": "service", + "description": "Id du service concerné", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "responses": { + "201": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + } + }, + "/services/{service}/resources/{resource}": { + "get": { + "tags": [ + "Gestion des ressources" + ], + "summary": "Obtenir la configuration d'une ressource.", + "description": "Cette requête retourne la configuration d'une ressource.", + "operationId": "get-resource", + "parameters": [ + { + "name": "service", + "description": "Id du service concerné", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "resource", + "in": "path", + "description": "Id de la ressource concernée", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/resourceConfiguration" + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + }, + "patch": { + "tags": [ + "Gestion des ressources" + ], + "summary": "Modifier une ressource existante. Il faut fournir la configuration de la ressource à modifier.", + "description": "Les sources indiquées doivent déjà exister.", + "operationId": "patch-resource", + "parameters": [ + { + "name": "service", + "description": "Id du service concerné", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "resource", + "in": "path", + "description": "Id de la ressource concernée", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/resourceConfiguration" + } + } + } + }, + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/resourceConfiguration" + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Gestion des ressources" + ], + "summary": "Supprimer une ressource. Il faut fournir l'id de la ressource à supprimer.", + "description": "", + "operationId": "delete-resource", + "parameters": [ + { + "name": "service", + "description": "Id du service concerné", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "resource", + "in": "path", + "description": "Id de la ressource concernée", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "successful operation" + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + } + }, + "/services/{service}/sources": { + "get": { + "tags": [ + "Gestion des sources" + ], + "summary": "Obtenir la liste des sources proposées par un service.", + "description": "Cette requête retourne la liste des sources sur le service indiqué.", + "operationId": "get-sources", + "parameters": [ + { + "name": "service", + "in": "path", + "description": "Id du service concerné", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "sources": { + "type": "array", + "items": { + "$ref": "#/components/schemas/sourceConfiguration" + } + } + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Gestion des sources" + ], + "summary": "Intégrer une nouvelle source. Il faut fournir la configuration de la source à intégrer.", + "description": "La donnée doit déjà exister.", + "operationId": "post-source", + "parameters": [ + { + "name": "service", + "description": "Id du service concerné", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/sourceConfiguration" + } + } + } + }, + "responses": { + "201": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/sourceConfiguration" + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + } + }, + "/services/{service}/sources/{source}": { + "get": { + "tags": [ + "Gestion des sources" + ], + "summary": "Obtenir la configuration d'une source.", + "description": "Cette requête retourne la configuration d'une source déjà existante.", + "operationId": "get-source", + "parameters": [ + { + "name": "service", + "description": "Id du service concerné", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "source", + "in": "path", + "description": "Id de la source concernée", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/sourceConfiguration" + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + }, + "patch": { + "tags": [ + "Gestion des sources" + ], + "summary": "Modifier une source existante. Il faut fournir la configuration de la source à modifier.", + "description": "La donnée doit déjà exister.", + "operationId": "patch-source", + "parameters": [ + { + "name": "service", + "description": "Id du service concerné", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "source", + "in": "path", + "description": "Id de la source concernée", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/sourceConfiguration" + } + } + } + }, + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/sourceConfiguration" + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Gestion des sources" + ], + "summary": "Surpprimer une source. Il faut fournir l'id de la source à supprimer.", + "description": "La suppression de la donnée doit être faite autrement. \nOn doit avoir supprimé son usage dans les ressources avant.\n", + "operationId": "delete-source", + "parameters": [ + { + "name": "service", + "description": "Id du service concerné", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "source", + "in": "path", + "description": "Id de la source concernée", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "successful operation" + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "errorResponse": { + "type": "object", + "properties": { + "error": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + }, + "adminConfiguration": { + "type": "object", + "properties": { + "administration": { + "type": "object", + "properties": { + "api": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "admin" + }, + "version": { + "type": "string", + "example": "1.0.0" + } + } + }, + "services": { + "type": "array", + "minItems": 0, + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "main" + }, + "configuration": { + "type": "string", + "example": "/home/docker/config/service.json" + }, + "creationType": { + "type": "string", + "example": "newProcess" + } + } + } + }, + "network": { + "type": "object", + "properties": { + "server": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "administrator" + }, + "https": { + "type": "string", + "example": "false" + }, + "host": { + "type": "string", + "example": "0.0.0.0" + }, + "port": { + "type": "string", + "example": "8079" + } + } + } + } + }, + "logs": { + "type": "object", + "properties": { + "configuration": { + "type": "string", + "example": "/home/docker/config/log4js-administration.json" + } + } + } + } + } + } + }, + "serviceConfiguration": { + "type": "object", + "properties": { + "application": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "Road2" + }, + "title": { + "type": "string", + "example": "Service de calcul d'itinéraire" + }, + "description": { + "type": "string", + "example": "Ce service permet de calculer des itinéraires sur les données du Géoportail." + }, + "url": { + "type": "string", + "example": "https://localhost/" + }, + "provider": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "IGN" + }, + "site": { + "type": "string", + "example": "www.ign.fr" + }, + "mail": { + "type": "string", + "example": "contact.geoservices@ign.fr" + } + } + }, + "logs": { + "type": "object", + "properties": { + "configuration": { + "type": "string", + "example": "/home/docker/config/log4js-service.json" + } + } + }, + "operations": { + "type": "object", + "properties": { + "directory": { + "type": "string", + "example": "/home/docker/app/src/resources/operations" + }, + "parameters": { + "type": "object", + "properties": { + "directory": { + "type": "string", + "example": "/home/docker/app/src/resources/parameters" + } + } + } + } + }, + "resources": { + "type": "object", + "properties": { + "directories": { + "type": "array", + "items": { + "type": "string", + "example": "/home/docker/data/resources/" + } + } + } + }, + "sources": { + "type": "object", + "properties": { + "directories": { + "type": "array", + "items": { + "type": "string", + "example": "/home/docker/data/sources/" + } + } + } + }, + "network": { + "type": "object", + "properties": { + "servers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "internalServer" + }, + "https": { + "type": "string", + "example": "false" + }, + "host": { + "type": "string", + "example": "0.0.0.0" + }, + "port": { + "type": "string", + "example": "8080" + } + } + } + }, + "cors": { + "type": "object", + "properties": { + "configuration": { + "type": "string", + "example": "/home/docker/config/cors.json" + } + } + } + } + }, + "projections": { + "type": "object", + "properties": { + "directory": { + "type": "string", + "example": "/home/docker/config/projections/" + } + } + }, + "apis": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "simple" + }, + "version": { + "type": "string", + "example": "1.0.0" + } + } + } + } + } + } + } + }, + "projectionConfiguration": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "EPSG:4326" + }, + "parameters": { + "type": "string", + "example": "+proj=longlat +datum=WGS84 +no_defs" + } + } + }, + "resourceConfiguration": { + "type": "object", + "properties": { + "resource": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "my-resource" + }, + "type": { + "type": "string", + "example": "osrm" + }, + "description": { + "type": "string", + "example": "Exemple d'une ressource." + }, + "resourceVersion": { + "type": "string", + "example": "yyyy-mm-dd" + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "example": "data-car-fastest" + } + }, + "availableOperations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "route" + }, + "parameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "resource" + }, + "defaultValueContent": { + "type": "string" + }, + "values": { + "type": "object" + } + } + } + } + } + } + } + } + } + } + }, + "sourceConfiguration": { + "oneOf": [ + { + "$ref": "#/components/schemas/osrmSourceConfiguration" + }, + { + "$ref": "#/components/schemas/pgrSourceConfiguration" + }, + { + "$ref": "#/components/schemas/valhallaSourceConfiguration" + } + ] + }, + "osrmSourceConfiguration": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "bduni-idf-car-fastest" + }, + "description": { + "type": "string", + "example": "test osrm" + }, + "type": { + "type": "string", + "enum": [ + "osrm" + ] + }, + "projection": { + "type": "string", + "example": "EPSG:4326" + }, + "bbox": { + "type": "string", + "example": "1.748.43.349.1" + }, + "storage": { + "type": "object", + "properties": { + "file": { + "type": "string", + "example": "/home/docker/data/bduni-idf-car-fastest/bduni-idf-car-fastest.osrm" + } + } + }, + "cost": { + "type": "object", + "properties": { + "cost": { + "type": "object", + "properties": { + "profile": { + "type": "string", + "example": "car" + }, + "optimization": { + "type": "string", + "example": "fastest" + } + } + } + } + } + } + }, + "pgrSourceConfiguration": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "bduni-idf-car-fastest" + }, + "description": { + "type": "string", + "example": "test osrm" + }, + "type": { + "type": "string", + "enum": [ + "pgrouting" + ] + }, + "projection": { + "type": "string", + "example": "EPSG:4326" + }, + "bbox": { + "type": "string", + "example": "1.748.43.349.1" + }, + "storage": { + "type": "object", + "properties": { + "base": { + "type": "object", + "properties": { + "dbConfig": { + "type": "string", + "example": "/home/docker/data/output_base.json" + }, + "schema": { + "type": "string", + "example": "public" + }, + "attributes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "example": "name" + }, + "column": { + "type": "string", + "example": "concat_names" + }, + "default": { + "type": "string", + "example": "false" + } + } + } + } + } + } + } + }, + "costs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "cost": { + "type": "object", + "properties": { + "profile": { + "type": "string", + "example": "car" + }, + "optimization": { + "type": "string", + "example": "fastest" + }, + "costType": { + "type": "string", + "example": "time" + }, + "costColumn": { + "type": "string", + "example": "cost_s_car" + }, + "rcostColumn": { + "type": "string", + "example": "reverse_cost_s_car" + } + } + } + } + } + } + } + }, + "valhallaSourceConfiguration": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "bduni-idf-car-fastest" + }, + "description": { + "type": "string", + "example": "test osrm" + }, + "type": { + "type": "string", + "enum": [ + "valhalla" + ] + }, + "projection": { + "type": "string", + "example": "EPSG:4326" + }, + "bbox": { + "type": "string", + "example": "1.748.43.349.1" + }, + "storage": { + "oneOf": [ + { + "type": "object", + "properties": { + "file": { + "type": "string", + "example": "/home/docker/data/bduni-idf-car-fastest/bduni-idf-car-fastest.osrm" + } + } + }, + { + "type": "object", + "properties": { + "base": { + "type": "object", + "properties": { + "dbConfig": { + "type": "string", + "example": "/home/docker/data/output_base.json" + }, + "schema": { + "type": "string", + "example": "public" + }, + "attributes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "example": "name" + }, + "column": { + "type": "string", + "example": "concat_names" + }, + "default": { + "type": "string", + "example": "false" + } + } + } + } + } + } + } + }, + { + "type": "object", + "properties": { + "tar": { + "type": "string", + "example": "/home/docker/data/bdtopo-valhalla-tiles.tar" + }, + "dir": { + "type": "string", + "example": "/home/docker/data/bdtopo-valhalla-tiles/" + }, + "config": { + "type": "string", + "example": "/home/docker/data/valhalla.json" + } + } + } + ] + }, + "costs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "cost": { + "type": "object", + "properties": { + "profile": { + "type": "string", + "example": "car" + }, + "optimization": { + "type": "string", + "example": "fastest" + }, + "costType": { + "type": "string", + "example": "time" + }, + "costing": { + "type": "string", + "example": "auto" + } + } + } + } + } + } + } + } + } + } +} diff --git a/documentation/apis/administration/1.0.0/api.yaml b/documentation/apis/administration/1.0.0/api.yaml deleted file mode 100644 index 66df8c67..00000000 --- a/documentation/apis/administration/1.0.0/api.yaml +++ /dev/null @@ -1,1250 +0,0 @@ -openapi: "3.0.0" - -info: - description: "Description de l'API d'administration de Road2." - version: "1.0.0" - title: "Administration de Road2" - contact: - email: "contact.geoservices@ign.fr" - -servers: - - url: "https://localhost:8079/admin/1.0.0/" - description: "Serveur de test local" - -tags: -- name: "État du serveur" - description: "Connaître l'état de l'instance globale (administrateur et services)" -- name: "Gestion de l'administrateur" - description: "Administrer l'administrateur" -- name: "Gestion des services" - description: "Administrer des services" -- name: "Gestion des ressources" - description: "Administrer les ressources sur un service spécifique." -- name: "Gestion des sources" - description: "Administrer les sources sur un service spécifique." - -paths: - - /version: - get: - tags: - - "État du serveur" - summary: "Obtenir la version du serveur." - description: | - Cette requête retourne la version de Road2 utilisée par cette instance - de l'administrateur. - operationId: "version" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - type: "object" - properties: - version: - type: "string" - description: "Version de Road2 utilisée" - - /health: - get: - tags: - - "État du serveur" - summary: "Obtenir l'état du serveur." - description: | - Cette requête retourne l'état du serveur d'administration et - de l'ensemble des services qu'il administre. Cet état fait principalement - référence à la disponibilité des données. Chaque service a un état lié à la - disponibilité de ses sources. Chaque source a un état lié à la disponibilité de ses données. - operationId: "health" - parameters: - - name: "verbose" - description: | - "Par défaut, puisque verbose=false, la requête retourne seulement l'état global - de l'administrateur et de ses services. Si on souhaite récupérer plus d'information - sur l'état de chaque service, on met verbose à true." - in: "query" - required: false - schema: - type: "boolean" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - type: "object" - properties: - state: - type: "string" - enum: ["green","yellow","red"] - description: | - "Lorsque tout va bien: 'green'. Si un des services a - un problème:yellow. Si aucun service n'est disponible:red. Seule information retournée - si verbose=false. " - example: "green" - administrator: - type: "object" - properties: - state: - type: "string" - example: "green" - enum: ["green","yellow","red"] - description: | - "Pour le moment, seul green est disponible car soit le serveur est disponible pour - répondre aux requêtes d'administration, soit il ne l'est pas du tout." - services: - type: "array" - items: - type: "object" - properties: - id: - type: "string" - example: "main" - description: | - "Id du service pour l'administrateur" - state: - type: "string" - example: "green" - enum: ["green","yellow","red"] - description: | - "Lorsque toutes les sources sont disponibles : 'green'. Si une des sources a - un problème:yellow. Si aucune source n'est disponible:red." - sources: - type: "array" - items: - type: "object" - properties: - id: - type: "string" - example: "bduni-idf-car-fastest" - description: | - "Id de la source pour le service" - state: - type: "string" - example: "green" - enum: ["green","red"] - description: | - "Lorsque les données sont disponibles : 'green'. Si les données ne le sont plus: 'red'." - - /configuration: - get: - tags: - - "Gestion de l'administrateur" - summary: "Obtenir la configuration de l'administrateur." - description: | - Cette requête retourne la configuration de l'administrateur. - operationId: "get-admin-configuration" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - $ref: "#/components/schemas/adminConfiguration" - patch: - tags: - - "Gestion de l'administrateur" - summary: "Modifier la configuration de l'administrateur." - description: | - Dans la configuration de l'administrateur, tout est modifiable. - Cela permet notamment de créer, modifier et supprimer les services - gérés par cet administrateur. - operationId: "patch-admin-configuration" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/adminConfiguration" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - $ref: "#/components/schemas/adminConfiguration" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - - /services: - get: - tags: - - "Gestion des services" - summary: "Obtenir la liste des services proposés par l'administrateur" - description: | - Cette requête retourne l'ensemble des services connus par l'administrateur. - Cette liste peut être vide si aucun service n'a été configuré. - operationId: "services" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - type: "array" - items: - type: "object" - allOf: - - type: "object" - properties: - id: - type: "string" - - $ref: "#/components/schemas/serviceConfiguration" - 500: - description: "Internal error" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - post: - tags: - - "Gestion des services" - summary: "Créer un service." - description: | - Si un service n'existe pas, il est possible de le créer - en fournissant sa configuration. - operationId: "post-service" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/serviceConfiguration" - responses: - 201: - description: "successful operation" - content: - application/json: - schema: - type: "object" - allOf: - - type: "object" - properties: - id: - type: "string" - - $ref: "#/components/schemas/serviceConfiguration" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - - /services/{service}: - get: - tags: - - "Gestion des services" - summary: "Obtenir la configuration d'un service." - description: | - Cette requête retourne la configuration du service demandé. - operationId: "get-service" - parameters: - - name: "service" - description: "Id du service concerné" - in: "path" - required: true - schema: - type: "string" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - $ref: "#/components/schemas/serviceConfiguration" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - patch: - tags: - - "Gestion des services" - summary: "Modifier la configuration d'un service existant." - description: | - Il s'agit de modifier des paramètres de configuration d'un service - déjà existant. Il faut fournir la configuration du service à modifier. - Si un redémarrage du service est nécessaire, il sera de fait - temporairement indisponible. - operationId: "patch-service" - parameters: - - name: "service" - description: "Id du service concerné" - in: "path" - required: true - schema: - type: "string" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/serviceConfiguration" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - $ref: "#/components/schemas/serviceConfiguration" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - delete: - tags: - - "Gestion des services" - summary: "Supprimer un service." - description: | - Pour supprimer un service, il sera nécessaire d'avoir d'abord - supprimé les sources et ressources associées. Une fois supprimés, - un service et sa configuration ne peuvent être récupérés. - operationId: "delete-service" - parameters: - - name: "service" - description: "Id du service concerné" - in: "path" - required: true - schema: - type: "string" - responses: - 204: - description: "successful operation" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - - /services/{service}/restart: - get: - tags: - - "Gestion des services" - summary: "Demander le redémarage d'un service." - description: | - Cette requête demande le redémarage du service demandé. Cette demande peut - échouer et l'utilisateur en sera informé. - operationId: "get-service-restart" - parameters: - - name: "service" - description: "Id du service concerné" - in: "path" - required: true - schema: - type: "string" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - $ref: "#/components/schemas/serviceConfiguration" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 500: - description: "Internal server error" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - - /services/{service}/projections/{projection}: - get: - tags: - - "Gestion des services" - - "Projection" - summary: "Récupération d'une projection supportée par un service." - description: | - Cette requête retourne une projection supportée par un service. - operationId: "get-service-projection" - parameters: - - name: "service" - description: "Id du service concerné" - in: "path" - required: true - schema: - type: "string" - - name: "projection" - description: "Id de la projection concernée" - in: "path" - required: true - schema: - type: "string" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - $ref: "#/components/schemas/projectionConfiguration" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 500: - description: "Internal server error" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - - /services/{service}/resources: - get: - tags: - - "Gestion des ressources" - summary: "Obtenir la liste des ressources proposées par un service." - description: | - Cette requête retourne la liste des ressources sur le service indiqué. - operationId: "get-resources" - parameters: - - name: "service" - in: "path" - description: "Id du service concerné" - required: true - schema: - type: "string" - - name: "source" - description: | - Filtre pour avoir les ressources qui utilisent cette source - in: "query" - required: false - schema: - type: "string" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - type: "object" - properties: - resources: - type: "array" - items: - $ref: "#/components/schemas/resourceConfiguration" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - post: - tags: - - "Gestion des ressources" - summary: "Intégrer une nouvelle ressource. Il faut fournir la configuration de la ressource à intégrer." - description: "Les sources indiquées doivent déjà exister." - operationId: "post-resource" - parameters: - - name: "service" - description: "Id du service concerné" - in: "path" - required: true - schema: - type: "string" - requestBody: - required: true - content: - application/json: - schema: - type: "object" - responses: - 201: - description: "successful operation" - content: - application/json: - schema: - type: "object" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - - /services/{service}/resources/{resource}: - get: - tags: - - "Gestion des ressources" - summary: "Obtenir la configuration d'une ressource." - description: "Cette requête retourne la configuration d'une ressource." - operationId: "get-resource" - parameters: - - name: "service" - description: "Id du service concerné" - in: "path" - required: true - schema: - type: "string" - - name: "resource" - in: "path" - description: "Id de la ressource concernée" - required: true - schema: - type: "string" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - $ref: "#/components/schemas/resourceConfiguration" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - patch: - tags: - - "Gestion des ressources" - summary: "Modifier une ressource existante. Il faut fournir la configuration de la ressource à modifier." - description: "Les sources indiquées doivent déjà exister." - operationId: "patch-resource" - parameters: - - name: "service" - description: "Id du service concerné" - in: "path" - required: true - schema: - type: "string" - - name: "resource" - in: "path" - description: "Id de la ressource concernée" - required: true - schema: - type: "string" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/resourceConfiguration" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - $ref: "#/components/schemas/resourceConfiguration" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - delete: - tags: - - "Gestion des ressources" - summary: "Supprimer une ressource. Il faut fournir l'id de la ressource à supprimer." - description: "" - operationId: "delete-resource" - parameters: - - name: "service" - description: "Id du service concerné" - in: "path" - required: true - schema: - type: "string" - - name: "resource" - in: "path" - description: "Id de la ressource concernée" - required: true - schema: - type: "string" - responses: - 204: - description: "successful operation" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - - /services/{service}/sources: - get: - tags: - - "Gestion des sources" - summary: "Obtenir la liste des sources proposées par un service." - description: "Cette requête retourne la liste des sources sur le service indiqué." - operationId: "get-sources" - parameters: - - name: "service" - in: "path" - description: "Id du service concerné" - required: true - schema: - type: "string" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - type: "object" - properties: - sources: - type: "array" - items: - $ref: "#/components/schemas/sourceConfiguration" - post: - tags: - - "Gestion des sources" - summary: "Intégrer une nouvelle source. Il faut fournir la configuration de la source à intégrer." - description: "La donnée doit déjà exister." - operationId: "post-source" - parameters: - - name: "service" - description: "Id du service concerné" - in: "path" - required: true - schema: - type: "string" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/sourceConfiguration" - responses: - 201: - description: "successful operation" - content: - application/json: - schema: - $ref: "#/components/schemas/sourceConfiguration" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - - /services/{service}/sources/{source}: - get: - tags: - - "Gestion des sources" - summary: "Obtenir la configuration d'une source." - description: "Cette requête retourne la configuration d'une source déjà existante." - operationId: "get-source" - parameters: - - name: "service" - description: "Id du service concerné" - in: "path" - required: true - schema: - type: "string" - - name: "source" - in: "path" - description: "Id de la source concernée" - required: true - schema: - type: "string" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - $ref: "#/components/schemas/sourceConfiguration" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - patch: - tags: - - "Gestion des sources" - summary: "Modifier une source existante. Il faut fournir la configuration de la source à modifier." - description: "La donnée doit déjà exister." - operationId: "patch-source" - parameters: - - name: "service" - description: "Id du service concerné" - in: "path" - required: true - schema: - type: "string" - - name: "source" - in: "path" - description: "Id de la source concernée" - required: true - schema: - type: "string" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/sourceConfiguration" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - $ref: "#/components/schemas/sourceConfiguration" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - delete: - tags: - - "Gestion des sources" - summary: "Surpprimer une source. Il faut fournir l'id de la source à supprimer." - description: | - La suppression de la donnée doit être faite autrement. - On doit avoir supprimé son usage dans les ressources avant. - operationId: "delete-source" - parameters: - - name: "service" - description: "Id du service concerné" - in: "path" - required: true - schema: - type: "string" - - name: "source" - in: "path" - description: "Id de la source concernée" - required: true - schema: - type: "string" - responses: - 204: - description: "successful operation" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - -components: - schemas: - - errorResponse: - type: "object" - properties: - error: - type: "object" - properties: - message: - type: "string" - - adminConfiguration: - type: "object" - properties: - administration: - type: "object" - properties: - api: - type: "object" - properties: - name: - type: "string" - example: "admin" - version: - type: "string" - example: "1.0.0" - services: - type: "array" - minItems: 0 - items: - type: "object" - properties: - id: - type: "string" - example: "main" - configuration: - type: "string" - example: "/home/docker/config/service.json" - creationType: - type: "string" - example: "newProcess" - network: - type: "object" - properties: - server: - type: "object" - properties: - id: - type: "string" - example: "administrator" - https: - type: "string" - example: "false" - host: - type: "string" - example: "0.0.0.0" - port: - type: "string" - example: "8079" - logs: - type: "object" - properties: - configuration: - type: "string" - example: "/home/docker/config/log4js-administration.json" - - serviceConfiguration: - type: "object" - properties: - application: - type: "object" - properties: - name: - type: "string" - example: "Road2" - title: - type: "string" - example: "Service de calcul d'itinéraire" - description: - type: "string" - example: "Ce service permet de calculer des itinéraires sur les données du Géoportail." - url: - type: "string" - example: "https://localhost/" - provider: - type: "object" - properties: - name: - type: "string" - example: "IGN" - site: - type: "string" - example: "www.ign.fr" - mail: - type: "string" - example: "contact.geoservices@ign.fr" - logs: - type: "object" - properties: - configuration: - type: "string" - example: "/home/docker/config/log4js-service.json" - operations: - type: "object" - properties: - directory: - type: "string" - example: "/home/docker/app/src/resources/operations" - parameters: - type: "object" - properties: - directory: - type: "string" - example: "/home/docker/app/src/resources/parameters" - resources: - type: "object" - properties: - directories: - type: "array" - items: - type: "string" - example: "/home/docker/data/resources/" - sources: - type: "object" - properties: - directories: - type: "array" - items: - type: "string" - example: "/home/docker/data/sources/" - network: - type: "object" - properties: - servers: - type: "array" - items: - type: "object" - properties: - id: - type: "string" - example: "internalServer" - https: - type: "string" - example: "false" - host: - type: "string" - example: 0.0.0.0 - port: - type: "string" - example: "8080" - cors: - type: "object" - properties: - configuration: - type: "string" - example: "/home/docker/config/cors.json" - projections: - type: "object" - properties: - directory: - type: "string" - example: "/home/docker/config/projections/" - apis: - type: "array" - items: - type: "object" - properties: - name: - type: "string" - example: "simple" - version: - type: "string" - example: "1.0.0" - - projectionConfiguration: - type: "object" - properties: - id: - type: "string" - example: "EPSG:4326" - required: true - - resourceConfiguration: - type: "object" - properties: - resource: - type: "object" - properties: - id: - type: "string" - example: "my-resource" - type: - type: "string" - example: "osrm" - description: - type: "string" - example: "Exemple d'une ressource." - resourceVersion: - type: "string" - example: "yyyy-mm-dd" - sources: - type: "array" - items: - type: "string" - example: "data-car-fastest" - availableOperations: - type: "array" - items: - type: "object" - properties: - id: - type: "string" - example: "route" - parameters: - type: "array" - items: - type: "object" - properties: - id: - type: "string" - example: "resource" - defaultValueContent: - type: "string" - values: - type: "object" - - sourceConfiguration: - oneOf: - - $ref: "#/components/schemas/osrmSourceConfiguration" - - $ref: "#/components/schemas/pgrSourceConfiguration" - - $ref: "#/components/schemas/valhallaSourceConfiguration" - - osrmSourceConfiguration: - type: "object" - properties: - id: - type: "string" - example: "bduni-idf-car-fastest" - description: - type: "string" - example: "test osrm" - type: - type: "string" - enum: ["osrm"] - projection: - type: "string" - example: "EPSG:4326" - bbox: - type: "string" - example: "1.748.43.349.1" - storage: - type: "object" - properties: - file: - type: "string" - example: "/home/docker/data/bduni-idf-car-fastest/bduni-idf-car-fastest.osrm" - cost: - type: "object" - properties: - cost: - type: "object" - properties: - profile: - type: "string" - example: "car" - optimization: - type: "string" - example: "fastest" - - pgrSourceConfiguration: - type: "object" - properties: - id: - type: "string" - example: "bduni-idf-car-fastest" - description: - type: "string" - example: "test osrm" - type: - type: "string" - enum: ["pgrouting"] - projection: - type: "string" - example: "EPSG:4326" - bbox: - type: "string" - example: "1.748.43.349.1" - storage: - type: "object" - properties: - base: - type: "object" - properties: - dbConfig: - type: "string" - example: "/home/docker/data/output_base.json" - schema: - type: "string" - example: "public" - attributes: - type: "array" - items: - type: "object" - properties: - key: - type: "string" - example: "name" - column: - type: "string" - example: "concat_names" - default: - type: "string" - example: "false" - costs: - type: "array" - items: - type: "object" - properties: - cost: - type: "object" - properties: - profile: - type: "string" - example: "car" - optimization: - type: "string" - example: "fastest" - costType: - type: "string" - example: "time" - costColumn: - type: "string" - example: "cost_s_car" - rcostColumn: - type: "string" - example: "reverse_cost_s_car" - - valhallaSourceConfiguration: - type: "object" - properties: - id: - type: "string" - example: "bduni-idf-car-fastest" - description: - type: "string" - example: "test osrm" - type: - type: "string" - enum: ["valhalla"] - projection: - type: "string" - example: "EPSG:4326" - bbox: - type: "string" - example: "1.748.43.349.1" - storage: - oneOf: - - type: "object" - properties: - file: - type: "string" - example: "/home/docker/data/bduni-idf-car-fastest/bduni-idf-car-fastest.osrm" - - type: "object" - properties: - base: - type: "object" - properties: - dbConfig: - type: "string" - example: "/home/docker/data/output_base.json" - schema: - type: "string" - example: "public" - attributes: - type: "array" - items: - type: "object" - properties: - key: - type: "string" - example: "name" - column: - type: "string" - example: "concat_names" - default: - type: "string" - example: "false" - - type: "object" - properties: - tar: - type: "string" - example: "/home/docker/data/bdtopo-valhalla-tiles.tar" - dir: - type: "string" - example: "/home/docker/data/bdtopo-valhalla-tiles/" - config: - type: "string" - example: "/home/docker/data/valhalla.json" - costs: - type: "array" - items: - type: "object" - properties: - cost: - type: "object" - properties: - profile: - type: "string" - example: "car" - optimization: - type: "string" - example: "fastest" - costType: - type: "string" - example: "time" - costing: - type: "string" - example: "auto" - - diff --git a/documentation/apis/simple/1.0.0/api.json b/documentation/apis/simple/1.0.0/api.json new file mode 100644 index 00000000..5dd07f64 --- /dev/null +++ b/documentation/apis/simple/1.0.0/api.json @@ -0,0 +1,1300 @@ +{ + "openapi": "3.0.0", + "info": { + "description": "Description de l'API du service d'itinéraire.", + "version": "1.0.0", + "title": "Service d'itinéraire", + "contact": { + "email": "contact.geoservices@ign.fr" + } + }, + "servers": [ + { + "url": "https://wxs.ign.fr/calcul/geoportail/itineraire/rest/1.0.0/", + "description": "Serveur de test IGN pour l'itinéraire" + }, + { + "url": "https://wxs.ign.fr/calcul/geoportail/isochrone/rest/1.0.0/", + "description": "Serveur de test IGN pour l'isochrone" + }, + { + "url": "http://localhost:8080/simple/1.0.0/", + "description": "Serveur de test local" + } + ], + "tags": [ + { + "name": "Découverte", + "description": "Découvrir le service et les ressources disponibles" + }, + { + "name": "Utilisation", + "description": "Utiliser le service d'itinéraire" + } + ], + "paths": { + "/getcapabilities": { + "get": { + "tags": [ + "Découverte" + ], + "summary": "Découvrir le service", + "description": "Découvrir le service: les opérations possibles, les ressources disponibles et les options proposées.", + "operationId": "getcapabilities", + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/getcapabilities" + } + } + } + }, + "404": { + "description": "Not found" + } + } + } + }, + "/route": { + "get": { + "tags": [ + "Utilisation" + ], + "summary": "Calculer un itinéraire", + "description": "Calculer un itinéraire en fournissant un point de départ et un point d'arrivé. Plusieurs options peuvent être fournies.", + "operationId": "routeItineraire-get", + "parameters": [ + { + "name": "resource", + "in": "query", + "description": "Ressource utilisée pour le calcul. Les valeurs disponibles sont présentes dans le GetCapabilities. Une ressource est un graphe de navigation qui peut potentiellement avoir plusieurs modes de transports et de calculs. La ressource va plutôt parler du graphe, de la topologie de la donnée. Par exemple, il pourra s'agir d'un graphe de navigation issu de la BDTOPO v3 permettant de trouver l'itinéraire le plus court pour une voiture. ", + "required": true, + "schema": { + "type": "string" + }, + "example": "bdtopo-osrm" + }, + { + "name": "start", + "in": "query", + "description": "Point de départ. Il devra être exprimé dans le CRS, par défaut, de la ressource (voir le paramètre 'crs' dans le GetCapabilities).", + "required": true, + "schema": { + "$ref": "#/components/schemas/point" + }, + "example": "2.337306,48.849319" + }, + { + "name": "end", + "in": "query", + "description": "Point d'arrivée. Il devra être exprimé dans le CRS, par défaut, de la ressource (voir le paramètre 'crs' dans le GetCapabilities).", + "required": true, + "schema": { + "$ref": "#/components/schemas/point" + }, + "example": "2.367776,48.852891" + }, + { + "name": "intermediates", + "in": "query", + "description": "Points intermédiaires. Ils devront être exprimés dans le CRS, par défaut, de la ressource (voir le paramètre 'crs' dans le GetCapabilities).", + "required": false, + "schema": { + "$ref": "#/components/schemas/coordinates" + }, + "explode": false, + "style": "pipeDelimited", + "example": "2.368776,48.852890" + }, + { + "name": "profile", + "in": "query", + "description": "Mode de déplacement utilisé pour le calcul. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities.", + "required": false, + "schema": { + "type": "string" + }, + "example": "car" + }, + { + "name": "optimization", + "in": "query", + "description": "Mode de calcul utilisé pour déterminer l'itinéraire. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities.", + "required": false, + "schema": { + "type": "string" + }, + "example": "fastest" + }, + { + "name": "geometryFormat", + "in": "query", + "description": "Format des géométries dans la réponse. Peuvent être au format GeoJSON ou Encoded Polyline.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "geojson", + "polyline", + "wkt" + ] + } + }, + { + "name": "constraints", + "in": "query", + "description": "Contraintes utilisées pour le calcul. Il s'agit d'un objet JSON (voir la version POST de cette opération). Les paramètres disponibles sont présents dans le GetCapabilities.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "example": [ + "{'constraintType':'banned','key':'ways_type','operator':'=','value':'autoroute','threshold':{'key':'delta_time','operator':'<','value':'10'}}" + ], + "explode": false, + "style": "pipeDelimited" + }, + { + "name": "getSteps", + "in": "query", + "description": "Présence des étapes dans la réponse. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities.", + "required": false, + "schema": { + "type": "boolean" + }, + "example": true + }, + { + "name": "getBbox", + "in": "query", + "description": "Présence de l'emprise de l'itinéraire dans la réponse. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities.", + "required": false, + "schema": { + "type": "boolean" + }, + "example": true + }, + { + "name": "distanceUnit", + "in": "query", + "description": "Unité des distances renvoyées. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities.", + "required": false, + "schema": { + "type": "string" + }, + "example": "kilometer" + }, + { + "name": "timeUnit", + "in": "query", + "description": "Unité du temps renvoyé. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities.", + "required": false, + "schema": { + "type": "string" + }, + "example": "hour" + }, + { + "name": "crs", + "in": "query", + "description": "Projection des géometries. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities.", + "required": false, + "schema": { + "type": "string" + }, + "example": "EPSG:4326" + }, + { + "name": "waysAttributes", + "in": "query", + "description": "Attributs des tronçons à afficher dans la réponse. Les valeurs disponibles et les valeurs par défaut utilisées sont présentes dans le GetCapabilities.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "example": "name", + "explode": false, + "style": "pipeDelimited" + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/itineraire" + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "403": { + "description": "Not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Utilisation" + ], + "summary": "Calculer un itinéraire", + "description": "Calculer un itinéraire en fournissant un point de départ et un point d'arrivé. Plusieurs options peuvent être fournies. Il est nécessaire de mettre 'Content-Type: application/json' dans le header de la requête.", + "operationId": "routeItineraire-post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/routeBody" + } + } + } + }, + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/itineraire" + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "403": { + "description": "Not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + } + }, + "/nearest": { + "get": { + "tags": [ + "Utilisation" + ], + "summary": "Récupérer les points les plus proche d'une paire de coordonnées.", + "description": "Trouver les points les plus proche d'une paire de coordonnées fournie. Plusieurs options peuvent être fournies.", + "operationId": "nearestItineraire-get", + "parameters": [ + { + "name": "resource", + "in": "query", + "description": "Ressource utilisée pour le calcul. Les valeurs disponibles sont présentes dans le GetCapabilities. Une ressource est un graphe de navigation qui peut potentiellement avoir plusieurs modes de transports et de calculs. La ressource va plutôt parler du graphe, de la topologie de la donnée. Par exemple, il pourra s'agir d'un graphe de navigation issu de la BDTOPO v3 permettant de trouver l'itinéraire le plus court pour une voiture. ", + "required": true, + "schema": { + "type": "string" + }, + "example": "bdtopo-osrm" + }, + { + "name": "coordinates", + "in": "query", + "description": "Point de référence dont on cherche les points du graphe les plus proche. Il devra être exprimé dans le CRS, par défaut, de la ressource (voir le paramètre 'crs' dans le GetCapabilities).", + "required": true, + "schema": { + "$ref": "#/components/schemas/point" + }, + "example": "2.337306,48.849319" + }, + { + "name": "crs", + "in": "query", + "description": "Projection des géometries. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities.", + "required": false, + "schema": { + "type": "string" + }, + "example": "EPSG:4326" + }, + { + "name": "nbPoints", + "in": "query", + "description": "Nombre de points que l'on souhaite récupérer. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities.", + "required": false, + "schema": { + "type": "string" + }, + "example": "EPSG:4326" + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/nearest" + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "403": { + "description": "Not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Utilisation" + ], + "summary": "Récupérer les points les plus proche d'une paire de coordonnées.", + "description": "Trouver les points les plus proche d'une paire de coordonnées fournie. Plusieurs options peuvent être fournies. Il est nécessaire de mettre 'Content-Type: application/json' dans le header de la requête.", + "operationId": "nearestItineraire-post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/nearestBody" + } + } + } + }, + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/nearest" + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "403": { + "description": "Not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + } + }, + "/isochrone": { + "get": { + "tags": [ + "Utilisation" + ], + "summary": "Calculer une isochrone ou une isodistance", + "description": "Obtenir une surface géo-localisée représentant l’ensemble des points atteignables à partir d’un point de départ. Les points de départ et d’arrivée peuvent être inversés: on obtient alors la liste des points de départs possibles permettant d’atteindre un point d’arrivée donné. On peut aussi fournir un critère de distance plutôt que de temps: on parle alors de calcul d’iso-distances.", + "operationId": "isochrone", + "parameters": [ + { + "name": "point", + "in": "query", + "description": "Coordonnées d'une position ponctuelle. C'est le point à partir duquel seront fait les calculs. Il devra être exprimé dans le CRS, par défaut, de la ressource (voir le paramètre 'crs' dans le GetCapabilities).", + "required": true, + "schema": { + "$ref": "#/components/schemas/point" + }, + "example": "2.337306,48.849319" + }, + { + "name": "resource", + "in": "query", + "description": "Ressource utilisée pour le calcul. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities. Une ressource est un graphe de navigation qui peut potentiellement avoir plusieurs modes de transports et de calculs. La ressource va plutôt parler du graphe, de la topologie de la donnée. Par exemple, il pourra s'agir d'un graphe de navigation issu de la BDTOPO v3 permettant de trouver des isochrones ou des isodistances.", + "required": true, + "schema": { + "type": "string" + }, + "example": "bdtopo-pgr" + }, + { + "name": "costValue", + "in": "query", + "description": "Valeur du coût utilisé pour le calcul. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities. On pourra, par exemple, préciser une distance ou un temps, selon l'optimisation choisie. L'unité dépendra aussi des paramètres distanceUnit et timeUnit.", + "required": true, + "schema": { + "type": "number", + "format": "float" + }, + "example": "1.0" + }, + { + "name": "costType", + "in": "query", + "description": "Type du coût utilisé pour le calcul. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities. On pourra, par exemple, préciser une distance ou un temps, selon l'optimisation choisie. L'unité dépendra aussi des paramètres distanceUnit et timeUnit.", + "required": true, + "schema": { + "type": "string" + }, + "example": "time" + }, + { + "name": "profile", + "in": "query", + "description": "Mode de déplacement utilisé pour le calcul. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities.", + "required": false, + "schema": { + "type": "string" + }, + "example": "car" + }, + { + "name": "direction", + "in": "query", + "description": "Sens du parcours. Cela permet de définir le sens du parcours. Soit on définit un point de départ et on obtient les points d'arrivé potentiels. Soit on définit un point d'arrivé et on otient les points de départ potentiels. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "departure", + "arrival" + ] + }, + "example": "départ" + }, + { + "name": "constraints", + "in": "query", + "description": "Contraintes utilisées pour le calcul. Il s'agit d'un objet JSON (voir la version POST de cette opération). Les paramètres disponibles sont présents dans le GetCapabilities.", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + }, + "example": [ + "{'constraintType':'banned','key':'ways_type','operator':'=','value':'autoroute'}" + ] + }, + { + "name": "geometryFormat", + "in": "query", + "description": "Format des géométries dans la réponse. Peuvent être au format GeoJSON ou Encoded Polyline.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "geojson", + "polyline", + "wkt" + ] + } + }, + { + "name": "distanceUnit", + "in": "query", + "description": "Unité des distances renvoyées. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities.", + "required": false, + "schema": { + "type": "string" + }, + "example": "kilometer" + }, + { + "name": "timeUnit", + "in": "query", + "description": "Unité du temps renvoyé. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities.", + "required": false, + "schema": { + "type": "string" + }, + "example": "hour" + }, + { + "name": "crs", + "in": "query", + "description": "Projection des géometries. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities.", + "required": false, + "schema": { + "type": "string" + }, + "example": "EPSG:4326" + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/isochrone" + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "403": { + "description": "Not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Utilisation" + ], + "summary": "Calculer une isochrone ou une isodistance", + "description": "Obtenir une surface géo-localisée représentant l’ensemble des points atteignables à partir d’un point de départ. Les points de départ et d’arrivée peuvent être inversés: on obtient alors la liste des points de départs possibles permettant d’atteindre un point d’arrivée donné. On peut aussi fournir un critère de distance plutôt que de temps: on parle alors de calcul d’iso-distances. Il est nécessaire de mettre 'Content-Type: application/json' dans le header de la requête.", + "operationId": "isochrone-post", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/isochroneBody" + } + } + } + }, + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/isochrone" + } + } + } + }, + "400": { + "description": "Invalid parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "403": { + "description": "Not allowed", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "point": { + "type": "string", + "pattern": "^(\\-?\\d+(\\.\\d+)?),\\s*(\\-?\\d+(\\.\\d+)?)$" + }, + "coordinates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/point" + } + }, + "constraint": { + "type": "object", + "properties": { + "constraintType": { + "type": "string", + "enum": [ + "banned", + "preferred", + "unpreferred" + ] + }, + "key": { + "type": "string" + }, + "operator": { + "type": "string" + }, + "value": { + "type": "string" + }, + "threshold": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "operator": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + } + }, + "constraintIso": { + "type": "object", + "properties": { + "constraintType": { + "type": "string", + "enum": [ + "banned" + ] + }, + "key": { + "type": "string" + }, + "operator": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "routeBody": { + "type": "object", + "properties": { + "resource": { + "type": "string" + }, + "start": { + "$ref": "#/components/schemas/point" + }, + "end": { + "$ref": "#/components/schemas/point" + }, + "intermediates": { + "$ref": "#/components/schemas/coordinates" + }, + "profile": { + "type": "string" + }, + "optimization": { + "type": "string" + }, + "constraints": { + "type": "array", + "items": { + "$ref": "#/components/schemas/constraint" + } + }, + "getSteps": { + "type": "boolean" + }, + "geometryFormat": { + "type": "string", + "enum": [ + "geojson", + "polyline", + "wkt" + ] + }, + "getBbox": { + "type": "boolean" + }, + "distanceUnit": { + "type": "string" + }, + "timeUnit": { + "type": "string" + }, + "crs": { + "type": "string" + }, + "waysAttributes": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "nearestBody": { + "type": "object", + "properties": { + "resource": { + "type": "string" + }, + "coordinates": { + "$ref": "#/components/schemas/point" + }, + "nbPoints": { + "type": "integer" + }, + "crs": { + "type": "string" + } + } + }, + "isochroneBody": { + "type": "object", + "properties": { + "point": { + "$ref": "#/components/schemas/point" + }, + "resource": { + "type": "string" + }, + "costType": { + "type": "string", + "enum": [ + "temps", + "distance" + ] + }, + "costValue": { + "type": "number", + "format": "float" + }, + "profile": { + "type": "string" + }, + "direction": { + "type": "string", + "enum": [ + "départ", + "arrivé" + ] + }, + "constraints": { + "type": "array", + "items": { + "$ref": "#/components/schemas/constraintIso" + } + }, + "geometryFormat": { + "type": "string", + "enum": [ + "geojson", + "polyline", + "wkt" + ] + }, + "distanceUnit": { + "type": "string" + }, + "timeUnit": { + "type": "string" + }, + "crs": { + "type": "string" + } + } + }, + "errorResponse": { + "type": "object", + "properties": { + "error": { + "type": "object", + "properties": { + "errorType": { + "type": "string" + }, + "message": { + "type": "string" + } + } + } + } + }, + "itineraire": { + "type": "object", + "properties": { + "start": { + "$ref": "#/components/schemas/point" + }, + "end": { + "$ref": "#/components/schemas/point" + }, + "geometry": { + "type": "string" + }, + "duration": { + "type": "number", + "format": "float" + }, + "distance": { + "type": "number", + "format": "float" + }, + "bbox": { + "type": "string" + }, + "resource": { + "type": "string" + }, + "resourceVersion": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "optimization": { + "type": "string" + }, + "crs": { + "type": "string" + }, + "constraints": { + "type": "array", + "items": { + "$ref": "#/components/schemas/constraint" + } + }, + "alerts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + }, + "portions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "$ref": "#/components/schemas/point" + }, + "end": { + "$ref": "#/components/schemas/point" + }, + "duration": { + "type": "number", + "format": "float" + }, + "distance": { + "type": "number", + "format": "float" + }, + "bbox": { + "type": "string" + }, + "steps": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "attributs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + }, + "duration": { + "type": "number", + "format": "float" + }, + "distance": { + "type": "number", + "format": "float" + }, + "geometry": { + "type": "string" + }, + "instruction": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "modifyer": { + "type": "string" + }, + "exit": { + "type": "string" + } + } + }, + "alerts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + }, + "nearest": { + "type": "object", + "properties": { + "resource": { + "type": "string" + }, + "resourceVersion": { + "type": "string" + }, + "coordinates": { + "$ref": "#/components/schemas/point" + }, + "crs": { + "type": "string" + }, + "points": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "geometry": { + "type": "array", + "items": { + "type": "number" + } + }, + "distance": { + "type": "number" + } + } + } + } + } + }, + "isochrone": { + "type": "object", + "properties": { + "point": { + "$ref": "#/components/schemas/point" + }, + "resource": { + "type": "string" + }, + "resourceVersion": { + "type": "string" + }, + "costType": { + "type": "string" + }, + "costValue": { + "type": "number" + }, + "profile": { + "type": "string" + }, + "direction": { + "type": "string" + }, + "constraints": { + "$ref": "#/components/schemas/constraintIso" + }, + "crs": { + "type": "string" + }, + "geometry": { + "type": "string" + }, + "alerts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + } + } + } + }, + "getcapabilities": { + "type": "object", + "properties": { + "info": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "url": { + "type": "string" + }, + "description": { + "type": "string" + } + } + }, + "api": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "simple" + }, + "version": { + "type": "string", + "example": "1.0.0" + } + } + }, + "operations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "description": { + "type": "string" + }, + "url": { + "type": "string" + }, + "methods": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "GET", + "POST", + "PUT", + "DELETE" + ] + } + }, + "parameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "in": { + "type": "string" + }, + "description": { + "type": "string" + }, + "required": { + "type": "boolean" + }, + "default": { + "type": "boolean" + }, + "schema": { + "type": "string" + }, + "example": { + "type": "string" + } + } + } + } + } + } + }, + "resources": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "description": { + "type": "string" + }, + "availableOperations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "availableParameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "values": { + "type": "string" + }, + "default": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/documentation/apis/simple/1.0.0/api.yaml b/documentation/apis/simple/1.0.0/api.yaml deleted file mode 100644 index 6f115c69..00000000 --- a/documentation/apis/simple/1.0.0/api.yaml +++ /dev/null @@ -1,825 +0,0 @@ -openapi: "3.0.0" -info: - description: "Description de l'API du service d'itinéraire." - version: "1.0.0" - title: "Service d'itinéraire" - contact: - email: "contact.geoservices@ign.fr" -servers: - - url: "https://wxs.ign.fr/calcul/geoportail/itineraire/rest/1.0.0/" - description: "Serveur de test IGN pour l'itinéraire" - - url: "https://wxs.ign.fr/calcul/geoportail/isochrone/rest/1.0.0/" - description: "Serveur de test IGN pour l'isochrone" - - url: "http://localhost:8080/simple/1.0.0/" - description: "Serveur de test local" -tags: -- name: "Découverte" - description: "Découvrir le service et les ressources disponibles" -- name: "Utilisation" - description: "Utiliser le service d'itinéraire" -paths: - /getcapabilities: - get: - tags: - - "Découverte" - summary: "Découvrir le service" - description: "Découvrir le service: les opérations possibles, les ressources disponibles et les options proposées." - operationId: "getcapabilities" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - $ref: "#/components/schemas/getcapabilities" - 404: - description: "Not found" - /route: - get: - tags: - - "Utilisation" - summary: "Calculer un itinéraire" - description: "Calculer un itinéraire en fournissant un point de départ et un point d'arrivé. Plusieurs options peuvent être fournies." - operationId: "routeItineraire-get" - parameters: - - name: "resource" - in: "query" - description: "Ressource utilisée pour le calcul. Les valeurs disponibles sont présentes dans le GetCapabilities. Une ressource est un graphe de navigation qui peut potentiellement avoir plusieurs modes de transports et de calculs. La ressource va plutôt parler du graphe, de la topologie de la donnée. Par exemple, il pourra s'agir d'un graphe de navigation issu de la BDTOPO v3 permettant de trouver l'itinéraire le plus court pour une voiture. " - required: true - schema: - type: "string" - example: "bdtopo-osrm" - - name: "start" - in: "query" - description: "Point de départ. Il devra être exprimé dans le CRS, par défaut, de la ressource (voir le paramètre 'crs' dans le GetCapabilities)." - required: true - schema: - $ref: "#/components/schemas/point" - example: "2.337306,48.849319" - - name: "end" - in: "query" - description: "Point d'arrivée. Il devra être exprimé dans le CRS, par défaut, de la ressource (voir le paramètre 'crs' dans le GetCapabilities)." - required: true - schema: - $ref: "#/components/schemas/point" - example: "2.367776,48.852891" - - name: "intermediates" - in: "query" - description: "Points intermédiaires. Ils devront être exprimés dans le CRS, par défaut, de la ressource (voir le paramètre 'crs' dans le GetCapabilities)." - required: false - schema: - $ref: "#/components/schemas/coordinates" - explode: false - style: "pipeDelimited" - example: "2.368776,48.852890" - - name: "profile" - in: "query" - description: "Mode de déplacement utilisé pour le calcul. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities." - required: false - schema: - type: "string" - example: "car" - - name: "optimization" - in: "query" - description: "Mode de calcul utilisé pour déterminer l'itinéraire. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities." - required: false - schema: - type: "string" - example: "fastest" - - name: "geometryFormat" - in: "query" - description: "Format des géométries dans la réponse. Peuvent être au format GeoJSON ou Encoded Polyline." - required: false - schema: - type: "string" - enum: ["geojson","polyline","wkt"] - - name: "constraints" - in: "query" - description: "Contraintes utilisées pour le calcul. Il s'agit d'un objet JSON (voir la version POST de cette opération). Les paramètres disponibles sont présents dans le GetCapabilities." - required: false - schema: - type: "array" - items: - type: "string" - example: ["{'constraintType':'banned','key':'ways_type','operator':'=','value':'autoroute','threshold':{'key':'delta_time','operator':'<','value':'10'}}"] - explode: false - style: "pipeDelimited" - - name: "getSteps" - in: "query" - description: "Présence des étapes dans la réponse. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities." - required: false - schema: - type: "boolean" - example: true - - name: "getBbox" - in: "query" - description: "Présence de l'emprise de l'itinéraire dans la réponse. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities." - required: false - schema: - type: "boolean" - example: true - - name: "distanceUnit" - in: "query" - description: "Unité des distances renvoyées. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities." - required: false - schema: - type: "string" - example: "kilometer" - - name: "timeUnit" - in: "query" - description: "Unité du temps renvoyé. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities." - required: false - schema: - type: "string" - example: "hour" - - name: "crs" - in: "query" - description: "Projection des géometries. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities." - required: false - schema: - type: "string" - example: "EPSG:4326" - - name: "waysAttributes" - in: "query" - description: "Attributs des tronçons à afficher dans la réponse. Les valeurs disponibles et les valeurs par défaut utilisées sont présentes dans le GetCapabilities." - required: false - schema: - type: "array" - items: - type: "string" - example: "name" - explode: false - style: "pipeDelimited" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - $ref: "#/components/schemas/itineraire" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 403: - description: "Not allowed" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - post: - tags: - - "Utilisation" - summary: "Calculer un itinéraire" - description: "Calculer un itinéraire en fournissant un point de départ et un point d'arrivé. Plusieurs options peuvent être fournies. Il est nécessaire de mettre 'Content-Type: application/json' dans le header de la requête." - operationId: "routeItineraire-post" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/routeBody" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - $ref: "#/components/schemas/itineraire" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 403: - description: "Not allowed" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - /nearest: - get: - tags: - - "Utilisation" - summary: "Récupérer les points les plus proche d'une paire de coordonnées." - description: "Trouver les points les plus proche d'une paire de coordonnées fournie. Plusieurs options peuvent être fournies." - operationId: "nearestItineraire-get" - parameters: - - name: "resource" - in: "query" - description: "Ressource utilisée pour le calcul. Les valeurs disponibles sont présentes dans le GetCapabilities. Une ressource est un graphe de navigation qui peut potentiellement avoir plusieurs modes de transports et de calculs. La ressource va plutôt parler du graphe, de la topologie de la donnée. Par exemple, il pourra s'agir d'un graphe de navigation issu de la BDTOPO v3 permettant de trouver l'itinéraire le plus court pour une voiture. " - required: true - schema: - type: "string" - example: "bdtopo-osrm" - - name: "coordinates" - in: "query" - description: "Point de référence dont on cherche les points du graphe les plus proche. Il devra être exprimé dans le CRS, par défaut, de la ressource (voir le paramètre 'crs' dans le GetCapabilities)." - required: true - schema: - $ref: "#/components/schemas/point" - example: "2.337306,48.849319" - - name: "crs" - in: "query" - description: "Projection des géometries. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities." - required: false - schema: - type: "string" - example: "EPSG:4326" - - name: "nbPoints" - in: "query" - description: "Nombre de points que l'on souhaite récupérer. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities." - required: false - schema: - type: "string" - example: "EPSG:4326" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - $ref: "#/components/schemas/nearest" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 403: - description: "Not allowed" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - post: - tags: - - "Utilisation" - summary: "Récupérer les points les plus proche d'une paire de coordonnées." - description: "Trouver les points les plus proche d'une paire de coordonnées fournie. Plusieurs options peuvent être fournies. Il est nécessaire de mettre 'Content-Type: application/json' dans le header de la requête." - operationId: "nearestItineraire-post" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/nearestBody" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - $ref: "#/components/schemas/nearest" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 403: - description: "Not allowed" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - /isochrone: - get: - tags: - - "Utilisation" - summary: "Calculer une isochrone ou une isodistance" - description: "Obtenir une surface géo-localisée représentant l’ensemble des points atteignables à partir d’un point de départ. Les points de départ et d’arrivée peuvent être inversés: on obtient alors la liste des points de départs possibles permettant d’atteindre un point d’arrivée donné. On peut aussi fournir un critère de distance plutôt que de temps: on parle alors de calcul d’iso-distances." - operationId: "isochrone" - parameters: - - name: "point" - in: "query" - description: "Coordonnées d'une position ponctuelle. C'est le point à partir duquel seront fait les calculs. Il devra être exprimé dans le CRS, par défaut, de la ressource (voir le paramètre 'crs' dans le GetCapabilities)." - required: true - schema: - $ref: "#/components/schemas/point" - example: "2.337306,48.849319" - - name: "resource" - in: "query" - description: "Ressource utilisée pour le calcul. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities. Une ressource est un graphe de navigation qui peut potentiellement avoir plusieurs modes de transports et de calculs. La ressource va plutôt parler du graphe, de la topologie de la donnée. Par exemple, il pourra s'agir d'un graphe de navigation issu de la BDTOPO v3 permettant de trouver des isochrones ou des isodistances." - required: true - schema: - type: "string" - example: "bdtopo-pgr" - - name: "costValue" - in: "query" - description: "Valeur du coût utilisé pour le calcul. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities. On pourra, par exemple, préciser une distance ou un temps, selon l'optimisation choisie. L'unité dépendra aussi des paramètres distanceUnit et timeUnit." - required: true - schema: - type: "number" - format: "float" - example: "1.0" - - name: "costType" - in: "query" - description: "Type du coût utilisé pour le calcul. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities. On pourra, par exemple, préciser une distance ou un temps, selon l'optimisation choisie. L'unité dépendra aussi des paramètres distanceUnit et timeUnit." - required: true - schema: - type: "string" - example: "time" - - name: "profile" - in: "query" - description: "Mode de déplacement utilisé pour le calcul. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities." - required: false - schema: - type: "string" - example: "car" - - name: "direction" - in: "query" - description: "Sens du parcours. Cela permet de définir le sens du parcours. Soit on définit un point de départ et on obtient les points d'arrivé potentiels. Soit on définit un point d'arrivé et on otient les points de départ potentiels. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities." - required: false - schema: - type: "string" - enum: ["departure","arrival"] - example: "départ" - - name: "constraints" - in: "query" - description: "Contraintes utilisées pour le calcul. Il s'agit d'un objet JSON (voir la version POST de cette opération). Les paramètres disponibles sont présents dans le GetCapabilities." - required: false - schema: - type: "array" - items: - type: "string" - example: ["{'constraintType':'banned','key':'ways_type','operator':'=','value':'autoroute'}"] - - name: "geometryFormat" - in: "query" - description: "Format des géométries dans la réponse. Peuvent être au format GeoJSON ou Encoded Polyline." - required: false - schema: - type: "string" - enum: ["geojson","polyline","wkt"] - - name: "distanceUnit" - in: "query" - description: "Unité des distances renvoyées. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities." - required: false - schema: - type: "string" - example: "kilometer" - - name: "timeUnit" - in: "query" - description: "Unité du temps renvoyé. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities." - required: false - schema: - type: "string" - example: "hour" - - name: "crs" - in: "query" - description: "Projection des géometries. Les valeurs disponibles et la valeur par défaut utilisées sont présentes dans le GetCapabilities." - required: false - schema: - type: "string" - example: "EPSG:4326" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - $ref: "#/components/schemas/isochrone" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 403: - description: "Not allowed" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - post: - tags: - - "Utilisation" - summary: "Calculer une isochrone ou une isodistance" - description: "Obtenir une surface géo-localisée représentant l’ensemble des points atteignables à partir d’un point de départ. Les points de départ et d’arrivée peuvent être inversés: on obtient alors la liste des points de départs possibles permettant d’atteindre un point d’arrivée donné. On peut aussi fournir un critère de distance plutôt que de temps: on parle alors de calcul d’iso-distances. Il est nécessaire de mettre 'Content-Type: application/json' dans le header de la requête." - operationId: "isochrone-post" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/isochroneBody" - responses: - 200: - description: "successful operation" - content: - application/json: - schema: - $ref: "#/components/schemas/isochrone" - 400: - description: "Invalid parameters" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 403: - description: "Not allowed" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" - 404: - description: "Not found" - content: - application/json: - schema: - $ref: "#/components/schemas/errorResponse" -components: - schemas: - point: - type: "string" - pattern: '^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$' - coordinates: - type: "array" - items: - $ref: "#/components/schemas/point" - constraint: - type: "object" - properties: - constraintType: - type: "string" - enum: ["banned","preferred","unpreferred"] - key: - type: "string" - operator: - type: "string" - value: - type: "string" - threshold: - type: "object" - properties: - key: - type: "string" - operator: - type: "string" - value: - type: "string" - constraintIso: - type: "object" - properties: - constraintType: - type: "string" - enum: ["banned"] - key: - type: "string" - operator: - type: "string" - value: - type: "string" - routeBody: - type: "object" - properties: - resource: - type: "string" - start: - $ref: "#/components/schemas/point" - end: - $ref: "#/components/schemas/point" - intermediates: - $ref: "#/components/schemas/coordinates" - profile: - type: "string" - optimization: - type: "string" - constraints: - type: "array" - items: - $ref: "#/components/schemas/constraint" - getSteps: - type: "boolean" - geometryFormat: - type: "string" - enum: ["geojson","polyline","wkt"] - getBbox: - type: "boolean" - distanceUnit: - type: "string" - timeUnit: - type: "string" - crs: - type: "string" - waysAttributes: - type: "array" - items: - type: "string" - nearestBody: - type: "object" - properties: - resource: - type: "string" - coordinates: - $ref: "#/components/schemas/point" - nbPoints: - type: "integer" - crs: - type: "string" - isochroneBody: - type: "object" - properties: - point: - $ref: "#/components/schemas/point" - resource: - type: "string" - costType: - type: "string" - enum: ["temps","distance"] - costValue: - type: "number" - format: "float" - profile: - type: "string" - direction: - type: "string" - enum: ["départ","arrivé"] - constraints: - type: "array" - items: - $ref: "#/components/schemas/constraintIso" - geometryFormat: - type: "string" - enum: ["geojson","polyline","wkt"] - distanceUnit: - type: "string" - timeUnit: - type: "string" - crs: - type: "string" - errorResponse: - type: "object" - properties: - error: - type: "object" - properties: - errorType: - type: "string" - message: - type: "string" - itineraire: - type: "object" - properties: - start: - $ref: "#/components/schemas/point" - end: - $ref: "#/components/schemas/point" - geometry: - type: "string" - duration: - type: "number" - format: "float" - distance: - type: "number" - format: "float" - bbox: - type: "string" - resource: - type: "string" - resourceVersion: - type: "string" - profile: - type: "string" - optimization: - type: "string" - crs: - type: "string" - constraints: - type: "array" - items: - $ref: "#/components/schemas/constraint" - alerts: - type: "array" - items: - type: "object" - properties: - message: - type: "string" - portions: - type: "array" - items: - type: "object" - properties: - start: - $ref: "#/components/schemas/point" - end: - $ref: "#/components/schemas/point" - duration: - type: "number" - format: "float" - distance: - type: "number" - format: "float" - bbox: - type: "string" - steps: - type: "array" - items: - type: "object" - properties: - id: - type: "string" - attributs: - type: "array" - items: - type: "object" - properties: - key: - type: "string" - value: - type: "string" - duration: - type: "number" - format: "float" - distance: - type: "number" - format: "float" - geometry: - type: "string" - instruction: - type: "object" - properties: - type: - type: "string" - modifyer: - type: "string" - exit: - type: "string" - alerts: - type: "array" - items: - type: "object" - properties: - message: - type: "string" - nearest: - type: "object" - properties: - resource: - type: "string" - resourceVersion: - type: "string" - coordinates: - $ref: "#/components/schemas/point" - crs: - type: "string" - points: - type: "array" - items: - type: "object" - properties: - id: - type: "string" - geometry: - type: "array" - items: - type: "number" - distance: - type: "number" - isochrone: - type: "object" - properties: - point: - $ref: "#/components/schemas/point" - resource: - type: "string" - resourceVersion: - type: "string" - costType: - type: "string" - costValue: - type: "number" - profile: - type: "string" - direction: - type: "string" - constraints: - $ref: "#/components/schemas/constraintIso" - crs: - type: "string" - geometry: - type: "string" - alerts: - type: "array" - items: - type: "object" - properties: - message: - type: "string" - getcapabilities: - type: "object" - properties: - info: - type: "object" - properties: - name: - type: "string" - url: - type: "string" - description: - type: "string" - api: - type: "object" - properties: - name: - type: "string" - example: "simple" - version: - type: "string" - example: "1.0.0" - operations: - type: "array" - items: - type: "object" - properties: - id: - type: "string" - description: - type: "string" - url: - type: "string" - methods: - type: "array" - items: - type: "string" - enum: ["GET","POST","PUT","DELETE"] - parameters: - type: "array" - items: - type: "object" - properties: - name: - type: "string" - in: - type: "string" - description: - type: "string" - required: - type: "boolean" - default: - type: "boolean" - schema: - type: "string" - example: - type: "string" - resources: - type: "array" - items: - type: "object" - properties: - id: - type: "string" - description: - type: "string" - availableOperations: - type: "array" - items: - type: "object" - properties: - id: - type: "string" - availableParameters: - type: "array" - items: - type: "object" - properties: - id: - type: "string" - values: - type: "string" - default: - type: "string" diff --git a/documentation/configuration/readme.md b/documentation/configuration/readme.md index 1b56eb9c..a9436d25 100644 --- a/documentation/configuration/readme.md +++ b/documentation/configuration/readme.md @@ -49,7 +49,7 @@ On peut trouver un [exemple](../../docker/config/cors.json) de ce fichier au for Le fichier *service.json* indique un dossier de projections. Ce dossier peut contenir plusieurs fichiers JSON. Ces fichiers seront lus, indépendamment de leur extension, pour obtenir les informations nécessaires permettant à [PROJ4](http://proj4js.org/) d'effectuer des reprojections. -On peut trouver un [exemple](../../docker/config/projections/projection.json) de ce fichier et le [modèle](./projections/projection_model.yaml) au format YAML. +On peut trouver un [exemple](../../docker/config/projections/world.json) de ce fichier et le [modèle](./projections/projection_model.yaml) au format YAML. ## Les sources diff --git a/documentation/developers/DCO.md b/documentation/developers/DCO.md new file mode 100644 index 00000000..49b8cb05 --- /dev/null +++ b/documentation/developers/DCO.md @@ -0,0 +1,34 @@ +Developer Certificate of Origin +Version 1.1 + +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + + +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. diff --git a/documentation/developers/conduct.md b/documentation/developers/conduct.md new file mode 100644 index 00000000..cc6912b9 --- /dev/null +++ b/documentation/developers/conduct.md @@ -0,0 +1,2 @@ +```{include} ../../CODE_OF_CONDUCT.md +``` diff --git a/documentation/developers/contributing.md b/documentation/developers/contributing.md new file mode 100644 index 00000000..ef6daa82 --- /dev/null +++ b/documentation/developers/contributing.md @@ -0,0 +1,2 @@ +```{include} ../../CONTRIBUTING.md +``` diff --git a/documentation/developers/version.md b/documentation/developers/version.md index 85b03800..f870b181 100644 --- a/documentation/developers/version.md +++ b/documentation/developers/version.md @@ -14,7 +14,8 @@ Route Graph Generator et PGRouting Procedures sont indépendants en tant que pro Sur ces trois projets ont une branche `master` et `develop`. La première permet de gérer les versions mises en production. La seconde permet de réaliser les développements. -On veillera à partir de `develop` et de créer une branche du type +On veillera à partir de `develop` et à créer une branche du type : +- `doc/*` pour modifier ou ajouter de la documentation uniquement, - `feat/*` pour réaliser de nouvelles fonctionnalités, - `fix/*` pour effectuer une correction sur le code source, - `docker/*` pour modifier la partie docker uniquement, @@ -53,7 +54,7 @@ Il est conseillé de commencer par gérer les versions de ces deux là. *Ce qui Démarche à suivre pour chaque projet: 1. Tester `develop` et corriger si nécessaire. -2. Update de la version sur `master` à 1.0.1. +2. Update de la version sur `develop` à 1.0.1. 3. Merge de `develop` sur `master`. 4. Update de la version sur `develop` à 1.0.2-DEVELOP. 5. Faire des tests sur `master` et corriger si nécessaire. diff --git a/documentation/docker/demonstration/readme.md b/documentation/docker/demonstration/readme.md index 97b88b93..314b9b48 100644 --- a/documentation/docker/demonstration/readme.md +++ b/documentation/docker/demonstration/readme.md @@ -36,5 +36,5 @@ docker run --rm road2-demonstration Il est possible de visualiser les documentations des APIs en local. On lancera la commande suivante : ``` -docker run --rm -p 8083:8080 -e SWAGGER_JSON=/api.yaml -v {path/to/yaml/directory}/api.yaml:/api.yaml swaggerapi/swagger-ui +docker run --rm -p 8083:8080 -e SWAGGER_JSON=/api.json -v {path/to/json/directory}/api.json:/api.json swaggerapi/swagger-ui ``` \ No newline at end of file diff --git a/documentation/docker/web/readme.md b/documentation/docker/web/readme.md index 3eab0432..75f82dda 100644 --- a/documentation/docker/web/readme.md +++ b/documentation/docker/web/readme.md @@ -30,7 +30,7 @@ On pourra tester Road2 sur le lien suivant: http://localhost:8080/road2/ # Visualiser la documentation de l'API -L'API est décrite via un fichier YAML qui est visualisable avec Swagger. Ce fichier est disponible via le lien http://localhost:8080/api/api.yaml. +L'API est décrite via un fichier JSON qui est visualisable avec Swagger. Ce fichier est disponible via le lien http://localhost:8080/api/api.json. Pour le visualiser ou l'éditer, il est possible d'utiliser les dockers proposés par Swagger. ``` @@ -41,7 +41,7 @@ docker run --rm -d -p 8081:8080 swaggerapi/swagger-editor docker run --rm -d -p 8081:8080 swaggerapi/swagger-ui ``` -Une fois le docker swagger et le docker web lancés, il suffit de se rendre sur l'URL suivante: http://localhost:8081/?url=http://localhost:8080/api/api.yaml. +Une fois le docker swagger et le docker web lancés, il suffit de se rendre sur l'URL suivante: http://localhost:8081/?url=http://localhost:8080/api/api.json. Il est donc possible de visualiser et d'éditer la documentation. Mais pour que les changements soient pris en compte, il faut modifier le vrai fichier manuellement dans de dépôt de code. diff --git a/documentation/index.md b/documentation/index.md index 9a4de841..3d2e3a4d 100644 --- a/documentation/index.md +++ b/documentation/index.md @@ -25,6 +25,8 @@ Configuration Données Production Changelog +Contribuer +Code de conduite ``` ---- diff --git a/package.json b/package.json index 35068f12..605e6c0c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,6 @@ { "name": "road2", - "version": "2.1.1", - + "version": "2.2.0", "description": "Calcul d'itinéraire", "author": "RDEV - IGN", "main": "src/js/road2.js", @@ -27,7 +26,8 @@ "https-proxy-agent": "5.0.1", "log4js": "6.7.1", "nconf": "0.12.0", - "proj4": "2.8.0" + "proj4": "2.8.0", + "swagger-ui-express": "4.6.3" }, "optionalDependencies": { "osrm": "5.26.0", @@ -54,6 +54,7 @@ "assert", "helmet", "got", - "http-proxy-agent" + "http-proxy-agent", + "swagger-ui-express" ] } diff --git a/readme.md b/readme.md index b4383bc7..64f7964c 100644 --- a/readme.md +++ b/readme.md @@ -36,7 +36,7 @@ L'IGN propose une visualisation de l'API utilisateur pour [l'itinéraire](https: L'IGN propose également des pages pour tester une instance du service sur l'ensemble de la France, avec une visualisation cartographique. Il y a une page pour l'[itinéraire](https://geoservices.ign.fr/documentation/services/api-et-services-ogc/itineraires) et une page pour l'[isochrone](https://geoservices.ign.fr/documentation/services/api-et-services-ogc/isochrones). -Autrement, l'ensemble des APIs disponibles sont documentées dans ce [dossier](./documentation/apis/). Pour le moment, il y a une seule API utilisateur qui est documentée via un [fichier](./documentation/apis/simple/1.0.0/api.yaml) YAML utilisant openapi 3.0.0, et une API d'administration documentée via un autre [fichier](./documentation/apis/administration/1.0.0/api.yaml) YAML suivant le même formalisme. +Autrement, l'ensemble des APIs disponibles sont documentées dans ce [dossier](./documentation/apis/). Pour le moment, il y a une seule API utilisateur qui est documentée via un [fichier](./documentation/apis/simple/1.0.0/api.json) JSON utilisant openapi 3.0.0, et une API d'administration documentée via un autre [fichier](./documentation/apis/administration/1.0.0/api.json) JSON suivant le même formalisme. Il est possible de visualiser ces documentations d'API localement en suivant les instructions qui sont [ici](./documentation/docker/demonstration/readme.md). @@ -82,7 +82,7 @@ On trouvera dans le dossier [docker/distrubutions](./docker/distributions) diff ## Participer aux développements -Les participations à ce projet sont encouragées. Il vous est demandé de réaliser vos développements en partant de la branche *develop*. +Les participations à ce projet sont encouragées (votre notre [charte](./CODE_OF_CONDUCT.md) à ce sujet). Nous avons mis en place un [guide](./CONTRIBUTING.md) des contributions pour vous accompagner dans cette démarche. On trouvera une documentation dédiée aux développeurs [ici](./documentation/developers/readme.md). Elle indique les concepts utiles pour effectuer des développements sur Road2. diff --git a/src/js/apis/admin/1.0.0/controller/controller.js b/src/js/apis/admin/1.0.0/controller/controller.js index 022a4c8a..319b8c6f 100644 --- a/src/js/apis/admin/1.0.0/controller/controller.js +++ b/src/js/apis/admin/1.0.0/controller/controller.js @@ -172,6 +172,8 @@ module.exports = { // On doit utiliser les attributs avec _ car les méthodes ne sont pas disponible dans le cadre d'une communication IPC userResponse.id = projectionResponse._id; + userResponse.parameters = projectionResponse._parameters; + return userResponse; } diff --git a/src/js/apis/admin/1.0.0/index.js b/src/js/apis/admin/1.0.0/index.js index 07a5cbe8..8a167555 100644 --- a/src/js/apis/admin/1.0.0/index.js +++ b/src/js/apis/admin/1.0.0/index.js @@ -1,11 +1,13 @@ 'use strict'; +const path = require('path'); const express = require('express'); const log4js = require('log4js'); const packageJSON = require('../../../../../package.json'); const errorManager = require('../../../utils/errorManager'); const controller = require('./controller/controller'); +const swaggerUi = require('swagger-ui-express'); var LOGGER = log4js.getLogger("ADMIN"); var router = express.Router(); @@ -16,6 +18,12 @@ router.all("/", function(req, res) { res.send("Road2 via l'API admin 1.0.0"); }); +// swagger-ui +var apiJsonPath = path.join(__dirname, '..', '..', '..','..','..', 'documentation','apis','administration', '1.0.0', 'api.json'); +LOGGER.info("Utilisation fichier .json '"+ apiJsonPath + "' pour initialisation swagger-ui de l'API administration en version 1.0.0"); +var swaggerDocument = require(apiJsonPath); +router.use('/openapi', swaggerUi.serve, swaggerUi.setup(swaggerDocument)); + // Version // Pour avoir la version de Road2 utilisée router.route("/version") diff --git a/src/js/apis/simple/1.0.0/index.js b/src/js/apis/simple/1.0.0/index.js index b291e246..5a505a54 100644 --- a/src/js/apis/simple/1.0.0/index.js +++ b/src/js/apis/simple/1.0.0/index.js @@ -1,10 +1,12 @@ 'use strict'; +const path = require('path'); const express = require('express'); const log4js = require('log4js'); const controller = require('./controller/controller'); const errorManager = require('../../../utils/errorManager'); +const swaggerUi = require('swagger-ui-express'); var LOGGER = log4js.getLogger("SIMPLE"); var router = express.Router(); @@ -44,6 +46,13 @@ router.all("/", function(req, res) { res.send("Road2 via l'API simple 1.0.0"); }); + +// swagger-ui +var apiJsonPath = path.join(__dirname, '..', '..', '..','..','..', 'documentation','apis','simple', '1.0.0', 'api.json'); +LOGGER.info("Utilisation fichier .json '"+ apiJsonPath + "' pour initialisation swagger-ui de l'API simple en version 1.0.0"); +var swaggerDocument = require(apiJsonPath); +router.use('/openapi', swaggerUi.serve, swaggerUi.setup(swaggerDocument)); + // GetCapabilities router.all("/getcapabilities", function(req, res) { diff --git a/src/js/geography/projectionManager.js b/src/js/geography/projectionManager.js index dd47f5d6..c662ca85 100644 --- a/src/js/geography/projectionManager.js +++ b/src/js/geography/projectionManager.js @@ -30,6 +30,9 @@ module.exports = class ProjectionManager { // Liste des ids de projections disponibles car déjà chargées dans proj4 this._loadedProjectionId = new Array(); + // Liste des paramètres de projection + this._loadedProjectionParameters = {}; + // Liste des ids des projections déjà vérifiées et qui doivent être cohérentes avec les prochaines qui seront vérifiés // Cet objet doit être vidé quand l'ensemble des configurations a été vérifié this._checkedProjectionId = new Array(); @@ -47,6 +50,17 @@ module.exports = class ProjectionManager { return this._loadedProjectionId; } + /** + * + * @function + * @name get loadedProjectionParameters + * @description Récupérer la liste des parametres de projections disponibles + * + */ + get loadedProjectionParameters () { + return this._loadedProjectionParameters; + } + /** * * @function @@ -74,6 +88,20 @@ module.exports = class ProjectionManager { } + /** + * + * @function + * @name getProjectionParameters + * @description Récupérer les paramètres d'une projection + * @param {string} id - ID de la projection + * + */ + getProjectionParameters (id) { + + return this._loadedProjectionParameters[id]; + + } + /** * * @function @@ -506,8 +534,9 @@ module.exports = class ProjectionManager { try { proj4.defs(configuration.id, configuration.parameters); - // On stocke l'id + // On stocke l'id et ces paramétres this._loadedProjectionId.push(configuration.id); + this._loadedProjectionParameters[configuration.id] = configuration.parameters; } catch(error) { LOGGER.error("Impossible de charger la projection dans proj4: "); diff --git a/src/js/responses/projectionResponse.js b/src/js/responses/projectionResponse.js index a4f369a3..15945be6 100644 --- a/src/js/responses/projectionResponse.js +++ b/src/js/responses/projectionResponse.js @@ -18,15 +18,20 @@ module.exports = class projectionResponse extends Response { * @function * @name constructor * @description Constructeur de la classe projectionResponse + * @params {string} id - Id de la projection + * @params {string} parameters - Paramétres de la projection * */ - constructor() { + constructor(id, parameters) { // Type de la réponse super("projectionResponse"); // Identifiant - this._id = ""; + this._id = id; + + // Paramétres + this._parameters = parameters; } @@ -44,13 +49,14 @@ module.exports = class projectionResponse extends Response { /** * * @function - * @name set id - * @description Attribuer l'identifiant - * @param {string} id - identifiant + * @name get parameters + * @description Récupérer les paramétres * */ - set id (id) { - this._id = id; + get parameters () { + return this._parameters; } + + } diff --git a/src/js/service/service.js b/src/js/service/service.js index f397f584..be7c5b3e 100644 --- a/src/js/service/service.js +++ b/src/js/service/service.js @@ -1141,15 +1141,19 @@ module.exports = class Service { LOGGER.info("computeProjectionRequest..."); // On doit utiliser les attributs avec _ car les méthodes ne sont pas disponible dans le cadre d'une communication IPC - let projectionResponse = new ProjectionResponse(); + let projectionIdAsked = projectionRequest._projection; - if (!this._projectionManager.isProjectionLoaded(projectionRequest._projection)) { - throw errorManager.createError(`Can't find projection ${projectionRequest._projection}`, 404); + if (!this._projectionManager.isProjectionLoaded(projectionIdAsked)) { + throw errorManager.createError(`Can't find projection ${projectionIdAsked}`, 404); } else { - projectionResponse.id = projectionRequest._projection; - } - return projectionResponse; + LOGGER.debug("La projection " + projectionIdAsked + " existe"); + let param = this._projectionManager.getProjectionParameters(projectionIdAsked); + LOGGER.debug("Paramétres de la projection : " + param); + + return new ProjectionResponse(projectionIdAsked, param); + + } } diff --git a/test/functional/configuration/cucumber/features/conf-projection.feature b/test/functional/configuration/cucumber/features/conf-projection.feature index 89f4376e..22c2d1d4 100644 --- a/test/functional/configuration/cucumber/features/conf-projection.feature +++ b/test/functional/configuration/cucumber/features/conf-projection.feature @@ -14,83 +14,77 @@ Feature: Road2 configuration Scenario: [projection.json] JSON vide Given a valid configuration - And without attribute "projectionsList" in "projection.json" projection + And without attribute "projectionsList" in "world.json" projection When I test the configuration Then the configuration analysis should give an exit code 1 Then the server log should contain "La fichier des projections ne contient pas de liste" Scenario: [projection.json] projectionsList absent Given a valid configuration - And without attribute "projectionsList" in "projection.json" projection - And with parameter "test" for attribute "projections" in "projection.json" projection + And without attribute "projectionsList" in "world.json" projection + And with parameter "test" for attribute "projections" in "world.json" projection When I test the configuration Then the configuration analysis should give an exit code 1 Then the server log should contain "La fichier des projections ne contient pas de liste" Scenario: [projection.json] projectionsList different Given a valid configuration - And with parameter "test" for attribute "projectionsList" in "projection.json" projection + And with parameter "test" for attribute "projectionsList" in "world.json" projection When I test the configuration Then the configuration analysis should give an exit code 1 Then the server log should contain "L'attribut projectionsList de la configuration n'est pas un tableau" Scenario: [projection.json] projectionsList est un tableau vide Given a valid configuration - And without attribute "projectionsList.[6]" in "projection.json" projection - And without attribute "projectionsList.[5]" in "projection.json" projection - And without attribute "projectionsList.[4]" in "projection.json" projection - And without attribute "projectionsList.[3]" in "projection.json" projection - And without attribute "projectionsList.[2]" in "projection.json" projection - And without attribute "projectionsList.[1]" in "projection.json" projection - And without attribute "projectionsList.[0]" in "projection.json" projection + And without attribute "projectionsList.[0]" in "world.json" projection When I test the configuration Then the configuration analysis should give an exit code 1 Then the server log should contain "L'attribut projectionsList de la configuration est un tableau vide" Scenario: [projection.json] une configuration de projection vide Given a valid configuration - And without attribute "projectionsList.[0].id" in "projection.json" projection - And without attribute "projectionsList.[0].parameters" in "projection.json" projection + And without attribute "projectionsList.[0].id" in "world.json" projection + And without attribute "projectionsList.[0].parameters" in "world.json" projection When I test the configuration Then the configuration analysis should give an exit code 1 Then the server log should contain "La configuration de la projection n'a pas d'id" Scenario: [projection.json] une configuration de projection sans id Given a valid configuration - And without attribute "projectionsList.[0].id" in "projection.json" projection + And without attribute "projectionsList.[0].id" in "world.json" projection When I test the configuration Then the configuration analysis should give an exit code 1 Then the server log should contain "La configuration de la projection n'a pas d'id" Scenario: [projection.json] une configuration de projection sans parametre Given a valid configuration - And without attribute "projectionsList.[0].parameters" in "projection.json" projection + And without attribute "projectionsList.[0].parameters" in "world.json" projection When I test the configuration Then the configuration analysis should give an exit code 1 Then the server log should contain "La configuration de la projection n'a pas de parametres" Scenario: [projection.json] une configuration de projection différentes Given a valid configuration - And with parameter "test" for attribute "projectionsList.[0]" in "projection.json" projection + And with parameter "test" for attribute "projectionsList.[0]" in "world.json" projection When I test the configuration Then the configuration analysis should give an exit code 1 Then the server log should contain "La configuration de la projection n'a pas d'id" Scenario: [projection.json] projection.id différent pour une projection inutilisée dans les topologies Given a valid configuration - And with parameter "test" for attribute "projectionsList.[2].id" in "projection.json" projection + And with parameter "test" for attribute "projectionsList.[2].id" in "france.json" projection When I test the configuration Then the configuration analysis should give an exit code 0 Scenario: [projection.json] projection.id différent pour une projection utilisée dans les topologies Given a valid configuration - And with parameter "test" for attribute "projectionsList.[0].id" in "projection.json" projection + And with parameter "test" for attribute "projectionsList.[0].id" in "world.json" projection When I test the configuration Then the configuration analysis should give an exit code 1 Scenario: [projection.json] projection.id vide Given a valid configuration - And with parameter "" for attribute "projectionsList.[2].id" in "projection.json" projection + And with parameter "" for attribute "projectionsList.[2].id" in "france.json" projection When I test the configuration Then the configuration analysis should give an exit code 1 Then the server log should contain "La configuration de la projection n'a pas d'id" @@ -98,13 +92,13 @@ Feature: Road2 configuration #TODO : Voir si on peut mieux vérifier Scenario: [projection.json] projection.parameters différent Given a valid configuration - And with parameter "test" for attribute "projectionsList.[0].parameters" in "projection.json" projection + And with parameter "test" for attribute "projectionsList.[0].parameters" in "world.json" projection When I test the configuration Then the configuration analysis should give an exit code 0 Scenario: [projection.json] projection.parameters vide Given a valid configuration - And with parameter "" for attribute "projectionsList.[0].parameters" in "projection.json" projection + And with parameter "" for attribute "projectionsList.[0].parameters" in "world.json" projection When I test the configuration Then the configuration analysis should give an exit code 1 Then the server log should contain "La configuration de la projection n'a pas de parametres" diff --git a/test/functional/request/cucumber/features/req-admin-1.0.0.feature b/test/functional/request/cucumber/features/req-admin-1.0.0.feature index efc33d62..b13bf0a6 100644 --- a/test/functional/request/cucumber/features/req-admin-1.0.0.feature +++ b/test/functional/request/cucumber/features/req-admin-1.0.0.feature @@ -154,7 +154,8 @@ Feature: Road2 with data When I send the request Then the server should send a response with status 200 And the response should have an header "content-type" with value "application/json" - And the response should contain "id" + And the response should contain an attribute "id" with value "EPSG:4326" + And the response should contain an attribute "parameters" Scenario: [admin/1.0.0] Projection invalide du service "main" Given an "GET" request on operation "services//projections/" in api "admin" "1.0.0" @@ -164,6 +165,7 @@ Feature: Road2 with data | projection | unknown | When I send the request Then the server should send a response with status 404 + And the response should contain an attribute "error" Scenario: [admin/1.0.0] Projection invalide du service "main" Given an "GET" request on operation "services//projections/" in api "admin" "1.0.0" @@ -172,7 +174,8 @@ Feature: Road2 with data | service | Unknown | | projection | Unknown | When I send the request - Then the server should send a response with status 404 + Then the server should send a response with status 404 + And the response should contain an attribute "error" Scenario: [admin/1.0.0] Projection sur service non défini Given an "GET" request on operation "services//projections/" in api "admin" "1.0.0" @@ -182,6 +185,7 @@ Feature: Road2 with data | projection | EPSG:4326 | When I send the request Then the server should send a response with status 400 + And the response should contain an attribute "error" Scenario: [admin/1.0.0] Projection non définie sur service "main" @@ -192,4 +196,5 @@ Feature: Road2 with data | projection | %20 | When I send the request Then the server should send a response with status 400 + And the response should contain an attribute "error" \ No newline at end of file diff --git a/test/integration/mocha/responses/integrationProjectionResponse.js b/test/integration/mocha/responses/integrationProjectionResponse.js index 8808f84d..13b6c55f 100644 --- a/test/integration/mocha/responses/integrationProjectionResponse.js +++ b/test/integration/mocha/responses/integrationProjectionResponse.js @@ -9,7 +9,7 @@ describe('Test de la classe ProjectionResponse', function() { logManager.manageLogs(); }); - let response = new ProjectionResponse(); + let response = new ProjectionResponse("EPSG:4326","+proj=longlat +datum=WGS84 +no_defs"); describe('Test du constructeur et des getters/setters', function() { @@ -18,12 +18,11 @@ describe('Test de la classe ProjectionResponse', function() { }); it('Get id', function() { - assert.equal(response.id, ""); + assert.equal(response.id, "EPSG:4326"); }); - it('Set id', function() { - response.id = "EPSG:4326"; - assert.equal(response.id, "EPSG:4326"); + it('Get parameters', function() { + assert.equal(response.parameters, "+proj=longlat +datum=WGS84 +no_defs"); }); }); diff --git a/test/unit/mocha/config/projections/projection.json b/test/unit/mocha/config/projections/france.json similarity index 100% rename from test/unit/mocha/config/projections/projection.json rename to test/unit/mocha/config/projections/france.json diff --git a/test/unit/mocha/geography/testsProjectionManager.js b/test/unit/mocha/geography/testsProjectionManager.js index 1f9ad4f2..71950dd7 100644 --- a/test/unit/mocha/geography/testsProjectionManager.js +++ b/test/unit/mocha/geography/testsProjectionManager.js @@ -50,7 +50,7 @@ describe('Test de la classe ProjectionManager', function() { describe('Vérification d\'un fichier de projections', function() { let projManager = new ProjectionManager(); - let file = "/home/docker/app/test/unit/mocha/config/projections/projection.json"; + let file = "/home/docker/app/test/unit/mocha/config/projections/france.json"; it('checkProjectionFile()', function() { assert.equal(projManager.checkProjectionFile(file), true); @@ -107,7 +107,7 @@ describe('Test de la classe ProjectionManager', function() { describe('Chargement d\'un fichier de projections', function() { let projManager = new ProjectionManager(); - let file = "/home/docker/app/test/unit/mocha/config/projections/projection.json"; + let file = "/home/docker/app/test/unit/mocha/config/projections/france.json"; it('loadProjectionFile()', function() { assert.equal(projManager.loadProjectionFile(file), true);