Organization
balena.models.organization : object
Kind: static namespace
create
balena.models.organization.create(options) ⇒ Promise
This method creates a new organization with the current user as an administrator.
Kind: static method of organization
Summary: Creates a new organization
Access: public
Fulfil: String - Organization
options
Object
Organization parameters to use.
options.name
String
Required: the name of the organization that will be created.
[options.handle]
String
The handle of the organization that will be created.
Example
balena.models.organization.create({ name:'MyOrganization' }).then(function(organization) {
console.log(organization);
});Example
balena.models.organization.create({
name:'MyOrganization',
logo_image: new File(
imageContent,
'img.jpeg'
);
})
.then(function(organization) {
console.log(organization);
});get
balena.models.organization.get(handleOrId, [options]) ⇒ Promise
Kind: static method of organization
Summary: Get a single organization
Access: public
Fulfil: Object - organization
handleOrId
String | Number
organization handle (string) or id (number).
[options]
Object
{}
extra pine options to use
Example
Example
getAll
balena.models.organization.getAll([options]) ⇒ Promise
Kind: static method of organization
Summary: Get all Organizations
Access: public
Fulfil: Object[] - organizations
[options]
Object
{}
extra pine options to use
Example
remove
balena.models.organization.remove(handleOrId) ⇒ Promise
Kind: static method of organization
Summary: Remove an Organization
Access: public
handleOrId
String | Number
organization handle (string) or id (number).
Example
invite
balena.models.organization.invite : object
Kind: static namespace of organization
accept
balena.models.organization.invite.accept(invitationToken) ⇒ Promise
This method adds the calling user to the organization.
Kind: static method of invite
Summary: Accepts an invite
Access: public
invitationToken
String
invite token
Example
create
balena.models.organization.invite.create(handleOrId, options, [message]) ⇒ Promise
This method invites a user by their email to an organization.
Kind: static method of invite
Summary: Creates a new invite for an organization
Access: public
Fulfil: String - organization invite
handleOrId
String | Number
organization handle (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.organization.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
getAllByOrganization
balena.models.organization.invite.getAllByOrganization(handleOrId, [options]) ⇒ Promise
This method returns all invites for a specific organization.
Kind: static method of invite
Summary: Get all invites by organization
Access: public
Fulfil: Object[] - invites
handleOrId
String | Number
organization handle (string), or id (number)
[options]
Object
{}
extra pine options to use
Example
Example
revoke
balena.models.organization.invite.revoke(id) ⇒ Promise
Kind: static method of invite
Summary: Revoke an invite
Access: public
id
Number
organization invite id
Example
membership
balena.models.organization.membership : object
Kind: static namespace of organization
changeRole
balena.models.organization.membership.changeRole(idOrUniqueKey, roleName) ⇒ Promise
This method changes the role of an organization member.
Kind: static method of membership
Summary: Changes the role of an organization member
Access: public
idOrUniqueKey
Number | Object
the id or an object with the unique user & is_member_of__organization numeric pair of the membership that will be changed
roleName
String
the role name to be granted to the membership
Example
Example
get
balena.models.organization.membership.get(membershipId, [options]) ⇒ Promise
This method returns a single organization membership.
Kind: static method of membership
Summary: Get a single organization membership
Access: public
Fulfil: Object - organization membership
membershipId
number | Object
the id or an object with the unique user & is_member_of__organization numeric pair of the membership
[options]
Object
{}
extra pine options to use
Example
getAllByOrganization
balena.models.organization.membership.getAllByOrganization(handleOrId, [options]) ⇒ Promise
This method returns all organization memberships for a specific organization.
Kind: static method of membership
Summary: Get all memberships by organization
Access: public
Fulfil: Object[] - organization memberships
handleOrId
String | Number
organization handle (string) or id (number).
[options]
Object
{}
extra pine options to use
Example
Example
getAllByUser
balena.models.organization.membership.getAllByUser(usernameOrId, [options]) ⇒ Promise
This method returns all organization memberships for a specific user.
Kind: static method of membership
Summary: Get all memberships by user
Access: public
Fulfil: Object[] - organization memberships
usernameOrId
String | Number
the user's username (string) or id (number)
[options]
Object
{}
extra pine options to use
Example
Example
remove
balena.models.organization.membership.remove(id) ⇒ Promise
Kind: static method of membership
Summary: Remove a membership
Access: public
id
Number
organization membership id
Example
Example
Last updated
Was this helpful?