diff --git a/openapi/components/examples/content/200-snapshots.json b/openapi/components/examples/content/200-snapshots.json new file mode 100644 index 0000000..bd282d2 --- /dev/null +++ b/openapi/components/examples/content/200-snapshots.json @@ -0,0 +1,26 @@ +{ + "value": [ + { + "hash": "bafkreig6sfhegnp4okzecgx3v6gj6pohh5qzw6zjtrdqtggx64743rkmz4", + "timeRange": { + "initTimestamp": 1577836800000, + "endTimestamp": 1606867200000 + }, + "replacedSnapshotHashes": [ + "bafkreig6sfhegnp4okzecgx3v6gj6pohh5qzw6zjtrdqtggx64743rkmz4" + ], + "numberOfEntities": 0, + "generationTimestamp": 1671126919124 + }, + { + "hash": "bafkreig6sfhegnp4okzecgx3v6gj6pohh5qzw6zjtrdqtggx64743rkmz4", + "timeRange": { + "initTimestamp": 1606867200000, + "endTimestamp": 1635897600000 + }, + "replacedSnapshotHashes": [], + "numberOfEntities": 0, + "generationTimestamp": 1671126611185 + } + ] +} \ No newline at end of file diff --git a/openapi/components/schemas/content/200-snapshots.yaml b/openapi/components/schemas/content/200-snapshots.yaml new file mode 100644 index 0000000..3870515 --- /dev/null +++ b/openapi/components/schemas/content/200-snapshots.yaml @@ -0,0 +1,30 @@ +type: array +items: + required: + - hash + - timeRange + - replacedSnapshotHashes + - numberOfEntities + - generationTimestamp + type: object + properties: + hash: + type: string + timeRange: + required: + - initTimestamp + - endTimestamp + type: object + properties: + initTimestamp: + type: number + endTimestamp: + type: number + replacedSnapshotHashes: + type: array + items: + type: string + numberOfEntities: + type: number + generationTimestamp: + type: number diff --git a/openapi/content.yaml b/openapi/content.yaml index 3232f28..68c1ba5 100644 --- a/openapi/content.yaml +++ b/openapi/content.yaml @@ -62,5 +62,7 @@ paths: $ref: paths/content/content@pointer-changes.yaml /snapshot: $ref: 'paths/content/content@snapshot.yaml' + /snapshots: + $ref: 'paths/content/content@snapshots.yaml' /status: $ref: paths/content/content@status.yaml diff --git a/openapi/paths/content/content@snapshots.yaml b/openapi/paths/content/content@snapshots.yaml new file mode 100644 index 0000000..9de900c --- /dev/null +++ b/openapi/paths/content/content@snapshots.yaml @@ -0,0 +1,25 @@ +get: + operationId: getSnapshots + summary: Snapshots with a list of active entities + tags: + - Content Server + description: >- + Lists all active deployments stored in the database in multiple snapshots for different time ranges. + If the information needed is front in time of the most recent snapshot, you may use the + `/content/pointer-changes` endpoint with the necessary `from` filter. + responses: + '200': + description: >- + The result is a list of snapshots. Each "hash" field references the a snapshot with all the active entities that has an entity timestamp within the specified time range. + Each hash is a reference to a JSON file containing one line per entity in a JSON format. + Once you get the hashes you can download them using the + /content/contents/{hashId} endpoint. + content: + application/json; charset=utf-8: + schema: + $ref: ../../components/schemas/content/200-snapshots.yaml + examples: + default: + $ref: ../../components/examples/content/200-snapshots.json + '503': + description: New Snapshots not yet created