CloudServersNG

class CloudServersNG.CloudServersNG(env, region=None)[source]

Bases: Cloud.Cloud

service = 'ServersOpenStack'
getLimits()[source]

Gets the current rate and absolute limits for your account.

Returns: JSON results as python dict

getExtensions(extension=None)[source]

List available extensions and get details for a specific extension.

Arguments: extension – alias of extension(string)

Returns: JSON results as python dict

getServer(sId)[source]

Fetch a server’s details. This operation returns the details of a specified server.

Arguments: sId – Server uuid

Returns: JSON results as python dict

getServers(details=False, attrDict={})[source]

Fetch servers. Use details=True for all details. Use attrDict to filter results.

Arguments: details – bool, defaults to False attrDict Options:

image – The image ID (Optional) flavor – The flavor ID (Optional) name – The server name. (Optional) status – The server status. (Optional) marker – The ID of the last item in the previous list. (Optional) limit – The page size. (Optional) changes-since –The changes-since time.
createServer(name, flavorRef, imageRef, attrDict={})[source]

This operation asynchronously provisions a new server.

Arguments: name – flavorRef – imageRef – uuid(string) attrDict – Optional dictionary containing OS-DCF:diskConfig, metadata, personality or accessIPv[4,6]

Returns: JSON results as python dict

setServerAttr(sId, attrDict)[source]

This operation updates the editable attributes of a specified server.

Arguments: id – Server uuid attrDict – dictionary containing name, accessIPv[4,6] updates

Returns: JSON results as python dict

deleteServer(sId)[source]

This operation deletes a specified server instance from the system.

Arguments: sId – Server uuid

Returns: status code

getAddresses(sId, network=None)[source]

This operation lists all networks and addresses associated with a specified server. Specify network for filtering

Arguments: sId – Server uuid network – Filter by network ie public, private

Returns: JSON results as python dict

changePass(sId, adminPass)[source]

This operation changes the administrator password for a specified server.

Arguments: sId – Server uuid adminPass – new password

Returns: status code

rebootServer(sId, rType='SOFT')[source]

This operation performs a soft or hard reboot of a specified server. A soft reboot is a graceful shutdown and restart of your server’s operating system. A hard reboot power cycles your server, which performs an immediate shutdown and restart.

Arguments: sId – Server uuid rType – HARD or SOFT(string)

Returns: status code

rebuildServer(sId, name, flavorRef, imageRef, attrDict=None)[source]

The rebuild operation removes all data on the server and replaces it with the specified image. The serverRef and all IP addresses remain the same. If you specify name, metadata, accessIPv4, or accessIPv6 in the rebuild request, new values replace existing values. Otherwise, these values do not change.

Arguments: sId – Server uuid name – Server name(string) flavorRef – flavor number(string) imageRef – uuid(string) attrDict – Optional dictionary containing OS-DCF:diskConfig, metadata, personality or accessIPv[4,6]

Returns: JSON results as python dict

resizeServer(sId, flavorRef, diskConfig='AUTO')[source]

This operation converts an existing server to a different flavor, which scales the server up or down. The original server is saved for a period of time to allow roll back if a problem occurs. You should test and explicitly confirm all resizes. When you do so, the original server is removed. All resizes are automatically confirmed after 24 hours if you do not explicitly confirm or revert the resize.

Arguments: sId – Server uuid flavorRef – flavor id (string) diskConfig – AUTO or MANUAL(string) OS-DCF:diskConfig

Returns: status code

confirmResizeServer(sId)[source]

After you verify that the newly resized server works properly, use this operation to confirm the resize. After you confirm the resize, the original server is removed and you cannot roll back to that server. All resizes are automatically confirmed after 24 hours if you do not explicitly confirm or revert the resize.

Arguments: sId – Server uuid

Returns: status code

revertResizeServer(sId)[source]

Use this operation to revert the resize and roll back to the original server. All resizes are automatically confirmed after 24 hours if you do not explicitly confirm or revert the resize.

Arguments: sId – Server uuid

Returns: status code

rescueServer(sId)[source]

A temporary root password is assigned for use during rescue mode. This password is returned in the response body for this call. Rescue mode is limited to 90 minutes, after which the rescue image is destroyed and the server attempts to reboot. You can exit rescue mode at any time.

Arguments: sId – Server uuid

Returns: JSON results as python dict

unrescueServer(sId)[source]

After you resolve any problems and reboot a rescued server, you can unrescue the server. When you unrescue the server, the repaired image is restored to its running state with your original password.

Arguments: sId – Server uuid

Returns: JSON results as python dict

createImage(sId, name, metaDict=None)[source]

This operation creates a new image for a specified server. Once complete, a new image is available that you can use to rebuild or create servers.

Arguments: sId – Server uuid name – Image name(string) metaDict – dictionary containing metadata key/value pairs.(Optional)

Returns: status code

createAttVolume(sId, volumeList)[source]

This operation attaches one or more volumes to the specified server.

Arguments: sId – Server uuid volumeList – dictionary containing volumeId and device keys.

Returns: JSON results as python dict

getAttVolumes(sId, vId=None)[source]

This operation returns a response body that lists the volume attachment(s) for the specified server.

Arguments: sId – Server uuid vId – Volume attachment id(Optional)

Returns: JSON results as python dict

deleteAttVolume(sId, vId)[source]

This operation deletes a specified volume attachment from a specified server instance.

Arguments: sId – Server uuid vId – Volume attachment id

Returns: status code

getFlavor(fId)[source]

Fetch a flavor’s details.

Arguments: fId – Flavor id

Returns: JSON results as python dict

getFlavors(details=False, attrDict=None)[source]

Fetch flavors. Use details=True for all details. Use attrDict to filter results.

Arguments: details – Bool, defaults to False. Specifying fId overrides this. attrDict – Python dict containing any of the following:

minDisk – Minimum number of gigabytes of disk storage. minRam – Minimum amount of RAM in megabytes. marker – The ID of the last item in the previous list. limit – Sets the page size.

Returns: JSON results as python dict

getImage(iId)[source]

Fetch an image’s details.

Arguments: iId – Image id

Returns: JSON results as python dict

getImages(details=False, attrDict=None)[source]

Fetch images. Use details=True for all details. Use attrDict to filter results.

Arguments: details – Bool, defaults to False. Specifying iId overrides this. attrDict – Python dict containing any of the following:

server – Specify the server reference by ID or by full URL. name – Filters the list of images by image name. status – Filters the list of images by status. changes-since – Filters the list of images to those that have changed since the changes-since time. marker – The ID of the last item in the previous list. limit – Sets the page size. type – {BASE|SERVER}

Returns: JSON results as python dict

deleteImage(iId)[source]

This operation deletes the specified image from the system.

Arguments: iId – Image id

Returns: status code

getMeta(mType, mId, key=None)[source]

Lists metadata associated with a server/image or specified key.

Arguments: mType – servers / images mId – Server or Image uuid key – metadata key(optional)

Returns: JSON response as python dict

setMeta(mType, mId, metaDict, key=None)[source]

Sets metadata for the specified server or image. If no key is provided, this will replace all existing metadata with the provided metaDict key/value pairs. If a key is provided, the list must contain that key/value pair and only that one will get set.

Arguments: mType – servers / images mId – Server or Image uuid metaDict – Python dictionary containing key/value pairs to be added/replaced. key – metadata key

Returns: JSON results as python dict

updateMeta(mType, mId, metaList)[source]

Updates metadata items for specified server or image. Items that are not explicitly mentioned are not modified.

Arguments: mType – servers / images mId – Server or Image uuid metaList – Python dictionary containing key/value pairs to be udpated.

Returns: JSON results as python dict

deleteMeta(mType, mId, key)[source]

Deletes a metadata item.

Arguments: mType – servers / images mId – Server or Image uuid key – Metadata key to delete

Returns: status code

Previous topic

CloudServersFG

Next topic

Auth1