The ID of the organization to create the role under
The ID of the entity the role belongs to (for example a user ID)
The role to add ("owner" or "operator")
The type of resource to create the role for ("robot", "location", or "organization")
The ID of the resource the role is being created for
Changes an existing role.
const oldAuth = new VIAM.appApi.Authorization({
authorizationType: 'role',
authorizationId: 'organization_owner',
organizationId: '<YOUR-ORGANIZATION-ID>',
resourceId: '<YOUR-RESOURCE-ID>', // The resource to grant access to
resourceType: 'organization', // The type of resource to grant access to
identityId: '<USER-ID>', // The user id of the user to grant access to (optional)
roleId: 'owner', // The role to grant access to
identityType: 'user',
});
const newAuth = new VIAM.appApi.Authorization({
authorizationType: 'role',
authorizationId: 'organization_operator',
organizationId: '<YOUR-ORGANIZATION-ID>',
resourceId: '<YOUR-RESOURCE-ID>', // The resource to grant access to
resourceType: 'organization', // The type of resource to grant access To
identityId: '<USER-ID>', // The user id of the user to grant access to (optional)
roleId: 'operator', // The role to grant access to
identityType: 'user',
});
await appClient.changeRole(oldAuth, newAuth);
Checks whether requested permissions exist.
A list of permissions to check
A filtered list of the authorized permissions
Creates a new API key.
The list of authorizations to provide for the API key
Optional
name: stringAn optional name for the key. If none is passed, defaults to present timestamp
The new key and ID
Creates a new key with an existing key's authorizations
The ID of the key to duplicate
The new key and ID
Creates a new location.
The ID of the organization to create the location under
The name of the location to create
Optional
parentLocationId: stringOptional name of a parent location to create the new location under
The location object
Create a location secret (LocationAuth
).
The ID of the location to create a LocationAuth
for
The newly created LocationAuth
Creates a new module.
The ID of the organization to create the module under
The name of the module
The module ID and a URL to its detail page
Create a new organization.
The name of the new organization
The new organization
Creates a new invitation to join an organization.
The id of the organization to create the invite for
The email address of the user to generate an invite for
The authorizations to associate with the new invite
Bool of whether to send an email invite (true) or automatically add a user. Defaults to true
The organization invite
const auth = new VIAM.appApi.Authorization({
authorizationType: 'role',
authorizationId: 'organization_operator',
organizationId: '<YOUR-ORGANIZATION-ID>',
resourceId: '<YOUR-RESOURCE-ID>', // The resource to grant access to
resourceType: 'organization', // The type of resource to grant access to
identityId: '<YOUR-USER-ID>', // The user id of the user to grant access to (optional)
roleId: 'owner', // The role to grant access to
identityType: 'user',
});
const invite = await appClient.createOrganizationInvite(
'<YOUR-ORGANIZATION-ID>',
'youremail@email.com',
[auth]
);
Create a new registry item.
The ID of the organization to create the registry item under
The name of the registry item
The type of the item in the registry.
Creates a new secret for a robot part.
The ID of the part to create a secret for
The robot part object
Deletes an existing API key.
The ID of the key to delete
Retrieves the app content for an organization.
The public namespace of the organization
The name of the app
The blob path and entrypoint of the app content
Looks up a fragment by ID.
The ID of the fragment to look up
The requested fragment
Looks up a location.
The ID of the location to query.
The location object
Retrieves user-defined metadata for a location.
The ID of the location
The metadata associated with the location
Looks up a particular module.
The ID of the module
The requested module
Get details about an organization.
The ID of the organization
Details about the organization, if it exists
Retrieves user-defined metadata for an organization.
The ID of the organization
The metadata associated with the organization
List all organizations with access to a particular location.
The ID of the location to query
The list of locations with access to the requested location
Get an item from the registry.
The ID of the item to get
The requested item
Gets a list of a robot's API keys.
The ID of the robot to get API keys for
A list of the robot's API keys
Retrieves user-defined metadata for a robot.
The ID of the robot
The metadata associated with the robot
Queries a specific robot part by ID.
The ID of the requested robot part
The robot part and a its json config
Get a list containing the history of a robot part.
The ID of the requested robot part
The list of the robot part's history
Get a page of log entries for a specific robot part. Logs are sorted by descending time (newest first).
The ID of the requested robot part
Optional
filter: stringOptional string to filter logs on
Optional
levels: string[]Optional array of log levels to return. Defaults to returning all log levels
Optional string indicating which page of logs to query. Defaults to the most recent
The robot requested logs and the page token for the next page of logs
Retrieves user-defined metadata for a robot part.
The ID of the robot part
The metadata associated with the robot part
Returns a list of parts for a given robot
The ID of the robot to query
The list of RobotPart
objects associated with the robot
Returns a list of rover rental robots for an organization.
The ID of the organization to query
The list of RoverRentalRobot
objects
Obtain a user's ID from their email address. Internal use only.
The email address of the user
The user's ID
List all authorizations for an organization.
The ID of the organization to list authorizations for
Optional
resourceIds: string[]Optional list of IDs of resources to list authorizations for. If not provided, all resources will be included
The list of authorizations
Lists all fragments within an organization.
The ID of the organization to list fragments for
Optional, deprecated boolean. Use fragmentVisibilities instead. If true then only public fragments will be listed. Defaults to true
The list of fragment objects
List all API keys for an organization.
The ID of the organization to query
The list of API keys
Lists all locations under an organization.
The ID of the organization to query
A list of locations under the organization
The machine ID used to filter fragments defined in a machine's parts. Also returns any fragments nested within the fragments defined in parts.
Optional
additionalFragmentIds: string[]Additional fragment IDs to append to the response. Useful when needing to view fragments that will be provisionally added to the machine alongside existing fragments.
The list of top level and nested fragments for a machine, as well as additionally specified fragment IDs.
Lists all modules for an organization.
The ID of the organization to query
The organization's modules
Lists organization memebers and outstanding invites.
The id of the organization to query
An object containing organization members, pending invites, and org ID
List all organizations associated with a user. Internal use only.
The ID of the user to query
The list of locations the requested user has access to
List all registry items for an organization.
The ID of the organization to query registry items for
A list of types to query. If empty, will not filter on type
A list of visibilities to query for. If empty, will not filter on visibility
A list of platforms to query for. If empty, will not filter on platform
A list of statuses to query for. If empty, will not filter on status
Optional
searchTerm: stringOptional search term to filter on
Optional
pageToken: stringOptional page token for results. If not provided, will return all results
The list of registry items
Get a location's LocationAuth
(location secret(s)).
The ID of the location to retrieve LocationAuth
from.
The LocationAuth
for the requested location.
Removes a role from an organization.
The ID of the organization to remove the role from
The ID of the entity the role belongs to (for example a user ID)
The role to remove ("owner" or "operator")
The type of resource to remove the role from ("robot", "location", or "organization")
The ID of the resource the role is being removes from
Resends a pending organization invite.
The ID of the organization
The email associated with the invite to resend
The invite
Rotates an existing API key.
The ID of the key to rotate
The updated key and ID
Get a stream of log entries for a specific robot part. Logs are sorted by descending time (newest first).
The ID of the requested robot part
A queue to put the log entries into
Optional
filter: stringOptional string to filter logs on
Optional bool to indicate whether or not only error-level logs should be returned. Defaults to true
Updates an existing fragment.
The ID of the fragment to update
The name to update the fragment to
The config to update the fragment to
Optional
makePublic: booleanOptional, deprecated boolean specifying whether the fragment should be public or not. If not passed, the visibility will be unchanged. Fragments are private by default when created
Optional
visibility: FragmentVisibilityOptional FragmentVisibility specifying the updated fragment visibility. If not passed, the visibility will be unchanged. If visibility is not set and makePublic is set, makePublic takes effect. If makePublic and visibility are set, they must not be conflicting. If neither is set, the fragment visibility will remain unchanged.
The updated fragment
Updates location details.
The ID of the location to update
Optional
name: stringOptional string to update the location's name to
Optional
parentLocId: stringOptional string to update the location's parent location to
Optional
region: stringOptional string to update the location's region to
The location object
Updates user-defined metadata for a location.
The ID of the location
The metadata to update
Updates an existing module.
The ID of the module to update
The visibility to set for the module
The url to reference for documentation, code, etc.
A short description of the module
A list of models available in the module
The executable to run to start the module program
The module URL
Updates organization details.
The id of the organization to update
Optional
name: stringOptional name to update the organization with
Optional
publicNamespace: stringOptional namespace to update the organization with
Optional
region: stringOptional region to update the organization with
Optional
cid: stringOptional CRM ID to update the organization with
The updated organization details
Updates authorizations for an existing org invite.
The id of the organization
The email address associated with the invite
List of authorizations to add to the invite
List of authorizations to remove from the invite
The organization invite
const auth = new VIAM.appApi.Authorization({
authorizationType: 'role',
authorizationId: 'organization_operator',
organizationId: '<YOUR-ORGANIZATION-ID>',
resourceId: '<YOUR-RESOURCE-ID>', // The resource to grant access to
resourceType: 'organization', // The type of resource to grant access to
identityId: '<YOUR-USER-ID>', // The user id of the user to grant access to (optional)
roleId: 'owner', // The role to grant access to
identityType: 'user',
});
const invite = await appClient.updateOrganizationInviteAuthorizations(
'<YOUR-ORGANIZATION-ID>',
'youremail@email.com',
[auth],
[]
);
Updates user-defined metadata for an organization.
The ID of the organization
The metadata to update
Update an existing registry item.
The ID of the registry item to update
The PackageType to update the item to
A description of the item
A visibility value to update to
Change the name of an existing machine. You can only change the name of the machine, not the location.
The ID of the robot to update
The ID of the location where the robot is
The name to update the robot to
The newly-modified robot object
Updates user-defined metadata for a robot.
The ID of the robot
The metadata to update
Updates user-defined metadata for a robot part.
The ID of the robot part
The metadata to update
Add a role under an organization.