Class: SFRest::Site_update_priority

Inherits:
Object
  • Object
show all
Defined in:
lib/sfrest/site_update_priority.rb

Overview

We need to keep this naming due to the way connection.rb autoloads things. rubocop: disable Naming/ClassAndModuleCamelCase Manage the site update priority feature.

Instance Method Summary collapse

Constructor Details

#initialize(conn) ⇒ Site_update_priority

Returns a new instance of Site_update_priority.

Parameters:



11
12
13
# File 'lib/sfrest/site_update_priority.rb', line 11

def initialize(conn)
  @conn = conn
end

Instance Method Details

#change_update_priority(priority) ⇒ Array

Set the site update priority list.

Parameters:

  • site (Array)

    node ids in the desired update order.

Returns:

  • (Array)

    an array containing the message given by the server.



26
27
28
29
30
31
# File 'lib/sfrest/site_update_priority.rb', line 26

def change_update_priority(priority)
  payload = {
    'priority' => priority
  }.to_json
  @conn.put('/api/v1/site-update-priority', payload)
end

#current_update_priorityArray

Get current site update priority.

Returns:

  • (Array)

    an array of the current site update priority.



18
19
20
# File 'lib/sfrest/site_update_priority.rb', line 18

def current_update_priority
  @conn.get('/api/v1/site-update-priority')
end

#reset_update_priorityArray

Reset the site update priority to the default.

Returns:

  • (Array)

    an array containing the message given by the server.



36
37
38
# File 'lib/sfrest/site_update_priority.rb', line 36

def reset_update_priority
  @conn.delete('/api/v1/site-update-priority')
end