sillydev 1.0.0 → 1.1.0
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/lib/sillydev/resources.rb +40 -7
- data/lib/sillydev/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7239efaba61bc40a3d9d3d93c571b254330b87071d20f7002ddd0485479fa5e9
|
|
4
|
+
data.tar.gz: c41a418a88895e4f3c9e3d1b2b84ba47b44cf0cc835e149dcb0bb1c393a34e90
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0dcac44b83c73912d9de67e76606040c3661d746e09ae7e637969ef61b73f34de226a00b249323127bc01d8ca6e3fa12807fc7f849dcf733378709c1300639d5
|
|
7
|
+
data.tar.gz: 5d6c98a7b24b193a1f72cab0267eced77178234a1643b17ad60b8f818ceaeb8ffe4bf2f5c890590b350eb29a1c403b8fe37c58e3c68d3eb5ec396212a0aae8a7
|
data/lib/sillydev/resources.rb
CHANGED
|
@@ -246,6 +246,21 @@ module SillyDev
|
|
|
246
246
|
def disable_badge(server)
|
|
247
247
|
req("DELETE", "#{server_path(server)}/settings/badge")
|
|
248
248
|
end
|
|
249
|
+
|
|
250
|
+
# Where a paid server can move, whether a backup is made first, and any move waiting. operationId: getNodeMove
|
|
251
|
+
def node_move(server)
|
|
252
|
+
req("GET", "#{server_path(server)}/settings/node-move")
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# Move a paid server to another node kept for paid servers, after a backup if it has a slot spare. operationId: moveServerToNode
|
|
256
|
+
def move_to_node(server, node)
|
|
257
|
+
req("POST", "#{server_path(server)}/settings/node-move", json: { node: node })
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# Clear a move that did not go ahead. operationId: dismissNodeMove
|
|
261
|
+
def dismiss_node_move(server)
|
|
262
|
+
req("DELETE", "#{server_path(server)}/settings/node-move")
|
|
263
|
+
end
|
|
249
264
|
end
|
|
250
265
|
|
|
251
266
|
# The startup command and variables (tag Startup).
|
|
@@ -383,9 +398,14 @@ module SillyDev
|
|
|
383
398
|
|
|
384
399
|
# Schedules and their tasks (tag Schedules).
|
|
385
400
|
class Schedules < Base
|
|
386
|
-
# Every schedule on the server, with its tasks. operationId: listSchedules
|
|
401
|
+
# Every schedule on the server, with its tasks, fetching every page. operationId: listSchedules
|
|
387
402
|
def list(server)
|
|
388
|
-
|
|
403
|
+
@client.paginate("#{server_path(server)}/schedules", { per_page: 100 }).to_a
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
# One page of schedules (50 a page unless per_page says otherwise, at most 100). operationId: listSchedules
|
|
407
|
+
def list_page(server, page: 1, per_page: nil)
|
|
408
|
+
@client.page("#{server_path(server)}/schedules", { page: page, per_page: per_page })
|
|
389
409
|
end
|
|
390
410
|
|
|
391
411
|
# Create a schedule from a cron timetable. operationId: createSchedule
|
|
@@ -441,9 +461,14 @@ module SillyDev
|
|
|
441
461
|
|
|
442
462
|
# The server's allocations, its IP and port pairs (tag Network).
|
|
443
463
|
class Network < Base
|
|
444
|
-
# Every allocation on the server. operationId: listAllocations
|
|
464
|
+
# Every allocation on the server, fetching every page. operationId: listAllocations
|
|
445
465
|
def list(server)
|
|
446
|
-
|
|
466
|
+
@client.paginate("#{server_path(server)}/network/allocations", { per_page: 100 }).to_a
|
|
467
|
+
end
|
|
468
|
+
|
|
469
|
+
# One page of allocations (50 a page unless per_page says otherwise, at most 100). operationId: listAllocations
|
|
470
|
+
def list_page(server, page: 1, per_page: nil)
|
|
471
|
+
@client.page("#{server_path(server)}/network/allocations", { page: page, per_page: per_page })
|
|
447
472
|
end
|
|
448
473
|
|
|
449
474
|
# Add a port, where an administrator has allowed it. operationId: createAllocation
|
|
@@ -469,9 +494,14 @@ module SillyDev
|
|
|
469
494
|
|
|
470
495
|
# Other accounts with access to the server (tag Subusers).
|
|
471
496
|
class Subusers < Base
|
|
472
|
-
# Every subuser of the server. operationId: listSubusers
|
|
497
|
+
# Every subuser of the server, fetching every page. operationId: listSubusers
|
|
473
498
|
def list(server)
|
|
474
|
-
|
|
499
|
+
@client.paginate("#{server_path(server)}/users", { per_page: 100 }).to_a
|
|
500
|
+
end
|
|
501
|
+
|
|
502
|
+
# One page of subusers (50 a page unless per_page says otherwise, at most 100). operationId: listSubusers
|
|
503
|
+
def list_page(server, page: 1, per_page: nil)
|
|
504
|
+
@client.page("#{server_path(server)}/users", { page: page, per_page: per_page })
|
|
475
505
|
end
|
|
476
506
|
|
|
477
507
|
# Invite an account by email with a list of permissions. operationId: createSubuser
|
|
@@ -678,7 +708,10 @@ module SillyDev
|
|
|
678
708
|
result = credit(view: view, page: number)
|
|
679
709
|
entries = result["data"] || []
|
|
680
710
|
entries.each { |entry| yielder << entry }
|
|
681
|
-
|
|
711
|
+
# Under meta.pagination, like every other list; panels from before that change put it
|
|
712
|
+
# at the top level.
|
|
713
|
+
pagination = (result["meta"] || {})["pagination"] || result["pagination"] || {}
|
|
714
|
+
pages = (pagination["total_pages"] || 1).to_i
|
|
682
715
|
break if entries.empty? || number >= pages
|
|
683
716
|
|
|
684
717
|
number += 1
|
data/lib/sillydev/version.rb
CHANGED