Skip to content

Instantly share code, notes, and snippets.

@cpswan
Last active December 20, 2015 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cpswan/6071831 to your computer and use it in GitHub Desktop.
Save cpswan/6071831 to your computer and use it in GitHub Desktop.
gcutil help (version 1.8.2)
Command line tool for interacting with Google Compute Engine.
Please refer to http://developers.google.com/compute/docs/gcutil/tips for more
information about gcutil usage.
USAGE: gcutil [--global_flags] <command> [--command_flags] [args]
Any of the following commands:
addaccessconfig, adddisk, addfirewall, addimage, addinstance, addnetwork,
addroute, addsnapshot, attachdisk, auth, config, deleteaccessconfig,
deletedisk, deletefirewall, deleteimage, deleteinstance, deletenetwork,
deleteoperation, deleteroute, deletesnapshot, deprecateimage, detachdisk,
getaddress, getdisk, getfirewall, getimage, getinstance, getkernel,
getmachinetype, getnetwork, getoperation, getproject, getregion, getroute,
getserialportoutput, getsnapshot, getzone, help, listaddresses, listdisks,
listfirewalls, listimages, listinstances, listkernels, listmachinetypes,
listnetworks, listoperations, listregions, listroutes, listsnapshots,
listzones, moveinstances, pull, push, releaseaddress, reserveaddress,
resetinstance, resumemove, setcommoninstancemetadata, setinstancemetadata,
setinstancetags, ssh, version
addaccessconfig Adds an access config to an instance's network
interface.
Usage: gcutil [--global_flags] addaccessconfig
[--command_flags] <instance-name>
adddisk Create new machine disks.
More than one disk name can be specified. Multiple
disks will be created in parallel.
Usage: gcutil [--global_flags] adddisk
[--command_flags] <disk-name-1> ... <disk-name-n>
addfirewall Create a new firewall rule to allow incoming traffic
for instances on a given network.
Usage: gcutil [--global_flags] addfirewall
[--command_flags] <firewall-name>
addimage Create a new machine image.
The root_source_tarball parameter must point to a tar
file of the contents of the desired root directory
stored in Google Storage.
Usage: gcutil [--global_flags] addimage
[--command_flags] <image-name> <root-source-tarball>
addinstance Create new VM instances.
More than one instance name can be specified.
Multiple instances will be created in parallel.
Usage: gcutil [--global_flags] addinstance
[--command_flags] <instance-name-1> ...
<instance-name-n>
addnetwork Create a new network instance.
Usage: gcutil [--global_flags] addnetwork
[--command_flags] <network-name>
addroute Create a new entry in the project's routes
collection.
A route is a rule that specifies how matching packets
should be handled by a virtual network.
Usage: gcutil [--global_flags] addroute
[--command_flags] <route-name>
<destination-address-range>
addsnapshot Create a new persistent disk snapshot.
Usage: gcutil [--global_flags] addsnapshot
[--command_flags] <snapshot-name>
attachdisk Attaches the given persistent disk to the given
instance.
Usage: gcutil [--global_flags] attachdisk
[--command_flags] <instance-name>
auth Class for forcing client authorization.
Usage: gcutil [--global_flags] auth [--command_flags]
config Class for forcing client authorization.
Usage: gcutil [--global_flags] config
[--command_flags]
deleteaccessconfig Deletes an access config from an instance's network
interface.
Usage: gcutil [--global_flags] deleteaccessconfig
[--command_flags] <instance-name>
deletedisk Delete one or more machine disks.
If multiple disk names are specified, the disks will
be deleted in parallel.
Usage: gcutil [--global_flags] deletedisk
[--command_flags] <disk-name-1> ... <disk-name-n>
deletefirewall Delete one or more firewall rules.
If multiple firewall names are specified, the
firewalls will be deleted in parallel.
Usage: gcutil [--global_flags] deletefirewall
[--command_flags] <firewall-name-1> ...
<firewall-name-n>
deleteimage Delete one or more machine images.
If multiple image names are specified, the images
will be deleted in parallel.
Usage: gcutil [--global_flags] deleteimage
[--command_flags] <image-name-1> ... <image-name-n>
deleteinstance Delete one or more VM instances.
If multiple instance names are specified, the
instances will be deleted in parallel.
Usage: gcutil [--global_flags] deleteinstance
[--command_flags] <instance-name-1> ...
<instance-name-n>
deletenetwork Delete one or more machine networks.
If multiple network names are specified, the networks
will be deleted in parallel.
Usage: gcutil [--global_flags] deletenetwork
[--command_flags] <network-name-1> ...
<network-name-n>
deleteoperation Delete one or more operations.
Usage: gcutil [--global_flags] deleteoperation
[--command_flags] <operation-name-1> ...
<operation-name-n>
deleteroute Delete one or more objects from the routes
collection.
If multiple route names are specified, the routes
will be deleted in parallel.
Usage: gcutil [--global_flags] deleteroute
[--command_flags] <route-name-1> ... <route-name-n>
deletesnapshot Delete one or more machine snapshots.
Usage: gcutil [--global_flags] deletesnapshot
[--command_flags] <snapshot-name>
deprecateimage Sets the deprecation status for an image.
Usage: gcutil [--global_flags] deprecateimage
[--command_flags] <image-name>
detachdisk Detaches the given persistent disk from the given
instance.
Usage: gcutil [--global_flags] detachdisk
[--command_flags] <instance-name>
getaddress Get a reserved address resource.
Usage: gcutil [--global_flags] getaddress
[--command_flags] <address-name>
getdisk Get a machine disk.
Usage: gcutil [--global_flags] getdisk
[--command_flags] <disk-name>
getfirewall Get a firewall.
Usage: gcutil [--global_flags] getfirewall
[--command_flags] <firewall-name>
getimage Get a machine image.
Usage: gcutil [--global_flags] getimage
[--command_flags] <image-name>
getinstance Get a machine instance.
Usage: gcutil [--global_flags] getinstance
[--command_flags] <instance-name>
getkernel Get a kernel.
Usage: gcutil [--global_flags] getkernel
[--command_flags]
getmachinetype Get a machine type.
Usage: gcutil [--global_flags] getmachinetype
[--command_flags]
getnetwork Get a network instance.
Usage: gcutil [--global_flags] getnetwork
[--command_flags] <network-name>
getoperation Retrieve an operation resource.
Usage: gcutil [--global_flags] getoperation
[--command_flags] <operation-name>
getproject Get the resource for a Google Compute Engine project.
Usage: gcutil [--global_flags] getproject
[--command_flags] <project-name>
getregion Get a region.
Usage: gcutil [--global_flags] getregion
[--command_flags] <region-name>
getroute Get a route.
Usage: gcutil [--global_flags] getroute
[--command_flags] <route-name>
getserialportoutput Get the output of an instance's serial port.
Usage: gcutil [--global_flags] getserialportoutput
[--command_flags] <instance-name>
getsnapshot Get a machine snapshot.
Usage: gcutil [--global_flags] getsnapshot
[--command_flags] <snapshot-name>
getzone Get a zone.
Usage: gcutil [--global_flags] getzone
[--command_flags] <zone-name>
help Help for all or selected command:
gcutil help [<command>]
To retrieve help with global flags:
gcutil --help
To retrieve help with flags only from the main
module:
gcutil --helpshort [<command>]
listaddresses List the addresses for a project.
Usage: gcutil [--global_flags] listaddresses
[--command_flags]
listdisks List the disks for a project.
Usage: gcutil [--global_flags] listdisks
[--command_flags]
listfirewalls List the firewall rules for a project.
Usage: gcutil [--global_flags] listfirewalls
[--command_flags]
listimages List the images for a project.
Usage: gcutil [--global_flags] listimages
[--command_flags]
listinstances List the instances for a project.
Usage: gcutil [--global_flags] listinstances
[--command_flags]
listkernels List the kernels for a project.
Usage: gcutil [--global_flags] listkernels
[--command_flags]
listmachinetypes List the machine types for a project.
Usage: gcutil [--global_flags] listmachinetypes
[--command_flags]
listnetworks List the networks for a project.
Usage: gcutil [--global_flags] listnetworks
[--command_flags]
listoperations List the operations for a project.
Usage: gcutil [--global_flags] listoperations
[--command_flags]
listregions List available regions for a project.
Usage: gcutil [--global_flags] listregions
[--command_flags]
listroutes List the routes collection for a project.
Usage: gcutil [--global_flags] listroutes
[--command_flags]
listsnapshots List the machine snapshots for a project.
Usage: gcutil [--global_flags] listsnapshots
[--command_flags]
listzones List available zones for a project.
Usage: gcutil [--global_flags] listzones
[--command_flags]
moveinstances Move a set of instances from one zone to another
zone.
This command also moves any persistent disks that are
attached to the instances.
During the move, do not modify your project, as
changes to the project may interfere with the move.
You can pick which instances to move by specifying a
series of regular expressions that will be used to
match instance names in the source zone. For example,
the following command will move all instances in
zone-a whose names match the regular expressions
i-[0-9] or b-.* to zone-b:
gcutil moveinstances --source_zone=zone-a
--destination_zone=zone-b "i-[0-9]" "b-.*"
WARNING: Instances that are moved will lose ALL of
their transient state (i.e., scratch disks, ephemeral
IP addresses, and memory).
WARNING: This command may fail. If failure happens
during validation, the state of your instances is
preserved. If failure happens during
the move, the 'resumemove' command may be used to
recover. In rare
circumstances, you may need to move your instances by
hand.
Usage: gcutil [--global_flags] moveinstances
[--command_flags] <name-regex-1> ... <name-regex-n>
pull Pull one or more files from an instance.
Usage: gcutil [--global_flags] pull [--command_flags]
<instance-name> <file-1> ... <file-n> <destination>
push Push one or more files to an instance.
Usage: gcutil [--global_flags] push [--command_flags]
<instance-name> <file-1> ... <file-n> <destination>
releaseaddress Release one or more reserved address.
If multiple address names are specified, the
addresses will be released in parallel.
Usage: gcutil [--global_flags] releaseaddress
[--command_flags] <address-name-1> ...
<address-name-n>
reserveaddress Reserve a new ip address.
Usage: gcutil [--global_flags] reserveaddress
[--command_flags] <address-name>
resetinstance Resets the given instance, resulting in a reboot.
Usage: gcutil [--global_flags] resetinstance
[--command_flags] <instance-name>
resumemove Resume a previously-failed move.
The moveinstances subcommand produces a log file that
can be used to re-attempt a move that fails. This is
intended to help complete moves that are interrupted
by the user or by transient network failures.
WARNING: Instances that are moved will lose ALL of
their transient state (i.e., scratch disks, ephemeral
IP addresses, and memory).
Usage: gcutil [--global_flags] resumemove
[--command_flags] <log-path>
setcommoninstancemetadata Set the commonInstanceMetadata field for a Google
Compute Engine project.
This is a blanket overwrite of all of the project
wide metadata.
Usage: gcutil [--global_flags]
setcommoninstancemetadata [--command_flags]
setinstancemetadata Sets instance metadata and sends new metadata to
instances.
This method overwrites existing instance metadata
with new metadata. Common metadata (project-wide) is
preserved.
For example, running:
gcutil --project=<project-name> setinstancemetadata
my-instance --metadata="key1:value1"
--fingerprint=<original-fingerprint>
...
gcutil --project=<project-name> setinstancemetadata
my-instance --metadata="key2:value2"
--fingerprint=<new-fingerprint>
will result in 'my-instance' having 'key2:value2' as
its metadata.
Usage: gcutil [--global_flags] setinstancemetadata
[--command_flags] <instance-name>
setinstancetags Sets instance tags and sends new tags to the
instance.
This method overwrites existing instance tags.
For example, running:
gcutil --project=<project-name> setinstancetags
my-instance --tags="tag-1"
--fingerprint=<original-fingerprint>
...
gcutil --project=<project-name> setinstancetags
my-instance --tags="tag-2,tag-3"
--fingerprint=<new-fingerprint>
will result in 'my-instance' having tags 'tag-2' and
'tag-3'.
Usage: gcutil [--global_flags] setinstancetags
[--command_flags]
ssh Ssh to an instance.
Usage: gcutil [--global_flags] ssh [--command_flags]
<instance-name> <ssh-args>
version Get the current version of this command.
Usage: gcutil [--global_flags] version
[--command_flags]
Run 'gcutil --help' to get help for global flags.
Run 'gcutil help <command>' to get help for <command>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment