From 72486264221a90bec42bac43624f105519938c45 Mon Sep 17 00:00:00 2001 From: Drew Blessing Date: Mon, 23 May 2016 15:08:31 -0500 Subject: [PATCH] Update license API docs [ci skip] --- doc/api/license.md | 41 +++++++++++++++++-- doc/api/{licenses.md => license_templates.md} | 2 +- 2 files changed, 38 insertions(+), 5 deletions(-) rename doc/api/{licenses.md => license_templates.md} (99%) diff --git a/doc/api/license.md b/doc/api/license.md index dc95f9fcebfc17..fe4513919b7c69 100644 --- a/doc/api/license.md +++ b/doc/api/license.md @@ -1,10 +1,10 @@ # License -## Retrieve information about the current license - -In order to retrieve the license information, you need to authenticate yourself +In order to interact with license endpoints, you need to authenticate yourself as an admin. +## Retrieve information about the current license + ``` GET /license ``` @@ -21,4 +21,37 @@ GET /license "user_limit": 100, "active_users": 60 } -``` \ No newline at end of file +``` + +## Add a new license + +``` +POST /license +``` + +| Attribute | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `license` | string | yes | The license string | + +```bash +curl -X POST -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/license?license=eyJkYXRhIjoiMHM5Q...S01Udz09XG4ifQ==" +``` + +Example response: + +```json +{ + "starts_at": "2015-10-24", + "expires_at": "2016-10-24", + "licensee": { + "Name": "John Doe", + "Company": "Doe, Inc.", + "Email": "john@doe.com" + }, + "user_limit": 100, + "active_users": 60 +} +``` + +It returns `201` if it succeeds or `400` if failed with an error message +explaining the reason. diff --git a/doc/api/licenses.md b/doc/api/license_templates.md similarity index 99% rename from doc/api/licenses.md rename to doc/api/license_templates.md index 855b0eab56fe26..7f589b3d01b357 100644 --- a/doc/api/licenses.md +++ b/doc/api/license_templates.md @@ -1,4 +1,4 @@ -# Licenses +# License Templates ## List license templates -- GitLab