Application
balena.models.application : object
Kind: static namespace
create
balena.models.application.create(options) ⇒ Promise
Kind: static method of application
Summary: Create an application
Access: public
Fulfil: Object - application
options
Object
application creation parameters
options.name
String
application name
options.organization
String | Number
handle (string) or id (number) of the organization that the application will belong to or null
[options.uuid]
String
application uuid
[options.applicationClass]
String
application class: 'app' | 'fleet' | 'block'
options.deviceType
String
device type slug
Example
balena.models.application.create({ name: 'My App', organization: 'myorganization', deviceType: 'raspberry-pi' }).then(function(application) {
console.log(application);
});Example
balena.models.application.create({ name: 'My Block', organization: 'myorganization', applicationClass: 'block', deviceType: 'raspberry-pi' }).then(function(application) {
console.log(application);
});disableDeviceUrls
balena.models.application.disableDeviceUrls(slugOrUuidOrId) ⇒ Promise
Kind: static method of application
Summary: Disable device urls for all devices that belong to an application
Access: public
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
Example
Example
enableDeviceUrls
balena.models.application.enableDeviceUrls(slugOrUuidOrId) ⇒ Promise
Kind: static method of application
Summary: Enable device urls for all devices that belong to an application
Access: public
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
Example
Example
generateProvisioningKey
balena.models.application.generateProvisioningKey(generateProvisioningKeyParams) ⇒ Promise
Kind: static method of application
Summary: Generate a device provisioning key for a specific application
Access: public
Fulfil: String - device provisioning key
generateProvisioningKeyParams
Object
an object containing the parameters for the provisioning key generation
generateProvisioningKeyParams.slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
generateProvisioningKeyParams.keyExpiryDate
String
Expiry Date for provisioning key
[generateProvisioningKeyParams.keyName]
String
Provisioning key name
[generateProvisioningKeyParams.keyDescription]
String
Description for provisioning key
Example
Example
Example
get
balena.models.application.get(slugOrUuidOrId, [options], [context]) ⇒ Promise
Kind: static method of application
Summary: Get a single application
Access: public
Fulfil: Object - application
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
[options]
Object
{}
extra pine options to use
[context]
String
extra access filters, undefined or 'directly_accessible'
Example
Example
Example
getAll
balena.models.application.getAll([options], [context]) ⇒ Promise
Kind: static method of application
Summary: Get all applications
Access: public
Fulfil: Object[] - applications
[options]
Object
{}
extra pine options to use
[context]
String
extra access filters, undefined or 'directly_accessible'
Example
getAllByOrganization
balena.models.application.getAllByOrganization(orgHandleOrId, [options]) ⇒ Promise
Kind: static method of application
Summary: Get all applications of an organization
Access: public
Fulfil: Object[] - applications
orgHandleOrId
Number | String
organization handle (string) or id (number)
[options]
Object
{}
extra pine options to use
Example
Example
getAllDirectlyAccessible
balena.models.application.getAllDirectlyAccessible([options]) ⇒ Promise
Kind: static method of application
Summary: Get all applications directly accessible by the user
Access: public
Fulfil: Object[] - applications
[options]
Object
{}
extra pine options to use
Example
getAppByName
balena.models.application.getAppByName(appName, [options], [context]) ⇒ Promise
Kind: static method of application
Summary: Get a single application using the appname and the handle of the owning organization
Access: public
Fulfil: Object - application
appName
String
application name
[options]
Object
{}
extra pine options to use
[context]
String
extra access filters, undefined or 'directly_accessible'
Example
getDashboardUrl
balena.models.application.getDashboardUrl(id) ⇒ String
Kind: static method of application
Summary: Get Dashboard URL for a specific application
Returns: String - - Dashboard URL for the specific application
Throws:
Exception if the id is not a finite number
id
Number
Application id
Example
getDirectlyAccessible
balena.models.application.getDirectlyAccessible(slugOrUuidOrId, [options]) ⇒ Promise
Kind: static method of application
Summary: Get a single application directly accessible by the user
Access: public
Fulfil: Object - application
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
[options]
Object
{}
extra pine options to use
Example
Example
getTargetReleaseHash
balena.models.application.getTargetReleaseHash(slugOrUuidOrId) ⇒ Promise
Kind: static method of application
Summary: Get the hash of the current release for a specific application
Access: public
Fulfil: String|undefined - The release hash of the current release
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
Example
Example
Example
getWithDeviceServiceDetails
balena.models.application.getWithDeviceServiceDetails(slugOrUuidOrId, [options]) ⇒ Promise
This method does not map exactly to the underlying model: it runs a larger prebuilt query, and reformats it into an easy to use and understand format. If you want more control, or to see the raw model directly, use application.get(uuidOrId, options) instead.
Kind: static method of application
Summary: Get a single application and its devices, along with each device's associated services' essential details
Access: public
Fulfil: Object - application
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
[options]
Object
{}
extra pine options to use
Example
Example
grantSupportAccess
balena.models.application.grantSupportAccess(slugOrUuidOrId, expiryTimestamp) ⇒ Promise
Kind: static method of application
Summary: Grant support access to an application until a specified time
Access: public
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
expiryTimestamp
Number
a timestamp in ms for when the support access will expire
Example
Example
has
balena.models.application.has(slugOrUuidOrId) ⇒ Promise
Kind: static method of application
Summary: Check if an application exists
Access: public
Fulfil: Boolean - has application
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
Example
Example
hasAny
balena.models.application.hasAny() ⇒ Promise
Kind: static method of application
Summary: Check if the user has access to any applications
Access: public
Fulfil: Boolean - has any applications
Example
isTrackingLatestRelease
balena.models.application.isTrackingLatestRelease(slugOrUuidOrId) ⇒ Promise
Kind: static method of application
Summary: Get whether the application is up to date and is tracking the latest finalized release for updates
Access: public
Fulfil: Boolean - is tracking the latest release
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
Example
Example
pinToRelease
balena.models.application.pinToRelease(slugOrUuidOrId, fullReleaseHash) ⇒ Promise
Configures the application to run a particular release and not get updated when the latest release changes.
Kind: static method of application
Summary: Set a specific application to run a particular release
Access: public
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
fullReleaseHash
String
the hash of a successful release (string)
Example
Example
purge
balena.models.application.purge(appId) ⇒ Promise
Kind: static method of application
Summary: Purge devices by application id
Access: public
appId
Number
application id
Example
reboot
balena.models.application.reboot(appId, [options]) ⇒ Promise
Kind: static method of application
Summary: Reboot devices by application id
Access: public
appId
Number
application id
[options]
Object
options
[options.force]
Boolean
false
override update lock
Example
remove
balena.models.application.remove(slugOrUuidOrIdOrIds) ⇒ Promise
Kind: static method of application
Summary: Remove application
Access: public
slugOrUuidOrIdOrIds
String | Number | Array.<Number>
application slug (string), uuid (string) or id (number) or array of ids
Example
Example
rename
balena.models.application.rename(slugOrUuidOrId, newName) ⇒ Promise
Kind: static method of application
Summary: Rename application
Access: public
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
newName
String
new application name (string)
Example
Example
restart
balena.models.application.restart(slugOrUuidOrId) ⇒ Promise
Kind: static method of application
Summary: Restart application
Access: public
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
Example
Example
revokeSupportAccess
balena.models.application.revokeSupportAccess(slugOrUuidOrId) ⇒ Promise
Kind: static method of application
Summary: Revoke support access to an application
Access: public
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
Example
Example
shutdown
balena.models.application.shutdown(appId, [options]) ⇒ Promise
Kind: static method of application
Summary: Shutdown devices by application id
Access: public
appId
Number
application id
[options]
Object
options
[options.force]
Boolean
false
override update lock
Example
trackLatestRelease
balena.models.application.trackLatestRelease(slugOrUuidOrId) ⇒ Promise
The application's current release will be updated with each new successfully built release.
Kind: static method of application
Summary: Configure a specific application to track the latest finalized available release
Access: public
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
Example
Example
willTrackNewReleases
balena.models.application.willTrackNewReleases(slugOrUuidOrId) ⇒ Promise
Kind: static method of application
Summary: Get whether the application is configured to receive updates whenever a new release is available
Access: public
Fulfil: Boolean - is tracking the latest release
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
Example
Example
buildVar
balena.models.application.buildVar : object
Kind: static namespace of application
get
balena.models.application.buildVar.get(slugOrUuidOrId, key) ⇒ Promise
Kind: static method of buildVar
Summary: Get the value of a specific build environment variable
Access: public
Fulfil: String|undefined - the build environment variable value (or undefined)
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
key
String
build environment variable name
Example
Example
getAllByApplication
balena.models.application.buildVar.getAllByApplication(slugOrUuidOrId, [options]) ⇒ Promise
Kind: static method of buildVar
Summary: Get all build environment variables for an application
Access: public
Fulfil: Object[] - application build environment variables
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
[options]
Object
{}
extra pine options to use
Example
Example
remove
balena.models.application.buildVar.remove(slugOrUuidOrId, key) ⇒ Promise
Kind: static method of buildVar
Summary: Clear the value of a specific build environment variable
Access: public
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
key
String
build environment variable name
Example
Example
set
balena.models.application.buildVar.set(slugOrUuidOrId, key, value) ⇒ Promise
Kind: static method of buildVar
Summary: Set the value of a specific build environment variable
Access: public
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
key
String
build environment variable name
value
String
build environment variable value
Example
Example
configVar
balena.models.application.configVar : object
Kind: static namespace of application
get
balena.models.application.configVar.get(slugOrUuidOrId, key) ⇒ Promise
Kind: static method of configVar
Summary: Get the value of a specific config variable
Access: public
Fulfil: String|undefined - the config variable value (or undefined)
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
key
String
config variable name
Example
Example
getAllByApplication
balena.models.application.configVar.getAllByApplication(slugOrUuidOrId, [options]) ⇒ Promise
Kind: static method of configVar
Summary: Get all config variables for an application
Access: public
Fulfil: Object[] - application config variables
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
[options]
Object
{}
extra pine options to use
Example
Example
remove
balena.models.application.configVar.remove(slugOrUuidOrId, key) ⇒ Promise
Kind: static method of configVar
Summary: Clear the value of a specific config variable
Access: public
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
key
String
config variable name
Example
Example
set
balena.models.application.configVar.set(slugOrUuidOrId, key, value) ⇒ Promise
Kind: static method of configVar
Summary: Set the value of a specific config variable
Access: public
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
key
String
config variable name
value
String
config variable value
Example
Example
envVar
balena.models.application.envVar : object
Kind: static namespace of application
get
balena.models.application.envVar.get(slugOrUuidOrId, key) ⇒ Promise
Kind: static method of envVar
Summary: Get the value of a specific environment variable
Access: public
Fulfil: String|undefined - the environment variable value (or undefined)
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
key
String
environment variable name
Example
Example
getAllByApplication
balena.models.application.envVar.getAllByApplication(slugOrUuidOrId, [options]) ⇒ Promise
Kind: static method of envVar
Summary: Get all environment variables for an application
Access: public
Fulfil: Object[] - application environment variables
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
[options]
Object
{}
extra pine options to use
Example
Example
remove
balena.models.application.envVar.remove(slugOrUuidOrId, key) ⇒ Promise
Kind: static method of envVar
Summary: Clear the value of a specific environment variable
Access: public
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
key
String
environment variable name
Example
Example
set
balena.models.application.envVar.set(slugOrUuidOrId, key, value) ⇒ Promise
Kind: static method of envVar
Summary: Set the value of a specific environment variable
Access: public
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
key
String
environment variable name
value
String
environment variable value
Example
Example
invite
balena.models.application.invite : object
Kind: static namespace of application
accept
balena.models.application.invite.accept(invitationToken) ⇒ Promise
This method adds the calling user to the application.
Kind: static method of invite
Summary: Accepts an invite
Access: public
invitationToken
String
invite token
Example
create
balena.models.application.invite.create(slugOrUuidOrId, options, [message]) ⇒ Promise
This method invites a user by their email to an application.
Kind: static method of invite
Summary: Creates a new invite for an application
Access: public
Fulfil: String - application invite
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
options
Object
invite creation parameters
options.invitee
String
the email of the invitee
[options.roleName]
String
"developer"
the role name to be granted to the invitee
[message]
String
the message to send along with the invite
Example
getAll
balena.models.application.invite.getAll([options]) ⇒ Promise
This method returns all invites.
Kind: static method of invite
Summary: Get all invites
Access: public
Fulfil: Object[] - invites
[options]
Object
{}
extra pine options to use
Example
getAllByApplication
balena.models.application.invite.getAllByApplication(slugOrUuidOrId, [options]) ⇒ Promise
This method returns all invites for a specific application.
Kind: static method of invite
Summary: Get all invites by application
Access: public
Fulfil: Object[] - invites
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
[options]
Object
{}
extra pine options to use
Example
Example
revoke
balena.models.application.invite.revoke(id) ⇒ Promise
Kind: static method of invite
Summary: Revoke an invite
Access: public
id
Number
application invite id
Example
membership
balena.models.application.membership : object
Kind: static namespace of application
changeRole
balena.models.application.membership.changeRole(idOrUniqueKey, roleName) ⇒ Promise
This method changes the role of an application member.
Kind: static method of membership
Summary: Changes the role of an application member
Access: public
idOrUniqueKey
Number | Object
the id or an object with the unique user & is_member_of__application numeric pair of the membership that will be changed
roleName
String
the role name to be granted to the membership
Example
Example
create
balena.models.application.membership.create(options) ⇒ Promise
This method adds a user to an application by their username if they are a member of the organization.
Kind: static method of membership
Summary: Creates a new membership for an application
Access: public
Fulfil: Object - application membership
options
Object
membership creation parameters
options.application
String | Number
application handle (string), or id (number)
options.username
String
the username of the balena user that will become a member
[options.roleName]
String
"member"
the role name to be granted to the membership
Example
get
balena.models.application.membership.get(membershipId, [options]) ⇒ Promise
This method returns a single application membership.
Kind: static method of membership
Summary: Get a single application membership
Access: public
Fulfil: Object - application membership
membershipId
number | Object
the id or an object with the unique user & is_member_of__application numeric pair of the membership
[options]
Object
{}
extra pine options to use
Example
getAllByApplication
balena.models.application.membership.getAllByApplication(slugOrUuidOrId, [options]) ⇒ Promise
This method returns all application memberships for a specific application.
Kind: static method of membership
Summary: Get all memberships by application
Access: public
Fulfil: Object[] - application memberships
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
[options]
Object
{}
extra pine options to use
Example
Example
getAllByUser
balena.models.application.membership.getAllByUser(usernameOrId, [options]) ⇒ Promise
This method returns all application memberships for a specific user.
Kind: static method of membership
Summary: Get all memberships by user
Access: public
Fulfil: Object[] - application memberships
usernameOrId
String | Number
the user's username (string) or id (number)
[options]
Object
{}
extra pine options to use
Example
Example
remove
balena.models.application.membership.remove(idOrUniqueKey) ⇒ Promise
Kind: static method of membership
Summary: Remove a membership
Access: public
idOrUniqueKey
Number | Object
the id or an object with the unique user & is_member_of__application numeric pair of the membership that will be removed
Example
Example
tags
balena.models.application.tags : object
Kind: static namespace of application
getAllByApplication
balena.models.application.tags.getAllByApplication(slugOrUuidOrId, [options]) ⇒ Promise
Kind: static method of tags
Summary: Get all application tags for an application
Access: public
Fulfil: Object[] - application tags
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
[options]
Object
{}
extra pine options to use
Example
Example
remove
balena.models.application.tags.remove(slugOrUuidOrId, tagKey) ⇒ Promise
Kind: static method of tags
Summary: Remove an application tag
Access: public
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
tagKey
String
tag key
Example
set
balena.models.application.tags.set(slugOrUuidOrId, tagKey, value) ⇒ Promise
Kind: static method of tags
Summary: Set an application tag
Access: public
slugOrUuidOrId
String | Number
application slug (string), uuid (string) or id (number)
tagKey
String
tag key
value
String | undefined
tag value
Example
Example
Last updated
Was this helpful?