mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Add deprecation warning for get_network
get_network is being deprecated in favour of get_network_complete, which returns the complete GET-Network API response from vCloud. This is a transitional step - see https://github.com/fog/fog/pull/2683 In a future release, get_network will be replaced with the logic from get_network_complete, and then get_network_complete deprecated accordingly. The network Model has been updated to use get_network_complete already. Any code that relies on existing get_network behaviour should be updated to use get_network_complete or the Model asap.
This commit is contained in:
parent
2df6d976d5
commit
a4a298b73a
1 changed files with 4 additions and 0 deletions
|
@ -6,6 +6,8 @@ module Fog
|
|||
|
||||
# Retrieve an organization network.
|
||||
#
|
||||
# @deprecated Use {#get_network_complete} instead
|
||||
#
|
||||
# @param [String] id Object identifier of the network.
|
||||
# @return [Excon::Response]
|
||||
# * body<~Hash>:
|
||||
|
@ -15,6 +17,7 @@ module Fog
|
|||
# @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/operations/GET-Network.html
|
||||
# @since vCloud API version 0.9
|
||||
def get_network(id)
|
||||
Fog::Logger.deprecation("#{self} => #get_network is deprecated, use #get_network_complete instead [light_black](#{caller.first})[/]")
|
||||
request(
|
||||
:expects => 200,
|
||||
:idempotent => true,
|
||||
|
@ -27,6 +30,7 @@ module Fog
|
|||
|
||||
class Mock
|
||||
def get_network(id)
|
||||
Fog::Logger.deprecation("#{self} => #get_network is deprecated, use #get_network_complete instead [light_black](#{caller.first})[/]")
|
||||
unless network = data[:networks][id]
|
||||
raise Fog::Compute::VcloudDirector::Forbidden.new(
|
||||
'This operation is denied.'
|
||||
|
|
Loading…
Reference in a new issue