sfrest 0.0.39 → 0.0.40

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e2e8fc07cf9577be1a4a1ccca84a3049b992e27e318a8b1d6d7fcd575f82fee
4
- data.tar.gz: 4c234cc4ce912626b82c1899a139026c02c214176a83018118e57d0714ef2dc1
3
+ metadata.gz: ef1480dd089e071458111ef6c8f2ea4e0e4aa7ff7bfc509e2c150f33167f0e69
4
+ data.tar.gz: f90b9028fbf5e4b117d8856144d271516c5f4af6e9ae04800d55c1f1cc2c48db
5
5
  SHA512:
6
- metadata.gz: 60dc925219e31dce103270055b1dbf73285f4b6ee4a08d18f697603a4d85c17eeb04aeaf7c82c0155ceed9514867cb2a7830955632f7d08217070d4db2c0878b
7
- data.tar.gz: 65076385c8d487c6adc87d1981bf8a39005f9208056b0733ec2a322d80949d2f46808833bd762309e0280f3b760c45c8898bf93d40e50c1fcca4b3b51eac896c
6
+ metadata.gz: e940d9ece6a6ad534a9d3025e3dfe2aa56ef3026f74d7efbdaa84fe9add7d9b62831d68d87a0bf12b7e2ccb5d91ba19eeb6b3822ce23e82b992c15d7d531a166
7
+ data.tar.gz: b488d33656b6ebc149f35f488da4963c34994fe762482a08717ae78f783db9d9354663803b7a9eedc5773afeeb69ed153c54a4efe1f7c66d5b38fb715d15f25b
@@ -175,7 +175,9 @@ module SFRest
175
175
  profile
176
176
  role
177
177
  site
178
+ site_guard
178
179
  site_ownership
180
+ site_update_priority
179
181
  stage
180
182
  task
181
183
  theme
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SFRest
4
+ # We need to keep this naming due to the way connection.rb autoloads things.
5
+ # rubocop: disable Naming/ClassAndModuleCamelCase
6
+ # Manage the site guard feature.
7
+ class Site_guard
8
+ # rubocop: enable Naming/ClassAndModuleCamelCase
9
+
10
+ # @param [SFRest::Connection] conn
11
+ def initialize(conn)
12
+ @conn = conn
13
+ end
14
+
15
+ # Get current site guard settings.
16
+ #
17
+ # @return [Array] an array containing current settings.
18
+ def current_settings
19
+ @conn.get('/api/v1/site-guard')
20
+ end
21
+
22
+ # Set and enables the site guard settings.
23
+ # @param [String] The message which will be displayed by the site guard.
24
+ # @param [String] The username which will be required by the site guard.
25
+ # @param [String] The password which will be required by the site guard.
26
+ #
27
+ # @return [Array] an array containing the message given by the server.
28
+ def enable_site_guard(message, username, password)
29
+ payload = {
30
+ 'message' => message,
31
+ 'username' => username,
32
+ 'password' => password
33
+ }
34
+
35
+ @conn.put('/api/v1/site-guard', payload.to_json)
36
+ end
37
+
38
+ # Removes and disableds the site guard settings.
39
+ #
40
+ # @return [Array] an array containing the message given by the server.
41
+ def disable_site_guard
42
+ @conn.delete('/api/v1/site-guard')
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SFRest
4
+ # We need to keep this naming due to the way connection.rb autoloads things.
5
+ # rubocop: disable Naming/ClassAndModuleCamelCase
6
+ # Manage the site update priority feature.
7
+ class Site_update_priority
8
+ # rubocop: enable Naming/ClassAndModuleCamelCase
9
+
10
+ # @param [SFRest::Connection] conn
11
+ def initialize(conn)
12
+ @conn = conn
13
+ end
14
+
15
+ # Get current site update priority.
16
+ #
17
+ # @return [Array] an array of the current site update priority.
18
+ def current_update_priority
19
+ @conn.get('/api/v1/site-update-priority')
20
+ end
21
+
22
+ # Set the site update priority list.
23
+ # @param [Array] site node ids in the desired update order.
24
+ #
25
+ # @return [Array] an array containing the message given by the server.
26
+ def change_update_priority(priority)
27
+ payload = {
28
+ 'priority' => priority
29
+ }.to_json
30
+ @conn.put('/api/v1/site-update-priority', payload)
31
+ end
32
+
33
+ # Reset the site update priority to the default.
34
+ #
35
+ # @return [Array] an array containing the message given by the server.
36
+ def reset_update_priority
37
+ @conn.delete('/api/v1/site-update-priority')
38
+ end
39
+ end
40
+ end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module SFRest
4
4
  # Just tracks the version of sfrest.
5
- VERSION = '0.0.39'
5
+ VERSION = '0.0.40'
6
6
  end
data/lib/sfrest.rb CHANGED
@@ -24,7 +24,9 @@ require 'sfrest/profile'
24
24
  require 'sfrest/pathbuilder'
25
25
  require 'sfrest/role'
26
26
  require 'sfrest/site'
27
+ require 'sfrest/site_guard'
27
28
  require 'sfrest/site_ownership'
29
+ require 'sfrest/site_update_priority'
28
30
  require 'sfrest/stage'
29
31
  require 'sfrest/task'
30
32
  require 'sfrest/theme'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sfrest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.39
4
+ version: 0.0.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - ACSF Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-25 00:00:00.000000000 Z
11
+ date: 2022-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon
@@ -117,7 +117,9 @@ files:
117
117
  - lib/sfrest/profile.rb
118
118
  - lib/sfrest/role.rb
119
119
  - lib/sfrest/site.rb
120
+ - lib/sfrest/site_guard.rb
120
121
  - lib/sfrest/site_ownership.rb
122
+ - lib/sfrest/site_update_priority.rb
121
123
  - lib/sfrest/stage.rb
122
124
  - lib/sfrest/task.rb
123
125
  - lib/sfrest/theme.rb