cloudmesh.oracle.compute.Provider

Module Contents

Classes

Provider

class cloudmesh.oracle.compute.Provider.Provider(name=None)

Bases: cloudmesh.abstract.ComputeNodeABC.ComputeNodeABC, cloudmesh.provider.ComputeProviderPlugin

kind = oracle
sample
vm_state = ['STARTING', 'RUNNING', 'STOPPING', 'STOPPED', 'UNKNOWN']
output
Print(self, data, output=None, kind=None)
static _get_credentials(config)

Internal function to create a dict for the oraclesdk credentials.

Parameters

config – The credentials from the cloudmesh yaml file

Returns

the dict for the oraclesdk

update_dict(self, elements, kind=None)

This function adds a cloudmesh cm dict to each dict in the list elements. Libcloud returns an object or list of objects With the dict method this object is converted to a dict. Typically this method is used internally.

Parameters
  • elements – the list of original dicts. If elements is a single dict a list with a single element is returned.

  • kind – for some kinds special attributes are added. This includes key, vm, image, flavor.

Returns

The list with the modified dicts

find(self, elements, name=None)

Finds an element in elements with the specified name.

Parameters
  • elements – The elements

  • name – The name to be found

Returns

get_instance(self, name)
keys(self)

Lists the keys on the cloud

Returns

dict

key_upload(self, key=None)

uploads the key specified in the yaml configuration to the cloud :param key: :return:

key_delete(self, name=None)

deletes the key with the given name :param name: The name of the key :return:

list_secgroups(self, name=None)

List the named security group

Parameters

name – The name of the group, if None all will be returned

Returns

list_secgroup_rules(self, name='default')

List the named security group

Parameters

name – The name of the group, if None all will be returned

Returns

add_secgroup(self, name=None, description=None, vcn_id=None)

Adds the :param name: Name of the group :param description: The description :return:

add_secgroup_rule(self, name=None, port=None, protocol=None, ip_range=None)

Adds the :param name: Name of the group :param description: The description :return:

remove_secgroup(self, name=None)

Delete the names security group

Parameters

name – The name

Returns

upload_secgroup(self, name=None)
add_rules_to_secgroup(self, name=None, rules=None)
remove_rules_from_secgroup(self, name=None, rules=None)
get_list(self, d, kind=None, debug=False, **kwargs)

Lists the dict d on the cloud :return: dict or libcloud object

images(self, **kwargs)

Lists the images on the cloud :return: dict object

image(self, name=None)

Gets the image with a given name :param name: The name of the image :return: the dict of the image

flavors(self)

Lists the flavors on the cloud

Returns

dict of flavors

flavor(self, name=None)

Gets the flavor with a given name :param name: The name of the flavor :return: The dict of the flavor

start(self, name=None)

Start a server with the given name

Parameters

name – A list of node name

Returns

A list of dict representing the nodes

stop(self, name=None)

Stop a list of nodes with the given name

Parameters

name – A list of node name

Returns

A list of dict representing the nodes

pause(self, name=None)

Start a server with the given name

Parameters

name – A list of node name

Returns

A list of dict representing the nodes

unpause(self, name=None)

Stop a list of nodes with the given name

Parameters

name – A list of node name

Returns

A list of dict representing the nodes

info(self, name=None)

Gets the information of a node with a given name

Parameters

name – The name of the virtual machine

Returns

The dict representing the node including updated status

status(self, name=None)
suspend(self, name=None)

NOT YET IMPLEMENTED.

suspends the node with the given name.

Parameters

name – the name of the node

Returns

The dict representing the node

resume(self, name=None)

resume a stopped node.

Parameters

name – the name of the node

Returns

the dict of the node

list(self)

Lists the vms on the cloud

Returns

dict of vms

destroy(self, name=None)

Destroys the node :param name: the name of the node :return: the dict of the node

reboot(self, name=None)

Reboot a list of nodes with the given name

Parameters

name – A list of node name

Returns

A list of dict representing the nodes

set_server_metadata(self, name, cm)

Sets the server metadata from the cm dict

Parameters
  • name – The name of the vm

  • cm – The cm dict

Returns

get_server_metadata(self, name)

gets the metadata for the server

Parameters

name – name of the fm

Returns

delete_server_metadata(self, name, key)

gets the metadata for the server

Parameters

name – name of the fm

Returns

get_availability_domain(self)
create_vcn_and_subnet(self, name, availability_domain)
create(self, name=None, image=None, size=None, location=None, timeout=360, key=None, secgroup=None, ip=None, user=None, public=True, group=None, metadata=None, cloud=None, **kwargs)

creates a named node

Parameters
  • group – the list of groups the vm belongs to

  • name – the name of the node

  • image – the image used

  • size – the size of the image

  • timeout – a timeout in seconds that is invoked in case the image does not boot. The default is set to 3 minutes.

  • kwargs – additional arguments HEADING(c=”.”)ed along at time of boot

Returns

list_public_ips(self, ip=None, available=False)

Lists the public ip addresses.

Parameters

available – if True only those that are not allocated will be returned.

Returns

delete_public_ip(self, ip=None)

Deletes the ip address

Parameters

ip – the ip address, if None than all will be deleted

Returns

create_public_ip(self)

Creates a new public IP address to use

Returns

The ip address information

find_available_public_ip(self)

Returns a single public available ip address.

Returns

The ip

attach_public_ip(self, name=None, ip=None)

adds a public ip to the named vm

Parameters
  • name – Name of the vm

  • ip – The ip address

Returns

detach_public_ip(self, name=None, ip=None)

adds a public ip to the named vm

Parameters
  • name – Name of the vm

  • ip – The ip address

Returns

get_public_ip(self, server=None, name=None)

returns the public ip

Parameters

name – name of the server

Returns

get_private_ipobj(self, id)
get_private_ip(self, server=None, name=None)
console(self, vm=None)

gets the output from the console

Parameters

vm – name of the VM

Returns

log(self, vm=None)
rename(self, name=None, destination=None)

rename a node. NOT YET IMPLEMENTED.

:param destination :param name: the current name :return: the dict with the new name

ssh(self, vm=None, command=None)
wait(self, vm=None, interval=None, timeout=None)

wais till the given VM can be logged into

Parameters
  • vm – name of the vm

  • interval – interval for checking

  • timeout – timeout

Returns