Commit 198a35df authored by ethiraj krishnamanaidu's avatar ethiraj krishnamanaidu
Browse files

Merge branch 'master' into trusted-ado-codemerge

parents 8145b466 24edd061
Pipeline #1042 canceled with stages
swagger: "2.0"
info:
description: "Storage service which handles the metadata ingestion in the OSDU\
\ ecosystem"
version: "2.0.0"
title: "Storage APIs"
contact:
name: "OSDU Data Platform Tesm team"
email: "dps@[OSDU].org"
host: "storage-[OSDU].appspot.com"
basePath: "/api/storage/v2"
tags:
- name: "records"
description: "Records management operations."
- name: "schemas"
description: "Schema management"
- name: "query"
description: "Record queries"
schemes:
- "https"
consumes:
- "application/json"
produces:
- "application/json"
paths:
/query/kinds:
get:
tags:
- "query"
summary: "Get all kinds"
description: "The API returns a list of all kinds in the specific {Account-Id}.\
\ Allowed roles: service.storage.admin."
operationId: "Get all kinds"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "cursor"
in: "query"
description: "Cursor"
required: false
type: "string"
- name: "limit"
in: "query"
description: "Page Size"
required: false
type: "integer"
default: 10
format: "int32"
- name: "OSDU-Account-Id"
in: "header"
description: "Account ID is the active account\
\ account) which the users choose to use with the Search API."
required: true
type: "string"
default: "tenant1"
- name: "OSDU-On-Behalf-Of"
in: "header"
description: "On behalf email or token is the token/email of the original\
\ user making the call. For now, only email is supported but eventually,\
\ primary usage will be token."
required: false
type: "string"
responses:
200:
description: "All kinds retrieved successfully."
schema:
$ref: "#/definitions/DatastoreQueryResult"
500:
description: "Unknown Error."
schema:
$ref: "#/definitions/AppError"
security:
- datalake_auth:
- "email"
- Bearer: []
/query/records:
get:
tags:
- "query"
summary: "Get all record from kind"
description: "The API returns a list of all record ids which belong to the specified\
\ kind. Allowed roles: service.storage.admin."
operationId: "Get all record from kind"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "cursor"
in: "query"
description: "Cursor"
required: false
type: "string"
- name: "limit"
in: "query"
description: "Page Size"
required: false
type: "integer"
default: 10
format: "int32"
- name: "kind"
in: "query"
description: "Filter Kind"
required: false
type: "string"
default: "tenant1:public:well:1.0.2"
- name: "OSDU-Account-Id"
in: "header"
description: "Account ID is the active OSDU account (OSDU account or customer's\
\ account) which the users choose to use with the Search API."
required: true
type: "string"
default: "tenant1"
- name: "OSDU-On-Behalf-Of"
in: "header"
description: "On behalf email or token is the token/email of the original\
\ user making the call. For now, only email is supported but eventually,\
\ primary usage will be token."
required: false
type: "string"
responses:
200:
description: "Record Ids retrieved successfully."
schema:
$ref: "#/definitions/DatastoreQueryResult"
404:
description: "Kind or cursor not found."
schema:
$ref: "#/definitions/AppError"
security:
- datalake_auth:
- "email"
- Bearer: []
post:
tags:
- "query"
summary: "Fetch records"
description: "The API fetches multiple records at once. Allowed roles: service.storage.viewer,\
\ service.storage.creator and service.storage.admin."
operationId: "Fetch records"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
required: false
schema:
$ref: "#/definitions/MultiRecordIds"
- name: "OSDU-Account-Id"
in: "header"
description: "Account ID is the active OSDU account (OSDU account or customer's\
\ account) which the users choose to use with the Search API."
required: true
type: "string"
default: "tenant1"
- name: "OSDU-On-Behalf-Of"
in: "header"
description: "On behalf email or token is the token/email of the original\
\ user making the call. For now, only email is supported but eventually,\
\ primary usage will be token."
required: false
type: "string"
responses:
200:
description: "Fetch multiple records successfully."
schema:
$ref: "#/definitions/MultiRecordIds"
500:
description: "Unknown storage error."
schema:
$ref: "#/definitions/AppError"
security:
- datalake_auth:
- "email"
- Bearer: []
/records/{id}:delete:
post:
tags:
- "records"
summary: "Delete record"
description: "The API performs a logical deletion of the given record. This\
\ operation can be reverted later. Allowed roles: service.storage.creator\
\ and service.storage.admin."
operationId: "Delete record"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "id"
in: "path"
description: "Record id"
required: true
type: "string"
default: "tenant1:well:123456789"
- name: "OSDU-Account-Id"
in: "header"
description: "Account ID is the active OSDU account (OSDU account or customer's\
\ account) which the users choose to use with the Search API."
required: true
type: "string"
default: "tenant1"
- name: "OSDU-On-Behalf-Of"
in: "header"
description: "On behalf email or token is the token/email of the original\
\ user making the call. For now, only email is supported but eventually,\
\ primary usage will be token."
required: false
type: "string"
responses:
204:
description: "Record deleted successfully."
404:
description: "Record not found."
schema:
$ref: "#/definitions/AppError"
security:
- datalake_auth:
- "email"
- Bearer: []
/records/{id}:
get:
tags:
- "records"
summary: "Get record"
description: "This API returns the latest version of the given record. Allowed\
\ roles: service.storage.viewer, service.storage.creator and service.storage.admin."
operationId: "Get record"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "id"
in: "path"
description: "Record id"
required: true
type: "string"
default: "tenant1:well:123456789"
- name: "attribute"
in: "query"
description: "Filter attributes to restrict the returned fields of the record.\
\ Usage: data.{record-data-field-name}."
required: false
type: "array"
items:
type: "string"
default: "data.wellName"
collectionFormat: "multi"
- name: "OSDU-Account-Id"
in: "header"
description: "Account ID is the active OSDU account (OSDU account or customer's\
\ account) which the users choose to use with the Search API."
required: true
type: "string"
default: "tenant1"
- name: "OSDU-On-Behalf-Of"
in: "header"
description: "On behalf email or token is the token/email of the original\
\ user making the call. For now, only email is supported but eventually,\
\ primary usage will be token."
required: false
type: "string"
responses:
200:
description: "Record retrieved successfully."
schema:
$ref: "#/definitions/RecordData"
404:
description: "Record not found."
schema:
$ref: "#/definitions/AppError"
security:
- datalake_auth:
- "email"
- Bearer: []
delete:
tags:
- "records"
summary: "Purge record"
description: "The API performs the physical deletion of the given record and\
\ all of its versions. This operation cannot be undone. Allowed roles: service.storage.admin."
operationId: "Purge record"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "id"
in: "path"
description: "Record id"
required: true
type: "string"
default: "tenant1:well:123456789"
- name: "OSDU-Account-Id"
in: "header"
description: "Account ID is the active OSDU account (OSDU account or customer's\
\ account) which the users choose to use with the Search API."
required: true
type: "string"
default: "tenant1"
- name: "OSDU-On-Behalf-Of"
in: "header"
description: "On behalf email or token is the token/email of the original\
\ user making the call. For now, only email is supported but eventually,\
\ primary usage will be token."
required: false
type: "string"
responses:
204:
description: "Record purged successfully."
404:
description: "Record not found."
schema:
$ref: "#/definitions/AppError"
security:
- datalake_auth:
- "email"
- Bearer: []
/records/{id}/{version}:
get:
tags:
- "records"
summary: "Get record version"
description: "The API retrieves the specific version of the given record. Allowed\
\ roles: service.storage.viewer, service.storage.creator and service.storage.admin."
operationId: "Get record version"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "id"
in: "path"
description: "Record id"
required: true
type: "string"
- name: "version"
in: "path"
description: "Record version"
required: true
type: "integer"
default: 123456789
format: "int64"
- name: "attribute"
in: "query"
description: "Filter attributes to restrict the returned fields of the record.\
\ Usage: data.{record-data-field-name}."
required: false
type: "array"
items:
type: "string"
default: "data.wellName"
collectionFormat: "multi"
- name: "OSDU-Account-Id"
in: "header"
description: "Account ID is the active OSDU account (OSDU account or customer's\
\ account) which the users choose to use with the Search API."
required: true
type: "string"
default: "tenant1"
- name: "OSDU-On-Behalf-Of"
in: "header"
description: "On behalf email or token is the token/email of the original\
\ user making the call. For now, only email is supported but eventually,\
\ primary usage will be token."
required: false
type: "string"
responses:
200:
description: "Record retrieved successfully."
schema:
$ref: "#/definitions/RecordData"
404:
description: "Record id or version not found."
schema:
$ref: "#/definitions/AppError"
security:
- datalake_auth:
- "email"
- Bearer: []
/records/versions/{id}:
get:
tags:
- "records"
summary: "Get all record versions"
description: "The API returns a list containing all versions for the given record\
\ id. Allowed roles: service.storage.viewer, service.storage.creator and service.storage.admin."
operationId: "Get all record versions"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "id"
in: "path"
description: "Record id"
required: true
type: "string"
default: "tenant1:well:123456789"
- name: "OSDU-Account-Id"
in: "header"
description: "Account ID is the active OSDU account (OSDU account or customer's\
\ account) which the users choose to use with the Search API."
required: true
type: "string"
default: "tenant1"
- name: "OSDU-On-Behalf-Of"
in: "header"
description: "On behalf email or token is the token/email of the original\
\ user making the call. For now, only email is supported but eventually,\
\ primary usage will be token."
required: false
type: "string"
responses:
200:
description: "Record versions retrieved successfully."
schema:
$ref: "#/definitions/RecordVersions"
404:
description: "Record id or version not found."
schema:
$ref: "#/definitions/AppError"
security:
- datalake_auth:
- "email"
- Bearer: []
/records:
put:
tags:
- "records"
summary: "Create or update records"
description: "The API represents the main injection mechanism into the Data\
\ Lake. It allows records creation and/or update. When no record id is provided\
\ or when the provided id is not already present in the Data Lake then a new\
\ record is created. If the id is related to an existing record in the Data\
\ Lake then an update operation takes place and a new version of the record\
\ is created. Allowed roles: service.storage.creator and service.storage.admin."
operationId: "Create or update records"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "skipdupes"
in: "query"
description: "Skip duplicates when updating records with the same value."
required: false
type: "boolean"
default: true
- in: "body"
name: "body"
required: false
schema:
type: "array"
items:
$ref: "#/definitions/Record"
- name: "OSDU-Account-Id"
in: "header"
description: "Account ID is the active OSDU account (OSDU account or customer's\
\ account) which the users choose to use with the Search API."
required: true
type: "string"
default: "tenant1"
- name: "OSDU-On-Behalf-Of"
in: "header"
description: "On behalf email or token is the token/email of the original\
\ user making the call. For now, only email is supported but eventually,\
\ primary usage will be token."
required: false
type: "string"
responses:
201:
description: "Records created and/or updated successfully."
schema:
$ref: "#/definitions/Record"
400:
description: "Invalid record format."
schema:
$ref: "#/definitions/AppError"
404:
description: "Invalid acl group."
schema:
$ref: "#/definitions/AppError"
403:
description: "User not authorized to perform the action."
schema:
$ref: "#/definitions/AppError"
security:
- datalake_auth:
- "email"
- Bearer: []
/schemas/{kind}:
get:
tags:
- "schemas"
summary: "Get schema"
description: "The API returns the schema specified byt the given kind, which\
\ must follow the naming convention {OSDU-Account-Id}:{dataset}:{type}:{version}.\
\ Allowed roles: service.storage.viewer, service.storage.creator and service.storage.admin."
operationId: "Get schema"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "kind"
in: "path"
description: "Kind"
required: true
type: "string"
default: "tenant1:public:well:1.0.2"
- name: "OSDU-Account-Id"
in: "header"
description: "Account ID is the active OSDU account (OSDU account or customer's\
\ account) which the users choose to use with the Search API."
required: true
type: "string"
default: "tenant1"
- name: "OSDU-On-Behalf-Of"
in: "header"
description: "On behalf email or token is the token/email of the original\
\ user making the call. For now, only email is supported but eventually,\
\ primary usage will be token."
required: false
type: "string"
responses:
200:
description: "Schema obtained successfully."
schema:
$ref: "#/definitions/Schema"
400:
description: "Bad request."
schema:
$ref: "#/definitions/AppError"
404:
description: "Schema not found for specified kind."
schema:
$ref: "#/definitions/AppError"
security:
- datalake_auth:
- "email"
- Bearer: []
delete:
tags:
- "schemas"
summary: "Delete a schema"
description: "Allowed roles: service.storage.admin. Delete a schema by kind\
\ in {OSDU-Account-Id}:{dataset}:{type}:{version} format."
operationId: "Delete a schema"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- name: "kind"
in: "path"
description: "Kind"
required: true
type: "string"
default: "tenant1:public:well:1.0.2"
- name: "OSDU-Account-Id"
in: "header"
description: "Account ID is the active OSDU account (OSDU account or customer's\
\ account) which the users choose to use with the Search API."
required: true
type: "string"
default: "tenant1"
- name: "OSDU-On-Behalf-Of"
in: "header"
description: "On behalf email or token is the token/email of the original\
\ user making the call. For now, only email is supported but eventually,\
\ primary usage will be token."
required: false
type: "string"
responses:
204:
description: "Schema deleted successfully."
400:
description: "Bad request."
schema:
$ref: "#/definitions/AppError"
404:
description: "Schema not found."