Class: Ultradns::Api::Account
- Inherits:
-
ClientAccessor
- Object
- ClientAccessor
- Ultradns::Api::Account
- Defined in:
- lib/ultradns/api/account.rb
Instance Attribute Summary collapse
-
#account_name ⇒ Object
readonly
Returns the value of attribute account_name.
Instance Method Summary collapse
-
#initialize(client, account_name) ⇒ Account
constructor
A new instance of Account.
-
#users ⇒ Object
List users for this account.
-
#zones(options = {}) ⇒ Object
List zones for this account.
Constructor Details
#initialize(client, account_name) ⇒ Account
Returns a new instance of Account.
13 14 15 16 |
# File 'lib/ultradns/api/account.rb', line 13 def initialize(client, account_name) super(client) @account_name = account_name end |
Instance Attribute Details
#account_name ⇒ Object (readonly)
Returns the value of attribute account_name.
11 12 13 |
# File 'lib/ultradns/api/account.rb', line 11 def account_name @account_name end |
Instance Method Details
#users ⇒ Object
List users for this account
48 49 50 |
# File 'lib/ultradns/api/account.rb', line 48 def users() client.with_auth_retry {|c| c.get "/accounts/#{@account_name}/users", } end |
#zones(options = {}) ⇒ Object
List zones for this account
Optional Parameters
-
:q
- The search parameters, in a hash. Valid keys are:name - substring match of the zone name zone_type - one of : PRIMARY SECONDARY ALIAS
-
:sort
- The sort column used to order the list. Valid values for the sort field are:NAME ACCOUNT_NAME RECORD_COUNT ZONE_TYPE
-
:reverse
- Whether the list is ascending(false) or descending(true). Defaults to true -
:offset
- The position in the list for the first returned element(0 based) -
:limit
- The maximum number of zones to be returned.
Examples
client.account('myaccount').zones
client.account('myaccount').zones(q: {name: 'foo', zone_type: 'PRIMARY'}, sort: 'NAME', reverse: true, offset:10, limit:50)
43 44 45 |
# File 'lib/ultradns/api/account.rb', line 43 def zones(={}) client.with_auth_retry {|c| c.get("/accounts/#{@account_name}/zones", ()) } end |