elastic-backup-2s3 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.semver +1 -1
- data/README.org +25 -0
- data/elastic-backup-2s3.gemspec +3 -3
- data/lib/elastic-backup-2s3/cli.rb +1 -5
- data/lib/elastic-backup-2s3/cli/delete.rb +20 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce88a4000495304e331b13c81fbb02e29b1fea50
|
4
|
+
data.tar.gz: f957e71163f5701ec11f9ca70b4998a220ae5588
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a1e3fb34a55bde0c662bb799e50784626e3c5983751731ce896277fad790521d5d01efc3e805b70ddca9c1883b6855e3c460b99b28f1631f8603a9c04a3481f
|
7
|
+
data.tar.gz: 458f9185337abe0c1a9041ccf7edf3212c35f510926816b459b50e660e03683e6f0ce2723ba64eefc9ced98adc3bb0f7208f276e021716242a5a47e24345888d
|
data/.semver
CHANGED
data/README.org
CHANGED
@@ -26,6 +26,19 @@
|
|
26
26
|
itself and remove the registration if you did not
|
27
27
|
specify a name for the registration.
|
28
28
|
|
29
|
+
** Installation
|
30
|
+
|
31
|
+
To install from command line:
|
32
|
+
#+begin_src bash
|
33
|
+
gem install elastic-backup-2s3
|
34
|
+
#+end_src
|
35
|
+
|
36
|
+
For a Gemfile entry:
|
37
|
+
#+begin_src ruby
|
38
|
+
gem 'elastic-backup-2s3'
|
39
|
+
#+end_src
|
40
|
+
|
41
|
+
|
29
42
|
** TODO Documentation
|
30
43
|
Documentation is comming. Basically,
|
31
44
|
just running the command without any parameters
|
@@ -85,6 +98,18 @@
|
|
85
98
|
es-snapshot list indices localhost
|
86
99
|
#+END_SRC
|
87
100
|
|
101
|
+
** Release Notes
|
102
|
+
| Date | Version | Description |
|
103
|
+
|------------+---------+-------------------------------------------------------------------------|
|
104
|
+
| 2016-04-17 | v0.0.3 | Added a delete snapshot option to allow deletion of a running snapshot. |
|
105
|
+
| | | |
|
106
|
+
** Known Issues
|
107
|
+
| Date | Version | Description |
|
108
|
+
| 2061-04-17 | v0.0.3 | 'delete' options not fully implemented. |
|
109
|
+
| | | Error return codes not fully fleshed out |
|
110
|
+
| | | 'delete snapshot' requires the full S3URL, but only needs the snapshot part. |
|
111
|
+
| | | |
|
112
|
+
|
88
113
|
** Scratchpad
|
89
114
|
My own personal notes on this project. These
|
90
115
|
are not gauranteed to be useful to you nor
|
data/elastic-backup-2s3.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: elastic-backup-2s3 0.0.
|
5
|
+
# stub: elastic-backup-2s3 0.0.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "elastic-backup-2s3"
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.3"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Fred Mitchell"]
|
14
|
-
s.date = "2016-04-
|
14
|
+
s.date = "2016-04-17"
|
15
15
|
s.description = "\n I simply want to be able to control the backup and\n restoration of the Elasticsearch cluster to S3\n without any fuss or having to dilly around with\n curl -XPUTS and friends.\n\n So here it is, and I make no apologies about not \n supporting the \"shared volume\" option of Elasticsearch\n snapshots. I may add support at a later date. Or\n feel free to add it and do a pull request.\n\n There are many features I wish to add to this, and\n if you have any suggestions, please feel free to send\n them my way!"
|
16
16
|
s.email = "fred.mitchell@gmx.de"
|
17
17
|
s.executables = ["es-snapshot"]
|
@@ -47,11 +47,7 @@ module ElasticBackup
|
|
47
47
|
Snapshot.restore s3url, Snapshot.esurl(suri: es), options
|
48
48
|
end
|
49
49
|
|
50
|
-
desc '
|
51
|
-
def monitor
|
52
|
-
end
|
53
|
-
|
54
|
-
desc 'delete', 'Not Implemented Yet -- Delete snapshots, indicies, registrations'
|
50
|
+
desc 'delete', 'Delete snapshots and repositories'
|
55
51
|
subcommand 'delete', Delete
|
56
52
|
|
57
53
|
desc 'list', 'list indicies, snapshots'
|
@@ -1,8 +1,27 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
module ElasticBackup
|
2
3
|
module Cli
|
3
4
|
class Delete < Thor
|
5
|
+
desc 'snapshot [ES S3URL]', 'Delete a snapshot or kill one in progress.'
|
6
|
+
option :repo, type: :string,
|
7
|
+
aliases: '-r',
|
8
|
+
banner: "[NAME]",
|
9
|
+
default: 'elastic-backup',
|
10
|
+
desc: "Repository name to use."
|
11
|
+
def snapshot es, s3url
|
12
|
+
esurl = Snapshot.esurl suri: es
|
13
|
+
puts "deleting snapshot at #{esurl}" unless options[:verbose] < 1
|
14
|
+
cli = Snapshot.elastic esurl
|
15
|
+
_bucket_name, _path, snapshot = Snapshot.s3url_splice s3url
|
16
|
+
result = MultiJson.load cli.snapshot.delete(repository: options[:repo],
|
17
|
+
snapshot: snapshot)
|
18
|
+
ap result unless options[:verbose] < 1
|
19
|
+
if result['status'] == 404
|
20
|
+
puts "Snapshot #{snapshot} does not exist."
|
21
|
+
exit 1
|
22
|
+
end
|
23
|
+
end
|
4
24
|
|
5
25
|
end
|
6
26
|
end
|
7
27
|
end
|
8
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elastic-backup-2s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fred Mitchell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: semver
|