# Module: os

Source:
  - models/os.js, line 2

### Methods

#### (static) download(parameters, destination, callback, onProgress)

Download an OS image

##### Parameters:

Name | Type | Description
--- | --- | ---
`parameters` | Object | os parameters
`destination` | String | destination path
`callback` | module:resin.models.os~downloadCallback | callback
`onProgress` | function | on progress callback

Source:
  - resource/models/os.js, line 54
To Do:
  - Find a way to test this

##### Throws:

If parameters is not an instance of module:resin/connection.OSParams

Type
  Error

##### Example

    parameters =
    		network: 'ethernet'
    		appId: 91

    resin.models.os.download parameters, '/opt/os.zip', (error) ->
    		throw error if error?
    	, (state) ->
    		return if not state?
    		console.log "Total: #{state.total}"
    		console.log "Received: #{state.received}"

#### (static) download(parameters, destination, callback, onProgress)

Download an OS image

##### Parameters:

Name | Type | Description
--- | --- | ---
`parameters` | Object | os parameters
`destination` | String | destination path
`callback` | module:resin.models.os~downloadCallback | callback
`onProgress` | function | on progress callback

Source:
  - models/os.js, line 54
To Do:
  - Find a way to test this

##### Throws:

If parameters is not an instance of module:resin/connection.OSParams

Type
  Error

##### Example

    parameters =
    		network: 'ethernet'
    		appId: 91

    resin.models.os.download parameters, '/opt/os.zip', (error) ->
    		throw error if error?
    	, (state) ->
    		return if not state?
    		console.log "Total: #{state.total}"
    		console.log "Received: #{state.received}"

Source:
  - resource/models/os.js, line 2

### Methods

#### (static) download(parameters, destination, callback, onProgress)

Download an OS image

##### Parameters:

Name | Type | Description
--- | --- | ---
`parameters` | Object | os parameters
`destination` | String | destination path
`callback` | module:resin.models.os~downloadCallback | callback
`onProgress` | function | on progress callback

Source:
  - resource/models/os.js, line 54
To Do:
  - Find a way to test this

##### Throws:

If parameters is not an instance of module:resin/connection.OSParams

Type
  Error

##### Example

    parameters =
    		network: 'ethernet'
    		appId: 91

    resin.models.os.download parameters, '/opt/os.zip', (error) ->
    		throw error if error?
    	, (state) ->
    		return if not state?
    		console.log "Total: #{state.total}"
    		console.log "Received: #{state.received}"

#### (static) download(parameters, destination, callback, onProgress)

Download an OS image

##### Parameters:

Name | Type | Description
--- | --- | ---
`parameters` | Object | os parameters
`destination` | String | destination path
`callback` | module:resin.models.os~downloadCallback | callback
`onProgress` | function | on progress callback

Source:
  - models/os.js, line 54
To Do:
  - Find a way to test this

##### Throws:

If parameters is not an instance of module:resin/connection.OSParams

Type
  Error

##### Example

    parameters =
    		network: 'ethernet'
    		appId: 91

    resin.models.os.download parameters, '/opt/os.zip', (error) ->
    		throw error if error?
    	, (state) ->
    		return if not state?
    		console.log "Total: #{state.total}"
    		console.log "Received: #{state.received}"