Skip to content

Commit

Permalink
APPS-990 Add backup routine configuration (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
reugn authored Nov 16, 2023
1 parent 7f20f56 commit d6a23b8
Show file tree
Hide file tree
Showing 23 changed files with 780 additions and 213 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ issues:
- unparam
- prealloc
- funlen
- goconst
- path: pkg/shared
linters:
- typecheck
Expand Down
20 changes: 12 additions & 8 deletions cmd/backup/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ aerospike-clusters:
name: "cluster1"
host: "localhost"
port: 3000
user: "tester"
password: "psw"
# user: "tester"
# password: "psw"

storage:
local1:
Expand All @@ -14,16 +14,20 @@ storage:
path: "./testout"

backup-policies:
policy-daily:
name: "policy-daily"
policy1:
name: "policy1"
type: 1
parallel: 1
remove-files: false

backup-routines:
routine1:
name: "routine1"
interval: 30000
incr-interval: 5000
type: 1
backup-policy: "policy1"
source-cluster: "cluster1"
storage: "local1"
namespace: "test"
set-list:
- set1
parallel: 1
remove-files: false

37 changes: 22 additions & 15 deletions cmd/backup/config/minio_config.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
---
aerospike-cluster:
- name: "cluster1"
aerospike-clusters:
cluster1:
name: "cluster1"
host: "localhost"
port: 3000
# user: "tester"
# password: "psw"

backup-storage:
- name: "s3"
storage:
s3:
name: "s3"
type: 1
s3_endpoint_override: "http://localhost:9000"
s3_region: "eu-central-1"
s3_profile: "minio"
s3-endpoint_override: "http://localhost:9000"
s3-region: "eu-central-1"
s3-profile: "minio"
path: "s3://as-backup-bucket/test-backup"

backup-policy:
- name: "policy-daily"
interval: 30000
incr_interval: 5000
backup-policies:
policy1:
name: "policy1"
type: 1
source_cluster: "cluster1"
parallel: 1
remove-files: false

backup-routines:
routine1:
name: "routine1"
interval: 30000
incr-interval: 5000
backup-policy: "policy1"
source-cluster: "cluster1"
storage: "s3"
namespace: "test"
parallel: 1
remove_files: false

207 changes: 172 additions & 35 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,126 @@
}
}
},
"/config/routine": {
"get": {
"produces": [
"application/json"
],
"tags": [
"Configuration"
],
"summary": "Reads all routines from the configuration.",
"operationId": "readRoutines",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/model.BackupRoutine"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
},
"put": {
"consumes": [
"application/json"
],
"tags": [
"Configuration"
],
"summary": "Updates an existing routine in the configuration.",
"operationId": "updateRoutine",
"parameters": [
{
"description": "backup routine",
"name": "storage",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.BackupRoutine"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
},
"post": {
"consumes": [
"application/json"
],
"tags": [
"Configuration"
],
"summary": "Adds a backup routine to the config.",
"operationId": "addRoutine",
"parameters": [
{
"description": "backup routine",
"name": "storage",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/model.BackupRoutine"
}
}
],
"responses": {
"201": {
"description": "Created"
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
},
"delete": {
"tags": [
"Configuration"
],
"summary": "Deletes a backup routine from the configuration by name.",
"operationId": "deleteRoutine",
"parameters": [
{
"type": "string",
"description": "Routine Name",
"name": "name",
"in": "query",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
}
},
"/config/storage": {
"get": {
"produces": [
Expand Down Expand Up @@ -692,30 +812,15 @@
"model.BackupPolicy": {
"type": "object",
"properties": {
"after-digest": {
"type": "string"
},
"bandwidth": {
"type": "integer"
},
"bin-list": {
"type": "array",
"items": {
"type": "string"
}
},
"file-limit": {
"type": "integer"
},
"filter-exp": {
"type": "string"
},
"incr-interval": {
"type": "integer"
},
"interval": {
"type": "integer"
},
"max-records": {
"type": "integer"
},
Expand All @@ -725,9 +830,6 @@
"name": {
"type": "string"
},
"namespace": {
"type": "string"
},
"no-bins": {
"type": "boolean"
},
Expand All @@ -740,18 +842,9 @@
"no-udfs": {
"type": "boolean"
},
"node-list": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Node"
}
},
"parallel": {
"type": "integer"
},
"partition-list": {
"type": "string"
},
"records-per-second": {
"type": "integer"
},
Expand All @@ -764,26 +857,64 @@
"retry-delay": {
"type": "integer"
},
"set-list": {
"socket-timeout": {
"type": "integer"
},
"total-timeout": {
"type": "integer"
},
"type": {
"$ref": "#/definitions/model.BackupType"
}
}
},
"model.BackupRoutine": {
"type": "object",
"properties": {
"after-digest": {
"type": "string"
},
"backup-policy": {
"type": "string"
},
"bin-list": {
"type": "array",
"items": {
"type": "string"
}
},
"socket-timeout": {
"incr-interval": {
"type": "integer"
},
"source-cluster": {
"interval": {
"type": "integer"
},
"name": {
"type": "string"
},
"storage": {
"namespace": {
"type": "string"
},
"total-timeout": {
"type": "integer"
"node-list": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Node"
}
},
"type": {
"$ref": "#/definitions/model.BackupType"
"partition-list": {
"type": "string"
},
"set-list": {
"type": "array",
"items": {
"type": "string"
}
},
"source-cluster": {
"type": "string"
},
"storage": {
"type": "string"
}
}
},
Expand Down Expand Up @@ -813,6 +944,12 @@
"$ref": "#/definitions/model.BackupPolicy"
}
},
"backup-routines": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/model.BackupRoutine"
}
},
"service": {
"$ref": "#/definitions/model.HTTPServerConfig"
},
Expand Down
Loading

0 comments on commit d6a23b8

Please sign in to comment.