Class: Dyn::Traffic::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/dyn/traffic/base.rb

Direct Known Subclasses

GSLB, Session, Zone

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#zoneObject

Returns the value of attribute zone.



24
25
26
# File 'lib/dyn/traffic/base.rb', line 24

def zone
  @zone
end

Instance Method Details

#discard_change_setHash

Discard any pending changes in the session - required if you don’t with to persist changes.

See: help.dynect.net/delete-zone-change-set-api/

Parameters:

  • The (String)

    zone to discard changes for - if one is provided when instantiated, we use that.

Returns:

  • (Hash)

    The dynect API response



42
43
44
# File 'lib/dyn/traffic/base.rb', line 42

def discard_change_set
  @dyn.delete("ZoneChanges/#{@zone}")
end

#freezeHash

Parameters:

  • The (String)

    zone to freeze - if one is provided when instantiated, we use that.

Returns:

  • (Hash)

    The dynect API response



52
53
54
# File 'lib/dyn/traffic/base.rb', line 52

def freeze
  @dyn.put("Zone/#{@zone}", { "freeze" => true })
end

#get_change_setHash

Show pending changes to zone

See: help.dyn.com/get-zone-changeset-api/

Parameters:

  • The (String)

    zone which we want to see the changes for - if one is provided when instantiated, we use that.

Returns:

  • (Hash)

    The dynect API response



72
73
74
# File 'lib/dyn/traffic/base.rb', line 72

def get_change_set
  @dyn.get("ZoneChanges/#{@zone}")
end

#publishHash

Publish any pending changes to the zone - required to make any alterations permanent.

See: manage.dynect.net/help/docs/api2/rest/resources/Zone.html

Parameters:

  • The (String)

    zone to publish - if one is provided when instantiated, we use that.

Returns:

  • (Hash)

    The dynect API response



32
33
34
# File 'lib/dyn/traffic/base.rb', line 32

def publish
  @dyn.put("Zone/#{@zone}", { "publish" => true })
end

#thawHash

Parameters:

  • The (String)

    zone to thaw - if one is provided when instantiated, we use that.

Returns:

  • (Hash)

    The dynect API response



62
63
64
# File 'lib/dyn/traffic/base.rb', line 62

def thaw
  @dyn.put("Zone/#{@zone}", { "thaw" => true })
end