lm_rest 1.0.5 → 1.0.6

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: 3c01ece27d96964546705d1d5a610b33e5a5c173d63a44f9a20252846192cb23
4
- data.tar.gz: 8ab3dc099b5088d46d0d752de09c73a273a662d17b05b2a753363f6f9498ed6b
3
+ metadata.gz: 1ca4971177cb2794426ad3ae05d420f1fdbda78717fc4d881380f367b6d820c6
4
+ data.tar.gz: 796de6d0afa84b5e176f188c17ec92043cfa55794755b6ab3daa744aea826f86
5
5
  SHA512:
6
- metadata.gz: c6180a42bdb7fdd738651da70f41c5a4158dd5ecd177e37bc45ce67434f4ec711183743526dea241d0a99ab73c247bfd13d879cf8119c5b89af88250c9f81f35
7
- data.tar.gz: b9e563ccf97f75174a23dd88e4d58222fa40b58a1078a22ba06d2f199ae8252cd8ed4249b007ee1efbbaa3b73c3c30fe43edde48bd395d962d41e78c6751e005
6
+ metadata.gz: 05c2aca42fb85b2e09499664fa02fe6ac597ad2b2388f374b50bc3b8fa431871d8f0526b20e371ff55758bf6b4b7b4e57eac004c401f04521ed67c92100d1ae4
7
+ data.tar.gz: 9d433ae007765e5c3c7eccbfdeaa5aca086c21e0dd1fc5a9700ac4357c2393edec4f18d47474f4383f492c0e352dff99fa2038d66f9326b63272e4b6b15d4d8f
data/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  An Unofficial Ruby gem for the LogicMonitor REST API.
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/lm_rest.svg)](https://badge.fury.io/rb/lm_rest)
6
+
7
+ [LM Swagger API Docs](https://www.logicmonitor.com/swagger-ui-master/dist/)
8
+
5
9
  ## Installation
6
10
 
7
11
  Add this line to your application's Gemfile:
@@ -18,6 +22,29 @@ Or install it yourself as:
18
22
 
19
23
  `$ gem install lm_rest`
20
24
 
25
+ ## Remove system.categories
26
+
27
+ If you accidentally applied system.categories all over your LogicMonitor
28
+ environment, or just need to clean out some old categories, there's an included
29
+ demo script just for you.
30
+
31
+ Install this gem, then check in the `/bin` folder of this repo for the
32
+ `system_category_cleaner.rb` script. It's very simple, you'll just need to pass
33
+ it the following arguments in order, preferrably in single quotes:
34
+ * Your portal name, like `'hooli'`
35
+ * Your API access ID like `'long_api_access_id'`
36
+ * Your API access Key like `'long_api_access_key'`
37
+ * The AppliesTo matching devices you want to scrub like
38
+ `'hascategory("collector")&& system.collectorversion>=24106'`
39
+ * The category you want to remove, like `'BadCategory'`
40
+
41
+ Your devices should be all cleaned up. The script will respect rate limits and
42
+ it splits all system.categories on ',' before removing the entry you specify.
43
+
44
+ It should go without saying that this is unofficial, unsupported, and may mess
45
+ your system up even more.
46
+
47
+
21
48
  ## Supported API Resources
22
49
 
23
50
  Every API resource is defined in the `api.json` file and its associated defined
@@ -59,7 +86,9 @@ lm.get_datasource(721)
59
86
 
60
87
 
61
88
  # return array of Resource objects whose names begin with "VMware"
62
- lm.get_datasources(filter: 'name:VMware*')
89
+ # NOTE: when using filter, you need quotes around the filter's "value":
90
+ # This is incorrect in the LogicMonitor API docs as of this writing (8/10/2021)
91
+ lm.get_datasources(filter: 'name:"VMware*"')
63
92
 
64
93
 
65
94
  # add a device to your account
@@ -9,9 +9,9 @@ def usage
9
9
  puts "USAGE:\t" + $PROGRAM_NAME + ' account id key applies_to category'
10
10
  puts ""
11
11
  puts "\taccount - just the beginning of your portal name, like 'hooli'"
12
- puts "\tid - API key access id"
13
- puts "\tkey - API key access key"
14
- puts "\tapplies_to - AppliesTo (in quotes on one line) matching devices you want to scrub"
12
+ puts "\tid - API key access id in quotes"
13
+ puts "\tkey - API key access key in quotes"
14
+ puts "\tapplies_to - AppliesTo (in single quotes on one line) matching devices you want to scrub"
15
15
  puts "\tcategory - The system category value you wish to remove."
16
16
  end
17
17
 
@@ -71,7 +71,7 @@ module LMRest
71
71
  headers['Authorization'] = sign(method, uri, params)
72
72
  headers['Content-Type'] = 'application/json'
73
73
  headers['Accept'] = 'application/json, text/javascript'
74
- headers['X-version'] = '2'
74
+ headers['X-version'] = '3'
75
75
 
76
76
  url = api_url + uri
77
77
  #puts "URL: " + url
@@ -1,3 +1,3 @@
1
1
  module LMRest
2
- VERSION = '1.0.5'
2
+ VERSION = '1.0.6'
3
3
  end
data/lm_rest.gemspec CHANGED
@@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency 'rake'
31
31
  spec.add_development_dependency 'minitest'
32
32
  spec.add_dependency 'rest-client'
33
- spec.add_dependency 'json', '~> 2.5.1'
33
+ spec.add_dependency 'json', '> 2.5.1'
34
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lm_rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Rodrigues
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-10 00:00:00.000000000 Z
11
+ date: 2024-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -70,14 +70,14 @@ dependencies:
70
70
  name: json
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">"
74
74
  - !ruby/object:Gem::Version
75
75
  version: 2.5.1
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 2.5.1
83
83
  description: Interact programmatically with your LogicMonitor account via the REST
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
127
  requirements: []
128
- rubygems_version: 3.2.15
128
+ rubygems_version: 3.4.19
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: API Wrapper for LogicMonitor Rest API v2.