diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-10-12 21:37:04 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-10-12 21:37:04 +0200 |
commit | 2f2ad9eaf06e4573da77f9602fa9678711dba4d9 (patch) | |
tree | 0f0eb102b146da8358ec1ba0c81bf0498cdee4bd /doc/api/templates/licenses.md | |
parent | 2e3bc85421ddfc814e81f75e3adb8a8c1d53093e (diff) | |
parent | 58e2b44afe535100508eb4d49d7e7df24e408383 (diff) | |
download | gitlab-ce-feature/improve-mrwbs-and-todos-for-pipelines.tar.gz |
Merge branch 'master' into feature/improve-mrwbs-and-todos-for-pipelinesfeature/improve-mrwbs-and-todos-for-pipelines
* master:
Update health_check gem to `~> 2.2.0`
API: Version information
Revert "Merge branch 'tests-use-tmpfs' into 'master'"
Added documentation chapter for Git attributes
Use activerecord_sane_schema_dumper
Add a separate stage for bundle check
Add a bundle check step to ensure dependencies are correct
Create a new /templates API namespace
Add disabled delete button to protected branches
Make spec deterministic
refactors tests because of gitlab-test repository changes
Addresses Robert's feedback
Speed up specs for GET /projects/:id/events
API: New /users/:id/events endpoint
writes tests to verify the issue is solved and fixes breaking issues.
removes inconsistency regarding tagging immediately as merged once you create a branch using new branch button and adds changelog entry
Diffstat (limited to 'doc/api/templates/licenses.md')
-rw-r--r-- | doc/api/templates/licenses.md | 147 |
1 files changed, 147 insertions, 0 deletions
diff --git a/doc/api/templates/licenses.md b/doc/api/templates/licenses.md new file mode 100644 index 00000000000..ae7218cf1bd --- /dev/null +++ b/doc/api/templates/licenses.md @@ -0,0 +1,147 @@ +# Licenses + +## List license templates + +Get all license templates. + +``` +GET /templates/licenses +``` + +| Attribute | Type | Required | Description | +| --------- | ------- | -------- | --------------------- | +| `popular` | boolean | no | If passed, returns only popular licenses | + +```bash +curl https://gitlab.example.com/api/v3/templates/licenses?popular=1 +``` + +Example response: + +```json +[ + { + "key": "apache-2.0", + "name": "Apache License 2.0", + "nickname": null, + "featured": true, + "html_url": "http://choosealicense.com/licenses/apache-2.0/", + "source_url": "http://www.apache.org/licenses/LICENSE-2.0.html", + "description": "A permissive license that also provides an express grant of patent rights from contributors to users.", + "conditions": [ + "include-copyright", + "document-changes" + ], + "permissions": [ + "commercial-use", + "modifications", + "distribution", + "patent-use", + "private-use" + ], + "limitations": [ + "trademark-use", + "no-liability" + ], + "content": " Apache License\n Version 2.0, January 2004\n [...]" + }, + { + "key": "gpl-3.0", + "name": "GNU General Public License v3.0", + "nickname": "GNU GPLv3", + "featured": true, + "html_url": "http://choosealicense.com/licenses/gpl-3.0/", + "source_url": "http://www.gnu.org/licenses/gpl-3.0.txt", + "description": "The GNU GPL is the most widely used free software license and has a strong copyleft requirement. When distributing derived works, the source code of the work must be made available under the same license.", + "conditions": [ + "include-copyright", + "document-changes", + "disclose-source", + "same-license" + ], + "permissions": [ + "commercial-use", + "modifications", + "distribution", + "patent-use", + "private-use" + ], + "limitations": [ + "no-liability" + ], + "content": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n [...]" + }, + { + "key": "mit", + "name": "MIT License", + "nickname": null, + "featured": true, + "html_url": "http://choosealicense.com/licenses/mit/", + "source_url": "http://opensource.org/licenses/MIT", + "description": "A permissive license that is short and to the point. It lets people do anything with your code with proper attribution and without warranty.", + "conditions": [ + "include-copyright" + ], + "permissions": [ + "commercial-use", + "modifications", + "distribution", + "private-use" + ], + "limitations": [ + "no-liability" + ], + "content": "The MIT License (MIT)\n\nCopyright (c) [year] [fullname]\n [...]" + } +] +``` + +## Single license template + +Get a single license template. You can pass parameters to replace the license +placeholder. + +``` +GET /templates/licenses/:key +``` + +| Attribute | Type | Required | Description | +| ---------- | ------ | -------- | ----------- | +| `key` | string | yes | The key of the license template | +| `project` | string | no | The copyrighted project name | +| `fullname` | string | no | The full-name of the copyright holder | + +>**Note:** +If you omit the `fullname` parameter but authenticate your request, the name of +the authenticated user will be used to replace the copyright holder placeholder. + +```bash +curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/templates/licenses/mit?project=My+Cool+Project +``` + +Example response: + +```json +{ + "key": "mit", + "name": "MIT License", + "nickname": null, + "featured": true, + "html_url": "http://choosealicense.com/licenses/mit/", + "source_url": "http://opensource.org/licenses/MIT", + "description": "A permissive license that is short and to the point. It lets people do anything with your code with proper attribution and without warranty.", + "conditions": [ + "include-copyright" + ], + "permissions": [ + "commercial-use", + "modifications", + "distribution", + "private-use" + ], + "limitations": [ + "no-liability" + ], + "content": "The MIT License (MIT)\n\nCopyright (c) 2016 John Doe\n [...]" +} +``` |