dedicated_hypervisor methods¶
-
class
ecl.dedicated_hypervisor.v1._proxy.
Proxy
(session)[source]¶ Bases:
ecl.proxy2.BaseProxy
-
add_license
(server_id, license_types, vm_id=None, vm_name=None)[source]¶ Add license to VM on hyper visor
Parameters: - server_id (string) – ID of server that have VM to add license
- license_types (array) – Array of license type’s Name
- vm_id (string) – VM ID, Specify either vm_id or vm_name
- vm_name (string) – VM Name, Specify either vm_id or vm_name
Returns: dict of job_id
-
create_license
(license_type)[source]¶ Create additional Guest Image license key. You can create additional license key only for the licenses which has_license_key property is True.
Parameters: license_type (string) – Name of your Guest Image license type as a string. Returns: The results of license createion. Return type: License
-
create_server
(name, networks, image, flavor, admin_pass=None, description=None, availability_zone=None, metadata=None)[source]¶ Create additional Dedicated Hypervisor server.
Parameters: - name (string) – Name of your Dedicated Hypervisor/Baremetal server as a string.
- description (string) – Description of your Dedicated Hypervisor server as a string.
- networks (array) – If it is specified greater than two, default gateway is first network.
- flavor (string) – The flavor reference for the desired flavor for your Dedicated Hypervisor server. Specify as an UUID or full URL. Parameters of id or links -> href in api_list_flavors page can be used as flavorRef parameter.
- admin_pass (string) – Password for the administrator.
- image (string) – The image reference for the desired image for your Dedicated Hypervisor server. Specify as an UUID or full URL.
- availability_zone (string) – The availability zone name in which to launch the server. If omit this parameter, target availability_zone is random.
- metadata (dict) – Metadata key and value pairs. The maximum size of the metadata key and value is 255 bytes each.
Returns: The results of server createion.
Return type:
-
delete_license
(license_id, ignore_missing=True)[source]¶ Delete a specified Guest Image license key.
Parameters: - license_id (string) – ID for the license
- 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
Returns: None
-
delete_server
(server_id, ignore_missing=True)[source]¶ Deletes a specified Dedicated Hypervisor server. You can delete server when specified server status is ACTIVE or ERROR status.
Parameters: - server_id (string) – ID for the server.
- 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
Returns: None
-
find_license_type
(name_or_id, ignore_missing=True)[source]¶ Find a single license type
Parameters: - name_or_id – The name or ID of a license type.
- 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: One
LicenseType
or None
-
get_add_license_job
(server_id, job_id)[source]¶ Get add license job status
Parameters: - server_id (string) – Server ID
- job_id (string) – Job ID
Returns: Job object
-
get_server
(server_id)[source]¶ Shows your Dedicated Hypervisor server information.
Parameters: server_id (string) – ID for the server. Returns: One Sever
instance.Return type: Server
-
get_usage_histories
(history_id, From=None, to=None)[source]¶ Shows your Guest Image usage history information.
Parameters: - history_id (string) – ID for the history.
- From (dateTime) – date to list usage from. YYYY-MM-DD hh:mm:ss .
- to (dateTime) – date to list usage to. month of the parameter must be the same as from . YYYY-MM-DD hh:mm:ss .
Returns:
-
license_types
()[source]¶ Lists your Guest Image license on Dedicated Hypervisor servers information.
Returns: list of the license types. Return type: list of LicenseType
-
licenses
(license_type=None)[source]¶ Lists your Guest Image license key information.
Returns: list of the licenses. Return type: list of License
-
license¶
-
class
ecl.dedicated_hypervisor.v1.license.
License
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_create
= True¶
-
allow_delete
= True¶
-
allow_list
= True¶
-
assigned_from
= None¶ date the license assigned from.
-
base_path
= '/licenses'¶
-
expires_at
= None¶ expiration date for the license.
-
id
= None¶ id of Guest Image license.
-
key
= None¶ license key.
-
license_type
= None¶ license_type of the license
-
resource_key
= 'license'¶
-
resources_key
= 'licenses'¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'dedicated-hypervisor', 'requires_project_id': False, 'api_version': None}¶
-
license_type¶
-
class
ecl.dedicated_hypervisor.v1.license_type.
LicenseType
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
allow_list
= True¶
-
base_path
= '/license_types'¶
-
description
= None¶ description of th elicense.
-
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 (
-
has_license_key
= None¶ true if the you can create license key by API
-
id
= None¶ id of license type.
-
license_switch
= None¶
-
name
= None¶ name of license type.
-
resource_key
= None¶
-
resources_key
= 'license_types'¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'dedicated-hypervisor', 'requires_project_id': False, 'api_version': None}¶
-
unit
= None¶ unit of the license
-
server¶
-
class
ecl.dedicated_hypervisor.v1.server.
Server
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
adminPass
= None¶ Password for the administrator.
-
admin_pass
= None¶
-
allow_create
= True¶
-
allow_delete
= True¶
-
allow_get
= True¶
-
allow_list
= True¶
-
availability_zone
= None¶ Server’s availability zone.
-
baremetal_server
= None¶ detail of baremetal server.
-
base_path
= '/servers'¶
-
description
= None¶ description of Dedicated Hypervisor instance.
-
flavor
= None¶
-
flavorRef
= None¶ flavor id of Dedicated Hypervisor instance.
-
hypervisor_type
= None¶ type of hypervisor. vsphere_esxi or hyper_v.
-
id
= None¶ id of Dedicated Hypervisor instance.
-
image
= None¶
-
imageRef
= None¶ image id of Dedicated Hypervisor instance.
-
links
= None¶ Link of the Dedicated Hypervisor server.
-
name
= None¶ name of Dedicated Hypervisor instance.
-
networks
= None¶ Networks.
-
resource_key
= 'server'¶
-
resources_key
= 'servers'¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'dedicated-hypervisor', 'requires_project_id': False, 'api_version': None}¶
-
status
= None¶ Status of the Dedicated Hypervisor instance.
-
-
class
ecl.dedicated_hypervisor.v1.server.
ServerAction
(synchronized=False, **attrs)[source]¶ Bases:
ecl.dedicated_hypervisor.v1.server.Server
-
allow_create
= True¶
-
allow_delete
= False¶
-
allow_get
= True¶
-
allow_list
= False¶
-
base_path
= '/servers/%s/action'¶
-
job_id
= None¶
-
license_types
= None¶
-
message
= None¶
-
requested_param
= None¶
-
resource_key
= None¶
-
resources_key
= None¶
-
status
= None¶
-
vm_id
= None¶
-
vm_name
= None¶
-
usage¶
-
class
ecl.dedicated_hypervisor.v1.usage.
Usage
(synchronized=False, **attrs)[source]¶ Bases:
ecl.resource2.Resource
-
From
= None¶ date to list usage from.
-
allow_get
= True¶
-
allow_list
= True¶
-
base_path
= '/usages'¶
-
get_usage_histories
(session, history_id, **kwargs)[source]¶ Shows your Guest Image usage history information.
-
has_license_key
= None¶ if true, there is license key.
-
histories
= None¶ histories of the usage
-
id
= None¶ history id of Guest Image usage.
-
license_type
= None¶ name of license type to show.
-
name
= None¶ license type name for the usage.
-
resource_id
= None¶ uuid for the resource.
-
resource_key
= None¶
-
resources_key
= 'usages'¶
-
service
= {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'dedicated-hypervisor', 'requires_project_id': False, 'api_version': None}¶
-
to
= None¶ date to list usage to. month of the parameter must be the same as from .
-
type
= None¶ type of Guest Image usage.
-
unit
= None¶ unit for the usage.
-
value
= None¶ usage value.
-