triton
) uses CloudAPI to manage infrastructure in Triton data centers. Many of the tasks that you can perform through the portal are also possible with Triton CLI, including:triton
. You can learn more about CloudAPI methods and resources in our additional reference documentation.triton
using Node Package Manager (npm
). In the following example, the npm
install command sets a global flag (-g
) that makes npm
modules accessible to all users. This flag is mandatory when installing triton
on Windows.sudo
. Remove it from the command to install triton
:.bash_profile
. On macOS, this file should be in your home directory.id_rsa.pub
:triton
required environment variables that began with SDC_*
, i.e. SDC_URL
and SDC_ACCOUNT
. As of January 2018, the SDC environment variables are still supported by triton
.triton profile create
command prompts you to answer a series of questions to configure your profile. The following example shows the steps for Triton user jill
.triton info
:triton info
output above shows that myuser's account already has two instances running.triton profiles
command:triton
commands to make a copy of the us-sw-1
profile for each of the data center urls. Copy this snippet below to add the new profiles (in this case, based on a profile named 'env'):triton profiles
again to check to see that it worked. We should have a new profile for each data center listed in triton datacenters
:triton profile set
command:triton
installed and configured, we can jump right into provisioning instances. Here's an example of provisioning an infrastructure container running Ubuntu. Think of infrastructure containers like virtual machines, only faster and more efficient.triton instance create
and we'll talk about the pieces after:triton ssh
to connect to it. This is an awesome addition to our tools because it means that we don't need to copy SSH keys or even lookup the IP address of the instance.triton instance create -w --name=server-1 ubuntu-14.04 g4-highcpu-1G
. That command has three parameters:--name server-1
-w
to wait the instance to be createdubuntu-14.04
as our imageg4-highcpu-1G
as our package_
, -
, and .
triton images
to list the images and add name=~ubuntu
to do a substring search for Ubuntu. It's sorted by published date so usually we'll pick the most recent. Today we'll choose 14.04 because it has wider support.g4-highcpu-<size>
), general purpose (g4-general-<size>
), memory optimized (g4-highram-<size>
), and storage optimized (g4-fastdisk-<size>
and g4-bigdisk-<size>
).k4-highcpu-<kvm|bhyve>-<size>
), general purpose (k4-general-<kvm|bhyve>-<size>
), memory optimized (k4-highram-<kvm|bhyve>-<size>
), and storage optimized (k4-fastdisk-<kvm|bhyve>-<size>
and k4-bigdisk-<kvm|bhyve>-<size>
).triton package
to search for a package with 1 gigabyte of RAM. We'll pick the g4-highcpu-1G
.triton
to fetch the pricing details for the different packages. To find out those costs, you can visit our public pricing page.--script
file installs Couchbase, and the triton ssh
runs cat /root/couchbase.txt
to show the address of the Couchbase dashboard.triton
commands.triton
tool does not wait for tasks to finish. This is great because it means that your commands return control back to you very quickly. However sometimes you'll need to wait for a task to complete before you do the next one. When this happens you can wait by using either the --wait
or -w
flags, or the triton instance wait
command. In the example above we used --wait
so that the instance would be ready by the time the triton ssh
command ran.triton instance get -j
to view your instance's details as a JSON blob. To parse fields out of the blob, I recommend using json although there are many other great tools out there.user-script
that we ran is part of the metadata.json KEYNAME
. For example you could get the IP address of an instance like this:triton instance delete
command:triton instance delete
command removes all of your instances regardless of whether they running or stopped.docker
, note that this is equivalent to using docker rm -f $(docker ps -aq)
to force the deletion of all your containers. If you want to remove all of your instances, using triton instance delete
might be faster since it deletes the instances in parallel.