diff --git a/docs/overlays/elasticsearch-openapi-overlays.yaml b/docs/overlays/elasticsearch-openapi-overlays.yaml index ead0f79c8c..dd877b2a8c 100644 --- a/docs/overlays/elasticsearch-openapi-overlays.yaml +++ b/docs/overlays/elasticsearch-openapi-overlays.yaml @@ -392,6 +392,63 @@ actions: examples: indicesLegacyPutTemplateRequestExample1: $ref: "../../specification/indices/put_template/indicesPutTemplateRequestExample1.yaml" +## Examples for licensing + - target: "$.paths['/_license/basic_status']['get']" + description: "Add example for get basic status response" + update: + responses: + 200: + content: + application/json: + examples: + getBasicStatusResponseExample1: + $ref: "../../specification/license/get_basic_status/GetBasicLicenseStatusResponseExample1.yaml" + - target: "$.paths['/_license/trial_status']['get']" + description: "Add example for get trial status response" + update: + responses: + 200: + content: + application/json: + examples: + getLicenseResponseExample1: + $ref: "../../specification/license/get_trial_status/GetTrialLicenseStatusResponseExample1.yaml" + - target: "$.paths['/_license/start_basic']['post']" + description: "Add example for start basic response" + update: + responses: + 200: + content: + application/json: + examples: + startBasicLicenseResponseExample1: + $ref: "../../specification/license/post_start_basic/StartBasicLicenseResponseExample1.yaml" + - target: "$.paths['/_license/start_trial']['post']" + description: "Add example for start trial response" + update: + responses: + 200: + content: + application/json: + examples: + startTrialLicenseResponseExample1: + $ref: "../../specification/license/post_start_trial/StartTrialLicenseResponseExample1.yaml" + - target: "$.components['requestBodies']['license.post']" + description: "Add examples for update license request" + update: + content: + application/json: + examples: + updateLicenseRequestExample1: + $ref: "../../specification/license/post/PostLicenseRequestExample1.yaml" + - target: "$.components['responses']['license.post#200']" + description: "Add examples for update license response" + update: + content: + application/json: + examples: + clusterHealthResponseExample1: + $ref: "../../specification/license/post/PostLicenseResponseExample1.yaml" ## Examples for search applications - target: "$.paths['/_application/search_application/{name}/_render_query']['post']" description: "Add examples for render search application query operation" @@ -402,10 +459,5 @@ actions: examples: renderSearchApplicationQueryRequestExample1: $ref: "../../specification/search_application/render_query/SearchApplicationsRenderQueryRequestExample1.yaml" - responses: - 200: - content: - application/json: - examples: renderSearchApplicationQueryResponseExample1: $ref: "../../specification/search_application/render_query/SearchApplicationsRenderQueryResponseExample1.yaml" diff --git a/docs/overlays/elasticsearch-shared-overlays.yaml b/docs/overlays/elasticsearch-shared-overlays.yaml index 63e7d7444a..fa8d1bd828 100644 --- a/docs/overlays/elasticsearch-shared-overlays.yaml +++ b/docs/overlays/elasticsearch-shared-overlays.yaml @@ -1351,3 +1351,14 @@ actions: examples: indicesRolloverResponseExample1: $ref: "../../specification/indices/rollover/indicesRolloverResponseExample1.yaml" +## Examples for licensing + - target: "$.paths['/_license']['get']" + description: "Add example for get license response" + update: + responses: + 200: + content: + application/json: + examples: + getLicenseResponseExample1: + $ref: "../../specification/license/get/GetLicenseResponseExample1.yaml" \ No newline at end of file diff --git a/output/schema/schema.json b/output/schema/schema.json index 6124ad8946..2cb1760e4e 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -9399,7 +9399,8 @@ } }, "description": "Start a trial.\nStart a 30-day trial, which gives access to all subscription features.\n\nNOTE: You are allowed to start a trial only if your cluster has not already activated a trial for the current major product version.\nFor example, if you have already activated a trial for v8.0, you cannot start a new trial until v9.0. You can, however, request an extended trial at https://www.elastic.co/trialextension.\n\nTo check the status of your trial, use the get trial status API.", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/start-trial.html", + "docId": "start-trial", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/start-trial.html", "name": "license.post_start_trial", "privileges": { "cluster": [ @@ -150121,7 +150122,7 @@ } } ], - "specLocation": "license/post_start_trial/StartTrialLicenseRequest.ts#L22-L39" + "specLocation": "license/post_start_trial/StartTrialLicenseRequest.ts#L22-L40" }, { "kind": "response", diff --git a/specification/license/get/GetLicenseResponseExample1.yaml b/specification/license/get/GetLicenseResponseExample1.yaml new file mode 100644 index 0000000000..937d67fc6e --- /dev/null +++ b/specification/license/get/GetLicenseResponseExample1.yaml @@ -0,0 +1,11 @@ +# summary: licensing/get-license.asciidoc:61 +description: A successful response from `GET /_license`. +# type: response +# response_code: '' +value: + "{\n \"license\" : {\n \"status\" : \"active\",\n \"uid\" : \"cbff45e7-c553-41f7-ae4f-9205eabd80xx\"\ + ,\n \"type\" : \"trial\",\n \"issue_date\" : \"2018-10-20T22:05:12.332Z\"\ + ,\n \"issue_date_in_millis\" : 1540073112332,\n \"expiry_date\" : \"2018-11-19T22:05:12.332Z\"\ + ,\n \"expiry_date_in_millis\" : 1542665112332,\n \"max_nodes\" : 1000,\n \ + \ \"max_resource_units\" : null,\n \"issued_to\" : \"test\",\n \"issuer\"\ + \ : \"elasticsearch\",\n \"start_date_in_millis\" : -1\n }\n}" diff --git a/specification/license/get_basic_status/GetBasicLicenseStatusResponseExample1.yaml b/specification/license/get_basic_status/GetBasicLicenseStatusResponseExample1.yaml new file mode 100644 index 0000000000..e6ed67a9d9 --- /dev/null +++ b/specification/license/get_basic_status/GetBasicLicenseStatusResponseExample1.yaml @@ -0,0 +1,6 @@ +# summary: licensing/get-basic-status.asciidoc:42 +description: A successful response from `GET /_license/basic_status`. +# type: response +# response_code: 200 +value: + eligible_to_start_basic: true diff --git a/specification/license/get_trial_status/GetTrialLicenseStatusResponseExample1.yaml b/specification/license/get_trial_status/GetTrialLicenseStatusResponseExample1.yaml new file mode 100644 index 0000000000..ce0ad02ed5 --- /dev/null +++ b/specification/license/get_trial_status/GetTrialLicenseStatusResponseExample1.yaml @@ -0,0 +1,6 @@ +# summary: licensing/get-trial-status.asciidoc:47 +description: A successful response from `GET /_license/trial_status`. +# type: response +# response_code: 200 +value: + eligible_to_start_trial: true diff --git a/specification/license/post/PostLicenseRequestExample1.yaml b/specification/license/post/PostLicenseRequestExample1.yaml new file mode 100644 index 0000000000..b31c86f423 --- /dev/null +++ b/specification/license/post/PostLicenseRequestExample1.yaml @@ -0,0 +1,11 @@ +# summary: licensing/update-license.asciidoc:63 +# method_request: PUT _license +description: > + Run `PUT _license` to update to a basic license. NOTE: These values are invalid; you must substitute the appropriate contents from your license file. +# type: request +value: + "{\n \"licenses\": [\n {\n \"uid\":\"893361dc-9749-4997-93cb-802e3d7fa4xx\"\ + ,\n \"type\":\"basic\",\n \"issue_date_in_millis\":1411948800000,\n \ + \ \"expiry_date_in_millis\":1914278399999,\n \"max_nodes\":1,\n \"\ + issued_to\":\"issuedTo\",\n \"issuer\":\"issuer\",\n \"signature\":\"\ + xx\"\n }\n ]\n}" diff --git a/specification/license/post/PostLicenseResponseExample1.yaml b/specification/license/post/PostLicenseResponseExample1.yaml new file mode 100644 index 0000000000..e6e7d909f1 --- /dev/null +++ b/specification/license/post/PostLicenseResponseExample1.yaml @@ -0,0 +1,15 @@ +# summary: licensing/get-trial-status.asciidoc:47 +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`. +# type: response +# response_code: 200 +value: + acknowledged: false + license_status: valid + acknowledge: + 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:"""' + watcher: + - Watcher will be disabled + logstash: + - Logstash will no longer poll for centrally-managed pipelines + security: + - The following X-Pack security functionality will be disabled ... diff --git a/specification/license/post_start_basic/StartBasicLicenseResponseExample1.yaml b/specification/license/post_start_basic/StartBasicLicenseResponseExample1.yaml new file mode 100644 index 0000000000..805a87b14c --- /dev/null +++ b/specification/license/post_start_basic/StartBasicLicenseResponseExample1.yaml @@ -0,0 +1,7 @@ +# summary: +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. +# type: response +# response_code: 200 +value: + basic_was_started: true + acknowledged: true diff --git a/specification/license/post_start_trial/StartTrialLicenseRequest.ts b/specification/license/post_start_trial/StartTrialLicenseRequest.ts index 5c722aec81..989ae9f846 100644 --- a/specification/license/post_start_trial/StartTrialLicenseRequest.ts +++ b/specification/license/post_start_trial/StartTrialLicenseRequest.ts @@ -30,6 +30,7 @@ import { RequestBase } from '@_types/Base' * @rest_spec_name license.post_start_trial * @availability stack since=6.1.0 stability=stable * @cluster_privileges manage + * @doc_id start-trial */ export interface Request extends RequestBase { query_parameters: { diff --git a/specification/license/post_start_trial/StartTrialLicenseResponseExample1.yaml b/specification/license/post_start_trial/StartTrialLicenseResponseExample1.yaml new file mode 100644 index 0000000000..105dcc1ae5 --- /dev/null +++ b/specification/license/post_start_trial/StartTrialLicenseResponseExample1.yaml @@ -0,0 +1,7 @@ +# summary: +description: A successful response from `POST /_license/start_trial?acknowledge=true`. +# type: response +# response_code: 200 +value: + trial_was_started: true + acknowledged: true