Difference between revisions of "NFV SpecFest Wiki"
Line 88: | Line 88: | ||
</gallery> | </gallery> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Verify == | == Verify == | ||
Line 147: | Line 139: | ||
To install and configure Git on your machine please refer to [[Get started]]. | To install and configure Git on your machine please refer to [[Get started]]. | ||
+ | |||
+ | === Optional: Upload the contribution via Git === | ||
+ | |||
+ | # Upload the contribution via the usual git workflow (please note the unususual push operation endpoint) | ||
+ | |||
+ | $ git add . | ||
+ | $ git commit -s -m "your message here" | ||
+ | $ git push origin HEAD:refs/for/master | ||
=== More on the starter kit === | === More on the starter kit === |
Revision as of 08:40, 17 August 2017
Warning: This page is a working draft. Information could be missing or unreliable. Contact the administrator for more support. |
Upload an OpenAPI specification to the ETSI Forge!
Welcome to the Wiki page for the NFV SpecFest event.
Today you have the opportunity to participate in the first collaborative OpenAPI specification on the ETSI Forge.
We will focus our attention on ETSI NFV GS SOL 002[1](Download here).
What you will need:
- A laptop (any operating system supported)
- A copy (paper or PDF) of NFV SOL 002 specification
- This wiki page.
Let's get started!
Contents
Set up
- Log in at ETSI Forge inserting your EOL accounts
- If you do not have an account yet, simply register here
- Install (if you have not yet) Google Chrome browser.
Starter Kit
To help you start up the activity we provided:
- A live spreadsheet to keep track of "who is doing what"
- Open the given spreadsheet and tag one operation with your name
- The operation will then be assigned to you to be edited
- Useful links
- OpenAPI Specification v2: the official and complete reference of the language;
- Templates and examples in our nfv-specfest repository.
Editing
Writing the definition (insert screenshots of word and editor)
Make sure you are using Google Chrome as your browser from this point |
Checklist:
- You will need the text of ETSI GS SOL 002 (Download here). Section 5.4.2.2 is fundamental for the next steps.
Edit the OpenApi specification:
- Open the template of a specification: this will be your starting point; you will find a structured file where you will need to insert the appropriate values from SOL002;
- Look up SOL002, Section 5.4.2.2
(Insert the image here)
- Create the definition into the nfv002_main_template.yaml and check correctness with VS Code
- Cut&paste what you created into a proper resource in /paths/index.yaml and create the corresponding file
- E.g. create the Vnf_instance data type into a Vnf_instance.yaml file
- Configure the files so that the CI/CD validates the result
- An example of specification: this is how your work should look like at the end;
Online via Gerrit
- Navigate to the project page of nfv-specfest
- Click on the
Sign in
link on the top right and the page and login with your EOL or Forge credentials - Click on the menu Projects -> List -> nfv-specfest
- Click on the
- Click ‘Create Change’ button
- Enter Branch: master
- Enter Change title
- Enter Change description
- Click on
Create
- Click 'Edit' in the File list at the bottom of the page
- Now click "Add" to insert a new modification in a file
- If you type the name of a file already existing in the repository, that file will be opened for editing. If, otherwise, you type a new file name, the file will be created.
- As you type, Gerrit will suggest names of files and folder in the repo.
- Now click on the file to open it in the online editor.
- Paste the content you created in your local editor or with the online editor.
- Click Save and Close
- Now click the blue Publish button on the top right of the page.
Verify
- Check Jenkins result on Gerrit and on Jenkins Job (go to https://forge.etsi.org/gerrit/#/dashboard/self)
- If there is no feedback from Jenkins contact CTI
- Wait for CTI to merge your contribution
Iterate!
All accomplished? Then it may be time to select a new part of the specification and create the OpenAPI version again!
Bonus level
Optional: Install an offline Editor application on your system
It is possible to edit and submit the specification files directly in the browser without the need of installing anything. But that method is a bit more error prone and sometimes less comfortable, therefore a better workflow would require an Editor locally installed on your machine. We list below two different options, both free, open source and with extensions to facilitate work with OpenAPIs.
Anyway, feel free to use your preferred editor: you will need to submit only the plain text.
VS Code
- Navigate to VS Code homepage, download the installer for your platform and execute it
- Install the Swagger Viewer Plugin
Editing with VS Code Example
Visual Studio Code is a multiplatform, free and open source, extendible editor by Microsoft (similar to SublimeText and Atom Editor). For VS Code a handy plugin is available to render OpenAPIs documentation while typing, therefore we selected this as a suitable tool for our activity. Anyway, feel free to use your preferred editor for the task.
Find below the instructions to render OpenAPI doc in VS Code:
- Open the template file with VS Code (e.g. open or paste the template file sol002-template.yaml)
- Press F1, then write "Swagger preview" and hit Enter. A new tab will open to show the graphical representation of the file. Note that as soon as you change the text, the other tab is automatically updated.
Atom Editor
- Navigate to Atom homepage, download the installer for your platform and execute it.
- Install the linter-swagger plugin.
Optional: Set up Git
To install and configure Git on your machine please refer to Get started.
Optional: Upload the contribution via Git
- Upload the contribution via the usual git workflow (please note the unususual push operation endpoint)
$ git add . $ git commit -s -m "your message here" $ git push origin HEAD:refs/for/master
More on the starter kit
- A repository at the Forge, with the folder structure, a template of specification file and some examples. Click here to visit the repository.
- A live spreadsheet to keep track of "who is doing what"
- Open the given spreadsheet and tag one operation with your name
- The operation will then be assigned to you to be edited
References
<references />