Team
balena.models.team : object
Kind: static namespace
create
balena.models.team.create(organizationSlugOrId, name) ⇒ Promise
This method creates a new team.
Kind: static method of team
Summary: Creates a new Team
Access: public
Fulfil: Object - Team
organizationSlugOrId
Number
Required: the organization slug or id the team will be part of.
name
String
Required: the name of the team that will be created.
Example
balena.models.team.create(1239948, 'MyTeam').then(function(team) {
console.log(team);
});Example
balena.models.team.create('myOrgHandle', 'MyTeam')
.then(function(team) {
console.log(team);
});get
balena.models.team.get(teamId, [options]) ⇒ Promise
Kind: static method of team
Summary: Get a single Team
Access: public
Fulfil: Object - Team
teamId
Number
team id (number).
[options]
Object
{}
extra pine options to use
Example
getAllByOrganization
balena.models.team.getAllByOrganization(organizationSlugOrId, [options]) ⇒ Promise
Kind: static method of team
Summary: Get all Teams of a specific Organization
Access: public
Fulfil: Object[] - Teams
organizationSlugOrId
Number
Required: the organization slug or id the team is part of.
[options]
Object
{}
extra pine options to use
Example
Example
remove
balena.models.team.remove(teamId) ⇒ Promise
Kind: static method of team
Summary: Remove a Team
Access: public
teamId
Number
team id (number).
Example
rename
balena.models.team.rename(teamId, newName) ⇒ Promise
Kind: static method of team
Summary: Rename Team
Access: public
teamId
Number
team id (number)
newName
String
new team name (string)
Example
applicationAccess
balena.models.team.applicationAccess : object
Kind: static namespace of team
get
balena.models.team.applicationAccess.get(teamApplicationAccessId, [options]) ⇒ Promise
This method get specific team application access.
Kind: static method of applicationAccess
Summary: Get team applications access
Access: public
Fulfil: Object - TeamApplicationAccess
teamApplicationAccessId
Number
Required: the team application access id.
[options]
Object
{}
extra pine options to use
Example
getAllByTeam
balena.models.team.applicationAccess.getAllByTeam(teamId, [options]) ⇒ Promise
This method get all team application access.
Kind: static method of applicationAccess
Summary: Get all team applications access
Access: public
Fulfil: Object[] - team application access
teamId
Number
Required: the team id.
[options]
Object
{}
extra pine options to use
Example
remove
balena.models.team.applicationAccess.remove(teamApplicationAccessId) ⇒ Promise
This remove a team application access.
Kind: static method of applicationAccess
Summary: Remove team application access
Access: public
Fulfil: void
teamApplicationAccessId
Number
Required: the team application access id.
Example
update
balena.models.team.applicationAccess.update(teamApplicationAccessId, roleName) ⇒ Promise
This method update a team application access role.
Kind: static method of applicationAccess
Summary: Update team application access
Access: public
Fulfil: Object - TeamApplicationAccess
teamApplicationAccessId
Number
Required: the team application access id.
roleName
String
Required: The new role to assing (ApplicationMembershipRoles).
Example
membership
balena.models.team.membership : object
Kind: static namespace of team
create
balena.models.team.membership.create(options) ⇒ Promise
This method adds a user to a team by their username.
Kind: static method of membership
Summary: Creates a new membership for a team
Access: public
Fulfil: Object - team membership
options
Object
membership creation parameters
options.team
Number
team id
options.username
String
the username of the balena user that will become a member
Example
get
balena.models.team.membership.get(membershipId, [options]) ⇒ Promise
This method returns a single team membership.
Kind: static method of membership
Summary: Get a single team membership
Access: public
Fulfil: Object - team membership
membershipId
Number
the team membership id
[options]
Object
{}
extra pine options to use
Example
getAllByTeam
balena.models.team.membership.getAllByTeam(teamId, [options]) ⇒ Promise
This method returns all team memberships for a specific team.
Kind: static method of membership
Summary: Get all memberships by team
Access: public
Fulfil: Object[] - team memberships
teamId
Number
the team id
[options]
Object
{}
extra pine options to use
Example
getAllByUser
balena.models.team.membership.getAllByUser(usernameOrId, [options]) ⇒ Promise
This method returns all team memberships for a specific user.
Kind: static method of membership
Summary: Get all memberships by user
Access: public
Fulfil: Object[] - team memberships
usernameOrId
String | Number
the user's username (string) or id (number)
[options]
Object
{}
extra pine options to use
Example
Example
remove
balena.models.team.membership.remove(idOrIds) ⇒ Promise
Kind: static method of membership
Summary: Remove a team membership
Access: public
idOrIds
Number | Array.<Number>
team membership id or array of team membership ids
Example
Example
Last updated
Was this helpful?