Commit c21dc052 authored by Daniel Perez's avatar Daniel Perez
Browse files

Moving swagger document to proper folder

parent e008f314
Pipeline #33819 passed with stages
in 5 minutes and 52 seconds
......@@ -24,9 +24,15 @@ info:
title: "Seismic Store Service"
version: "2.0.0"
description: "Seismic Domain Data Management APIs to store and manage seismic datasets ."
license:
name: "Apache 2.0"
url: "https://www.apache.org/licenses/LICENSE-2.0.html"
host: "api.evq.csp.slb.com"
basePath: "/seistore-svc/api/v3"
securityDefinitions:
authentication:
type: "apiKey"
name: "Authorization"
in: "header"
consumes:
- application/json
......
......@@ -16,7 +16,7 @@
"test-coverage": "env UTEST=true nyc mocha -r ts-node/register --reporter mocha-junit-reporter tests/utest/test.ts",
"test-automation": "npm run clean && npm install && npm run build && npm run test-coverage",
"test-e2e-parallel": "node ./tests/e2e/parallel/run_e2e_tests_parallel.js",
"copyStaticFiles": "copyfiles --error --up 1 ./src/swagger/swagger.yaml ./dist/",
"copyStaticFiles": "copyfiles --error --up 1 ./docs/api/seismic_dms_seistore_openapi.yaml ./dist/docs",
"postbuild": "npm run copyStaticFiles"
},
"nyc": {
......
......@@ -70,7 +70,7 @@ export class Server {
}
constructor() {
const swaggerDocument = YAML.load('./dist/swagger/swagger.yaml');
const swaggerDocument = YAML.load('./dist/docs/api/seismic_dms_seistore_openapi.yaml');
this.app = express();
this.app.use(bodyparser.urlencoded({ extended: false }));
......
# ***************************************************************************
# Copyright 2017 - 2020, Schlumberger
#
# Licensed under the Apache License, Version 2.0(the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ***************************************************************************
# ===========================================================================
# Endpoints Description
# ===========================================================================
swagger: "2.0"
info:
title: "Seismic Store Service"
version: "2.0.0"
description: "Seismic Domain Data Management APIs to store and manage seismic datasets ."
license:
name: "Apache 2.0"
url: "https://www.apache.org/licenses/LICENSE-2.0.html"
securityDefinitions:
authentication:
type: "apiKey"
name: "Authorization"
in: "header"
consumes:
- application/json
produces:
- application/json
schemes:
- https
# ===========================================================================
# Endpoints Paths Section
# ===========================================================================
paths:
# /api/v3/svcstatus:
# get:
# summary: "Seismic store service status (fast check)"
# description: "<ul><li>Return the seismic store service status.</li><li>Required roles: none</li></ul>"
# security:
# - api-key: []
# operationId: service-status
# tags:
# - General
# responses:
# 200:
# description: "service status"
# schema:
# type: string
# example: "service OK"
# /svcstatus/access:
# get:
# summary: "Seismic store service status"
# description: "<ul><li>Return the seismic store service status.</li><li>Required roles: none</li></ul>"
# operationId: service-status-check
# tags:
# - General
# responses:
# 200:
# description: "Seismic store service status"
# schema:
# $ref: '#/definitions/Status'
# 401:
# description: "Unauthorized"
# 403:
# description: "Forbidden"
/dataset/tenant/{tenantid}/subproject/{subprojectid}/dataset/{datasetid}:
post:
summary: "Register a new dataset"
description: "<ul><li>Register a new dataset in seismic store.</li><li>Required roles: subproject.admin, subproject.editor</li></ul>"
operationId: dataset-register
tags:
- Dataset
parameters:
- description: "Legal tag of the dataset"
in: header
name: ltag
type: string
required: false
default: "Slb-Private-USA-EHC"
- description: "Name of the tenant"
in: path
name: tenantid
required: true
type: string
default: "common"
- description: "Name of the subproject"
in: path
name: subprojectid
required: true
type: string
default: "carbon"
- description: "Hierarchical path of the dataset"
in: query
name: path
required: true
type: string
default: "a/b/c"
- description: "Name of the dataset"
in: path
name: datasetid
required: true
type: string
default: "slb-dataset"
- description: "Request body"
in: body
name: request body
required: false
schema:
$ref: "#/definitions/DatasetRegisterBody"
responses:
200:
description: "Registered dataset metadata"
schema:
$ref: "#/definitions/Dataset"
400:
description: "Bad request"
401:
description: "Unauthorized"
403:
description: "Forbidden"
404:
description: "Not found"
409:
description: "Conflict"
423:
description: "Locked"
get:
summary: "Retrieve a dataset"
description: "<ul><li>Return the dataset metadata from seismic store.</li><li>Required roles: subproject.admin, subproject.editor, subproject.viewer</li></ul>"
operationId: dataset-get
tags:
- Dataset
parameters:
- description: "Name of the tenant"
in: path
name: tenantid
required: true
default: common
type: string
- description: "Name of the subproject"
in: path
name: subprojectid
required: true
type: string
default: carbon
- description: "Hierarchical path of the dataset"
in: query
name: path
required: true
type: string
default: "a/b/c"
- description: "Name of the dataset"
in: path
name: datasetid
required: true
type: string
default: "slb-dataset"
- description: "Include the seismic storage metadata record if it exists"
in: query
name: seismicmeta
required: false
type: boolean
responses:
200:
description: "Metadata of the dataset"
schema:
$ref: "#/definitions/Dataset"
400:
description: "Bad request"
401:
description: "Unauthorized"
403:
description: "Forbidden"
404:
description: "Not found"
delete:
summary: "Delete a dataset"
description: "<ul><li>Delete a dataset in seismic store.</li><li>Required roles: subproject.admin, subproject.editor</li></ul>"
operationId: dataset-delete
tags:
- Dataset
parameters:
- description: "Name of the tenant"
in: path
name: tenantid
required: true
default: common
type: string
- description: "Name of the subproject"
in: path
name: subprojectid
required: true
type: string
default: carbon
- description: "Hierarchical path of the dataset"
in: query
name: path
required: true
type: string
default: "a/b/c"
- description: "Name of the dataset"
in: path
name: datasetid
required: true
type: string
default: "slb-dataset"
responses:
200:
description: "The resource was deleted successfully."
400:
description: "Bad request"
401:
description: "Unauthorized"
403:
description: "Forbidden"
404:
description: "Not found"
patch:
summary: "Patch the dataset metadata"
description: "<ul><li>Update the dataset meta information in seismic store or close(unlock) the dataset. If the endpoint is used without the close parameter, at least one body field is required or the endpoint will return an error.</li><li>Required roles: subproject.admin, subproject.editor</li><li>Patchable fields: <ul><li><b>dataset_new_name:</b> new name to use for the dataset (rename)</li><li><b>filemetadata:</b> this is a seistore specific field and describe how the physical data are stored in the cloud storage system (GCS/AzureContainer etc etc). This metadata is mainly used by client libraries to correctly reconstruct the dataset. For example you can store a dataset as truncated in multiple objects of 64MB each, name them from 0 to N and save the filemetadata = “{nOboject: N, totalSize: 1024, objsize: 64, sizeUnit: MB }”.</li><li><b>last_modified_date:</b> mark this field as true to update the dataset last modified date</li><li><b>gtags:</b> upsert tags to an existing dataset metadata. If the dataset metadata already has gtags, then new gtags are appended to this list.</li><li><b>ltag:</b> update the existing legalTag value</b></li><li><b>readonly:</b> update the dataset mode to readonly(true) or to read/write(false)</li><li><b>seismicmeta:</b> update the DataEcosystem storage metadata (refer to the DataEcosystem storage service tutorial for more help)</b></li></ul></li></ul>"
operationId: dataset-patch
tags:
- Dataset
parameters:
- description: "Name of the tenant"
in: path
name: tenantid
required: true
type: string
default: common
- description: "Name of the subproject"
in: path
name: subprojectid
required: true
type: string
default: carbon
- description: "Hierarchical path of the dataset"
in: query
name: path
required: true
type: string
default: a/b/c
- description: "Name of the dataset"
in: path
name: datasetid
required: true
type: string
default: slb-dataset
- description: "Request body"
in: body
name: request body
schema:
$ref: "#/definitions/DatasetPatch"
- description: "Non null sbit value of the dataset. Using this value here will close the dataset"
in: query
name: close
required: false
type: string
responses:
200:
description: "Metadata of the patched dataset"
schema:
$ref: "#/definitions/Dataset"
400:
description: "Bad request"
401:
description: "Unauthorized"
403:
description: "Forbidden"
404:
description: "Not found"
409:
description: "Conflict"
423:
description: "Locked"
/dataset/tenant/{tenantid}/subproject/{subprojectid}/dataset/{datasetid}/lock:
put:
summary: "Acquire a lock for a dataset id"
description: "<ul><li>Open a dataset for read or write and lock its state.</li><li>Required roles open lock for write: subproject.admin, subproject.editor</li><li>Required roles open lock for read: subproject.admin, subproject.editor, subproject.viewer</ul>"
operationId: dataset-lock
tags:
- Dataset
parameters:
- description: "Name of the tenant"
in: path
name: tenantid
required: true
type: string
default: common
- description: "Name of the subproject"
in: path
name: subprojectid
required: true
type: string
default: carbon
- description: "Hierarchical path of the dataset"
in: query
name: path
required: true
type: string
default: a/b/c
- description: "Name of the dataset"
in: path
name: datasetid
required: true
type: string
default: slb-dataset
- description: "Type of the lock which can be set to 'read' (default) or 'write'"
in: query
name: openmode
required: false
type: string
- description: "Session identifier issued for a previous write lock acquisition operation"
in: query
name: wid
required: false
type: number
responses:
200:
description: "Acquired a lock and the return value is the dataset metadata with session identifier stored in 'sbit' attribute"
schema:
$ref: "#/definitions/Dataset"
400:
description: "Bad request"
401:
description: "Unauthorized"
403:
description: "Forbidden"
404:
description: "Not found"
423:
description: "Locked"
/dataset/tenant/{tenantid}/subproject/{subprojectid}/dataset/{datasetid}/unlock:
put:
summary: "Remove the lock associated with a dataset id."
description: "<ul><li>Removes the lock for a dataset id.</li><li>Required roles: subproject.admin</li></ul>"
operationId: dataset-lock-rm
tags:
- Dataset
parameters:
- description: "Name of the tenant"
in: path
name: tenantid
required: true
type: string
default: common
- description: "Name of the subproject"
in: path
name: subprojectid
required: true
type: string
default: carbon
- description: "Hierarchical path for the dataset"
in: query
name: path
required: true
type: string
default: a/b/c
- description: "Name of the dataset"
in: path
name: datasetid
required: true
type: string
default: slb-dataset
responses:
200:
description: "Removed the lock value associated with dataset id"
400:
description: "Bad request"
401:
description: "Unauthorized"
403:
description: "Forbidden"
404:
description: "Not found"
423:
description: "Locked"
/dataset/tenant/{tenantid}/subproject/{subprojectid}/dataset/{datasetid}/permission:
get:
summary: "Retrieve the access permissions of a user on a dataset id."
description: "<ul><li>Retrieve the access permission of a user on a dataset.</li><li>Required roles: subproject.admin, subproject.editor, subproject.viewer</li></ul>"
operationId: dataset-permission
tags:
- Dataset
parameters:
- description: "Name of the tenant"
in: path
name: tenantid
required: true
type: string
default: common
- description: "Name of the subproject"
in: path
name: subprojectid
required: true
type: string
default: carbon
- description: "Hierarchical path for the dataset"
in: query
name: path
required: true
type: string
default: a/b/c
- description: "Name of the dataset"
in: path
name: datasetid
required: true
type: string
default: slb-dataset
responses:
200:
description: "User access permission on the dataset."
schema:
$ref: "#/definitions/DatasetPermission"
400:
description: "Bad request"
401:
description: "Unauthorized"
403:
description: "Forbidden"
404:
description: "Not found"
/dataset/tenant/{tenantid}/subproject/{subprojectid}/dataset/{datasetid}/ctagcheck:
get:
summary: "Validate if a dataset ctag matches the pre-existing ctag in metadata catalog."
description: "<ul><li>Check if the provided dataset cTag match the one stored in the metadata catalog.</li><li>Required roles: subproject.admin, subproject.editor, subproject.viewer</li></ul>"
operationId: ctag-check
tags:
- Dataset
parameters:
- description: "Name of the tenant"
in: path
name: tenantid
required: true
type: string
default: common
- description: "Name of the subproject"
in: path
name: subprojectid
required: true
type: string
default: carbon
- description: "Hierarchical path of the dataset"
in: query
name: path
required: true
type: string
default: a/b/c
- description: "Name of the dataset"
in: path
name: datasetid
required: true
type: string
default: slb-dataset
- description: "Ctag to be validated"
in: query
name: ctag
required: true
type: string
default: slb-dataset-ctag
responses:
200:
description: "Return true if the ctag is valid or false if it is invalid"
schema:
type: boolean
example: "true"
400:
description: "Bad request"
401:
description: "Unauthorized"
403:
description: "Forbidden"
404:
description: "Not found"
/dataset/tenant/{tenantid}/subproject/{subprojectid}/dataset/{datasetid}/gtags:
put:
summary: "Upsert tags to a dataset"
description: "<ul><li>Upsert tags to an existing dataset metadata. If the dataset metadata already has gtags, then new gtags are appended to this list.</li><li>Required roles: subproject.admin, subproject.editor</li></ul>"
operationId: add-tag
tags:
- Dataset
parameters:
- description: "Name of the tenant"
in: path
name: tenantid
required: true
type: string
default: common
- description: "Name of the subproject"
in: path
name: subprojectid
required: true
type: string
default: carbon
- description: "Hierarchical path of the dataset"
in: query
name: path
required: true
type: string
default: a/b/c
- description: "Name of the dataset"
in: path
name: datasetid
required: true
type: string
default: slb-dataset
- description: "Gtags array list"
in: query
name: gtag
required: true
type: array
items:
type: string
default: "tag1"
collectionFormat: multi
responses:
200:
description: "Gtags were upserted to the dataset metadata."
400:
description: "Bad request"
401:
description: "Unauthorized"
403:
description: "Forbidden"
404:
description: "Not found"
# To deprecate in favor of /utility/ls
# /dataset/tenant/{tenantid}/subproject/{subprojectid}/readdsdirfulllist:
# get:
# summary: "content list"
# description: "<ul><li>List datasets and sub-directories for a directory path.</li><li>Required roles: subproject.admin, subproject.editor, subproject.viewer</li></ul>"
# operationId: dataset-read-directory
# tags:
# - Dataset
# parameters: