From a7af96064b9ff64475b6547009fe39c39251a729 Mon Sep 17 00:00:00 2001 From: Alexey Yarmosh Date: Tue, 5 Dec 2023 13:45:25 +0100 Subject: [PATCH] docs: update openapi docs --- public/v1/components/examples.yaml | 8 ++++++++ public/v1/components/schemas.yaml | 14 ++++++++------ public/v1/spec.yaml | 3 +++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/public/v1/components/examples.yaml b/public/v1/components/examples.yaml index 747b0723..81ea5257 100644 --- a/public/v1/components/examples.yaml +++ b/public/v1/components/examples.yaml @@ -75,6 +75,14 @@ components: "packets": 6 } } + createMeasurementPingLocationsMeasurementId: + summary: 'ping: previous measurement id' + value: + { + "type": "ping", + "target": "cdn.jsdelivr.net", + "locations": "1wzMrzLBZfaPoT1c" + } createMeasurementResponse: value: { diff --git a/public/v1/components/schemas.yaml b/public/v1/components/schemas.yaml index d51fccd6..b440d707 100644 --- a/public/v1/components/schemas.yaml +++ b/public/v1/components/schemas.yaml @@ -76,12 +76,14 @@ components: maximum: 200 default: 1 MeasurementLocations: - type: array - description: | - An array of locations from which to run the measurement. - Each object specifies a location using one or multiple keys. - items: - $ref: 'schemas.yaml#/components/schemas/MeasurementLocationOption' + oneOf: + - type: array + description: | + An array of locations from which to run the measurement. Each object specifies a location using one or multiple keys. + items: + $ref: 'schemas.yaml#/components/schemas/MeasurementLocationOption' + - type: string + description: Id of a previous measurement. Probes of that measurement in the same order are used to create a new measurement. Only probes are copied, measurement type and options may be any and should still be specified in request. MeasurementOptions: anyOf: - $ref: 'schemas.yaml#/components/schemas/MeasurementPingOptions' diff --git a/public/v1/spec.yaml b/public/v1/spec.yaml index da8b58ae..e67ffdcd 100644 --- a/public/v1/spec.yaml +++ b/public/v1/spec.yaml @@ -47,6 +47,7 @@ paths: - Set the `inProgressUpdates` option to `true` if the application is running in interactive mode so that the user sees the results right away. - If the application is interactive by default but also implements a "CI" mode to be used in scripts, do not set the flag in the CI mode. + - To use the same probes in different measurements pass id of the first measurement to the `locations` option. requestBody: content: application/json: @@ -61,6 +62,8 @@ paths: $ref: 'components/examples.yaml#/components/examples/createMeasurementPingLocationsMagic' pingCustom: $ref: 'components/examples.yaml#/components/examples/createMeasurementPingCustom' + pingLocationsMeasurementId: + $ref: 'components/examples.yaml#/components/examples/createMeasurementPingLocationsMeasurementId' responses: '202': $ref: 'components/responses.yaml#/components/responses/measurements202'