compute methods¶
-
class
ecl.compute.v2._proxy.
Proxy
(session)[source]¶ Bases:
ecl.proxy2.BaseProxy
-
availability_zones
(details=False)[source]¶ Return a list of availability zones
Parameters: details (bool) – Return extra details about the availability zones. This defaults to False as it generally requires extra permission. Returns: A list of AvailabilityZone
-
create_image_from_server
(server, name, metadata=None)[source]¶ Create image from a certain server
Parameters: - server – Either the ID of a server or a
Server
instance. - name (string) – Image name (1-255 characters).
- metadata (dict) – Image metadata ({“metadata_key”: “metadata_value”})
Returns: None
- server – Either the ID of a server or a
-
create_keypair
(name=None, public_key=None)[source]¶ Create a new keypair from attributes
Parameters: - name (string) – The name to associate with the keypair.
- public_key (string) – The public ssh key to import. If not provided, a key is generated.
Returns:
-
create_server
(flavor_id, name, disk_config=None, image_id=None, min_count=None, max_count=None, availability_zone=None, config_drive=None, key_name=None, user_data=None, block_device_mapping=None, block_device_mapping_v2=None, metadata=None, networks=None, personality=None, admin_pass=None, **attrs)[source]¶ Create a new server from attributes
Parameters: - flavor_id (string) – ID of server
- name (string) – Name of server
- disk_config (dict) – a single partition which is expanded to the size of the flavor selected
- image_id (string) – if block_device_mapping_v2 is not specified, it is require
- min_count (int) – minim count of instance
- max_count (int) – maxmum count of instance
- availability_zone (string) – availability zone
- config_drive (boolean) – Enables metadata injection in a server through a configuration drive
- key_name (string) – key name
- (Base64 encoded) user_data (string) – user data
- block_device_mapping (array) – block device mapping info
- block_device_mapping_v2 (array) – block device mapping v2 info
- metadata (dict) – metadata of the server
- networks (array) – if a tenant has more than two networks, it is required
- personality (array) – This param will not run for ECL2.0
- admin_pass (string) – the administrator password for the server
- attrs (kwargs) – Keyword arguments which will be used to create
a
Server
, comprised of the properties on the Server class.
Returns:
-
create_server_interface
(server, net_id=None, ip_address=None, port_id=None, fixed_ips=None)[source]¶ Create a new server interface from attributes
Parameters: - server – The server can be either the ID of a server or a
Server
instance that the interface belongs to. - net_id (string) – ID of network, may need to specify ip address if
- ip_address (string) – ip_address of add interface to the VM instance
- port_id (string) – ID of port of add interface to the VM instance
- fixed_ips (dict) – dict of fixed ips to add to the VM instance
Returns: - server – The server can be either the ID of a server or a
-
create_server_volume
(server, volume_id, device=None)[source]¶ Attaches a volume to the specified server
Parameters: - server – The server can be either the ID of a server or a
Server
- volume_id (string) – Volume ID to be attached
- device (string) – Device name that satisfies the following conditions: ^/dev/x{0,1}[a-z]{0,1}d{0,1})([a-z]+)[0-9]*$
- server – The server can be either the ID of a server or a
-
create_volume
(size, name=None, description=None, volume_type=None, metadata=None, availability_zone=None, snapshot_id=None)[source]¶ Create a single volume
Parameters: - size – size of volume to create.
- name – display name of volume to create.
- description – display description of volume to create.
- volume_type – volume type of volume to create.
- metadata – size of metadata to create.
- availability_zone – availability zone of volume to create.
- snapshot_id – ID of snapshot to create from.
Returns:
-
delete_image
(image, ignore_missing=True)[source]¶ Delete an image
Parameters: - image – The value can be either the ID of an image or a
Image
instance. - ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the image does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent image.
Returns: None
- image – The value can be either the ID of an image or a
-
delete_image_metadata
(image, keys)[source]¶ Delete metadata for an image
Parameters: - image – Either the ID of an image or a
Image
orImageDetail
instance. - keys (array) – The keys to delete.
Return type: None
- image – Either the ID of an image or a
-
delete_keypair
(keypair, ignore_missing=True)[source]¶ Delete a keypair
Parameters: - keypair – The value can be either the ID of a keypair or a
Keypair
instance. - ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the keypair does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent keypair.
Returns: None
- keypair – The value can be either the ID of a keypair or a
-
delete_server
(server, ignore_missing=True, force=False)[source]¶ Delete a server
Parameters: - server – The value can be either the ID of a server or a
Server
instance. - ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the server does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent server - force (bool) – When set to
True
, the server deletion will be forced immediatly.
Returns: None
- server – The value can be either the ID of a server or a
-
delete_server_interface
(server_interface, server=None, ignore_missing=True)[source]¶ Delete a server interface
Parameters: - server_interface – The value can be either the ID of a server interface or a
ServerInterface
instance. - server – This parameter need to be specified when ServerInterface
ID is given as value. It can be either the ID of a
server or a
Server
instance that the interface belongs to. - ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the server interface does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent server interface.
Returns: None
- server_interface – The value can be either the ID of a server interface or a
-
delete_server_metadata
(server, keys)[source]¶ Delete metadata for a server
Note: This method will do a HTTP DELETE request for every key in keys.
Parameters: - server – Either the ID of a server or a
Server
orServerDetail
instance. - keys (array) – The keys to delete
Returns: None
- server – Either the ID of a server or a
-
delete_server_volume
(server_volume, server=None, ignore_missing=True)[source]¶ Detach a volume from a server
Parameters: - server_volume – The value can be either the ID of a server volume or a
ServerVolume
instance. - server – This parameter need to be specified when ServerVolume
ID is given as value. It can be either the ID of a
server or a
Server
instance that the volume belongs to. - ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the server volume does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent server volume.
Returns: None
- server_volume – The value can be either the ID of a server volume or a
-
delete_volume
(volume, ignore_missing=True)[source]¶ Delete an volume
Parameters: - volume – The value can be either the ID of an volume or a
Volume
instance. - ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the volume does not exist. When set toTrue
, no exception will be set when attempting to delete a nonexistent volume.
Returns: None
- volume – The value can be either the ID of an volume or a
-
find_availability_zone
(name_or_id, ignore_missing=True)[source]¶ Find a single availability_zone
Parameters: - name_or_id (string) – The name or ID of a availability_zone.
- ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the resource does not exist. When set toTrue
, None will be returned when attempting to find a nonexistent resource.
Returns: AvailabilityZone
or None
-
find_flavor
(name_or_id, ignore_missing=True)[source]¶ Find a single flavor
Parameters: - name_or_id (string) – The name or ID of a flavor.
- ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the resource does not exist. When set toTrue
, None will be returned when attempting to find a nonexistent resource.
Returns: Flavor
or None
-
find_image
(name_or_id, ignore_missing=True)[source]¶ Find a single image
Parameters: - name_or_id (string) – The name or ID of a image.
- ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the resource does not exist. When set toTrue
, None will be returned when attempting to find a nonexistent resource.
Returns: Image
or None
-
find_keypair
(name_or_id, ignore_missing=True)[source]¶ Find a single keypair
Parameters: - name_or_id (string) – The name or ID of a keypair.
- ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the resource does not exist. When set toTrue
, None will be returned when attempting to find a nonexistent resource.
Returns: Keypair
or None
-
find_server
(name_or_id, ignore_missing=True)[source]¶ Find a single server
Parameters: - name_or_id (string) – The name or ID of a server.
- ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the resource does not exist. When set toTrue
, None will be returned when attempting to find a nonexistent resource.
Returns: Server
or None
-
flavors
(details=True)[source]¶ Return a list of flavors
Parameters: details (bool) – When True
, returnsFlavorDetail
objects, otherwiseFlavor
.Returns: A list of Flavor
-
get_default_quota
(tenant_id)[source]¶ Get default quota info of a tenant
Parameters: tenant_id (string) – The ID for the tenant for which you want to show quotas. This ID is different from the tenant ID of authentication. That ID is for the admin tenant. Returns: DefaultQuota
Raises: ResourceNotFound
when no resource can be found.
-
get_flavor
(flavor)[source]¶ Get a single flavor
Parameters: flavor – The value can be the ID of a flavor or a Flavor
instance.Returns: Flavor
Raises: ResourceNotFound
when no resource can be found.
-
get_image
(image)[source]¶ Get a single image
Parameters: image – The value can be the ID of an image or a Image
instance.Returns: Image
Raises: ResourceNotFound
when no resource can be found.
-
get_image_metadata
(image)[source]¶ Return a dictionary of metadata for an image
Parameters: image – Either the ID of an image or a Image
orImageDetail
instance.Returns: A Image
with only the image’s metadata. All keys and values are Unicode text.Return type: Image
-
get_keypair
(keypair)[source]¶ Get a single keypair
Parameters: keypair – The value can be the ID of a keypair or a Keypair
instance.Returns: Keypair
Raises: ResourceNotFound
when no resource can be found.
-
get_limits
()[source]¶ Retrieve limits that are applied to the project’s account
Returns: A Limits object, including both AbsoluteLimits
andRateLimits
Return type: Limits
-
get_quota
(tenant_id)[source]¶ Get quota info of a tenant
Parameters: tenant_id – The ID for the tenant for which you want to show quotas. This ID is different from the tenant ID of authentication. That ID is for the admin tenant. Returns: Quota
Raises: ResourceNotFound
when no resource can be found.
-
get_server
(server)[source]¶ Get a single server
Parameters: server – The value can be the ID of a server or a Server
instance.Returns: Server
Raises: ResourceNotFound
when no resource can be found.
-
get_server_action
(server_action, server=None)[source]¶ Get a single server action
Parameters: - server_action – The value can be the request ID of a server action or a
ServerAction
instance. - server – This parameter need to be specified when ServerAction
ID is given as value. It can be either the ID of a
server or a
Server
instance that the action belongs to.
Returns: Server Action object
ServerAction
Raises: ResourceNotFound
when no resource can be found.- server_action – The value can be the request ID of a server action or a
-
get_server_console
(server, vnc_type)[source]¶ Get the console link of server
Parameters: - server – Either the ID of a server or a
Server
instance. - vnc_type – should be one of these: novnc, rdp-html5, spice-html5, serial
Returns: console link and type info
Return type: dict {"url": "", "type": ""}
- server – Either the ID of a server or a
-
get_server_metadata
(server)[source]¶ Return a dictionary of metadata for a server
Parameters: server – Either the ID of a server or a Server
orServerDetail
instance.Returns: A Server
with only the server’s metadata. All keys and values are Unicode text.
-
get_tenant_usage
(tenant_id)[source]¶ Get tenant usage information of a tenant
Parameters: tenant_id (string) – The ID for the tenant for which you want to show usage information. This ID is different from the tenant ID of authentication. That ID is for the admin tenant. Returns: TenantUsage
Raises: ResourceNotFound
when no resource can be found.
-
get_volume
(volume)[source]¶ Get a single volume
Parameters: volume – The value can be the ID of a volume or a Volume
instance.Returns: Volume
Raises: ResourceNotFound
when no resource can be found.
-
images
(details=True, **query)[source]¶ Return a list of images
Parameters: - details (bool) – When
True
, returnsImageDetail
objects, otherwiseImage
. - **query (kwargs) – Optional query parameters to be sent to limit the resources being returned.
Returns: A list of
Image
- details (bool) – When
-
resize_server
(server, flavor_id)[source]¶ Resize the server to flavor reference
Parameters: - server – Either the ID of a server or a
Server
instance. - flavor_id (string) – ID of flavor to resize
Returns: <Response 202>
- server – Either the ID of a server or a
-
server_actions
(server)[source]¶ Return a list of server actions
Parameters: server – The server can be either the ID of a server or a Server
.Returns: A list of ServerAction
-
server_interfaces
(server)[source]¶ Return a list of server interfaces
Parameters: server – The server can be either the ID of a server or a Server
.Returns: A list of ServerInterface
-
server_volumes
(server)[source]¶ Return a list of server volumes
Parameters: server – The server can be either the ID of a server or a Server
.Returns: A list of ServerVolume
-
servers
(details=True, **query)[source]¶ Retrieve a list of servers
Parameters: - details (bool) – When set to
False
Server
instances will be returned. The default,True
, will causeServerDetail
instances to be returned. - **query (kwargs) –
Optional query parameters to be sent to limit the servers being returned. Available parameters include:
- changes_since: A time/date stamp for when the server last changed status.
- image: An image resource or ID.
- flavor: A flavor resource or ID.
- name: Name of the server as a string.
- status: Value of the status of the server so that you can filter on “ACTIVE” for example.
- host: Name of the host as a string.
- limit: Requests a specified page size of returned items from the query.
- marker: Specifies the ID of the last-seen item.
Returns: A list of
Server
- details (bool) – When set to
-
set_image_metadata
(image, **metadata)[source]¶ Update metadata for an image
Parameters: - image – Either the ID of an image or a
Image
orImageDetail
instance. - metadata (kwargs) – Key/value pairs to be updated in the image’s metadata. No other metadata is modified by this call. All keys and values are stored as Unicode.
Returns: A
Image
with only the image’s metadata. All keys and values are Unicode text.- image – Either the ID of an image or a
-
set_server_metadata
(server, **metadata)[source]¶ Update metadata for a server
Parameters: - server – Either the ID of a server or a
Server
orServerDetail
instance. - metadata (kwargs) – Key/value pairs to be updated in the server’s metadata. No other metadata is modified by this call. All keys and values are stored as Unicode.
Returns: A
Server
with only the server’s metadata. All keys and values are Unicode text.- server – Either the ID of a server or a
-
start_server
(server)[source]¶ Start the server
Parameters: server – Either the ID of a server or a Server
instance.Returns: <Response 202>
-
stop_server
(server)[source]¶ Stop the server
Parameters: server – Either the ID of a server or a Server
instance.Returns: <Response 202>
-
update_server
(server, **body)[source]¶ Update a server
Parameters: - server – Either the ID of a server or a
Server
instance. - name (string) – Server name
- access_ipv4 (string) – IPv4 address
- access_ipv6 (string) – IPv6 address
Returns: - server – Either the ID of a server or a
-
availability_zone¶
-
class
ecl.compute.v2.availability_zone.
AvailabilityZone
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_list
= True¶
-
base_path
= '/os-availability-zone'¶
-
classmethod
find
(session, name_or_id, ignore_missing=True, **params)[source]¶ Find a resource by its name or id.
Parameters: - session (
Session
) – The session to use for making this request. - name_or_id – This resource’s identifier, if needed by
the request. The default is
None
. - ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the resource does not exist. When set toTrue
, None will be returned when attempting to find a nonexistent resource. - params (dict) – Any additional parameters to be passed into
underlying methods, such as to
existing()
in order to pass on URI parameters.
Returns: The
Resource
object matching the given name or id or None if nothing matches.Raises: ecl.exceptions.DuplicateResource
if more than one resource is found for this request.Raises: ecl.exceptions.ResourceNotFound
if nothing is found and ignore_missing isFalse
.- session (
-
hosts
= None¶ hosts of availability zone
-
name
= None¶ name of availability zone
-
resources_key
= 'availabilityZoneInfo'¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'compute', 'requires_project_id': False, 'api_version': None}¶
-
state
= None¶ state of availability zone
-
-
class
ecl.compute.v2.availability_zone.
AvailabilityZoneDetail
(synchronized=False, **attrs)[source]¶ Bases:
ecl.compute.v2.availability_zone.AvailabilityZone
-
base_path
= '/os-availability-zone/detail'¶
-
extension¶
-
class
ecl.compute.v2.extension.
Extension
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
alias
= None¶ A short name by which this extension is also known.
-
allow_get
= True¶
-
allow_list
= True¶
-
base_path
= '/extensions'¶
-
description
= None¶ Text describing this extension’s purpose.
-
id_attribute
= 'alias'¶
-
links
= None¶ Links pertaining to this extension. This is a list of dictionaries, each including keys
href
andrel
.
-
name
= None¶ The name of the extension.
-
namespace
= None¶ A URL pointing to the namespace for this extension.
-
resource_key
= 'extension'¶
-
resources_key
= 'extensions'¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'compute', 'requires_project_id': False, 'api_version': None}¶
-
updated_at
= None¶ Timestamp when this extension was last updated.
-
flavor¶
-
class
ecl.compute.v2.flavor.
Flavor
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_create
= True¶
-
allow_delete
= True¶
-
allow_get
= True¶
-
allow_list
= True¶
-
base_path
= '/flavors'¶
-
disk
= None¶ Size of the disk this flavor offers. Type: int
-
ephemeral
= None¶ Size of the ephemeral data disk attached to this server. Type: int
-
is_disabled
= None¶ True
if this flavor is disabled,False
if not. Type: bool
-
is_public
= None¶ True
if this is a publicly visible flavor.False
if this is a private image. Type: bool
-
links
= None¶ Links pertaining to this flavor. This is a list of dictionaries, each including keys
href
andrel
.
-
name
= None¶ The name of this flavor.
-
ram
= None¶ The amount of RAM (in MB) this flavor offers. Type: int
-
resource_key
= 'flavor'¶
-
resources_key
= 'flavors'¶
-
rxtx_factor
= None¶ The bandwidth scaling factor this flavor receives on the network.
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'compute', 'requires_project_id': False, 'api_version': None}¶
-
swap
= None¶ Size of the swap partitions.
-
vcpus
= None¶ The number of virtual CPUs this flavor offers. Type: int
-
image¶
-
class
ecl.compute.v2.image.
Image
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
,ecl.compute.v2.metadata.MetadataMixin
-
allow_delete
= True¶
-
allow_get
= True¶
-
allow_list
= True¶
-
base_path
= '/images'¶
-
created_at
= None¶ Timestamp when the image was created.
-
links
= None¶ Links pertaining to this image. This is a list of dictionaries, each including keys
href
andrel
, and optionallytype
.
-
metadata
= None¶ Metadata pertaining to this image. Type: dict
-
min_disk
= None¶ The mimimum disk size. Type: int
-
min_ram
= None¶ The minimum RAM size. Type: int
-
name
= None¶ The name of this image.
-
progress
= None¶ If this image is still building, its progress is represented here. Once an image is created, progres will be 100. Type: int
-
resource_key
= 'image'¶
-
resources_key
= 'images'¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'compute', 'requires_project_id': False, 'api_version': None}¶
-
size
= None¶ Size of the image in bytes. Type: int
-
status
= None¶ The status of this image.
-
updated_at
= None¶ Timestamp when the image was updated.
-
keypair¶
-
class
ecl.compute.v2.keypair.
Keypair
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_create
= True¶
-
allow_delete
= True¶
-
allow_get
= True¶
-
allow_list
= True¶
-
base_path
= '/os-keypairs'¶
-
fingerprint
= None¶ The short fingerprint associated with the
public_key
for this keypair.
-
id
= None¶ The id identifying the keypair
-
name
= None¶ A name identifying the keypair
-
private_key
= None¶ The private key for the keypair
-
public_key
= None¶ The SSH public key that is paired with the server.
-
resource_key
= 'keypair'¶
-
resources_key
= 'keypairs'¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'compute', 'requires_project_id': False, 'api_version': None}¶
-
user_id
= None¶
-
limits¶
-
class
ecl.compute.v2.limits.
AbsoluteLimits
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
backup_gigabytes
= None¶
-
backup_gigabytes_used
= None¶
-
backups
= None¶
-
backups_used
= None¶
-
cores
= None¶ The maximum amount of cores.
-
cores_used
= None¶ The amount of cores currently in use.
-
floating_ips
= None¶ The maximum amount of floating IPs.
-
floating_ips_used
= None¶ The amount of floating IPs currently in use.
-
gigabytes_used
= None¶
-
image_meta
= None¶ The number of key-value pairs that can be set as image metadata.
-
instances
= None¶ The maximum amount of instances.
-
instances_used
= None¶ The amount of instances currently in use.
-
keypairs
= None¶ The maximum amount of keypairs.
-
personality
= None¶ The maximum number of personality contents that can be supplied.
-
personality_size
= None¶ The maximum size, in bytes, of a personality.
-
ram
= None¶ The maximum RAM size in megabytes.
-
ram_used
= None¶ The RAM size in megabytes currently in use.
-
security_group_rules
= None¶ The maximum amount of security group rules allowed.
-
security_groups
= None¶ The maximum amount of security groups allowed.
-
security_groups_used
= None¶ The amount of security groups currently in use.
-
server_group_members
= None¶ The maximum number of members in a server group.
-
server_groups
= None¶ The maximum amount of server groups.
-
server_groups_used
= None¶ The amount of server groups currently in use.
-
server_meta
= None¶ The number of key-value pairs that can be set as sever metadata.
-
snapshots
= None¶ New missing attributes
-
snapshots_used
= None¶
-
volume_gigabytes
= None¶
-
volumes
= None¶
-
volumes_used
= None¶
-
-
class
ecl.compute.v2.limits.
Limits
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
absolute
= None¶
-
allow_get
= True¶
-
base_path
= '/limits'¶
-
get
(session, requires_id=False)[source]¶ Get the Limits resource.
Parameters: session ( Session
) – The session to use for making this request.Returns: A Limits instance Return type: Limits
-
rate
= None¶
-
resource_key
= 'limits'¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'compute', 'requires_project_id': False, 'api_version': None}¶
-
-
class
ecl.compute.v2.limits.
RateLimit
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
limits
= None¶ A list of the specific limits that apply to the
regex
anduri
.
-
regex
= None¶ A regex representing which routes this rate limit applies to.
-
uri
= None¶ A URI representing which routes this rate limit applies to.
-
metadata¶
-
class
ecl.compute.v2.metadata.
MetadataMixin
[source]¶ Bases:
object
-
delete_metadata
(session, keys)[source]¶ Delete metadata
Note: This method will do a HTTP DELETE request for every key in keys.
Parameters: - session – The session to use for this request.
- keys – The keys to delete.
Return type: None
-
get_metadata
(session)[source]¶ Retrieve metadata
Parameters: session – The session to use for this request. Returns: A dictionary of the requested metadata. All keys and values are Unicode text. Return type: dict
-
set_metadata
(session, **metadata)[source]¶ Update metadata
This call will replace only the metadata with the same keys given here. Metadata with other keys will not be modified.
Parameters: - session – The session to use for this request.
- metadata (kwargs) – key/value metadata pairs to be update on this server instance. All keys and values are stored as Unicode.
Returns: A dictionary of the metadata after being updated. All keys and values are Unicode text.
Return type: dict
-
quota¶
-
class
ecl.compute.v2.quota.
DefaultQuota
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_get
= True¶
-
base_path
= '/os-quota-sets/%(tenant_id)s/defaults'¶
-
cores
= None¶
-
fixed_ips
= None¶
-
id
= None¶
-
injected_file_content_bytes
= None¶
-
injected_file_path_bytes
= None¶
-
injected_files
= None¶
-
instances
= None¶
-
key_pairs
= None¶
-
metadata_items
= None¶
-
ram
= None¶
-
resource_key
= 'quota_set'¶
-
resources_key
= 'quota_sets'¶
-
security_group_rules
= None¶
-
security_groups
= None¶
-
server_group_members
= None¶
-
server_groups
= None¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'compute', 'requires_project_id': False, 'api_version': None}¶
-
tenant_id
= None¶
-
-
class
ecl.compute.v2.quota.
Quota
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_get
= True¶
-
base_path
= '/os-quota-sets'¶
-
cores
= None¶
-
fixed_ips
= None¶
-
id
= None¶
-
injected_file_content_bytes
= None¶
-
injected_file_path_bytes
= None¶
-
injected_files
= None¶
-
instances
= None¶
-
key_pairs
= None¶
-
metadata_items
= None¶
-
ram
= None¶
-
resource_key
= 'quota_set'¶
-
resources_key
= 'quota_sets'¶
-
security_group_rules
= None¶
-
security_groups
= None¶
-
server_group_members
= None¶
-
server_groups
= None¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'compute', 'requires_project_id': False, 'api_version': None}¶
-
-
class
ecl.compute.v2.quota.
TenantUsage
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_get
= True¶
-
base_path
= '/os-simple-tenant-usage'¶
-
resource_key
= 'tenant_usage'¶
-
resources_key
= 'tenant_usages'¶
-
server_usages
= None¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'compute', 'requires_project_id': False, 'api_version': None}¶
-
start
= None¶
-
stop
= None¶
-
tenant_id
= None¶
-
total_hours
= None¶
-
total_local_gb_usage
= None¶
-
total_memory_mb_usage
= None¶
-
total_vcpus_usage
= None¶
-
server¶
-
class
ecl.compute.v2.server.
Server
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
,ecl.compute.v2.metadata.MetadataMixin
-
accessIPv4
= None¶
-
accessIPv6
= None¶
-
access_ipv4
= None¶ IPv4 Address
-
access_ipv6
= None¶ IPv6 Address
-
addresses
= None¶ A dictionary of addresses this server can be accessed through. The dictionary contains keys such as
private
andpublic
, each containing a list of dictionaries for addresses of that type. The addresses are contained in a dictionary with keysaddr
andversion
, which is either 4 or 6 depending on the protocol of the IP address. Type: dict
-
adminPass
= None¶
-
admin_pass
= None¶ admin user’s password for this server
-
allow_create
= True¶
-
allow_delete
= True¶
-
allow_get
= True¶
-
allow_list
= True¶
-
allow_update
= True¶
-
attached_volumes
= None¶ A list of an attached volumes. Each item in the list contains at least an “id” key to identify the specific volumes.
-
availability_zone
= None¶ The name of the availability zone this server is a part of.
-
base_path
= '/servers'¶
-
block_device_mapping
= None¶ Enables fine grained control of the block device mapping for an instance. This is typically used for booting servers from volumes.
-
block_device_mapping_v2
= None¶
-
change_password
(session, new_password)[source]¶ Change the administrator password to the given password.
-
config_drive
= None¶ config drive
-
create
(session, prepend_key=True)[source]¶ Create a remote resource based on this instance.
Parameters: - session (
Session
) – The session to use for making this request. - prepend_key – A boolean indicating whether the resource_key should be prepended in a resource creation request. Default to True.
Returns: This
Resource
instance.Raises: MethodNotSupported
ifResource.allow_create
is not set toTrue
.- session (
-
create_image
(session, name, metadata=None)[source]¶ Create image from server. :param session :param name :param metadata
-
created_at
= None¶ Timestamp of when the server was created.
-
diskConfig
= None¶
-
disk_config
= None¶ The disk configuration. Either AUTO or MANUAL.
-
classmethod
find
(session, name_or_id, ignore_missing=True, **params)[source]¶ Find a resource by its name or id.
Parameters: - session (
Session
) – The session to use for making this request. - name_or_id – This resource’s identifier, if needed by
the request. The default is
None
. - ignore_missing (bool) – When set to
False
ResourceNotFound
will be raised when the resource does not exist. When set toTrue
, None will be returned when attempting to find a nonexistent resource. - params (dict) – Any additional parameters to be passed into
underlying methods, such as to
existing()
in order to pass on URI parameters.
Returns: The
Resource
object matching the given name or id or None if nothing matches.Raises: ecl.exceptions.DuplicateResource
if more than one resource is found for this request.Raises: ecl.exceptions.ResourceNotFound
if nothing is found and ignore_missing isFalse
.- session (
-
flavor
= None¶ The flavor property as returned from server.
-
flavor_id
= None¶ The flavor reference, as a ID or full URL, for the flavor to use for this server.
-
host_id
= None¶ An ID representing the host of this server.
-
id
= None¶ ID of the server
-
image
= None¶ The image property as returned from server.
-
image_id
= None¶ The image reference, as a ID or full URL, for the image to use for this server.
-
key_name
= None¶ The name of an associated keypair
-
launched_at
= None¶ The timestamp when the server was launched.
-
links
= None¶ A list of dictionaries holding links relevant to this server.
-
max_count
= None¶ Requested maximum count of instance
-
metadata
= None¶ Metadata stored for this server. Type: dict
-
min_count
= None¶ Requested minim count of instance
-
name
= None¶ Name of the server
-
networks
= None¶ A networks object. Required parameter when there are multiple networks defined for the tenant. When you do not specify the networks parameter, the server attaches to the only network created for the current tenant.
-
personality
= None¶ The file path and contents, text only, to inject into the server at launch. The maximum size of the file path data is 255 bytes. The maximum limit is The number of allowed bytes in the decoded, rather than encoded, data.
-
power_state
= None¶ The power state of this server.
-
progress
= None¶ of completion. Once it is completed, it will be 100. Type: int
-
project_id
= None¶ The ID of the project this server is associated with.
-
rebuild
(session, name, admin_password, preserve_ephemeral=False, image=None, access_ipv4=None, access_ipv6=None, metadata=None, personality=None)[source]¶ Rebuild the server with the given arguments.
-
resource_key
= 'server'¶
-
resources_key
= 'servers'¶
-
scheduler_hints
= None¶ The dictionary of data to send to the scheduler.
-
security_groups
= None¶ A list of applicable security groups. Each group contains keys for description, name, id, and rules.
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'compute', 'requires_project_id': False, 'api_version': None}¶
-
status
= None¶ The state this server is in. Valid values include
ACTIVE
,BUILDING
,DELETED
,ERROR
,HARD_REBOOT
,PASSWORD
,PAUSED
,REBOOT
,REBUILD
,RESCUED
,RESIZED
,REVERT_RESIZE
,SHUTOFF
,SOFT_DELETED
,STOPPED
,SUSPENDED
,UNKNOWN
, orVERIFY_RESIZE
.
The dict of tags of servers
-
task_state
= None¶ The task state of this server.
-
terminated_at
= None¶ The timestamp when the server was terminated (if it has been).
-
updated_at
= None¶ Timestamp of when this server was last updated.
-
user_data
= None¶ Configuration information or scripts to use upon launch. Must be Base64 encoded.
-
user_id
= None¶ The ID of the owners of this server.
-
vm_state
= None¶ The VM state of this server.
-
server_action¶
-
class
ecl.compute.v2.server_action.
ServerAction
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
action
= None¶ action instance
-
allow_get
= True¶
-
allow_list
= True¶
-
base_path
= '/servers/%(instance_uuid)s/os-instance-actions'¶
-
instance_uuid
= None¶ The ID for the server.
-
message
= None¶ Message of action
-
project_id
= None¶ - project id
-
request_id
= None¶ request id
-
resource_key
= 'instanceAction'¶
-
resources_key
= 'instanceActions'¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'compute', 'requires_project_id': False, 'api_version': None}¶
-
start_time
= None¶ start time of an action
-
user_id
= None¶ owner of the instance
-
server_interface¶
-
class
ecl.compute.v2.server_interface.
ServerInterface
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_create
= True¶
-
allow_delete
= True¶
-
allow_get
= False¶
-
allow_list
= True¶
-
allow_update
= False¶
-
base_path
= '/servers/%(server_id)s/os-interface'¶
-
fixed_ips
= None¶ Fixed IP addresses with subnet IDs.
-
mac_addr
= None¶ The MAC address.
-
net_id
= None¶ The network ID.
-
port_id
= None¶ The ID of the port for which you want to create an interface.
-
port_state
= None¶ The port state.
-
resource_key
= 'interfaceAttachment'¶
-
resources_key
= 'interfaceAttachments'¶
-
server_id
= None¶ The ID for the server.
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'compute', 'requires_project_id': False, 'api_version': None}¶
-
server_volume¶
-
class
ecl.compute.v2.server_volume.
ServerVolume
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_create
= True¶
-
allow_delete
= True¶
-
allow_get
= False¶
-
allow_list
= True¶
-
allow_update
= False¶
-
base_path
= '/servers/%(serverId)s/os-volume_attachments'¶
-
device
= None¶ Device name
-
id
= None¶ Attachment ID
-
resource_key
= 'volumeAttachment'¶
-
resources_key
= 'volumeAttachments'¶
-
serverId
= None¶ The ID of the server
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'compute', 'requires_project_id': False, 'api_version': None}¶
-
volumeId
= None¶ The ID of the volume
-
volume¶
-
class
ecl.compute.v2.volume.
Volume
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_create
= True¶
-
allow_delete
= True¶
-
allow_get
= True¶
-
allow_list
= True¶
-
allow_update
= True¶
-
attachments
= None¶
-
availability_zone
= None¶
-
base_path
= '/os-volumes'¶
-
bootable
= None¶
-
created_at
= None¶
-
description
= None¶
-
id
= None¶
-
metadata
= None¶
-
name
= None¶
-
resource_key
= 'volume'¶
-
resources_key
= 'volumes'¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'compute', 'requires_project_id': False, 'api_version': None}¶
-
size
= None¶
-
snapshot_id
= None¶
-
status
= None¶
-
volume_type
= None¶
-