mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-21 14:37:47 +00:00
Document resin/os
This commit is contained in:
parent
68f3d601cb
commit
a41d55f147
@ -1,3 +1,33 @@
|
||||
# Generate os cache name
|
||||
#
|
||||
# It generates an unique name for a certain instance of the os
|
||||
# with id and connection params embedded in the filename.
|
||||
#
|
||||
# @param {String, Number} id application id
|
||||
# @param {Object} connectionParams connection parameters
|
||||
# @option connectionParams {String} network network type
|
||||
# @option connectionParams {String} wifiKey wifi key
|
||||
# @option connectionParams {String} wifiSsid wifi ssid
|
||||
#
|
||||
# @return {String} os cache name
|
||||
#
|
||||
# @note For security reasons, the wifiSsid is omitted from the filename
|
||||
# @note The original filename extension (*.zip in this case) is lost in the renaming process
|
||||
#
|
||||
# @example Generate cache name for ethernet os
|
||||
# result = resin.os.generateCacheName(51, { network: 'ethernet' })
|
||||
# console.log(result)
|
||||
# # 51-ethernet-1418040928724
|
||||
#
|
||||
# @example Generate cache name for wifi os
|
||||
# result = resin.os.generateCacheName(51, {
|
||||
# network: 'wifi'
|
||||
# wifiKey: 'MyWifi'
|
||||
# wifiSsid: 'secret'
|
||||
# })
|
||||
# console.log(result)
|
||||
# # 51-wifi-MyWifi-1418040928724
|
||||
#
|
||||
exports.generateCacheName = (id, connectionParams) ->
|
||||
result = "#{id}-#{connectionParams.network}"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user