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
A
suitescript api
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});
| Parameter | Type | Required | Description |
|---|---|---|---|
| options.url | string | required | The host of the remote account. |
| options.keyId | string | The 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.secret | string | The 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.hostKey | string | required | The host key for the trusted fingerprint on the server. |
| options.username | string | required | The 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.port | number | optional | The port used to connect to the remote account. By default, port 22 is used. |
| options.directory | string | optional | The remote directory of the connection. Note: The directory parameter is required if you use a remote server that cannot resolve relative paths. |
| options.timeout | number | optional | The 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
mynt syntax
No Mynt syntax yet.
Nothing in the language compiles to sftp.createConnection(options) today. How should it read?
C
community proposals
Competing syntax for createConnection, from GitHub Discussions. Select two or more to compare them side by side.
Loading proposals from GitHub…
D
suggest an alternative
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,saveandRef[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?