barruun 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/barruun/cli.rb +10 -2
- data/lib/barruun/configurations/bigquery/dataset.rb +19 -0
- data/lib/barruun/managers/bigquery/dataset.rb +20 -0
- data/lib/barruun/managers/logging/sink.rb +1 -1
- data/lib/barruun/managers/storage/bucket.rb +1 -1
- data/lib/barruun/managers/utils.rb +2 -2
- data/lib/barruun/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9decd7dacebba1fb4656151f53f93ffb9eb40e50d11cf2857d94f8c39a91dcb3
|
4
|
+
data.tar.gz: 288089cad737ee2aeab66e9ca916b0b06d8cc2418da2b9fe2a0560016b2a7be2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80b36585f4e4b397208992ea82ed2ab90ed98147b5a37535f419ddb5b24f06ce619be1533dfae3fffa0fe9da0f76986eca1a6769d3ca0a76dac33374bc75da41
|
7
|
+
data.tar.gz: e7b8efa49ae874feb0f6e72f3fbc45dff60923209a072a60dc74724972b65ec79d42e6c1f2bd1a4ade594b2651fa89e2e1185d631a0143e19d799c10f0c590d6
|
data/Gemfile.lock
CHANGED
data/lib/barruun/cli.rb
CHANGED
@@ -2,18 +2,25 @@ require "thor"
|
|
2
2
|
|
3
3
|
module Barruun
|
4
4
|
class StorageCommand < Thor
|
5
|
-
desc "bucket [FILEPATH]", "Create
|
5
|
+
desc "bucket [FILEPATH]", "Create bucket"
|
6
6
|
def bucket(file_path)
|
7
7
|
Barruun::Managers::Storage::Bucket.new(file_path).call
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
11
|
class LoggingCommand < Thor
|
12
|
-
desc "sink [FILEPATH]", "Create
|
12
|
+
desc "sink [FILEPATH]", "Create sink"
|
13
13
|
def sink(file_path)
|
14
14
|
Barruun::Managers::Logging::Sink.new(file_path).call
|
15
15
|
end
|
16
16
|
end
|
17
|
+
|
18
|
+
class BigqueryCommand < Thor
|
19
|
+
desc "dataset [FILEPATH]", "Create dataset"
|
20
|
+
def sink(file_path)
|
21
|
+
Barruun::Managers::Bigquery::Dataset.new(file_path).call
|
22
|
+
end
|
23
|
+
end
|
17
24
|
|
18
25
|
class CLI < Thor
|
19
26
|
def self.exit_on_failure?
|
@@ -22,5 +29,6 @@ module Barruun
|
|
22
29
|
|
23
30
|
register(StorageCommand, 'storage', 'storage <command>', 'Manage Cloud Storage')
|
24
31
|
register(LoggingCommand, 'logging', 'logging <command>', 'Manage Cloud Logging')
|
32
|
+
register(BigqueryCommand, 'bigquery', 'bigquery <command>', 'Manage BigQuery')
|
25
33
|
end
|
26
34
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Barruun
|
2
|
+
module Configurations
|
3
|
+
module Bigquery
|
4
|
+
class Dataset
|
5
|
+
def initialize(hash)
|
6
|
+
@hash = hash
|
7
|
+
end
|
8
|
+
|
9
|
+
def name
|
10
|
+
@hash["name"]
|
11
|
+
end
|
12
|
+
|
13
|
+
def options
|
14
|
+
@hash.reject { |k| ["name"].include?(k) }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative "../../configurations/bigquery/dataset"
|
2
|
+
require_relative "../utils"
|
3
|
+
|
4
|
+
module Barruun
|
5
|
+
module Managers
|
6
|
+
module Bigquery
|
7
|
+
class Dataset
|
8
|
+
include Barruun::Managers::Utils
|
9
|
+
|
10
|
+
def create
|
11
|
+
`bq #{location_string} mk --dataset #{options_string(@config.options)} #{@config.name}`
|
12
|
+
end
|
13
|
+
|
14
|
+
def exist?
|
15
|
+
`bq ls`.include?(@config.name)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -8,7 +8,7 @@ module Barruun
|
|
8
8
|
include Barruun::Managers::Utils
|
9
9
|
|
10
10
|
def create
|
11
|
-
`gcloud logging sinks create #{@config.name} #{@config.destination} #{options_string}`
|
11
|
+
`gcloud logging sinks create #{@config.name} #{@config.destination} #{options_string(@config.options)}`
|
12
12
|
end
|
13
13
|
|
14
14
|
def exist?
|
data/lib/barruun/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: barruun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cc-kawakami
|
@@ -60,8 +60,10 @@ files:
|
|
60
60
|
- exe/barruun
|
61
61
|
- lib/barruun.rb
|
62
62
|
- lib/barruun/cli.rb
|
63
|
+
- lib/barruun/configurations/bigquery/dataset.rb
|
63
64
|
- lib/barruun/configurations/logging/sink.rb
|
64
65
|
- lib/barruun/configurations/storage/bucket.rb
|
66
|
+
- lib/barruun/managers/bigquery/dataset.rb
|
65
67
|
- lib/barruun/managers/logging/sink.rb
|
66
68
|
- lib/barruun/managers/storage/bucket.rb
|
67
69
|
- lib/barruun/managers/utils.rb
|