Members
name
- Description:
The project's name.
- Source:
The project's name.
Example
project.name();
quotas
- Description:
The project quotas.
- Source:
The project quotas.
Example
// Create map of supported devices.
let supported = {};
(await corellium.supported()).forEach(modelInfo => {
supported[modelInfo.name] = modelInfo;
});
// Get how many CPUs we're currently using.
let cpusUsed = 0;
instances.forEach(instance => {
cpusUsed += supported[instance.flavor].quotas.cpus;
});
console.log('Used: ' + cpusUsed + '/' + project.quotas.cpus);
quotasUsed
- Description:
How much of the project's quotas are currently used. To ensure this information is up to date, call Project#refresh() first.
- Source:
Properties:
Name | Type | Description |
---|---|---|
cores |
number | Number of used CPU cores |
How much of the project's quotas are currently used. To ensure this information is up to date, call Project#refresh() first.
Example
project.quotasUsed();
Methods
(async) addKey(key, kind, labelopt) → {Promise.<ProjectKey>}
- Description:
Add a public key to project.
- Source:
Example
project.addKey('ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA+eDLGqe+nefGQ2LjvXDlTXDuF33ZHD9wHk/oEICKYd', 'ssh', 'SSH Key');
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
key |
string | public key, as formatted in a .pub file |
||
kind |
'ssh' | 'adb' |
ssh
|
||
label |
string |
<optional> |
null
|
defaults to the public key comment, if present |
Returns:
- Type
- Promise.<ProjectKey>
(async) createInstance(options, vmmioopt) → {Promise.<Instance>}
- Description:
Creates an instance and returns the Instance object. The options are passed directly to the API.
- Source:
Example
const instance = await project.createInstance({
flavor: 'iphone6',
os: '11.3',
name: 'Test Device',
osbuild: '15E216',
patches: 'corelliumd',
bootOptions: {
udid: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
},
});
await instance.finishRestore();
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | The options for instance creation. These are the same as the JSON options passed to the instance creation API endpoint. For a full list of possible options, see the API documentation. Properties
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
vmmio |
Array.<vmmio> |
<optional> |
VMMIO options for external MMIO support |
Returns:
- Type
- Promise.<Instance>
(async) createRole(grantee, type)
- Description:
- Source:
Example
project.createRole(grantee, 'user');
Parameters:
Name | Type | Default | Description |
---|---|---|---|
grantee |
User | Team | ||
type |
string |
user
|
user ID |
(async) deleteImage(image)
- Description:
Delete a Image
- Source:
Parameters:
Name | Type | Description |
---|---|---|
image |
Image |
(async) deleteIotFirmware(firmwareImage)
- Description:
Delete an IoT firmware
- Source:
Parameters:
Name | Type | Description |
---|---|---|
firmwareImage |
FirmwareImage |
(async) deleteKernel(kernelImage)
- Description:
Delete a kernel
- Source:
Parameters:
Name | Type | Description |
---|---|---|
kernelImage |
KernelImage |
(async) deleteKey(keyId)
- Description:
Delete public key from the project
- Source:
Example
project.deleteKey('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa');
Parameters:
Name | Type | Description |
---|---|---|
keyId |
string |
(async) destroy()
- Description:
Destroy this project.
- Source:
Example
project.destroy();
(async) getInstance(id) → {Promise.<Instance>}
- Description:
Returns the Instance with the given ID.
- Source:
Example
await project.getInstance('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa');
Parameters:
Name | Type | Description |
---|---|---|
id |
string |
Returns:
- Type
- Promise.<Instance>
(async) getToken() → {string}
- Description:
Returns refreshed authentication token
- Source:
Example
let token = await project.getToken()
Returns:
token
- Type
- string
(async) instances() → {Promise.<Array.<Instance>>}
- Description:
Returns an array of the Instances in this project.
- Source:
Example
const instances = await project.instances();
const instance = instances.find(instance => instance.name === 'Test Device');
Returns:
The instances in this project
- Type
- Promise.<Array.<Instance>>
(async) keys() → {Promise.<Array.<ProjectKey>>}
- Description:
Returns a list of authorized keys associated with the project. When a new instance is created in this project, its authorized_keys (iOS) or adbkeys (Android) will be populated with these keys by default. Adding or removing keys from the project will have no effect on existing instances.
- Source:
Example
let keys = project.keys();
for(let key of keys)
console.log(key);
Returns:
- Type
- Promise.<Array.<ProjectKey>>
(async) refresh()
- Description:
Reload the project info. This currently consists of name and quotas, but will likely include more in the future.
- Source:
Example
project.refresh();
(async) roles() → {Array.<Role>}
- Description:
Returns a list of Roles associated with this project, showing who has permissions over this project.
This function is only available to domain and project administrators.
- Source:
Example
await project.roles();
Returns:
- Type
- Array.<Role>
(async) setQuotas(quotas)
- Description:
Sets the project quotas. Only the cores property is currently respected.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
quotas |
ProjectQuotas |
(async) uploadImage(type, filePath, name, progressopt) → {Promise.<Image>}
- Description:
Add an image to the project. These images may be removed at any time and are meant to facilitate creating a new Instance with images.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
string | E.g. fw for the main firmware image. |
|
filePath |
string | The path on the local file system to get the file. |
|
name |
string | The name of the file to identify the file on the server. Usually the basename of the path. |
|
progress |
Project~progressCallback |
<optional> |
The callback for file upload progress information. |
Returns:
- Type
- Promise.<Image>
(async) uploadIotFirmware(filePath, name, progressopt) → {Promise.<FirmwareImage>}
- Description:
Add a custom IoT firmware image to a project for use in creating new instances.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
filePath |
string | The path on the local file system to get the firmware file. |
|
name |
string | The name of the file to identify the file on the server. Usually the basename of the path. |
|
progress |
Project~progressCallback |
<optional> |
The callback for file upload progress information. |
Returns:
- Type
- Promise.<FirmwareImage>
(async) uploadKernel(filePath, name, progressopt) → {Promise.<KernelImage>}
- Description:
Add a kernel image to a project for use in creating new instances.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
filePath |
string | The path on the local file system to get the kernel file. |
|
name |
string | The name of the file to identify the file on the server. Usually the basename of the path. |
|
progress |
Project~progressCallback |
<optional> |
The callback for file upload progress information. |
Returns:
- Type
- Promise.<KernelImage>
(async) uploadVmfile(filePath, name, progressopt) → {Promise.<string>}
- Description:
Add a vmfile image to a project for use in creating new instances.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
filePath |
string | The path on the local file system to get the vmfile file |
|
name |
string | The name of the file to identify the file on the server, usually the basename of the path. |
|
progress |
Project~progressCallback |
<optional> |
The callback for the file upload progress information. |
Returns:
- Type
- Promise.<string>
(async) vpnConfig(type, clientUUID) → {Promise.<Buffer>}
- Description:
Get the VPN configuration to connect to the project network. This is only available for cloud. At least one instance must be on in the project.
- Source:
Example
await project.vpnConfig('ovpn', undefined)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
type |
string |
ovpn
|
Could be either "ovpn" or "tblk" to select between OpenVPN and TunnelBlick configuration formats. TunnelBlick files are delivered as a ZIP file and OpenVPN configuration is just a text file. |
clientUUID |
string | An arbitrary UUID to uniquely associate this VPN configuration with so it can be later identified in a list of connected clients. Optional. |
Returns:
- Type
- Promise.<Buffer>