samanage 2.1.01 → 2.1.02

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
  SHA1:
3
- metadata.gz: b80680119ee4b58f79e671c7a8f52a8c828a1d9d
4
- data.tar.gz: 14984ffdcc1356df27c96af099e4def041533820
3
+ metadata.gz: 2d7d09cd7b743a00cce08f1c7b97900486fe9d43
4
+ data.tar.gz: 7f69ddd25f6b5f1520644754b3f5667dfe2afafd
5
5
  SHA512:
6
- metadata.gz: e49c1a93f61074ae57582091a6c28691526e111ac2e7af679d066955e7f82fe2dae50b5893cfbb081e8fc2b271f7907307f47e153c04f4446f812c4718d123df
7
- data.tar.gz: eced4a164597e9182f54e3e88a16f4c67263fe25952ddaa3b366150aceb6953f2293bfa249ec9fb1a688dfd154fc0b7fd9b402d8ed0e428a8c351fd6c7996eb8
6
+ metadata.gz: a8babe5f601a40d89064fbff102d5f3295dbf1f085e003efc0d2713261438c02471200a8716b02173cec2f3e89ae3b6ece9be63a786a13fb81d2da44cf25f990
7
+ data.tar.gz: afcb46b087604c66217f2e2a7536430b840e88e3e9cfb6a3c01a51fb7edf58c1dad229561a424d466eb34264a0b5981d55e97865cdceac1749afc5b6938f6fdb
data/changelog.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 2.1.02
2
+ - Use parmas in all collections
3
+
1
4
  # 2.1.01
2
5
  - Added solutions
3
6
 
@@ -1,8 +1,9 @@
1
1
  module Samanage
2
2
  class Api
3
3
  def get_categories(path: PATHS[:category], options: {})
4
- url = Samanage::UrlBuilder.new(path: path, options: options).url
5
- self.execute(path: url)
4
+ params = self.set_params(options: options)
5
+ path = 'categories.json?' + params
6
+ self.execute(path: path)
6
7
  end
7
8
 
8
9
 
@@ -3,8 +3,9 @@ module Samanage
3
3
 
4
4
  # Default get change path
5
5
  def get_changes(path: PATHS[:change], options: {})
6
- url = Samanage::UrlBuilder.new(path: path, options: options).url
7
- self.execute(path: url)
6
+ params = self.set_params(options: options)
7
+ path = 'changes.json?' + params
8
+ self.execute(path: path)
8
9
  end
9
10
 
10
11
 
@@ -14,7 +15,7 @@ module Samanage
14
15
  # - layout: 'long'
15
16
  def collect_changes(options: {})
16
17
  changes = Array.new
17
- total_pages = self.get_changes[:total_pages]
18
+ total_pages = self.get_changes(options: options)[:total_pages]
18
19
  1.upto(total_pages) do |page|
19
20
  options[:page] = page
20
21
  params = self.set_params(options: options)
@@ -3,14 +3,15 @@ module Samanage
3
3
 
4
4
  # Get contract default path
5
5
  def get_contracts(path: PATHS[:contract], options: {})
6
- url = Samanage::UrlBuilder.new(path: path, options: options).url
7
- self.execute(path: url)
6
+ params = self.set_params(options: options)
7
+ path = 'contracts.json?' + params
8
+ self.execute(path: path)
8
9
  end
9
10
 
10
11
  # Get all contracts
11
12
  def collect_contracts(options: {})
12
13
  contracts = Array.new
13
- total_pages = self.get_contracts[:total_pages]
14
+ total_pages = self.get_contracts(options: options)[:total_pages]
14
15
  1.upto(total_pages) do |page|
15
16
  options[:page] = page
16
17
  params = self.set_params(options: options)
@@ -3,14 +3,15 @@ module Samanage
3
3
 
4
4
  # Get custom fields default url
5
5
  def get_custom_fields(path: PATHS[:custom_fields], options:{})
6
- url = Samanage::UrlBuilder.new(path: path, options: options).url
7
- self.execute(path: url)
6
+ params = self.set_params(options: options)
7
+ path = 'custom_fields.json?' + params
8
+ self.execute(path: path)
8
9
  end
9
10
 
10
11
  # Gets all custom fields
11
12
  def collect_custom_fields(options: {})
12
13
  custom_fields = Array.new
13
- total_pages = self.get_custom_fields[:total_pages] ||= 2
14
+ total_pages = self.get_custom_fields(options: options)[:total_pages] ||= 2
14
15
  1.upto(total_pages) do |page|
15
16
  options[:page] = page
16
17
  params = self.set_params(options: options)
@@ -2,14 +2,15 @@ module Samanage
2
2
  class Api
3
3
  # Get custom forms path
4
4
  def get_custom_forms(path: PATHS[:custom_forms], options: {})
5
- url = Samanage::UrlBuilder.new(path: path, options: options).url
6
- self.execute(path: url)
5
+ params = self.set_params(options: options)
6
+ path = 'custom_forms.json?' + params
7
+ self.execute(path: path)
7
8
  end
8
9
 
9
10
  # Get all custom forms
10
11
  def collect_custom_forms(options: {})
11
12
  custom_forms = Array.new
12
- total_pages = self.get_custom_forms[:total_pages]
13
+ total_pages = self.get_custom_forms(options: options)[:total_pages]
13
14
  1.upto(total_pages) do |page|
14
15
  options[:page] = page
15
16
  params = self.set_params(options: options)
@@ -1,13 +1,14 @@
1
1
  module Samanage
2
2
  class Api
3
3
  def get_departments(path: PATHS[:department], options: {})
4
- url = Samanage::UrlBuilder.new(path: path, options: options).url
5
- self.execute(path: url)
4
+ params = self.set_params(options: options)
5
+ path = 'departments.json?' + params
6
+ self.execute(path: path)
6
7
  end
7
8
 
8
9
  def collect_departments(options: {})
9
10
  departments = Array.new
10
- total_pages = self.get_departments[:total_pages]
11
+ total_pages = self.get_departments(options: options)[:total_pages]
11
12
  1.upto(total_pages) do |page|
12
13
  options[:page] = page
13
14
  params = self.set_params(options: options)
@@ -1,13 +1,14 @@
1
1
  module Samanage
2
2
  class Api
3
3
  def get_groups(path: PATHS[:group], options: {})
4
- url = Samanage::UrlBuilder.new(path: path, options: options).url
5
- self.execute(path: url)
4
+ params = self.set_params(options: options)
5
+ path = 'groups.json?' + params
6
+ self.execute(path: path)
6
7
  end
7
8
 
8
9
  def collect_groups(options: {})
9
10
  groups = Array.new
10
- total_pages = self.get_groups[:total_pages]
11
+ total_pages = self.get_groups(options: options)[:total_pages]
11
12
  1.upto(total_pages) do |page|
12
13
  options[:page] = page
13
14
  params = self.set_params(options: options)
@@ -3,14 +3,15 @@ module Samanage
3
3
 
4
4
  # Get hardware default path
5
5
  def get_hardwares(path: PATHS[:hardware], options: {})
6
- url = Samanage::UrlBuilder.new(path: path, options: options).url
7
- self.execute(path: url)
6
+ params = self.set_params(options: options)
7
+ path = 'hardwares.json?' + params
8
+ self.execute(path: path)
8
9
  end
9
10
 
10
11
  # Get all hardwares
11
12
  def collect_hardwares(options: {})
12
13
  hardwares = Array.new
13
- total_pages = self.get_hardwares[:total_pages]
14
+ total_pages = self.get_hardwares(options: options)[:total_pages]
14
15
  1.upto(total_pages) do |page|
15
16
  options[:page] = page
16
17
  params = self.set_params(options: options)
@@ -15,7 +15,7 @@ module Samanage
15
15
  # - layout: 'long'
16
16
  def collect_incidents(options: {})
17
17
  incidents = Array.new
18
- total_pages = self.get_incidents[:total_pages]
18
+ total_pages = self.get_incidents(options: options)[:total_pages]
19
19
  puts "Pulling Incidents with Audit Archives (this may take a while)" if options[:audit_archives] && options[:verbose]
20
20
  1.upto(total_pages) do |page|
21
21
  puts "Collecting Incidents page: #{page}/#{total_pages}" if options[:verbose]
@@ -3,14 +3,16 @@ module Samanage
3
3
 
4
4
  # Get mobile default path
5
5
  def get_mobiles(path: PATHS[:mobile], options: {})
6
- url = Samanage::UrlBuilder.new(path: path, options: options).url
7
- self.execute(path: url)
6
+ params = self.set_params(options: options)
7
+ path = 'mobiles.json' + params
8
+ self.execute(path: path)
9
+
8
10
  end
9
11
 
10
12
  # Get all mobiles
11
13
  def collect_mobiles(options: {})
12
14
  mobiles = Array.new
13
- total_pages = self.get_mobiles[:total_pages]
15
+ total_pages = self.get_mobiles(options: options)[:total_pages]
14
16
  1.upto(total_pages) do |page|
15
17
  options[:page] = page
16
18
  params = self.set_params(options: options)
@@ -3,14 +3,15 @@ module Samanage
3
3
 
4
4
  # Default get other_assets path
5
5
  def get_other_assets(path: PATHS[:other_asset], options: {})
6
- url = Samanage::UrlBuilder.new(path: path, options: options).url
7
- self.execute(path: url)
6
+ params = self.set_params(options: options)
7
+ path = 'other_assets.json' + params
8
+ self.execute(path: path)
8
9
  end
9
10
 
10
11
  # Returns all other assets
11
12
  def collect_other_assets(options: {})
12
13
  other_assets = Array.new
13
- total_pages = self.get_other_assets[:total_pages]
14
+ total_pages = self.get_other_assets(options: options)[:total_pages]
14
15
  other_assets = []
15
16
  1.upto(total_pages) do |page|
16
17
  options[:page] = page
@@ -1,13 +1,14 @@
1
1
  module Samanage
2
2
  class Api
3
3
  def get_sites(path: PATHS[:site], options: {})
4
- url = Samanage::UrlBuilder.new(path: path, options: options).url
5
- self.execute(path: url)
4
+ params = self.set_params(options: options)
5
+ path = 'sites.json' + params
6
+ self.execute(path: path)
6
7
  end
7
8
 
8
9
  def collect_sites(options: {})
9
10
  sites = Array.new
10
- total_pages = self.get_sites[:total_pages]
11
+ total_pages = self.get_sites(options: options)[:total_pages]
11
12
  1.upto(total_pages) do |page|
12
13
  options[:page] = page
13
14
  params = self.set_params(options: options)
@@ -1,13 +1,14 @@
1
1
  module Samanage
2
2
  class Api
3
3
  def get_solutions(path: PATHS[:solution], options: {})
4
- url = Samanage::UrlBuilder.new(path: path, options: options).url
5
- self.execute(path: url)
4
+ params = self.set_params(options: options)
5
+ path = 'solutions.json' + params
6
+ self.execute(path: path)
6
7
  end
7
8
 
8
9
  def collect_solutions(options: {})
9
10
  solutions = Array.new
10
- total_pages = self.get_solutions[:total_pages]
11
+ total_pages = self.get_solutions(options: options)[:total_pages]
11
12
  1.upto(total_pages) do |page|
12
13
  options[:page] = page
13
14
  params = self.set_params(options: options)
@@ -4,15 +4,14 @@ module Samanage
4
4
  # Get users, using URL builder
5
5
  def get_users(path: PATHS[:user], options: {})
6
6
  params = self.set_params(options: options)
7
- path = path + params
8
- url = Samanage::UrlBuilder.new(path: path, options: options).url
9
- self.execute(path: url)
7
+ path = 'users.json' + params
8
+ self.execute(path: path)
10
9
  end
11
10
 
12
11
  # Returns all users in the account
13
12
  def collect_users(options: {})
14
13
  users = Array.new
15
- total_pages = self.get_users[:total_pages]
14
+ total_pages = self.get_users(options: options)[:total_pages]
16
15
  1.upto(total_pages) do |page|
17
16
  options[:page] = page
18
17
  params = self.set_params(options: options)
@@ -1,3 +1,3 @@
1
1
  module Samanage
2
- VERSION = '2.1.01'
2
+ VERSION = '2.1.02'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: samanage
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.01
4
+ version: 2.1.02
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Walls