module function · N/sftp

createConnection()

sftp.createConnection(options)

Establishes a connection to a remote FTP server.

Implementation
Not started
Design
Open for proposals suggest how it should read
Proposals
A
Signature
sftp.createConnection(options)
Module
N/sftp
Returns
sftp.Connection
Governance
None
Script types
Server scripts
Version
SuiteScript 2.x, documented for 2.1; since NetSuite 2016.2
call shapefrom Oracle's parameter table
1sftp.createConnection({2    url:       /* string, required */,3    keyId:     /* string */,4    secret:    /* string */,5    hostKey:   /* string, required */,6    username:  /* string, required */,7    port:      /* number, optional */,8    directory: /* string, optional */,9    timeout:   /* number, optional */10});
Oracle reference for this method
ParameterTypeRequiredDescription
options.urlstringrequiredThe host of the remote account.
options.keyIdstringThe script ID of the key to be used for authentication. You can upload SSH keys in PEM format at Setup > Company > Keys. For more information, see N/keyControl Module and SSH Keys for SFTP . You can use this in combination with a GUID or secret for two-factor authentication.
options.secretstringThe script ID of the secret used for authentication. You can store secrets at Setup > Company > API Secrets. For more information, see Secrets Management . You can use the secret parameter in combination with the key parameter for two-factor authentication. You cannot use the secret parameter in combination with the passwordGuid parameter.
options.hostKeystringrequiredThe host key for the trusted fingerprint on the server.
options.usernamestringrequiredThe username of the remote account. The script ID of a secret can be accepted for this parameter. You can store secrets at Setup > Company > API Secrets. For more information, see Secrets Management . By default, the login is anonymous.
options.portnumberoptionalThe port used to connect to the remote account. By default, port 22 is used.
options.directorystringoptionalThe remote directory of the connection. Note: The directory parameter is required if you use a remote server that cannot resolve relative paths.
options.timeoutnumberoptionalThe number of seconds to allow for an established connection. This value should be between 1 and 20 seconds. By default, this value is set to 20 seconds.
B

No Mynt syntax yet.

Nothing in the language compiles to sftp.createConnection(options) today. How should it read?

C

Competing syntax for createConnection, from GitHub Discussions. Select two or more to compare them side by side.

All discussions

Loading proposals from GitHub…

D

Write the Mynt you wish you could write.

A good proposal shows the syntax, the SuiteScript it should become, and argues for it: why it is clearer, how it fits the rest of the language, what it makes harder.

  • Clarity. Does it say what happens, without ceremony?
  • Consistency. Does it read like load, save and Ref[field]?
  • Expressiveness. Does it cover the cases people actually write?
  • Honesty. Does it hide a NetSuite cost, such as governance, that a reader should see?

N/sftp · sftp.createConnection(options)

Suggest syntax for createConnection