IPWorks Cloud 2020 Node.js Edition

Questions / Feedback?

Region Property

The region the class will make requests against.

Syntax

 digitalocean.getRegion([callback])
 digitalocean.setRegion( region, [callback])

Default Value

"nyc3"

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for the getRegion([callback]) method is defined as:

function(err, data){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'data' is the value returned by the method.

The callback for the setRegion([callback]) method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This property control which region the class will make requests against. By default the class uses nyc3, the New York 3 region. This property should be changed to create or access resources in other regions.

Regions:

Value Region
ams2 Amsterdam 2
ams3 Amsterdam 3
blr1 Bangalore 1
fra1 Frankfurt 1
lon1 London 1
nyc1 New York 1
nyc2 New York 2
nyc3 (Default) New York 3
sfo1 San Francisco 1
sfo2 San Francisco 2
sgp1 Singapore 1
tor1 Toronto 1

The class will always convert this property's value to lowercase. If this property is cleared, the class will reset it to the default value.

Data Type

String

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 Node.js Edition - Version 20.0 [Build 8265]