cp_mgmt 1.0.1 → 1.0.2

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: 6b7d0aee842401dd6b2486c2d2f3a41697cdd49c4a34a50c162f8921b69a744b
4
- data.tar.gz: 4370a9827d23e3bdfa4482283c23018079394310d405817c47b81d43221b1aea
3
+ metadata.gz: 8418b1b92ff9efe6d59b624c56b7da3a0cde37e6a354b85a1f8867d362df9b75
4
+ data.tar.gz: 74c86e53286bfab4e0b7ea33e73787477a93e09abe4cfdfa1d4febf0f98142e4
5
5
  SHA512:
6
- metadata.gz: 387af715772b2db68b5a6d4146b8ff05039bb7b845dd94fa5a46de31acf8e531a190bf55ee41b4beeb1d38b39d978c52746e759ef6ca32b25d18b3400640c769
7
- data.tar.gz: 9a5d1450bd3993ce7b648f6d26f3f863e6686ed27247987a69694ce96f92241b477bb85be05dc3791638051eac75b8df82932d700b3ea0d710baed64bc59618f
6
+ metadata.gz: 578ac872f78ef62c168e2d7cc552924d8e846ef5bb4673f92ed9b40f440716ba6da18ec52d527b1d5f465e75303a9983d6d1e7589624c58c5ec16b3f00cb6010
7
+ data.tar.gz: e49d2b1b3c0f47e9f682a0db0ff4a936bcb4eb7d49fb303dad139523ad7028894646496c3dad5fe2e6ed2583b623e413ade3c17ed95830756012bebac5b0e58a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cp_mgmt (1.0.1)
4
+ cp_mgmt (1.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,11 +1,12 @@
1
1
  module CpMgmt
2
2
  class AccessLayer
3
3
  # Adds a access-layer
4
- def add(name)
4
+ def add(name, options={})
5
5
  client = CpMgmt.configuration.client
6
6
  CpMgmt.logged_in?
7
+ params = {name: name}
8
+ body = params.merge(options).to_json
7
9
 
8
- body = {name: name}.to_json
9
10
  response = client.post do |req|
10
11
  req.url '/web_api/add-access-layer'
11
12
  req.headers['Content-Type'] = 'application/json'
data/lib/cp_mgmt/host.rb CHANGED
@@ -1,11 +1,12 @@
1
1
  module CpMgmt
2
2
  class Host
3
3
  # Adds a host
4
- def add(name, ip_address)
4
+ def add(name, ip_address, options={})
5
5
  client = CpMgmt.configuration.client
6
6
  CpMgmt.logged_in?
7
+ params = {name: name, "ip-address": ip_address}
8
+ body = params.merge(options).to_json
7
9
 
8
- body = {name: name, "ip-address": ip_address}.to_json
9
10
  response = client.post do |req|
10
11
  req.url '/web_api/add-host'
11
12
  req.headers['Content-Type'] = 'application/json'
@@ -1,11 +1,12 @@
1
1
  module CpMgmt
2
2
  class Network
3
3
  # Adds a network
4
- def add(name, subnet, subnet_mask)
4
+ def add(name, subnet, subnet_mask, options={})
5
5
  client = CpMgmt.configuration.client
6
6
  CpMgmt.logged_in?
7
+ params = {name: name, subnet: subnet, "subnet-mask": subnet_mask}
8
+ body = params.merge(options).to_json
7
9
 
8
- body = {name: name, subnet: subnet, "subnet-mask": subnet_mask}.to_json
9
10
  response = client.post do |req|
10
11
  req.url '/web_api/add-network'
11
12
  req.headers['Content-Type'] = 'application/json'
@@ -1,3 +1,3 @@
1
1
  module CpMgmt
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cp_mgmt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Forester
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-20 00:00:00.000000000 Z
11
+ date: 2018-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler