itglue 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -6
- data/lib/itglue/asset.rb +7 -2
- data/lib/itglue/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8217e3d49165473cf67212ecfb101f481c6f4632
|
4
|
+
data.tar.gz: 8ed94c541d8e0cd8557b1eb87d6b04280aebf68e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afa4b7449dcc55f49f44747421bda5887b07f86cfdac8799965831e397af57d443f184ff89d36e61d14ac34cc8a13f86b4aeae73c4a0291aba0259ec0d131664
|
7
|
+
data.tar.gz: 18a093cc4d219d15c281ac790d458a117e005f4227762913092151cba39a8b9200e4116d489b3929432892cec29f6db420bac30ec2f6a6c76b0a60241066056b
|
data/README.md
CHANGED
@@ -24,7 +24,8 @@ For now this gem only supports API Key authentication.
|
|
24
24
|
require 'itglue'
|
25
25
|
|
26
26
|
ITGlue.configure do |config|
|
27
|
-
config.itglue_api_key = 'ITG.b94e901420fe7cb163a364b451f172d9
|
27
|
+
config.itglue_api_key = 'ITG.b94e901420fe7cb163a364b451f172d9...'
|
28
|
+
config.itglue_api_base_uri = 'https://api.itglue.com'
|
28
29
|
config.logger = ::Logger.new(STDOUT)
|
29
30
|
end
|
30
31
|
```
|
@@ -46,11 +47,12 @@ organizations = ITGlue::Organization.filter(name: 'Happy Frog')
|
|
46
47
|
Get organization by id
|
47
48
|
```ruby
|
48
49
|
organization = ITGlue::Organization.find(123)
|
49
|
-
#=> #<ITGlue::Organization id: 123 name: "
|
50
|
+
#=> #<ITGlue::Organization id: 123 name: "Happy Frog", description: nil, ...>]
|
50
51
|
```
|
51
52
|
Get configurations for a specific organization
|
52
53
|
```ruby
|
53
|
-
|
54
|
+
configurations = ITGlue::Configuration.get_nested(organization)
|
55
|
+
#=> [#<ITGlue::Configuration id: 23943 organization_id: 31131, organization_name: "Happy Frog", name: "HP", ...>, ...]
|
54
56
|
```
|
55
57
|
|
56
58
|
### Client
|
@@ -59,6 +61,7 @@ You can also directly instantiate a client and handle the data and response dire
|
|
59
61
|
```ruby
|
60
62
|
client = ITGlue::Client.new
|
61
63
|
#=> #<ITGlue::Client:0x007fd7eb032d00 ...>
|
64
|
+
|
62
65
|
query = { filter: { name: 'HP' } }
|
63
66
|
client.get(:configurations, { parent: organization }, { query: query })
|
64
67
|
# => [
|
@@ -66,6 +69,7 @@ client.get(:configurations, { parent: organization }, { query: query })
|
|
66
69
|
# id: 456,
|
67
70
|
# type: "configurations",
|
68
71
|
# attributes: {
|
72
|
+
# name: "HP",
|
69
73
|
# organization_id: 123,
|
70
74
|
# organization_name: "Happy Frog",
|
71
75
|
# ...
|
@@ -76,15 +80,16 @@ client.get(:configurations, { parent: organization }, { query: query })
|
|
76
80
|
```
|
77
81
|
A get request such as the one above will handle generating the route and pagination. If you want to handle these yourself, you can use 'execute'
|
78
82
|
```ruby
|
79
|
-
client.execute(:get, '/organizations/31131/relationships/configurations', nil, {query:
|
83
|
+
client.execute(:get, '/organizations/31131/relationships/configurations', nil, { query: query })
|
80
84
|
# => {
|
81
85
|
# "data"=> [
|
82
86
|
# {
|
83
87
|
# "id"=>"23943",
|
84
88
|
# "type"=>"configurations",
|
85
89
|
# "attributes"=> {
|
86
|
-
# "
|
87
|
-
# "organization-
|
90
|
+
# "name" => "HP",
|
91
|
+
# "organization-id"=>123,
|
92
|
+
# "organization-name"=>"Happy Frog",
|
88
93
|
# ...
|
89
94
|
# }
|
90
95
|
# },
|
data/lib/itglue/asset.rb
CHANGED
@@ -1,8 +1,13 @@
|
|
1
|
-
|
1
|
+
require File.join(File.dirname(__FILE__), 'asset/base.rb')
|
2
|
+
require File.join(File.dirname(__FILE__), 'asset/configuration.rb')
|
3
|
+
require File.join(File.dirname(__FILE__), 'asset/configuration_interface.rb')
|
4
|
+
require File.join(File.dirname(__FILE__), 'asset/configuration_status.rb')
|
5
|
+
require File.join(File.dirname(__FILE__), 'asset/configuration_type.rb')
|
6
|
+
require File.join(File.dirname(__FILE__), 'asset/organization.rb')
|
2
7
|
|
3
8
|
module ITGlue
|
4
9
|
module Asset
|
5
10
|
class ITGlueAssetError < ITGlueError; end
|
6
11
|
class MethodNotAvailable < ITGlueAssetError; end
|
7
12
|
end
|
8
|
-
end
|
13
|
+
end
|
data/lib/itglue/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itglue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Silva
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|