zillabyte-cli 0.9.21 → 0.9.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OGNjNWZjOTI0NzM5OTA3Y2MwZGQ2NDZiOTEwZTJjMmVlOTU4ZGM5NQ==
4
+ MWQ4ZWI4NzhhMTU4NmM2MjhlMjUxYjEyMmRiNjY1ZGU3YWQ0M2U1Yw==
5
5
  data.tar.gz: !binary |-
6
- MmE5ZjA2ZDM5Njc2ZGY2Y2FhMzA0NTEyMGI1MTIxYTZjYmFjOTgyMg==
6
+ NjI4NDE3ZWZjNmZlYmZjNDFlOWM4NmJkZjlkY2Q4ZjIzZmRlZGUzMA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjhhMTNlMjgwYTM3YjY0OTU3OWE3ZmUwMTQzN2QzMDRkMDA5NTZlODU2MmEw
10
- NjVmZWJhODAwNjcxNmY4ZGRmNTA0N2ZmM2ExYTQ2ODNiNWRhNzVlNjhkNzhm
11
- NGU0ODExNjBjMzYxNTZhYzVhZWY1MDJhM2VmZjZlNWFkNDI3Nzk=
9
+ NzI3OGZiOTEzMWUzNGZhYzIyMmFhODJmNWYwZTRmNDA1MTY1MjRiNDY0ODc0
10
+ NGM2MzE2ZmVhNWU5OTg2NjE5ODk1N2EzYTg3N2QwNjFjYjllNTIyNjZiMmQy
11
+ MDIyYTM2ZjA1NjI5YWJmZDAyYTg3YjljNmFjOGViNzNjYmY2OWE=
12
12
  data.tar.gz: !binary |-
13
- MjczNTMzZDBlMDM1OTZmNjkyODI1MGJiZmI5ZDU5NTVjNmIyZDMwNWM1ZGNk
14
- NjAzM2ZlYWMwYjhjZGE3NDUzYWMwYjQ0NzAzYzBhMjNhNTFlZjViNTZkM2Zj
15
- ZTRmZDAzMWNlM2M1NDBlZTEwMTAzMmQzN2UzOWViN2NjNjY5Mzg=
13
+ NTRiYTI5MjJhNmE5MDk2YTVlZWFjYjAyZTA0YmY5OTcyMWI4ZDhlZjFlZjZi
14
+ NjhiMTRkNTc0ODY2NjA2NDVjMjlhZGJmYmM4ZWM5MWRkNzBhMmUxMjBkMzc2
15
+ MjE1MGRmYjliNzVmZGJiZTZkMGYyMGUwMTIyNzQ5OTJjNzE4ZmE=
@@ -1,5 +1,5 @@
1
1
  module Zillabyte
2
2
  module CLI
3
- VERSION = "0.9.21"
3
+ VERSION = "0.9.22"
4
4
  end
5
5
  end
@@ -291,6 +291,46 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Flows
291
291
  end
292
292
 
293
293
 
294
+
295
+
296
+ # apps:cron PERIOD
297
+ #
298
+ # Schedules the app to run on a reocurring basis. Period must be of the form 'every N (minutes|hours|days|weeks)'
299
+ #
300
+ # --id ID # The app id. Otherwise, use infer from current directory
301
+ #
302
+ def cron
303
+
304
+ flow_id = options[:id]
305
+ if flow_id.nil?
306
+ flow_id = read_name_from_conf(options)
307
+ end
308
+ period = options[:period] || shift_argument
309
+
310
+ error("no id given", type) if flow_id.nil?
311
+ error("no period given", type) if period.nil?
312
+
313
+ options = {
314
+ :period => period
315
+ }
316
+
317
+ res = api.request(
318
+ :expects => 200,
319
+ :method => :post,
320
+ :path => "/apps/#{CGI.escape(flow_id)}/cron",
321
+ :body => options.to_json
322
+ ).body
323
+
324
+ if res["error"]
325
+ display res['error_message']
326
+ else
327
+ display "App schedule to run on #{res['next_run']}"
328
+ end
329
+
330
+ end
331
+ alias_command "cron", "apps:cron"
332
+
333
+
294
334
  # apps:kill ID
295
335
  #
296
336
  # Kills the given app.
@@ -302,6 +342,19 @@ class Zillabyte::Command::Apps < Zillabyte::Command::Flows
302
342
  super
303
343
  end
304
344
 
345
+
346
+ # apps:authorize [ID] [SCOPE]
347
+ #
348
+ # changes permission of the flow
349
+ #
350
+ # --id ID # The dataset id
351
+ # --public # Makes the flow public (default)
352
+ # --private # Makes the flow private
353
+ #
354
+ def authorize
355
+ super
356
+ end
357
+
305
358
 
306
359
  # apps:live_run [OPERATION_NAME] [PIPE_NAME] [DIR]
307
360
  #
@@ -185,7 +185,18 @@ class Zillabyte::Command::Components < Zillabyte::Command::Flows
185
185
  def live_run
186
186
  super
187
187
  end
188
-
188
+
189
+
190
+ # components:authorize [ID] [SCOPE]
191
+ #
192
+ # changes permission of the flow
193
+ #
194
+ # --id ID # The dataset id
195
+ # --public # Makes the flow public (default)
196
+ # --private # Makes the flow private
197
+ #
198
+ def authorize
199
+ end
189
200
 
190
201
  # components:push [DIR]
191
202
  #
@@ -172,6 +172,43 @@ class Zillabyte::Command::Data < Zillabyte::Command::Base
172
172
 
173
173
 
174
174
 
175
+ # data:authorize [ID] [SCOPE]
176
+ #
177
+ # changes permission on the dataset
178
+ #
179
+ # --id ID # The dataset id
180
+ # --public # Makes the dataset public (default)
181
+ # --private # Makes the dataset private
182
+ #
183
+ def authorize
184
+
185
+ id = options[:id] || shift_argument
186
+ scope = options[:scope] || shift_argument || "public"
187
+ make_public = options[:public]
188
+ make_private = options[:private]
189
+
190
+ error("no id given", type) if id.nil?
191
+ error("both --public and --private cannot be given", type) if make_public && make_private
192
+ if make_private
193
+ scope = "private"
194
+ end
195
+
196
+ res = self.api.request(
197
+ :expects => 200,
198
+ :method => :post,
199
+ :path => "/relations/#{CGI.escape(id)}/authorizations",
200
+ :body => {:scope => scope}.to_json
201
+ ).body
202
+
203
+ display "Authorization updated"
204
+ end
205
+ alias_command "data:publicize", "data:authorize"
206
+ alias_command "data:public", "data:authorize"
207
+ alias_command "data:auth", "data:authorize"
208
+
209
+
210
+
211
+
175
212
  # data:readme ID FILE
176
213
  #
177
214
  # Attaches a README file to a dataset
@@ -191,7 +228,7 @@ class Zillabyte::Command::Data < Zillabyte::Command::Base
191
228
  :method => :post,
192
229
  :path => "/relations/#{CGI.escape(id)}/readme",
193
230
  :body => {:filename => file, :content => content}.to_json
194
- )
231
+ ).body
195
232
 
196
233
  display "README updated"
197
234
  end
@@ -140,6 +140,47 @@ class Zillabyte::Command::Flows < Zillabyte::Command::Base
140
140
  alias_command "push", "flows:push"
141
141
 
142
142
 
143
+
144
+
145
+
146
+ # flows:authorize [ID] [SCOPE]
147
+ #
148
+ # changes permission of the flow
149
+ #
150
+ # --id ID # The dataset id
151
+ # --public # Makes the flow public (default)
152
+ # --private # Makes the flow private
153
+ #
154
+ def authorize
155
+
156
+ id = options[:id] || shift_argument
157
+ if id.nil?
158
+ id = read_name_from_conf(options)
159
+ end
160
+ make_public = options[:public]
161
+ make_private = options[:private]
162
+
163
+ error("no id given", type) if id.nil?
164
+ error("both --public and --private cannot be given", type) if make_public && make_private
165
+ scope = "public"
166
+ if make_private
167
+ scope = "private"
168
+ end
169
+
170
+ res = self.api.request(
171
+ :expects => 200,
172
+ :method => :post,
173
+ :path => "/flows/#{CGI.escape(id)}/authorizations",
174
+ :body => {:scope => scope}.to_json
175
+ ).body
176
+
177
+ display "Authorization updated"
178
+ end
179
+ alias_command "authorize", "flows:authorize"
180
+
181
+
182
+
183
+
143
184
  # flows:prep [DIR]
144
185
  #
145
186
  # Performs any necessary initialization for the flow.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zillabyte-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.21
4
+ version: 0.9.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - zillabyte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-31 00:00:00.000000000 Z
11
+ date: 2014-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake