Commit 68626278 authored by Anastasiia Gelmut's avatar Anastasiia Gelmut
Browse files

Merge branch 'integration-master' into feature/GONRG-1734_Audit_Impl

parents 9a9f9841 51b1f8f1
......@@ -7,7 +7,7 @@
<parent>
<artifactId>backup-service</artifactId>
<groupId>org.opengroup.osdu</groupId>
<version>0.0.1</version>
<version>0.0.2</version>
<relativePath>../pom.xml</relativePath>
</parent>
......@@ -18,7 +18,7 @@
<artifactId>backup-core</artifactId>
<description>Backup service Core on GCP</description>
<version>0.0.1</version>
<version>0.0.2</version>
<dependencies>
<dependency>
......
openapi: 3.0.1
info:
title: Backup Service
description: "Backup service provide a set of APIs to schedule backups for different\
\ Assets (Datastore, Storage, ElasticSearch, etc depends on which currently implemented\
\ ), \nlist registered Schedules, list available Backups, restore Asset state\
\ from Backup."
version: "1.0"
servers:
- url: http://localhost:8080/api/backup/v1
description: Generated server url
security:
- JWT: []
paths:
/collection:
post:
tags:
- backup-collection-api
operationId: createCollection
parameters:
- name: data-partition-id
in: header
description: Tenant Id
required: true
examples:
opendes:
description: Tenant Id
value: opendes
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/BackupCollection'
required: true
responses:
"200":
description: OK
content:
'*/*':
schema:
$ref: '#/components/schemas/BackupCollection'
/collection/{collectionName}:
get:
tags:
- backup-collection-api
operationId: getCollectionConfig
parameters:
- name: collectionName
in: path
required: true
schema:
type: string
- name: data-partition-id
in: header
description: Tenant Id
required: true
examples:
opendes:
description: Tenant Id
value: opendes
responses:
"200":
description: OK
content:
'*/*':
schema:
$ref: '#/components/schemas/BackupCollection'
put:
tags:
- backup-collection-api
operationId: updateCollection
parameters:
- name: collectionName
in: path
required: true
schema:
type: string
- name: data-partition-id
in: header
description: Tenant Id
required: true
examples:
opendes:
description: Tenant Id
value: opendes
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/BackupCollection'
required: true
responses:
"200":
description: OK
content:
'*/*':
schema:
$ref: '#/components/schemas/BackupCollection'
delete:
tags:
- backup-collection-api
operationId: deleteCollection
parameters:
- name: collectionName
in: path
required: true
schema:
type: string
- name: data-partition-id
in: header
description: Tenant Id
required: true
examples:
opendes:
description: Tenant Id
value: opendes
responses:
"200":
description: OK
content:
'*/*':
schema:
type: string
/collection/list:
get:
tags:
- backup-collection-api
operationId: listCollections
parameters:
- name: data-partition-id
in: header
description: Tenant Id
required: true
examples:
opendes:
description: Tenant Id
value: opendes
responses:
"200":
description: OK
content:
'*/*':
schema:
type: array
items:
$ref: '#/components/schemas/BackupCollection'
/collection/states/{collectionName}:
get:
tags:
- backup-collection-api
operationId: getCollectionStates
parameters:
- name: collectionName
in: path
required: true
schema:
type: string
- name: success
in: query
required: false
schema:
type: string
- name: data-partition-id
in: header
description: Tenant Id
required: true
examples:
opendes:
description: Tenant Id
value: opendes
responses:
"200":
description: OK
content:
'*/*':
schema:
type: array
items:
$ref: '#/components/schemas/CollectionState'
/collection/restore/{stateId}:
patch:
tags:
- backup-collection-api
operationId: restoreCollection
parameters:
- name: stateId
in: path
required: true
schema:
type: string
- name: data-partition-id
in: header
description: Tenant Id
required: true
examples:
opendes:
description: Tenant Id
value: opendes
responses:
"200":
description: OK
content:
'*/*':
schema:
$ref: '#/components/schemas/CollectionState'
/health/liveness_check:
get:
tags:
- health-check-api
operationId: livenessCheck
parameters:
- name: data-partition-id
in: header
description: Tenant Id
required: true
examples:
opendes:
description: Tenant Id
value: opendes
responses:
"200":
description: OK
content:
'*/*':
schema:
type: string
/health/readiness_check:
get:
tags:
- health-check-api
operationId: readinessCheck
parameters:
- name: data-partition-id
in: header
description: Tenant Id
required: true
examples:
opendes:
description: Tenant Id
value: opendes
responses:
"200":
description: OK
content:
'*/*':
schema:
type: string
components:
schemas:
BackupCollection:
required:
- active
- collectionName
- interval
- lifetime
- scheduleSet
type: object
properties:
collectionId:
type: string
collectionName:
type: string
active:
type: boolean
interval:
type: integer
format: int32
lifetime:
type: integer
format: int32
scheduleSet:
uniqueItems: true
type: array
items:
$ref: '#/components/schemas/BackupSchedule'
BackupSchedule:
type: object
properties:
scheduleId:
type: string
assetType:
type: string
enum:
- DATASTORE
- SQL
assetContext:
type: object
additionalProperties:
type: string
BackupStamp:
type: object
properties:
stampId:
type: string
assetType:
type: string
enum:
- DATASTORE
- SQL
success:
type: boolean
assetContext:
type: object
additionalProperties:
type: string
CollectionState:
type: object
properties:
stateId:
type: string
collectionId:
type: string
backupStamps:
type: array
items:
$ref: '#/components/schemas/BackupStamp'
creationDate:
type: string
format: date-time
stateStatus:
type: string
enum:
- SUCCESS
- PARTIAL_SUCCESS
- FAILED
securitySchemes:
JWT:
type: http
name: Authorization
in: header
scheme: bearer
bearerFormat: JWT
{
"openapi": "3.0.1",
"info": {
"title": "Backup Service",
"description": "Backup service provide a set of APIs to schedule backups for different Assets (Datastore, Storage, ElasticSearch, etc depends on which currently implemented ), \nlist registered Schedules, list available Backups, restore Asset state from Backup.",
"version": "1.0"
},
"servers": [
{
"url": "http://localhost:8080/api/backup/v1",
"description": "Generated server url"
}
],
"security": [
{
"JWT": []
}
],
"paths": {
"/list_backups": {
"get": {
"tags": [
"backup-api"
],
"operationId": "listBackups",
"parameters": [
{
"name": "data-partition-id",
"in": "header",
"description": "Tenant Id",
"required": true,
"examples": {
"opendes": {
"description": "Tenant Id",
"value": "opendes"
}
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/components/schemas/BackupStamp"
}
}
}
}
}
}
}
}
},
"/backup_import": {
"post": {
"tags": [
"backup-api"
],
"operationId": "submitImport",
"parameters": [
{
"name": "data-partition-id",
"in": "header",
"description": "Tenant Id",
"required": true,
"examples": {
"opendes": {
"description": "Tenant Id",
"value": "opendes"
}
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BackupImportRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/BackupStamp"
}
}
}
}
}
}
},
"/list_schedules": {
"get": {
"tags": [
"backup-api"
],
"operationId": "listSchedules",
"parameters": [
{
"name": "data-partition-id",
"in": "header",
"description": "Tenant Id",
"required": true,
"examples": {
"opendes": {
"description": "Tenant Id",
"value": "opendes"
}
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/BackupSchedule"
}
}
}
}
}
}
}
},
"/schedule": {
"get": {
"tags": [
"backup-api"
],
"operationId": "getScheduleById",
"parameters": [
{
"name": "id",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "data-partition-id",
"in": "header",
"description": "Tenant Id",
"required": true,
"examples": {
"opendes": {
"description": "Tenant Id",
"value": "opendes"
}
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/BackupSchedule"
}
}
}
}
}
},
"put": {
"tags": [
"backup-api"
],
"operationId": "updateBackupSchedule",
"parameters": [
{
"name": "data-partition-id",
"in": "header",
"description": "Tenant Id",
"required": true,
"examples": {
"opendes": {
"description": "Tenant Id",
"value": "opendes"
}
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BackupSchedule"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/BackupSchedule"
}
}
}
}
}
},
"post": {
"tags": [
"backup-api"
],
"operationId": "submitBackupSchedule",
"parameters": [
{
"name": "data-partition-id",
"in": "header",
"description": "Tenant Id",
"required": true,
"examples": {
"opendes": {
"description": "Tenant Id",
"value": "opendes"
}
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BackupSchedule"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/BackupSchedule"
}
}
}