Class: Mandrill::Ips

Inherits:
Object
  • Object
show all
Defined in:
lib/mandrill/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(master) ⇒ Ips

Returns a new instance of Ips.



1194
1195
1196
# File 'lib/mandrill/api.rb', line 1194

def initialize(master)
    @master = master
end

Instance Attribute Details

#masterObject

Returns the value of attribute master.



1192
1193
1194
# File 'lib/mandrill/api.rb', line 1192

def master
  @master
end

Instance Method Details

#cancel_warmup(ip) ⇒ Hash

Cancels the warmup process for a dedicated IP.

Parameters:

  • ip (String)

    a dedicated ip address

Returns:

  • (Hash)

    Information about the dedicated IP

    • String

      ip the ip address

    • String

      created_at the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format

    • String

      pool the name of the pool that this dedicated IP belongs to

    • String

      domain the domain name (reverse dns) of this dedicated IP

    • Hash

      custom_dns information about the ip’s custom dns, if it has been configured

      - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
      - [Boolean] valid whether the ip's custom dns is currently valid
      - [String] error if the ip's custom dns is invalid, this will include details about the error
      
    • Hash

      warmup information about the ip’s warmup status

      - [Boolean] warming_up whether the ip is currently in warmup mode
      - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
      - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
      


1283
1284
1285
1286
# File 'lib/mandrill/api.rb', line 1283

def cancel_warmup(ip)
    _params = {:ip => ip}
    return @master.call 'ips/cancel-warmup', _params
end

#check_custom_dns(ip, domain) ⇒ Hash

Tests whether a domain name is valid for use as the custom reverse DNS for a dedicated IP.

Parameters:

  • ip (String)

    a dedicated ip address

  • domain (String)

    the domain name to test

Returns:

  • (Hash)

    validation results for the domain

    • String

      valid whether the domain name has a correctly-configured A record pointing to the ip address

    • String

      error if valid is false, this will contain details about why the domain’s A record is incorrect



1408
1409
1410
1411
# File 'lib/mandrill/api.rb', line 1408

def check_custom_dns(ip, domain)
    _params = {:ip => ip, :domain => domain}
    return @master.call 'ips/check-custom-dns', _params
end

#create_pool(pool) ⇒ Hash

Creates a pool and returns it. If a pool already exists with this name, no action will be performed.

Parameters:

  • pool (String)

    the name of a pool to create

Returns:

  • (Hash)

    Information about the dedicated ip pool

    • String

      name this pool’s name

    • String

      created_at the date and time that this pool was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format

    • Array

      ips the dedicated IPs in this pool

      - [Hash] ips[] information about each dedicated IP
          - [String] ip the ip address
          - [String] created_at the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
          - [String] pool the name of the pool that this dedicated IP belongs to
          - [String] domain the domain name (reverse dns) of this dedicated IP
          - [Hash] custom_dns information about the ip's custom dns, if it has been configured
              - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
              - [Boolean] valid whether the ip's custom dns is currently valid
              - [String] error if the ip's custom dns is invalid, this will include details about the error
          - [Hash] warmup information about the ip's warmup status
              - [Boolean] warming_up whether the ip is currently in warmup mode
              - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
              - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
      


1387
1388
1389
1390
# File 'lib/mandrill/api.rb', line 1387

def create_pool(pool)
    _params = {:pool => pool}
    return @master.call 'ips/create-pool', _params
end

#delete(ip) ⇒ Hash

Deletes a dedicated IP. This is permanent and cannot be undone.

Parameters:

  • ip (String)

    the dedicated ip to remove from your account

Returns:

  • (Hash)

    a description of the ip that was removed from your account.

    • String

      ip the ip address

    • String

      deleted a boolean indicating whether the ip was successfully deleted



1315
1316
1317
1318
# File 'lib/mandrill/api.rb', line 1315

def delete(ip)
    _params = {:ip => ip}
    return @master.call 'ips/delete', _params
end

#delete_pool(pool) ⇒ Hash

Deletes a pool. A pool must be empty before you can delete it, and you cannot delete your default pool.

Parameters:

  • pool (String)

    the name of the pool to delete

Returns:

  • (Hash)

    information about the status of the pool that was deleted

    • String

      pool the name of the pool

    • Boolean

      deleted whether the pool was deleted



1397
1398
1399
1400
# File 'lib/mandrill/api.rb', line 1397

def delete_pool(pool)
    _params = {:pool => pool}
    return @master.call 'ips/delete-pool', _params
end

#info(ip) ⇒ Hash

Retrieves information about a single dedicated ip.

Parameters:

  • ip (String)

    a dedicated IP address

Returns:

  • (Hash)

    Information about the dedicated ip

    • String

      ip the ip address

    • String

      created_at the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format

    • String

      pool the name of the pool that this dedicated IP belongs to

    • String

      domain the domain name (reverse dns) of this dedicated IP

    • Hash

      custom_dns information about the ip’s custom dns, if it has been configured

      - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
      - [Boolean] valid whether the ip's custom dns is currently valid
      - [String] error if the ip's custom dns is invalid, this will include details about the error
      
    • Hash

      warmup information about the ip’s warmup status

      - [Boolean] warming_up whether the ip is currently in warmup mode
      - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
      - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
      


1233
1234
1235
1236
# File 'lib/mandrill/api.rb', line 1233

def info(ip)
    _params = {:ip => ip}
    return @master.call 'ips/info', _params
end

#listArray

Lists your dedicated IPs.

Returns:

  • (Array)

    an array of structs for each dedicated IP

    • Hash

      return[] information about a single dedicated IP

      - [String] ip the ip address
      - [String] created_at the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
      - [String] pool the name of the pool that this dedicated IP belongs to
      - [String] domain the domain name (reverse dns) of this dedicated IP
      - [Hash] custom_dns information about the ip's custom dns, if it has been configured
          - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
          - [Boolean] valid whether the ip's custom dns is currently valid
          - [String] error if the ip's custom dns is invalid, this will include details about the error
      - [Hash] warmup information about the ip's warmup status
          - [Boolean] warming_up whether the ip is currently in warmup mode
          - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
          - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
      


1213
1214
1215
1216
# File 'lib/mandrill/api.rb', line 1213

def list()
    _params = {}
    return @master.call 'ips/list', _params
end

#list_poolsArray

Lists your dedicated IP pools.

Returns:

  • (Array)

    the dedicated IP pools for your account, up to a maximum of 1,000

    • Hash

      return[] information about each dedicated IP pool

      - [String] name this pool's name
      - [String] created_at the date and time that this pool was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format
      - [Array] ips the dedicated IPs in this pool
          - [Hash] ips[] information about each dedicated IP
              - [String] ip the ip address
              - [String] created_at the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
              - [String] pool the name of the pool that this dedicated IP belongs to
              - [String] domain the domain name (reverse dns) of this dedicated IP
              - [Hash] custom_dns information about the ip's custom dns, if it has been configured
                  - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
                  - [Boolean] valid whether the ip's custom dns is currently valid
                  - [String] error if the ip's custom dns is invalid, this will include details about the error
              - [Hash] warmup information about the ip's warmup status
                  - [Boolean] warming_up whether the ip is currently in warmup mode
                  - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
                  - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
      


1339
1340
1341
1342
# File 'lib/mandrill/api.rb', line 1339

def list_pools()
    _params = {}
    return @master.call 'ips/list-pools', _params
end

#pool_info(pool) ⇒ Hash

Describes a single dedicated IP pool.

Parameters:

  • pool (String)

    a pool name

Returns:

  • (Hash)

    Information about the dedicated ip pool

    • String

      name this pool’s name

    • String

      created_at the date and time that this pool was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format

    • Array

      ips the dedicated IPs in this pool

      - [Hash] ips[] information about each dedicated IP
          - [String] ip the ip address
          - [String] created_at the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format
          - [String] pool the name of the pool that this dedicated IP belongs to
          - [String] domain the domain name (reverse dns) of this dedicated IP
          - [Hash] custom_dns information about the ip's custom dns, if it has been configured
              - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
              - [Boolean] valid whether the ip's custom dns is currently valid
              - [String] error if the ip's custom dns is invalid, this will include details about the error
          - [Hash] warmup information about the ip's warmup status
              - [Boolean] warming_up whether the ip is currently in warmup mode
              - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
              - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
      


1363
1364
1365
1366
# File 'lib/mandrill/api.rb', line 1363

def pool_info(pool)
    _params = {:pool => pool}
    return @master.call 'ips/pool-info', _params
end

#provision(warmup = false, pool = nil) ⇒ Hash

Requests an additional dedicated IP for your account. Accounts may have one outstanding request at any time, and provisioning requests are processed within 24 hours.

Parameters:

  • warmup (Boolean) (defaults to: false)

    whether to enable warmup mode for the ip

  • pool (String) (defaults to: nil)

    the id of the pool to add the dedicated ip to, or null to use your account’s default pool

Returns:

  • (Hash)

    a description of the provisioning request that was created

    • String

      requested_at the date and time that the request was created as a UTC timestamp in YYYY-MM-DD HH:MM:SS format



1243
1244
1245
1246
# File 'lib/mandrill/api.rb', line 1243

def provision(warmup=false, pool=nil)
    _params = {:warmup => warmup, :pool => pool}
    return @master.call 'ips/provision', _params
end

#set_custom_dns(ip, domain) ⇒ Hash

Configures the custom DNS name for a dedicated IP.

Parameters:

  • ip (String)

    a dedicated ip address

  • domain (String)

    a domain name to set as the dedicated IP’s custom dns name.

Returns:

  • (Hash)

    information about the dedicated IP’s new configuration

    • String

      ip the ip address

    • String

      created_at the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format

    • String

      pool the name of the pool that this dedicated IP belongs to

    • String

      domain the domain name (reverse dns) of this dedicated IP

    • Hash

      custom_dns information about the ip’s custom dns, if it has been configured

      - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
      - [Boolean] valid whether the ip's custom dns is currently valid
      - [String] error if the ip's custom dns is invalid, this will include details about the error
      
    • Hash

      warmup information about the ip’s warmup status

      - [Boolean] warming_up whether the ip is currently in warmup mode
      - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
      - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
      


1429
1430
1431
1432
# File 'lib/mandrill/api.rb', line 1429

def set_custom_dns(ip, domain)
    _params = {:ip => ip, :domain => domain}
    return @master.call 'ips/set-custom-dns', _params
end

#set_pool(ip, pool, create_pool = false) ⇒ Hash

Moves a dedicated IP to a different pool.

Parameters:

  • ip (String)

    a dedicated ip address

  • pool (String)

    the name of the new pool to add the dedicated ip to

  • create_pool (Boolean) (defaults to: false)

    whether to create the pool if it does not exist; if false and the pool does not exist, an Unknown_Pool will be thrown.

Returns:

  • (Hash)

    Information about the updated state of the dedicated IP

    • String

      ip the ip address

    • String

      created_at the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format

    • String

      pool the name of the pool that this dedicated IP belongs to

    • String

      domain the domain name (reverse dns) of this dedicated IP

    • Hash

      custom_dns information about the ip’s custom dns, if it has been configured

      - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
      - [Boolean] valid whether the ip's custom dns is currently valid
      - [String] error if the ip's custom dns is invalid, this will include details about the error
      
    • Hash

      warmup information about the ip’s warmup status

      - [Boolean] warming_up whether the ip is currently in warmup mode
      - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
      - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
      


1305
1306
1307
1308
# File 'lib/mandrill/api.rb', line 1305

def set_pool(ip, pool, create_pool=false)
    _params = {:ip => ip, :pool => pool, :create_pool => create_pool}
    return @master.call 'ips/set-pool', _params
end

#start_warmup(ip) ⇒ Hash

Begins the warmup process for a dedicated IP. During the warmup process, Mandrill will gradually increase the percentage of your mail that is sent over the warming-up IP, over a period of roughly 30 days. The rest of your mail will be sent over shared IPs or other dedicated IPs in the same pool.

Parameters:

  • ip (String)

    a dedicated ip address

Returns:

  • (Hash)

    Information about the dedicated IP

    • String

      ip the ip address

    • String

      created_at the date and time that the dedicated IP was created as a UTC string in YYYY-MM-DD HH:MM:SS format

    • String

      pool the name of the pool that this dedicated IP belongs to

    • String

      domain the domain name (reverse dns) of this dedicated IP

    • Hash

      custom_dns information about the ip’s custom dns, if it has been configured

      - [Boolean] enabled a boolean indicating whether custom dns has been configured for this ip
      - [Boolean] valid whether the ip's custom dns is currently valid
      - [String] error if the ip's custom dns is invalid, this will include details about the error
      
    • Hash

      warmup information about the ip’s warmup status

      - [Boolean] warming_up whether the ip is currently in warmup mode
      - [String] start_at the start time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
      - [String] end_at the end date and time for the warmup process as a UTC string in YYYY-MM-DD HH:MM:SS format
      


1263
1264
1265
1266
# File 'lib/mandrill/api.rb', line 1263

def start_warmup(ip)
    _params = {:ip => ip}
    return @master.call 'ips/start-warmup', _params
end