# Module: application

Source:
  - models/application.js, line 2

### Methods

#### (static) create(name, deviceType, callback)

Create an application

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | String | application name
`deviceType` | String | device type (slug form)
`callback` | module:resin.models.application~createCallback | callback

Source:
  - resource/models/application.js, line 130

##### Example

    resin.models.application.create 'My App', 'raspberry-pi', (error, id) ->
    		throw error if error?
    		console.log(id)

#### (static) create(name, deviceType, callback)

Create an application

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | String | application name
`deviceType` | String | device type (slug form)
`callback` | module:resin.models.application~createCallback | callback

Source:
  - models/application.js, line 222

##### Example

    resin.models.application.create 'My App', 'raspberry-pi', (error, id) ->
    		throw error if error?
    		console.log(id)

#### (static) get(name, callback)

Get a single application

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | String | application name
`callback` | module:resin.models.application~getCallback | callback

Source:
  - models/application.js, line 110

##### Example

    resin.models.application.get 'MyApp', (error, application) ->
    		throw error if error?
    		console.log(application)

#### (static) get(id, callback)

Get a single application

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | String | Number | application id
`callback` | module:resin.models.application~getCallback | callback

Source:
  - resource/models/application.js, line 92

##### Example

    resin.models.application.get 51, (error, application) ->
    		throw error if error?
    		console.log(application)

#### (static) getAll(callback)

Get all applications

##### Parameters:

Name | Type | Description
--- | --- | ---
`callback` | module:resin.models.application~getAllCallback | callback

Source:
  - resource/models/application.js, line 47

##### Example

    resin.models.application.getAll (error, applications) ->
    		throw error if error?
    		console.log(applications)

#### (static) getAll(callback)

Get all applications

##### Parameters:

Name | Type | Description
--- | --- | ---
`callback` | module:resin.models.application~getAllCallback | callback

Source:
  - models/application.js, line 49

##### Example

    resin.models.application.getAll (error, applications) ->
    		throw error if error?
    		console.log(applications)

#### (static) getById(id, callback)

Get a single application by id

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | Number | String | application id
`callback` | module:resin.models.application~getByIdCallback | callback

Source:
  - models/application.js, line 169

##### Example

    resin.models.application.getById 89, (error, application) ->
    		throw error if error?
    		console.log(application)

#### (static) remove(id, callback)

Remove application

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | String | Number | application id
`callback` | module:resin.models.application~removeCallback | callback

Source:
  - resource/models/application.js, line 169

##### Example

    resin.models.application.remove 51, (error) ->
    		throw error if error?

#### (static) remove(name, callback)

Remove application

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | String | application name
`callback` | module:resin.models.application~removeCallback | callback

Source:
  - models/application.js, line 282

##### Example

    resin.models.application.remove 'MyApp', (error) ->
    		throw error if error?

#### (static) restart(id, callback)

Restart application

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | String | Number | application id
`callback` | module:resin.models.application~restartCallback | callback

Source:
  - resource/models/application.js, line 197

##### Example

    resin.models.application.restart 51, (error) ->
    		throw error if error?

#### (static) restart(name, callback)

Restart application

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | String | application name
`callback` | module:resin.models.application~restartCallback | callback

Source:
  - models/application.js, line 334

##### Example

    resin.models.application.restart 'MyApp', (error) ->
    		throw error if error?

### Type Definitions

#### Application

A Resin API application

##### Type:

- Object

Source:
  - resource/models/application.js, line 20

#### Application

A Resin API application

##### Type:

- Object

Source:
  - models/application.js, line 22

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

### Methods

#### (static) create(name, deviceType, callback)

Create an application

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | String | application name
`deviceType` | String | device type (slug form)
`callback` | module:resin.models.application~createCallback | callback

Source:
  - resource/models/application.js, line 130

##### Example

    resin.models.application.create 'My App', 'raspberry-pi', (error, id) ->
    		throw error if error?
    		console.log(id)

#### (static) create(name, deviceType, callback)

Create an application

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | String | application name
`deviceType` | String | device type (slug form)
`callback` | module:resin.models.application~createCallback | callback

Source:
  - models/application.js, line 222

##### Example

    resin.models.application.create 'My App', 'raspberry-pi', (error, id) ->
    		throw error if error?
    		console.log(id)

#### (static) get(name, callback)

Get a single application

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | String | application name
`callback` | module:resin.models.application~getCallback | callback

Source:
  - models/application.js, line 110

##### Example

    resin.models.application.get 'MyApp', (error, application) ->
    		throw error if error?
    		console.log(application)

#### (static) get(id, callback)

Get a single application

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | String | Number | application id
`callback` | module:resin.models.application~getCallback | callback

Source:
  - resource/models/application.js, line 92

##### Example

    resin.models.application.get 51, (error, application) ->
    		throw error if error?
    		console.log(application)

#### (static) getAll(callback)

Get all applications

##### Parameters:

Name | Type | Description
--- | --- | ---
`callback` | module:resin.models.application~getAllCallback | callback

Source:
  - resource/models/application.js, line 47

##### Example

    resin.models.application.getAll (error, applications) ->
    		throw error if error?
    		console.log(applications)

#### (static) getAll(callback)

Get all applications

##### Parameters:

Name | Type | Description
--- | --- | ---
`callback` | module:resin.models.application~getAllCallback | callback

Source:
  - models/application.js, line 49

##### Example

    resin.models.application.getAll (error, applications) ->
    		throw error if error?
    		console.log(applications)

#### (static) getById(id, callback)

Get a single application by id

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | Number | String | application id
`callback` | module:resin.models.application~getByIdCallback | callback

Source:
  - models/application.js, line 169

##### Example

    resin.models.application.getById 89, (error, application) ->
    		throw error if error?
    		console.log(application)

#### (static) remove(id, callback)

Remove application

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | String | Number | application id
`callback` | module:resin.models.application~removeCallback | callback

Source:
  - resource/models/application.js, line 169

##### Example

    resin.models.application.remove 51, (error) ->
    		throw error if error?

#### (static) remove(name, callback)

Remove application

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | String | application name
`callback` | module:resin.models.application~removeCallback | callback

Source:
  - models/application.js, line 282

##### Example

    resin.models.application.remove 'MyApp', (error) ->
    		throw error if error?

#### (static) restart(id, callback)

Restart application

##### Parameters:

Name | Type | Description
--- | --- | ---
`id` | String | Number | application id
`callback` | module:resin.models.application~restartCallback | callback

Source:
  - resource/models/application.js, line 197

##### Example

    resin.models.application.restart 51, (error) ->
    		throw error if error?

#### (static) restart(name, callback)

Restart application

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | String | application name
`callback` | module:resin.models.application~restartCallback | callback

Source:
  - models/application.js, line 334

##### Example

    resin.models.application.restart 'MyApp', (error) ->
    		throw error if error?

### Type Definitions

#### Application

A Resin API application

##### Type:

- Object

Source:
  - resource/models/application.js, line 20

#### Application

A Resin API application

##### Type:

- Object

Source:
  - models/application.js, line 22