gcloudex v0.4.3 GCloudex.ComputeEngine.Client
Summary
Functions
Adds an access config to the ‘instance’ if it exists in the given ‘zone’. The kind and type will automatically be added with the default (and only possible) values
Adds a list of ‘instances’ to the specified ‘instance_group’ if it exists in the given ‘zone’
Retrieves an aggregated list of autoscalers according to the given ‘query_params’ if provided
Retrieves an aggregated list of Disk Types according to the ‘query_params’ if provided
Retrieves an aggregated list of persistent disks according to the given ‘query_params’ if they’re provided
Retrieves the list of Instance Groups and sorts them by zone
Retrieves aggregated list of instances according to the specified ‘query_params’ if present
Returns an aggragated list of machine types following the specified ‘query_params’ if present
Attaches the ‘disk_resource’ to the ‘instance’ if it exists in the given ‘zone’
Creates a snapshot of a specified persistent ‘disk’ if it exists in the given ‘zone’ and according to the given ‘resource’. The ‘request’ map must contain the keys “name” and “description” and “name” must obey the refex ‘(?:a-z?)’
Deletes te ‘access_config’ from the ‘instance’ ‘network_interface’ if the ‘instance’ exists in the given ‘zone’
Deletes the specified ‘autoscaler’ if it exists in the given ‘zone’
Deletes the specified persistent ‘disk’ if it exists in the given ‘zone’
Deletes the specified ‘firewall’
Deletes the specified ‘image’
Deletes the given ‘instance’ if it exists in the given ‘zone’
Deletes the specified ‘instance_group’ if it exists in the given ‘zone’
Deletes the specified ‘network’
Sets the deprecation status of an ‘image’ using the data provided in the ‘request_params’
Detaches the disk with ‘device_name’ from the ‘instance’ if it exists in the given ‘zone’
Returns the specified ‘autoscaler’ resource if it exists in the given ‘zone’
Returns a specified persistent ‘disk’ if it exists in the given ‘zone’. The HTTP reply contains a Disk Resource in the body
Returns the specified ‘disk_type’ if it exists in the given ‘zone’
Returns the specified ‘firewall’
Returns the specified ‘image’
Returns the data about the ‘instance’ in the given ‘zone’ if it exists
Returns the specified ‘instance_group’ if it exists in the given ‘zone’
Returns the specified ‘license’ resource
Returns the specified ‘machine_type’ in the given ‘zone’
Returns the speciefied ‘network’
Returns the specified ‘region’ resource
Returns the specified ‘instance’ serial ‘port’ output if the ‘instance’ exists in the given ‘zone’. The ‘port’ accepted values are from 1 to 4, inclusive
Returns the specified ‘zone’ resource
Creates an autoscaler in the given ‘zone’ using the data provided in ‘autoscaler_resource’
Creates a persistent disk in the specified ‘zone’ using the data in the ‘disk_resource’. You can create a disk with a ‘source_image’ or a sourceSnapshot (provided in the ‘disk_resource’), or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property in the ‘disk_resource’
Creates a new firewall using the data included in ‘firewall_resource’. For information about the structure and properties of Firewall Resources check https://cloud.google.com/compute/docs/reference/latest/firewalls#resource
Creates an image with the given ‘name’ and ‘source_url’. This function uses the minimal amount of parameters needed to build the image. For a more detailed image creation use insert_image_with_resource/2 where more complex Image Resources can be passed
Creates an image with the provided ‘image_resource’
Creates a new Virtual Machine instance on Google Compute Engine in the given ‘zone’ and with properties defined in ‘instance_resource’. Example of the minimal Instance Resource the API will accept
Creates an Instance Group in the specified ‘zone’ using the data provided in ‘instance_group_resource’. For the structure and properties required in the Instance Group Resources check https://cloud.google.com/compute/docs/reference/latest/instanceGroups#resource
Creates a network using the data specified in ‘network_resource’. To read about the structure and properties of the Network Resource check https://cloud.google.com/compute/docs/reference/latest/networks#resource
Retrieves a list of autoscalers contained within the specified ‘zone’ and according to the ‘query_params’ if provided
Retrieves a list of disk types available to the specified ‘zone’ according to the given ‘query_params’ if provided
Retrieves a list of persistent disks contained within the specified ‘zone’ and according to the given ‘query_params’ if provided
Retrieves the list of firewall rules according to the ‘query_params’ if provided
Retrieves the list of private images available (project scoped only)
Retrieves the list of instance groups that are located in the specified ‘zone’
Lists all instances in the given ‘zone’ obeying the given ‘query_params’ if present
Lists the instances in the specified ‘instance_group’ if it exists in the given ‘zone’. A filter for the state of the instances can be passed through ‘instance_state’
Retrieves a list of machine types available in the specified ‘zone’ and that fit in the given ‘query_params’ if present
Retrieves the list of networks available according to the given ‘query_params’ if provided
Retrieves a list of region resources according to the given ‘query_params’
Retrieves the list of Zone resources available according to the given ‘query_params’
Updates ‘autoscaler_name’ in the specified ‘zone’ using the data included in the ‘autoscaler_resource’. This function supports patch semantics
Updates the specified ‘firewall’ rule with the data included in the ‘firewall_resource’. This function supports patch semantics
Removes the ‘instances’ from the provided ‘instance_group’ if it exists in the given ‘zone’
Performs a hard reset on the ‘instance’ if it exists in the given ‘zone’
Resizes the specified persistent ‘disk’ if it exists in the given ‘zone’ to the provided ‘size_gb’
Sets the ‘auto_delete’ flag for the disk with ‘device_name’ attached to ‘instance’ if it exists in the given ‘zone’
Changes the Machine Type for a stopped ‘instance’ to the specified ‘machine_type’ if the ‘instance’ exists in the given ‘zone’
Sets metadata for the specified ‘instance’ to the data specified in ‘fingerprint’ and ‘items’. The ‘instance’ must exist in the given ‘zone’
Sets the named ‘ports’ for the specified ‘instance_group’ if it exists in the
given ‘zone’. The ‘ports’ must be passed as a list of tuples with the format
{
Sets an ‘instance’ scheduling options if it exists in the given ‘zone’. The ‘preemptible’ option cannot be changed after instance creation
Sets tags for the specified ‘instance’ to the given ‘fingerprint’ and ‘items’. The ‘instance’ must exist in the given ‘zone’
Starts a stopped ‘instance’ if it exists in the given ‘zone’
Stops a running ‘instance’ if it exists in the given ‘zone’
Updates an autoscaler in the specified ‘zone’ using the data included in the ‘autoscaler_resource’. The ‘autoscaler_name’ may be provided but it’s optional
Updates the specified ‘firewall’ rule with the data included in the ‘firewall_resource’
Functions
Specs
add_access_config(zone :: binary, instance :: binary, network_interface :: binary, name :: binary, nat_ip :: binary, fields :: binary) :: HTTPResponse.t
Adds an access config to the ‘instance’ if it exists in the given ‘zone’. The kind and type will automatically be added with the default (and only possible) values.
Specs
add_instances_to_group(zone :: binary, instance_group :: binary, instances :: [binary], fields :: binary) :: HTTPResponse.t
Adds a list of ‘instances’ to the specified ‘instance_group’ if it exists in the given ‘zone’.
Specs
aggregated_list_of_autoscalers(query_params :: Map.t) :: HTTPResponse.t
Retrieves an aggregated list of autoscalers according to the given ‘query_params’ if provided.
Specs
aggregated_list_of_disk_types(query_params :: Map.t) :: HTTPResponse.t
Retrieves an aggregated list of Disk Types according to the ‘query_params’ if provided.
Specs
aggregated_list_of_disks(query_params :: Map.t) :: HTTPResponse.t
Retrieves an aggregated list of persistent disks according to the given ‘query_params’ if they’re provided.
Specs
aggregated_list_of_instance_groups(query_params :: Map.t) :: HTTPResponse.t
Retrieves the list of Instance Groups and sorts them by zone.
Specs
aggregated_list_of_instances(query_params :: Map.t) :: HTTPResponse.t
Retrieves aggregated list of instances according to the specified ‘query_params’ if present.
Specs
aggregated_list_of_machine_types(query_params :: Map.t) :: HTTPResponse.t
Returns an aggragated list of machine types following the specified ‘query_params’ if present.
Specs
attach_disk(zone :: binary, instance :: binary, disk_resource :: map, fields :: binary) :: HTTPResponse.t
Attaches the ‘disk_resource’ to the ‘instance’ if it exists in the given ‘zone’.
Disk Resource structure:
{
"kind": "compute#attachedDisk",
"index": integer,
"type": string,
"mode": string,
"source": string,
"deviceName": string,
"boot": boolean,
"initializeParams": {
"diskName": string,
"sourceImage": string,
"diskSizeGb": long,
"diskType": string
},
"autoDelete": boolean,
"licenses": [
string
],
"interface": string
}
Specs
create_snapshot(zone :: binary, disk :: binary, request :: Map.t, fields :: binary) :: HTTPResponse.t
Creates a snapshot of a specified persistent ‘disk’ if it exists in the given ‘zone’ and according to the given ‘resource’. The ‘request’ map must contain the keys “name” and “description” and “name” must obey the refex ‘(?:a-z?)’.
Specs
delete_access_config(zone :: binary, instance :: binary, access_config :: binary, network_interface :: binary, fields :: binary) :: HTTPResponse.t
Deletes te ‘access_config’ from the ‘instance’ ‘network_interface’ if the ‘instance’ exists in the given ‘zone’.
Specs
delete_autoscaler(zone :: binary, autoscaler :: binary, fields :: binary) :: HTTPResponse.t
Deletes the specified ‘autoscaler’ if it exists in the given ‘zone’.
Specs
delete_disk(zone :: binary, disk :: binary, fields :: binary) :: HTTPResponse.t
Deletes the specified persistent ‘disk’ if it exists in the given ‘zone’.
Specs
delete_firewall(firewall :: binary, fields :: binary) :: HTTPResponse.t
Deletes the specified ‘firewall’.
Specs
delete_image(image :: binary, fields :: binary) :: HTTPResponse.t
Deletes the specified ‘image’.
Specs
delete_instance(zone :: binary, instance :: binary, fields :: binary) :: HTTPResponse.t
Deletes the given ‘instance’ if it exists in the given ‘zone’.
Specs
delete_instance_group(zone :: binary, instance_group :: binary, fields :: binary) :: HTTPResponse.t
Deletes the specified ‘instance_group’ if it exists in the given ‘zone’.
Specs
delete_network(network :: binary, fields :: binary) :: HTTPResponse.t
Deletes the specified ‘network’.
Specs
deprecate_image(image :: binary, request_params :: Map.t, fields :: binary) :: HTTPResponse.t
Sets the deprecation status of an ‘image’ using the data provided in the ‘request_params’.
Specs
detach_disk(zone :: binary, instance :: binary, device_name :: binary, fields :: binary) :: HTTPResponse.t
Detaches the disk with ‘device_name’ from the ‘instance’ if it exists in the given ‘zone’.
Specs
get_autoscaler(zone :: binary, autoscaler :: binary, fields :: binary) :: HTTPResponse.t
Returns the specified ‘autoscaler’ resource if it exists in the given ‘zone’.
Specs
get_disk(zone :: binary, disk :: binary, fields :: binary) :: HTTPResponse.t
Returns a specified persistent ‘disk’ if it exists in the given ‘zone’. The HTTP reply contains a Disk Resource in the body.
Specs
get_disk_type(zone :: binary, disk_type :: binary, fields :: binary) :: HTTPResponse.t
Returns the specified ‘disk_type’ if it exists in the given ‘zone’.
Specs
get_firewall(firewall :: binary, fields :: binary) :: HTTPResponse.t
Returns the specified ‘firewall’.
Specs
get_image(image :: binary, fields :: binary) :: HTTPResponse.t
Returns the specified ‘image’.
Specs
get_instance(zone :: binary, instance :: binary, fields :: binary) :: HTTPResponse.t
Returns the data about the ‘instance’ in the given ‘zone’ if it exists.
Specs
get_instance_group(zone :: binary, instance_group :: binary, fields :: binary) :: HTTPResponse.t
Returns the specified ‘instance_group’ if it exists in the given ‘zone’.
Specs
get_license(binary, binary) :: HTTPResponse.t
Returns the specified ‘license’ resource.
Specs
get_machine_type(zone :: binary, machine_type :: binary, fields :: binary) :: HTTPResponse.t
Returns the specified ‘machine_type’ in the given ‘zone’.
Specs
get_network(network :: binary, fields :: binary) :: HTTPResponse.t
Returns the speciefied ‘network’.
Specs
get_region(region :: binary, fields :: binary) :: HTTPResponse.t
Returns the specified ‘region’ resource.
Specs
get_serial_port_output(zone :: binary, instance :: binary, port :: 1..4, fields :: binary) :: HTTPResponse.t
Returns the specified ‘instance’ serial ‘port’ output if the ‘instance’ exists in the given ‘zone’. The ‘port’ accepted values are from 1 to 4, inclusive.
Specs
get_zone(zone :: binary, fields :: binary) :: HTTPResponse.t
Returns the specified ‘zone’ resource.
Specs
insert_autoscaler(zone :: binary, autoscaler_resource :: Map.t, fields :: binary) ::
HTTPResponse.t |
no_return
Creates an autoscaler in the given ‘zone’ using the data provided in ‘autoscaler_resource’.
For the properties and structure of the ‘autoscaler_resource’ check https://cloud.google.com/compute/docs/reference/latest/autoscalers#resource
Specs
insert_disk(zone :: binary, disk_resource :: map, source_image :: binary, fields :: binary) :: HTTPResponse.t
Creates a persistent disk in the specified ‘zone’ using the data in the ‘disk_resource’. You can create a disk with a ‘source_image’ or a sourceSnapshot (provided in the ‘disk_resource’), or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property in the ‘disk_resource’.
Specs
insert_firewall(firewall_resource :: Map.t, fields :: binary) :: HTTPResponse.t
Creates a new firewall using the data included in ‘firewall_resource’. For information about the structure and properties of Firewall Resources check https://cloud.google.com/compute/docs/reference/latest/firewalls#resource
Specs
insert_image(name :: binary, source_url :: binary, fields :: binary) :: HTTPResponse.t
Creates an image with the given ‘name’ and ‘source_url’. This function uses the minimal amount of parameters needed to build the image. For a more detailed image creation use insert_image_with_resource/2 where more complex Image Resources can be passed.
Specs
insert_image_with_resource(image_resource :: Map.t, fields :: binary) :: HTTPResponse.t
Creates an image with the provided ‘image_resource’.
Specs
insert_instance(zone :: binary, instance_resource :: Map.t, fields :: binary) :: HTTPResponse.t
Creates a new Virtual Machine instance on Google Compute Engine in the given ‘zone’ and with properties defined in ‘instance_resource’. Example of the minimal Instance Resource the API will accept:
%{
"disks" =>
[
%{
"autoDelete" => true, "boot" => true,
"initializeParams" =>
%{
"sourceImage" =>
"projects/debian-cloud/global/images/debian-8-jessie-v20160119"
},
"type" => "PERSISTENT"
}
],
"machineType" => "zones/europe-west1-d/machineTypes/f1-micro",
"name" => "example-instance",
"networkInterfaces" =>
[
%{
"accessConfigs" =>
[
%{
"name" => "External NAT",
"type" => "ONE_TO_ONE_NAT"
}
],
"network" => "global/networks/default"
}
]
}
For the ‘instance_resource’ check the documentation at:
https://cloud.google.com/compute/docs/reference/latest/instances#resource
Specs
insert_instance_group(zone :: binary, instance_group_resource :: map, fields :: binary) :: HTTPResponse.t
Creates an Instance Group in the specified ‘zone’ using the data provided in ‘instance_group_resource’. For the structure and properties required in the Instance Group Resources check https://cloud.google.com/compute/docs/reference/latest/instanceGroups#resource
Specs
insert_network(network_resource :: Map.t, fields :: binary) ::
HTTPResponse.t |
no_return
Creates a network using the data specified in ‘network_resource’. To read about the structure and properties of the Network Resource check https://cloud.google.com/compute/docs/reference/latest/networks#resource.
Specs
list_autoscalers(zone :: binary, query_params :: map) :: HTTPResponse.t
Retrieves a list of autoscalers contained within the specified ‘zone’ and according to the ‘query_params’ if provided.
Specs
list_disk_types(zone :: binary, query_params :: Map.t) :: HTTPResponse.t
Retrieves a list of disk types available to the specified ‘zone’ according to the given ‘query_params’ if provided.
Specs
list_disks(zone :: binary, query_params :: Map.t) :: HTTPResponse.t
Retrieves a list of persistent disks contained within the specified ‘zone’ and according to the given ‘query_params’ if provided.
Specs
list_firewalls(query_params :: Map.t) :: HTTPResponse.t
Retrieves the list of firewall rules according to the ‘query_params’ if provided.
Specs
list_images(query_params :: Map.t) :: HTTPResponse.t
Retrieves the list of private images available (project scoped only).
Specs
list_instance_groups(zone :: binary, query_params :: Map.t) :: HTTPResponse.t
Retrieves the list of instance groups that are located in the specified ‘zone’.
Specs
list_instances(zone :: binary, query_params :: Map.t) :: HTTPResponse.t
Lists all instances in the given ‘zone’ obeying the given ‘query_params’ if present.
Specs
list_instances_in_group(zone :: binary, instance_group :: binary, instance_state :: binary, query_params :: Map.t) :: HTTPResponse.t
Lists the instances in the specified ‘instance_group’ if it exists in the given ‘zone’. A filter for the state of the instances can be passed through ‘instance_state’.
Specs
list_machine_types(zone :: binary, query_params :: Map.t) :: HTTPResponse.t
Retrieves a list of machine types available in the specified ‘zone’ and that fit in the given ‘query_params’ if present.
Specs
list_networks(query_params :: Map.t) :: HTTPResponse.t
Retrieves the list of networks available according to the given ‘query_params’ if provided.
Specs
list_regions(query_params :: Map.t) :: HTTPResponse.t
Retrieves a list of region resources according to the given ‘query_params’.
Specs
list_zones(query_params :: Map.t) :: HTTPResponse.t
Retrieves the list of Zone resources available according to the given ‘query_params’.
Specs
patch_autoscaler(zone :: binary, autoscaler_name :: binary, autoscaler_resource :: Map.t, fields :: binary) :: HTTPResponse.t
Updates ‘autoscaler_name’ in the specified ‘zone’ using the data included in the ‘autoscaler_resource’. This function supports patch semantics.
Specs
patch_firewall(firewall :: binary, firewall_resource :: Map.t, fields :: binary) :: HTTPResponse.t
Updates the specified ‘firewall’ rule with the data included in the ‘firewall_resource’. This function supports patch semantics.
Specs
remove_instances_from_group(zone :: binary, insance_group :: binary, instances :: [binary], fields :: binary) :: HTTPResponse.t
Removes the ‘instances’ from the provided ‘instance_group’ if it exists in the given ‘zone’.
Specs
request(verb :: atom, endpoint :: binary, headers :: [{binary, binary}], body :: binary, parameters :: binary) :: HTTPResponse.t
Specs
reset_instance(zone :: binary, instance :: binary, fields :: binary) :: HTTPResponse.t
Performs a hard reset on the ‘instance’ if it exists in the given ‘zone’.
Specs
resize_disk(zone :: binary, disk :: binary, size_gb :: pos_integer, fields :: binary) :: HTTPResponse.t
Resizes the specified persistent ‘disk’ if it exists in the given ‘zone’ to the provided ‘size_gb’.
Specs
set_disk_auto_delete(zone :: binary, instance :: binary, auto_delete :: boolean, device_name :: binary, fields :: binary) :: HTTPResponse.t
Sets the ‘auto_delete’ flag for the disk with ‘device_name’ attached to ‘instance’ if it exists in the given ‘zone’.
Specs
set_machine_type(zone :: binary, instance :: binary, machine_type :: binary, fields :: binary) :: HTTPResponse.t
Changes the Machine Type for a stopped ‘instance’ to the specified ‘machine_type’ if the ‘instance’ exists in the given ‘zone’.
Specs
set_metadata(zone :: binary, instance :: binary, fingerprint :: binary, items :: [map], fields :: binary) :: HTTPResponse.t
Sets metadata for the specified ‘instance’ to the data specified in ‘fingerprint’ and ‘items’. The ‘instance’ must exist in the given ‘zone’.
The ‘items’ should be passed as a list of maps: [
%{
"key" => "some key value",
"value" => "some value"
},
%{
"key" => "some other key value",
"value" => "some other value"
}
]
Specs
set_named_ports_for_group(zone :: binary, instance_group :: binary, ports :: [{name :: binary, port :: binary}], fingerprint :: binary, fields :: binary) :: HTTPResponse.t
Sets the named ‘ports’ for the specified ‘instance_group’ if it exists in the
given ‘zone’. The ‘ports’ must be passed as a list of tuples with the format
{
Specs
set_scheduling(zone :: binary, instance :: binary, {on_host_maintenance :: binary, automatic_restart :: boolean, preemptible :: boolean}, fields :: binary) :: HTTPResponse.t
Sets an ‘instance’ scheduling options if it exists in the given ‘zone’. The ‘preemptible’ option cannot be changed after instance creation.
Specs
set_tags(zone :: binary, instance :: binary, fingerprint :: binary, items :: [binary], fields :: binary) :: HTTPResponse.t
Sets tags for the specified ‘instance’ to the given ‘fingerprint’ and ‘items’. The ‘instance’ must exist in the given ‘zone’.
Specs
start_instance(zone :: binary, instance :: binary, fields :: binary) :: HTTPResponse.t
Starts a stopped ‘instance’ if it exists in the given ‘zone’.
Specs
stop_instance(zone :: binary, instance :: binary, fields :: binary) :: HTTPResponse.t
Stops a running ‘instance’ if it exists in the given ‘zone’.
Specs
update_autoscaler(zone :: binary, autoscaler_name :: binary, autoscaler_resource :: Map.t, fields :: binary) :: HTTPResponse.t
Updates an autoscaler in the specified ‘zone’ using the data included in the ‘autoscaler_resource’. The ‘autoscaler_name’ may be provided but it’s optional.