baremetal methods

class ecl.baremetal.v2._proxy.Proxy(session)[source]

Bases: ecl.proxy2.BaseProxy

availability_zones()[source]

Return a list of availability zones for baremetal servers

Returns:List of AvailabilityZone
create_keypair(name, public_key=None)[source]

Generate or import SSH keys. After generating a KeyPair, please specify the key_name parameter in the request body in Create Server request to associate the new server with SSH keys.

Parameters:
  • name (string) – The name associated with a KeyPair.
  • public_key (string) – Keypair’s public key. If you do not specify this parameter, You can get the private key from Responce.
Returns:

Keypair

create_server(name, networks, flavor, admin_pass=None, image=None, key_name=None, availability_zone=None, user_data=None, raid_arrays=None, lvm_volume_groups=None, filesystems=None, metadata=None, personality=None)[source]

This API create additional Baremetal server.

Parameters:
  • name (string) – Name of your Baremetal server as a string.
  • networks (array) – Network Array. If it is specified greater than two, default gateway is first network.
  • flavor (string) – The flavor reference for the desired flavor for your Baremetal server.
  • admin_pass (string) – Password for the administrator.
  • image (string) – The image reference for the desired image for your Baremetal server.
  • key_name (string) – SSH Keypair name you created on KeyPairs API.
  • availability_zone (string) – The availability zone name in which to launch the server.
  • user_data (string) – Configuration information or scripts to use upon launch. Must be Base64 encoded. Maximum size is 65535 bytes.
  • raid_arrays (array) – Raid Arrays information.
  • lvm_volume_groups (array) – LVM information. must be sure to specify if you have to true lvm parameters Raid Arrays.
  • filesystems (array) – Partition filesystem / mount point information.
  • metadata (dict) – Metadata key and value pairs. The maximum size of the metadata key and value is 255 bytes each.
  • personality (array) – File path and contents (text only) to inject into your Baremetal server at launch. This parameter is not supported in esxi.
Returns:

Server

delete_keypair(keypair_name)[source]

Delete KeyPair associated with keypair_name.

Parameters:keypair_name (string) – The name associated with a KeyPair.
Returns:None
delete_metadata(server_id, key)[source]

This API deletes metadata item (key and value) by specifying key for a specified server.

Parameters:
  • server_id (string) – ID for specified server.
  • key (string) – A string. Maximum length is 255 characters.
Returns:

None

delete_server(server_id)[source]

This API deletes a specified Baremetal server.

Parameters:server_id (string) – ID for the specified server.
Returns:None
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 an availability zone.
  • ignore_missing (bool) – When set to False ResourceNotFound will be raised when the resource does not exist. When set to True, 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) – 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 to True, None will be returned when attempting to find a nonexistent resource.
Returns:

Flavor or None

find_server(name_or_id, ignore_missing=True)[source]

Find a single baremetal server

Parameters:
  • name_or_id (string) – 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 to True, None will be returned when attempting to find a nonexistent resource.
Returns:

Server or None

flavors(details=True)[source]

Lists all Flavor. That hash only id, links and name. If you want to get detail flavor information, call List Flavors Detail API. A flavor is a hardware configuration for a server. Each flavor is a unique combination of disk space and memory capacity.

Returns:A List of Flavor
get_flavor(flavor_id)[source]

Gets details for a FlavorDetail associated with flavor_id. A flavor is a hardware configuration for a server. Each flavor is a unique combination of disk space and memory capacity.

Parameters:flavor_id (string) – ID of a flavor.
Returns:Flavor
get_keypair(keypair_name)[source]

Show a KeyPair associated with keypair_name.

Parameters:keypair (string) – The name associated with a KeyPair.
Returns:Keypair
get_limits()[source]

This API lists the current limits for the account

Returns:Limits
get_management_console(server_id)[source]

Gets information to access the remote console of Baremetal Server. This request will be accepted only when the task_state is None. This API response console parameters are used at Remote Console Access - Get Started. To access your Baremetal Server, you have to create VPN user and connect to VPN.

Parameters:server_id (string) – ID for the server.
Returns:ServerAction
get_nic_physical_port(server_id, port_id)[source]

This API shows the specified NicPhysicalPort information for specified server.

Parameters:
  • server_id (string) – ID for the specified server.
  • port_id (string) – ID for the specified network interface port.
Returns:

NicPhysicalPort

get_server(server_id)[source]

Show your Baremetal server’s information.

Parameters:server_id (string) – ID for specified server.
Returns:Server
get_stock(flavor_id, availability_zone=None)[source]

This API show which Baremetal server stock is available or not.

Parameters:
  • flavor_id (string) – UUID of the flavor for search stock.
  • availability_zone (string) – Name of the AvailabilityZone. If you specified this parameter, search stock from Baremetal server that matching AvailabilityZone and flavor_id. If you omit this parameter, stock search from all Baremetal server that matching flavor_id.
Returns:

Stock

get_uefi(server_id)[source]

This API shows the UEFI setting information for specified Baremetal server.

Parameters:server_id (string) – ID for the requested server.
Returns:UEFI
get_version()[source]

Show Baremetal Server API version.

Returns:Version
keypairs()[source]

Lists name, public_key and finger_print for all KeyPairs.

Returns:A list of Keypair
media_attach(server_id, image)[source]

Attach media to the Baremetal Server associated with server_id. This request will be accepted only when the task_state is None.

Parameters:
  • server_id (string) – ID for the server.
  • image (string) – ID of the image you want to attach.
Returns:

None

media_detach(server_id, image)[source]

Detach media from the Baremetal Server associated with server_id. This request will be accepted only when the task_state is None.

Parameters:
  • server_id (string) – ID for the server.
  • image (string) – ID of the image you want to detach.
Returns:

None

merge_metadata(server_id, **attr)[source]

This API creates or merges metadata for a specified server. This API replaces items which match the specified keys in the request. This API does not remove items, unlike Replace Server Metadata Items.

Parameters:
  • server_id (string) – ID for specified server.
  • attr (kwargs) – Keyword arguments which will be used to do update process for Metadata.
Returns:

Metadata

metadata(server_id)[source]

This API lists metadata for a specified server.

Parameters:server_id (string) – ID for specified server.
Returns:A list of Metadata
nic_physical_ports(server_id)[source]

This API lists all NicPhysicalPort information for the specified server.

Parameters:server_id (string) – ID for the specified server.
Returns:A list of NicPhysicalPort
reboot_server(server_id, type, boot_mode)[source]

Reboot the Baremetal Server associated with server_id. This request will be accepted only when the task_state is None.

Parameters:
  • server_id (string) – ID for the server.
  • type (string) – Baremetal Server shutdown mode. A valid value is HARD or SOFT. HARD is force restart by IPMI. This operations is equal to power down. SOFT is restated by ACPI.
  • boot_mode (string) – Baremetal Server boot mode. A valid value is DISK, PXE, LEGACY or ISO.
Returns:

None

replace_metadata(server_id, **attr)[source]

This API creates or replaces metadata for a specified server. All existing metadata items are removed and completely replaced by the metadata items in the request. If you don’t want to remove existing items, please use Merge Server Metadata Items.

Parameters:
  • server_id (string) – ID for specified server.
  • attr (kwargs) – Keyword arguments which will be used to do update process for Metadata.
Returns:

Metadata

servers(details=True, **attrs)[source]

This API lists your Baremetal servers information.

Parameters:
  • details (bool) – When set to False Server instance will be returned. The default, True, will cause ServerDetail instances to be returned.
  • attrs – Attributes to be passed onto the list() method.
Returns:

A list of Server

show_metadata(server_id, key)[source]

This API shows metadata item (key and value) by specifying key for a specified server.

Parameters:
  • server_id (string) – ID for specified server.
  • key (string) – A string. Maximum length is 255 characters.
Returns:

Metadata

start_server(server_id, boot_mode)[source]

Power on the Baremetal Server associated with server_id. This request will be accepted only when the task_state is None.

Parameters:
  • server_id (string) – ID for the server.
  • boot_mode (string) – Baremetal Server boot mode. A valid value is DISK, PXE, LEGACY or ISO.
Returns:

None

stop_server(server_id)[source]

Stop the Baremetal Server associated with server_id. This request will be accepted only when the task_state is None.

Parameters:server_id (string) – ID for the server.
Returns:None
update_metadata(server_id, key, **attr)[source]

This API sets additonal metadata item (key and value) by specifying key for a specified server.

Parameters:
  • server_id (string) – ID for specified server.
  • key (string) – A string. Maximum length is 255 characters.
  • attr (kwargs) – Keyword arguments which will be used to do update process for Metadata.
Returns:

Metadata

update_uefi(server_id, **attrs)[source]

Updates UEFI setting of specified Baremetal server. This request will be accepted only when the task_state is None.

Parameters:
  • server_id (string) – ID for the requested server.
  • attrs (kwargs) – Attributes to be passed onto the update() method to be updated.
Returns:

UEFI

versions()[source]

List Baremetal Server API version.

Returns:A list of Version
class ecl.baremetal.v2._proxy.VersionSession(profile, user_agent=None, **kwargs)[source]

Bases: ecl.session.Session

get_endpoint(auth=None, interface='public', service_type=None, **kwargs)[source]

Override get endpoint to automate endpoint filtering

This method uses the service catalog to find the root URI of each service and then gets all available versions directly from the service, not from the service catalog.

Endpoints are cached per service type and interface combination so that they’re only requested from the remote service once per instance of this class.

availability_zone

class ecl.baremetal.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 to True, 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 is False.

hosts = None

hosts of availability zone

name = None
resources_key = 'availabilityZoneInfo'
service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'baremetal-server', 'requires_project_id': False, 'api_version': None}
state = None
zoneName = None

name of availability zone

zoneState = None

state of availability zone

flavor

class ecl.baremetal.v2.flavor.Flavor(synchronized=False, **attrs)[source]

Bases: ecl.resource2.Resource

allow_get = True
allow_list = True
base_path = '/flavors'
disk = None

The amount of disk space, in GBs.

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 to True, 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 is False.

id = None

The ID for the flavor, which is a unique integer value.

List of flavor resource links.

name = None

Name for the flavor.

ram = None

The amount of RAM, in MBs, for this flavor.

resource_key = 'flavor'
resources_key = 'flavors'
service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'baremetal-server', 'requires_project_id': False, 'api_version': None}
vcpus = None

The CPUs, in whole integer amount, for the flavor. In order to maintain compatibility with Nova API, we put the size of the physical cpu to vcpu.

class ecl.baremetal.v2.flavor.FlavorDetail(synchronized=False, **attrs)[source]

Bases: ecl.baremetal.v2.flavor.Flavor

allow_get = False
base_path = '/flavors/detail'

keypair

class ecl.baremetal.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

Fingerprint of public key.

list(session, paginated=False)[source]
name = None

The name to associate with the KeyPair. It is a unique name in the tenant. Available character is 1-255 character of alphabet(a-zA-Z), number(0-9) and slash(-).

private_key = None

Generated SSH private key. This parameter is visible only when did not specify public_key This parameter is only included in the response of Create Keypair.

public_key = None

The public RSA or DSA SSH key to import. If not provided, a key is generated 2048bit RSA key.

resource_key = 'keypair'
resources_key = 'keypairs'
service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'baremetal-server', 'requires_project_id': False, 'api_version': None}

limits

class ecl.baremetal.v2.limits.AbsoluteLimits(synchronized=False, **attrs)[source]

Bases: ecl.resource2.Resource

instances = None
instances_used = None
keypairs = None
maxPersonality = None
maxPersonalitySize = None
maxServerMeta = None
maxTotalInstances = None
maxTotalKeypairs = None
personality = None
personality_size = None
server_meta = None
totalInstancesUsed = None
class ecl.baremetal.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 Baremetal Limits instance
Return type:Limits
rate = None
resource_key = 'limits'
service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'baremetal-server', 'requires_project_id': False, 'api_version': None}
class ecl.baremetal.v2.limits.RateLimit(synchronized=False, **attrs)[source]

Bases: ecl.resource2.Resource

limits = None
regex = None
uri = None

metadata

class ecl.baremetal.v2.metadata.Metadata(synchronized=False, **attrs)[source]

Bases: ecl.resource2.Resource

allow_create = True
allow_delete = True
allow_list = True
allow_show = True
base_path = '/servers/%(server_id)s/metadata'
delete(session, server_id, key)[source]
get(session, server_id, key)[source]
list(session, server_id)[source]
merge(session, server_id, **attrs)[source]
metadata = None

Metadata of the server.

replace(session, server_id, **attrs)[source]
resource_key = None
resources_key = None
service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'baremetal-server', 'requires_project_id': False, 'api_version': None}
update(session, server_id, key, **attrs)[source]

nic_physical_port

class ecl.baremetal.v2.nic_physical_port.NicPhysicalPort(synchronized=False, **attrs)[source]

Bases: ecl.resource2.Resource

allow_get = True
allow_list = True
attached_ports = None

Logical attached ports of host.

base_path = '/servers/%(server_id)s/nic_physical_ports'
get(session, server_id, port_id)[source]
hardware_id = None

ID of hardware attaching the NicPhysicalPort.

id = None

UUID of the NicPhysicalPort.

list(session, server_id)[source]
mac_addr = None

MAC address of the NicPhysicalPort.

network_physical_port_id = None

Network controller port id of physical leaf switch.

plane = None

Value = ‘data’(default) or ‘storage’. Assigning preferentially the order to the NIC physical port. data plane: all devices cloud be connected. storage plane: this plane type is only used and optimized for storages between servers.You can assigning each until 2 planes.

resource_key = 'nic_physical_port'
resources_key = 'nic_physical_ports'
server_id = None

ID for the specified server.

service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'baremetal-server', 'requires_project_id': False, 'api_version': None}

server

class ecl.baremetal.v2.server.Server(synchronized=False, **attrs)[source]

Bases: ecl.resource2.Resource

OS_EXT_AZ_availability_zone = None

Server’s availability zone.

OS_EXT_STS_power_state = None

Power state: {“RUNNING”:”The server is running.”, “SHUTDOWN”:”The server was shut down.”, “CRASHED”:”The server lost powor controll information temporary. Status transfer RUNNING/SHUTDOWN Automatically.”}

OS_EXT_STS_task_state = None

Task state: {None:”There are no tasks. Only this status can be received API requests.”, “BUILDING”:”The task is building the Baremetal Server. This status is transfered by Create Server.”, “DELETING”:”The task is deleting the Baremetal Server. This status is transfered by Delete Server.”, “STOPPING”:”The task is stopping the Baremetal Server. This status is transfered by Stop Server.”, “STARTING”:”The task is starting the Baremetal Server. This status is transfered by Start Server.”, “REBOOTING”:”The task is rebooting the Baremetal Server. This status is transfered by Reboot Server.”}

OS_EXT_STS_vm_state = None

VM state: {“ACTIVE”:”The Baremetal server is active. This status is target of billing.”, “BUILD”:”The Baremetal server is built.”, “ERROR”: “The Baremetal server is outputing a error. There is necessity to report to our support.”, “DELETED”:”The Baremetal server is deleted.”}

adminPass = None

Password for the administrator. This parameter is shown only once, so you have to memo. Please refer OS specific limitations adminPass raw to know the required administrator name for each OS.

admin_pass = None
allow_create = True
allow_delete = True
allow_get = True
allow_list = True
availability_zone = None
base_path = '/servers'
chassis_status = None

Server’s chassis status information.

create(session, **attrs)[source]
created = None

Sever’s created time.

filesystems = None

Server’s file system information.

flavor = None

Server’s flavor information.

hostId = None

Server’s host ID.

id = None

UUID of the Baremetal server.

image = None

Server’s ID.

key_name = None

key_pair name

Link of the Baremetal server.

lvm_volume_groups = None

Server’s lvm volume groups information.

managed_by_service = None

managed_by_service

media_attachments = None
metadata = None

Server’s image information.

name = None

Name of the Baremetal server.

nic_physical_ports = None

Server’s nic physical ports information.

power_state = None
progress = None

Server’s links information.

raid_arrays = None

Server’s raid arrays information.

resource_key = 'server'
resources_key = 'servers'
service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'baremetal-server', 'requires_project_id': False, 'api_version': None}
status = None

Server’s metadata information.

task_state = None
tenant_id = None

Server’s tenant id.

updated = None

Server’s updated time.

user_id = None

Server’s user id.

vm_state = None
class ecl.baremetal.v2.server.ServerAction(synchronized=False, **attrs)[source]

Bases: ecl.resource2.Resource

base_path = '/servers/%s/action'
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 to True, 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 is False.

get_management_console(session, server_id)[source]
media_attach(session, server_id, image)[source]
media_detach(session, server_id, image)[source]
password = None

Password for sign in to the remote console.

reboot(session, server_id, type, boot_mode)[source]
resource_key = 'console'
resources_key = None
service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'baremetal-server', 'requires_project_id': False, 'api_version': None}
start(session, server_id, boot_mode)[source]
stop(session, server_id)[source]
type = None

Type of the remote console. Valid values are IPMI or IMM.

url = None

URL to access the remote console.

user_id = None

User ID for sign in to the remote console.

class ecl.baremetal.v2.server.ServerDetail(synchronized=False, **attrs)[source]

Bases: ecl.baremetal.v2.server.Server

allow_create = False
allow_delete = False
allow_get = False
allow_list = True
allow_update = False
base_path = '/servers/detail'

stock

class ecl.baremetal.v2.stock.Stock(synchronized=False, **attrs)[source]

Bases: ecl.resource2.Resource

allow_get = True
availability_zone = None

Availability Zone name of Baremetal server stock search condition.

base_path = '/stock'
flavor_id = None

Flavor UUID of Baremetal server stock search condition.

get(session, flavor_id, availability_zone=None)[source]
resource_key = 'stock'
service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'baremetal-server', 'requires_project_id': False, 'api_version': None}
stock = None

Baremetal server stock is available or not.

uefi

class ecl.baremetal.v2.uefi.UEFI(synchronized=False, **attrs)[source]

Bases: ecl.resource2.Resource

allow_get = True
allow_update = True
base_path = '/servers/%(server_id)s/uefi'
flavor_id = None

The ID for the flavor.

flavor_name = None

Name for the flavor.

get(session, server_id)[source]
message = None

Error messages when updating uefi setting is failed.

resource_key = 'uefi'
resources_key = 'uefi'
service = {'region_name': None, 'service_name': None, 'interface': 'public', 'version': None, 'service_type': 'baremetal-server', 'requires_project_id': False, 'api_version': None}
setting = None

UEFI setting.

status = None

The last result of applying uefi setting.

update(session, server_id, has_body=True, **attrs)[source]
updated = None

Updated time for UEFI