Skip to content

Commit 1728ff7

Browse files
lcawlszabosteve
andauthored
Add examples to licensing APIs (#3420) (#3425)
Co-authored-by: István Zoltán Szabó <[email protected]> (cherry picked from commit e153632)
1 parent e9b082d commit 1728ff7

11 files changed

+135
-7
lines changed

docs/overlays/elasticsearch-openapi-overlays.yaml

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,63 @@ actions:
392392
examples:
393393
indicesLegacyPutTemplateRequestExample1:
394394
$ref: "../../specification/indices/put_template/indicesPutTemplateRequestExample1.yaml"
395+
## Examples for licensing
396+
- target: "$.paths['/_license/basic_status']['get']"
397+
description: "Add example for get basic status response"
398+
update:
399+
responses:
400+
200:
401+
content:
402+
application/json:
403+
examples:
404+
getBasicStatusResponseExample1:
405+
$ref: "../../specification/license/get_basic_status/GetBasicLicenseStatusResponseExample1.yaml"
406+
- target: "$.paths['/_license/trial_status']['get']"
407+
description: "Add example for get trial status response"
408+
update:
409+
responses:
410+
200:
411+
content:
412+
application/json:
413+
examples:
414+
getLicenseResponseExample1:
415+
$ref: "../../specification/license/get_trial_status/GetTrialLicenseStatusResponseExample1.yaml"
416+
- target: "$.paths['/_license/start_basic']['post']"
417+
description: "Add example for start basic response"
418+
update:
419+
responses:
420+
200:
421+
content:
422+
application/json:
423+
examples:
424+
startBasicLicenseResponseExample1:
425+
$ref: "../../specification/license/post_start_basic/StartBasicLicenseResponseExample1.yaml"
426+
- target: "$.paths['/_license/start_trial']['post']"
427+
description: "Add example for start trial response"
428+
update:
429+
responses:
430+
200:
431+
content:
432+
application/json:
433+
examples:
434+
startTrialLicenseResponseExample1:
435+
$ref: "../../specification/license/post_start_trial/StartTrialLicenseResponseExample1.yaml"
436+
- target: "$.components['requestBodies']['license.post']"
437+
description: "Add examples for update license request"
438+
update:
439+
content:
440+
application/json:
441+
examples:
442+
updateLicenseRequestExample1:
443+
$ref: "../../specification/license/post/PostLicenseRequestExample1.yaml"
444+
- target: "$.components['responses']['license.post#200']"
445+
description: "Add examples for update license response"
446+
update:
447+
content:
448+
application/json:
449+
examples:
450+
clusterHealthResponseExample1:
451+
$ref: "../../specification/license/post/PostLicenseResponseExample1.yaml"
395452
## Examples for search applications
396453
- target: "$.paths['/_application/search_application/{name}/_render_query']['post']"
397454
description: "Add examples for render search application query operation"
@@ -402,10 +459,5 @@ actions:
402459
examples:
403460
renderSearchApplicationQueryRequestExample1:
404461
$ref: "../../specification/search_application/render_query/SearchApplicationsRenderQueryRequestExample1.yaml"
405-
responses:
406-
200:
407-
content:
408-
application/json:
409-
examples:
410462
renderSearchApplicationQueryResponseExample1:
411463
$ref: "../../specification/search_application/render_query/SearchApplicationsRenderQueryResponseExample1.yaml"

docs/overlays/elasticsearch-shared-overlays.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,3 +1351,14 @@ actions:
13511351
examples:
13521352
indicesRolloverResponseExample1:
13531353
$ref: "../../specification/indices/rollover/indicesRolloverResponseExample1.yaml"
1354+
## Examples for licensing
1355+
- target: "$.paths['/_license']['get']"
1356+
description: "Add example for get license response"
1357+
update:
1358+
responses:
1359+
200:
1360+
content:
1361+
application/json:
1362+
examples:
1363+
getLicenseResponseExample1:
1364+
$ref: "../../specification/license/get/GetLicenseResponseExample1.yaml"

output/schema/schema.json

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# summary: licensing/get-license.asciidoc:61
2+
description: A successful response from `GET /_license`.
3+
# type: response
4+
# response_code: ''
5+
value:
6+
"{\n \"license\" : {\n \"status\" : \"active\",\n \"uid\" : \"cbff45e7-c553-41f7-ae4f-9205eabd80xx\"\
7+
,\n \"type\" : \"trial\",\n \"issue_date\" : \"2018-10-20T22:05:12.332Z\"\
8+
,\n \"issue_date_in_millis\" : 1540073112332,\n \"expiry_date\" : \"2018-11-19T22:05:12.332Z\"\
9+
,\n \"expiry_date_in_millis\" : 1542665112332,\n \"max_nodes\" : 1000,\n \
10+
\ \"max_resource_units\" : null,\n \"issued_to\" : \"test\",\n \"issuer\"\
11+
\ : \"elasticsearch\",\n \"start_date_in_millis\" : -1\n }\n}"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# summary: licensing/get-basic-status.asciidoc:42
2+
description: A successful response from `GET /_license/basic_status`.
3+
# type: response
4+
# response_code: 200
5+
value:
6+
eligible_to_start_basic: true
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# summary: licensing/get-trial-status.asciidoc:47
2+
description: A successful response from `GET /_license/trial_status`.
3+
# type: response
4+
# response_code: 200
5+
value:
6+
eligible_to_start_trial: true
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# summary: licensing/update-license.asciidoc:63
2+
# method_request: PUT _license
3+
description: >
4+
Run `PUT _license` to update to a basic license. NOTE: These values are invalid; you must substitute the appropriate contents from your license file.
5+
# type: request
6+
value:
7+
"{\n \"licenses\": [\n {\n \"uid\":\"893361dc-9749-4997-93cb-802e3d7fa4xx\"\
8+
,\n \"type\":\"basic\",\n \"issue_date_in_millis\":1411948800000,\n \
9+
\ \"expiry_date_in_millis\":1914278399999,\n \"max_nodes\":1,\n \"\
10+
issued_to\":\"issuedTo\",\n \"issuer\":\"issuer\",\n \"signature\":\"\
11+
xx\"\n }\n ]\n}"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# summary: licensing/get-trial-status.asciidoc:47
2+
description: If you update to a basic license and you previously had a license with more features, you receive this type of response. You must re-submit the API request and set the `acknowledge` parameter to `true`.
3+
# type: response
4+
# response_code: 200
5+
value:
6+
acknowledged: false
7+
license_status: valid
8+
acknowledge:
9+
message: '"""This license update requires acknowledgement. To acknowledge the license, please read the following messages and update the license again, this time with the "acknowledge=true" parameter:"""'
10+
watcher:
11+
- Watcher will be disabled
12+
logstash:
13+
- Logstash will no longer poll for centrally-managed pipelines
14+
security:
15+
- The following X-Pack security functionality will be disabled ...
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# summary:
2+
description: A successful response from `POST /_license/start_basic?acknowledge=true`. If you currently have a license with more features than a basic license and you start a basic license, you must pass the acknowledge parameter.
3+
# type: response
4+
# response_code: 200
5+
value:
6+
basic_was_started: true
7+
acknowledged: true

specification/license/post_start_trial/StartTrialLicenseRequest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { RequestBase } from '@_types/Base'
3030
* @rest_spec_name license.post_start_trial
3131
* @availability stack since=6.1.0 stability=stable
3232
* @cluster_privileges manage
33+
* @doc_id start-trial
3334
*/
3435
export interface Request extends RequestBase {
3536
query_parameters: {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# summary:
2+
description: A successful response from `POST /_license/start_trial?acknowledge=true`.
3+
# type: response
4+
# response_code: 200
5+
value:
6+
trial_was_started: true
7+
acknowledged: true

0 commit comments

Comments
 (0)