lib/conjur/api/hosts.rb in conjur-api-4.19.1 vs lib/conjur/api/hosts.rb in conjur-api-4.20.0
- old
+ new
@@ -1,7 +1,7 @@
#
-# Copyright (C) 2013 Conjur Inc
+# Copyright (C) 2013-2015 Conjur Inc
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
@@ -76,10 +76,12 @@
# @raise RestClient::Conflict when id is given and a host with that id already exists.
# @raise RestClient::Forbidden when ownerid is given and the owner role does not exist, or you are not
# a member of the owner role.
#
def create_host options = nil
+ options = options.merge \
+ cidr: [*options[:cidr]].map(&CIDR.method(:validate)).map(&:to_s) if options[:cidr]
standard_create Conjur::Core::API.host, :host, nil, options
end
# Get a host by its *unqualified id*.
#
@@ -102,6 +104,6 @@
standard_show Conjur::Core::API.host, :host, id
end
#@!endgroup
end
-end
\ No newline at end of file
+end