sfrest 0.0.41 → 0.0.44

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56ae7ea4f4d053d0263ad970320261fb9e2cea437d24b6785ddb5661d8b9a41a
4
- data.tar.gz: 6c9eae93565ffa04bd0ba347838e51b2a33d7c4bececd1819265ea26d31a4d88
3
+ metadata.gz: 15bac5247b3e3d00d8768db3340f88a89bbe0de1b9be834fd7e33b894ad07c9f
4
+ data.tar.gz: e854d3e6b0dc267d9bd2d7c859481cfa53fa3e668da0eb328cefa2958e187fd6
5
5
  SHA512:
6
- metadata.gz: b4677baf9be68f2c5d00b86d223ff79721eaae9d52446b0683bd55bc08cedfba094c6594a4b5cbf84bd44a90751851252c76b190d01341a60ee48f2d328db04c
7
- data.tar.gz: d5feaaa64b0be6c1267b9eb5ec9d4d94690ab33c5a9e5d31f7c68ddc7c4300d7c766dbd5681527b2ccea255298d7580a3c79b7784ed66a5274f910e70f6a458d
6
+ metadata.gz: f45092c3c47e83d4489e4c5bb22e56886072f1e93f2ad4a3cb9023ebb73f2d7ad569a604f242952958b3a752d62b97fb1b4c7893a6d7ecf4222359ebf0cfb632
7
+ data.tar.gz: 99719c9f33909d86ad410f6e54cdc73699a96a5ea6e27e73d1b957da43787ce13f1d6e25cd6c42bf5bc70f4c0c598e00f02c86b16aba6eb088e6df7e431b63b7
@@ -14,5 +14,28 @@ module SFRest
14
14
  def list
15
15
  @conn.get('/api/v1/stacks')
16
16
  end
17
+
18
+ # Edits stack name and description.
19
+ # @param [Integer] stack_id.
20
+ # @param [String] name.
21
+ # @param [String] description.
22
+ # @param [String] tangle_alias.
23
+ #
24
+ # @return [Array] an array containing the message given by the server.
25
+ def edit_stacks(stack_id, name, description, tangle_alias)
26
+ payload = {
27
+ 'name' => name,
28
+ 'description' => description,
29
+ 'tangle_alias' => tangle_alias
30
+ }
31
+ @conn.put("/api/v1/stacks/#{stack_id}", payload.to_json)
32
+ end
33
+
34
+ # Lists the codebases with details.
35
+ # @return [Hash] A hash of codebases with details configured for the factory.
36
+ # {"1": {"id": 1, "name": "name", "description": "description", "tangle_alias": "tangle1"} }
37
+ def stacks_with_details
38
+ @conn.get('/api/v1/stacks/details')
39
+ end
17
40
  end
18
41
  end
@@ -174,6 +174,7 @@ module SFRest
174
174
  info
175
175
  profile
176
176
  role
177
+ security_settings
177
178
  site
178
179
  site_guard
179
180
  site_ownership
@@ -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 factory security settings.
7
+ class Security_settings
8
+ # rubocop: enable Naming/ClassAndModuleCamelCase
9
+
10
+ # @param [SFRest::Connection] conn
11
+ def initialize(conn)
12
+ @conn = conn
13
+ end
14
+
15
+ # Get current security settings.
16
+ #
17
+ # @return [Array] an array containing current security settings.
18
+ def current_security_settings
19
+ @conn.get('/api/v1/security')
20
+ end
21
+
22
+ # Change security settings.
23
+ #
24
+ # @param [Hash] data Options to the security settings
25
+ # @option data [Integer] 'minimum_password_length'
26
+ # @option data [String] 'minimum_required_password_strength'
27
+ # @option data [Boolean] 'two_step_verification'
28
+ # @option data [Boolean] 'sign_out_inactive_user_accounts'
29
+ # @option data [Integer] 'sign_out_inactivity_time'
30
+ # @option data [Boolean] 'automatically_disable_accounts'
31
+ # @option data [Integer] 'automatically_disable_accounts_after_days'
32
+ #
33
+ # @return [Array] an array containing the message given by the server.
34
+ def change_security_settings(data)
35
+ @conn.put('/api/v1/security', data.to_json)
36
+ end
37
+
38
+ # Reset current security settings.
39
+ #
40
+ # @return [Array] an array containing the message given by the server.
41
+ def reset_security_settings
42
+ @conn.delete('/api/v1/security')
43
+ end
44
+ end
45
+ end
data/lib/sfrest/update.rb CHANGED
@@ -100,6 +100,22 @@ module SFRest
100
100
  @multi_stack ||= @conn.codebase.list['stacks'].size > 1
101
101
  end
102
102
 
103
+ # Terminates an updater.
104
+ def terminate_updater(update_id)
105
+ current_path = "/api/v1/update/#{update_id}"
106
+ @conn.delete(current_path)
107
+ end
108
+
109
+ # Changes the updater start time.
110
+ def change_updater_start_time(updater_id, new_update_time)
111
+ current_path = '/api/v1/update/change_time'
112
+ payload = {
113
+ 'updater_id' => updater_id,
114
+ 'new_update_time' => new_update_time
115
+ }.to_json
116
+ @conn.post(current_path, payload)
117
+ end
118
+
103
119
  # Determines if the v2 endpoint exists.
104
120
  # A factory with the endpoint will raise an SFRest::BadRequestError
105
121
  # A factory without the endpoint will raise SFRest::InvalidResponse
@@ -2,5 +2,5 @@
2
2
 
3
3
  module SFRest
4
4
  # Just tracks the version of sfrest.
5
- VERSION = '0.0.41'
5
+ VERSION = '0.0.44'
6
6
  end
data/lib/sfrest.rb CHANGED
@@ -23,6 +23,7 @@ require 'sfrest/info'
23
23
  require 'sfrest/profile'
24
24
  require 'sfrest/pathbuilder'
25
25
  require 'sfrest/role'
26
+ require 'sfrest/security_settings'
26
27
  require 'sfrest/site'
27
28
  require 'sfrest/site_guard'
28
29
  require 'sfrest/site_ownership'
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.41
4
+ version: 0.0.44
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-05-20 00:00:00.000000000 Z
11
+ date: 2022-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon
@@ -116,6 +116,7 @@ files:
116
116
  - lib/sfrest/pathbuilder.rb
117
117
  - lib/sfrest/profile.rb
118
118
  - lib/sfrest/role.rb
119
+ - lib/sfrest/security_settings.rb
119
120
  - lib/sfrest/site.rb
120
121
  - lib/sfrest/site_guard.rb
121
122
  - lib/sfrest/site_ownership.rb