Handle deprecated providers with a error message and a URL to follow up
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/fad83850 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/fad83850 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/fad83850 Branch: refs/heads/trunk Commit: fad83850a21e36264c8068ad31a88bbdbcae4553 Parents: 6d2a3bb Author: anthony-shaw <[email protected]> Authored: Fri Feb 12 17:03:45 2016 +1100 Committer: anthony-shaw <[email protected]> Committed: Sat Feb 13 07:04:26 2016 +1100 ---------------------------------------------------------------------- .../_supported_methods_block_storage.rst | 10 - .../_supported_methods_image_management.rst | 10 - .../_supported_methods_key_pair_management.rst | 10 - docs/compute/_supported_methods_main.rst | 10 - docs/compute/_supported_providers.rst | 10 - libcloud/compute/deprecated.py | 50 ++ libcloud/compute/drivers/cloudframes.py | 435 ----------- libcloud/compute/drivers/hpcloud.py | 99 --- libcloud/compute/drivers/ibm_sce.py | 752 ------------------- libcloud/compute/drivers/ninefold.py | 29 - libcloud/compute/drivers/opsource.py | 620 --------------- libcloud/compute/providers.py | 17 +- 12 files changed, 57 insertions(+), 1995 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/fad83850/docs/compute/_supported_methods_block_storage.rst ---------------------------------------------------------------------- diff --git a/docs/compute/_supported_methods_block_storage.rst b/docs/compute/_supported_methods_block_storage.rst index 66f1833..081de50 100644 --- a/docs/compute/_supported_methods_block_storage.rst +++ b/docs/compute/_supported_methods_block_storage.rst @@ -10,7 +10,6 @@ Provider list volumes create volume destroy volume `Brightbox`_ no no no no no no no `BSNL`_ no no no no no no no `CiscoCCS`_ no no no no no no no -`CloudFrames`_ no no no no no no no `CloudSigma (API v2.0)`_ no no no no no no no `CloudStack`_ yes yes yes yes yes no yes `Cloudwatt`_ yes yes yes yes yes yes yes @@ -44,8 +43,6 @@ Provider list volumes create volume destroy volume `Google Compute Engine`_ yes yes yes yes yes yes yes `GoGrid`_ no no no no no no no `HostVirtual`_ no no no no no no no -`HP Public Cloud (Helion)`_ yes yes yes yes yes yes yes -`IBM SmartCloud Enterprise`_ yes yes yes yes yes no no `Ikoula`_ yes yes yes yes yes no yes `Indosat`_ no no no no no no no `InternetSolutions`_ no no no no no no no @@ -57,12 +54,10 @@ Provider list volumes create volume destroy volume `MedOne`_ no no no no no no no `NephoScale`_ no no no no no no no `Nimbus`_ yes yes yes yes yes yes yes -`Ninefold`_ yes yes yes yes yes no yes `NTTAmerica`_ no no no no no no no `OnApp`_ no no no no no no no `OpenNebula (v3.8)`_ yes yes yes yes yes no no `OpenStack`_ yes yes yes yes yes no no -`Opsource`_ no no no no no no no `Outscale INC`_ yes yes yes yes yes yes yes `Outscale SAS`_ yes yes yes yes yes yes yes `Packet`_ no no no no no no no @@ -90,7 +85,6 @@ Provider list volumes create volume destroy volume .. _`Brightbox`: http://www.brightbox.co.uk/ .. _`BSNL`: http://www.bsnlcloud.com/ .. _`CiscoCCS`: http://www.cisco.com/ -.. _`CloudFrames`: http://www.cloudframes.net/ .. _`CloudSigma (API v2.0)`: http://www.cloudsigma.com/ .. _`CloudStack`: http://cloudstack.org/ .. _`Cloudwatt`: https://www.cloudwatt.com/ @@ -124,8 +118,6 @@ Provider list volumes create volume destroy volume .. _`Google Compute Engine`: https://cloud.google.com/ .. _`GoGrid`: http://www.gogrid.com/ .. _`HostVirtual`: http://www.hostvirtual.com -.. _`HP Public Cloud (Helion)`: http://www.hpcloud.com/ -.. _`IBM SmartCloud Enterprise`: http://ibm.com/services/us/en/cloud-enterprise/ .. _`Ikoula`: http://express.ikoula.co.uk/cloudstack .. _`Indosat`: http://www.indosat.com/ .. _`InternetSolutions`: http://www.is.co.za/ @@ -137,12 +129,10 @@ Provider list volumes create volume destroy volume .. _`MedOne`: http://www.med-1.com/ .. _`NephoScale`: http://www.nephoscale.com .. _`Nimbus`: http://www.nimbusproject.org/ -.. _`Ninefold`: http://ninefold.com/ .. _`NTTAmerica`: http://www.nttamerica.com/ .. _`OnApp`: http://onapp.com/ .. _`OpenNebula (v3.8)`: http://opennebula.org/ .. _`OpenStack`: http://openstack.org/ -.. _`Opsource`: http://www.opsource.net/ .. _`Outscale INC`: http://www.outscale.com .. _`Outscale SAS`: http://www.outscale.com .. _`Packet`: http://www.packet.net/ http://git-wip-us.apache.org/repos/asf/libcloud/blob/fad83850/docs/compute/_supported_methods_image_management.rst ---------------------------------------------------------------------- diff --git a/docs/compute/_supported_methods_image_management.rst b/docs/compute/_supported_methods_image_management.rst index f3ad312..12d113b 100644 --- a/docs/compute/_supported_methods_image_management.rst +++ b/docs/compute/_supported_methods_image_management.rst @@ -10,7 +10,6 @@ Provider list images get image create image delete `Brightbox`_ yes no no no no `BSNL`_ yes no no no no `CiscoCCS`_ yes no no no no -`CloudFrames`_ yes no no no no `CloudSigma (API v2.0)`_ yes no no no no `CloudStack`_ yes no no no no `Cloudwatt`_ yes yes yes yes no @@ -44,8 +43,6 @@ Provider list images get image create image delete `Google Compute Engine`_ yes no no no no `GoGrid`_ yes no no no no `HostVirtual`_ yes no no no no -`HP Public Cloud (Helion)`_ yes yes yes yes no -`IBM SmartCloud Enterprise`_ yes no yes no no `Ikoula`_ yes no no no no `Indosat`_ yes no no no no `InternetSolutions`_ yes no no no no @@ -57,12 +54,10 @@ Provider list images get image create image delete `MedOne`_ yes no no no no `NephoScale`_ yes no no no no `Nimbus`_ yes yes yes yes yes -`Ninefold`_ yes no no no no `NTTAmerica`_ yes no no no no `OnApp`_ no no no no no `OpenNebula (v3.8)`_ yes no no no no `OpenStack`_ yes yes no no no -`Opsource`_ yes no no no no `Outscale INC`_ yes yes yes yes yes `Outscale SAS`_ yes yes yes yes yes `Packet`_ yes no no no no @@ -90,7 +85,6 @@ Provider list images get image create image delete .. _`Brightbox`: http://www.brightbox.co.uk/ .. _`BSNL`: http://www.bsnlcloud.com/ .. _`CiscoCCS`: http://www.cisco.com/ -.. _`CloudFrames`: http://www.cloudframes.net/ .. _`CloudSigma (API v2.0)`: http://www.cloudsigma.com/ .. _`CloudStack`: http://cloudstack.org/ .. _`Cloudwatt`: https://www.cloudwatt.com/ @@ -124,8 +118,6 @@ Provider list images get image create image delete .. _`Google Compute Engine`: https://cloud.google.com/ .. _`GoGrid`: http://www.gogrid.com/ .. _`HostVirtual`: http://www.hostvirtual.com -.. _`HP Public Cloud (Helion)`: http://www.hpcloud.com/ -.. _`IBM SmartCloud Enterprise`: http://ibm.com/services/us/en/cloud-enterprise/ .. _`Ikoula`: http://express.ikoula.co.uk/cloudstack .. _`Indosat`: http://www.indosat.com/ .. _`InternetSolutions`: http://www.is.co.za/ @@ -137,12 +129,10 @@ Provider list images get image create image delete .. _`MedOne`: http://www.med-1.com/ .. _`NephoScale`: http://www.nephoscale.com .. _`Nimbus`: http://www.nimbusproject.org/ -.. _`Ninefold`: http://ninefold.com/ .. _`NTTAmerica`: http://www.nttamerica.com/ .. _`OnApp`: http://onapp.com/ .. _`OpenNebula (v3.8)`: http://opennebula.org/ .. _`OpenStack`: http://openstack.org/ -.. _`Opsource`: http://www.opsource.net/ .. _`Outscale INC`: http://www.outscale.com .. _`Outscale SAS`: http://www.outscale.com .. _`Packet`: http://www.packet.net/ http://git-wip-us.apache.org/repos/asf/libcloud/blob/fad83850/docs/compute/_supported_methods_key_pair_management.rst ---------------------------------------------------------------------- diff --git a/docs/compute/_supported_methods_key_pair_management.rst b/docs/compute/_supported_methods_key_pair_management.rst index 4b97d6c..2affe1a 100644 --- a/docs/compute/_supported_methods_key_pair_management.rst +++ b/docs/compute/_supported_methods_key_pair_management.rst @@ -10,7 +10,6 @@ Provider list key pairs get key pair create key pai `Brightbox`_ no no no no no no `BSNL`_ no no no no no no `CiscoCCS`_ no no no no no no -`CloudFrames`_ no no no no no no `CloudSigma (API v2.0)`_ no no no no no no `CloudStack`_ yes yes yes yes no yes `Cloudwatt`_ yes yes yes yes no yes @@ -44,8 +43,6 @@ Provider list key pairs get key pair create key pai `Google Compute Engine`_ no no no no no no `GoGrid`_ no no no no no no `HostVirtual`_ no no no no no no -`HP Public Cloud (Helion)`_ yes yes yes yes no yes -`IBM SmartCloud Enterprise`_ no no no no no no `Ikoula`_ yes yes yes yes no yes `Indosat`_ no no no no no no `InternetSolutions`_ no no no no no no @@ -57,12 +54,10 @@ Provider list key pairs get key pair create key pai `MedOne`_ no no no no no no `NephoScale`_ no no no no no no `Nimbus`_ yes yes yes yes no yes -`Ninefold`_ yes yes yes yes no yes `NTTAmerica`_ no no no no no no `OnApp`_ no no no no no no `OpenNebula (v3.8)`_ no no no no no no `OpenStack`_ no no no no no no -`Opsource`_ no no no no no no `Outscale INC`_ yes yes yes yes no yes `Outscale SAS`_ yes yes yes yes no yes `Packet`_ yes no yes no no yes @@ -90,7 +85,6 @@ Provider list key pairs get key pair create key pai .. _`Brightbox`: http://www.brightbox.co.uk/ .. _`BSNL`: http://www.bsnlcloud.com/ .. _`CiscoCCS`: http://www.cisco.com/ -.. _`CloudFrames`: http://www.cloudframes.net/ .. _`CloudSigma (API v2.0)`: http://www.cloudsigma.com/ .. _`CloudStack`: http://cloudstack.org/ .. _`Cloudwatt`: https://www.cloudwatt.com/ @@ -124,8 +118,6 @@ Provider list key pairs get key pair create key pai .. _`Google Compute Engine`: https://cloud.google.com/ .. _`GoGrid`: http://www.gogrid.com/ .. _`HostVirtual`: http://www.hostvirtual.com -.. _`HP Public Cloud (Helion)`: http://www.hpcloud.com/ -.. _`IBM SmartCloud Enterprise`: http://ibm.com/services/us/en/cloud-enterprise/ .. _`Ikoula`: http://express.ikoula.co.uk/cloudstack .. _`Indosat`: http://www.indosat.com/ .. _`InternetSolutions`: http://www.is.co.za/ @@ -137,12 +129,10 @@ Provider list key pairs get key pair create key pai .. _`MedOne`: http://www.med-1.com/ .. _`NephoScale`: http://www.nephoscale.com .. _`Nimbus`: http://www.nimbusproject.org/ -.. _`Ninefold`: http://ninefold.com/ .. _`NTTAmerica`: http://www.nttamerica.com/ .. _`OnApp`: http://onapp.com/ .. _`OpenNebula (v3.8)`: http://opennebula.org/ .. _`OpenStack`: http://openstack.org/ -.. _`Opsource`: http://www.opsource.net/ .. _`Outscale INC`: http://www.outscale.com .. _`Outscale SAS`: http://www.outscale.com .. _`Packet`: http://www.packet.net/ http://git-wip-us.apache.org/repos/asf/libcloud/blob/fad83850/docs/compute/_supported_methods_main.rst ---------------------------------------------------------------------- diff --git a/docs/compute/_supported_methods_main.rst b/docs/compute/_supported_methods_main.rst index 0486651..6ba8a79 100644 --- a/docs/compute/_supported_methods_main.rst +++ b/docs/compute/_supported_methods_main.rst @@ -10,7 +10,6 @@ Provider list nodes create node reboot node destroy `Brightbox`_ yes yes no yes yes yes no `BSNL`_ yes yes yes yes yes yes yes `CiscoCCS`_ yes yes yes yes yes yes yes -`CloudFrames`_ yes yes yes yes yes yes no `CloudSigma (API v2.0)`_ yes yes no yes yes yes no `CloudStack`_ yes yes yes yes yes yes yes `Cloudwatt`_ yes yes yes yes yes yes yes @@ -44,8 +43,6 @@ Provider list nodes create node reboot node destroy `Google Compute Engine`_ yes yes yes yes yes yes no `GoGrid`_ yes yes yes yes yes yes yes `HostVirtual`_ yes yes yes yes yes yes yes -`HP Public Cloud (Helion)`_ yes yes yes yes yes yes yes -`IBM SmartCloud Enterprise`_ yes yes yes yes yes yes no `Ikoula`_ yes yes yes yes yes yes yes `Indosat`_ yes yes yes yes yes yes yes `InternetSolutions`_ yes yes yes yes yes yes yes @@ -57,12 +54,10 @@ Provider list nodes create node reboot node destroy `MedOne`_ yes yes yes yes yes yes yes `NephoScale`_ yes yes yes yes yes yes yes `Nimbus`_ yes yes yes yes yes yes yes -`Ninefold`_ yes yes yes yes yes yes yes `NTTAmerica`_ yes yes yes yes yes yes yes `OnApp`_ yes yes no yes no no no `OpenNebula (v3.8)`_ yes yes yes yes yes yes no `OpenStack`_ yes no yes yes yes yes no -`Opsource`_ yes yes yes yes yes yes yes `Outscale INC`_ yes yes yes yes yes yes yes `Outscale SAS`_ yes yes yes yes yes yes yes `Packet`_ yes yes yes yes yes yes no @@ -90,7 +85,6 @@ Provider list nodes create node reboot node destroy .. _`Brightbox`: http://www.brightbox.co.uk/ .. _`BSNL`: http://www.bsnlcloud.com/ .. _`CiscoCCS`: http://www.cisco.com/ -.. _`CloudFrames`: http://www.cloudframes.net/ .. _`CloudSigma (API v2.0)`: http://www.cloudsigma.com/ .. _`CloudStack`: http://cloudstack.org/ .. _`Cloudwatt`: https://www.cloudwatt.com/ @@ -124,8 +118,6 @@ Provider list nodes create node reboot node destroy .. _`Google Compute Engine`: https://cloud.google.com/ .. _`GoGrid`: http://www.gogrid.com/ .. _`HostVirtual`: http://www.hostvirtual.com -.. _`HP Public Cloud (Helion)`: http://www.hpcloud.com/ -.. _`IBM SmartCloud Enterprise`: http://ibm.com/services/us/en/cloud-enterprise/ .. _`Ikoula`: http://express.ikoula.co.uk/cloudstack .. _`Indosat`: http://www.indosat.com/ .. _`InternetSolutions`: http://www.is.co.za/ @@ -137,12 +129,10 @@ Provider list nodes create node reboot node destroy .. _`MedOne`: http://www.med-1.com/ .. _`NephoScale`: http://www.nephoscale.com .. _`Nimbus`: http://www.nimbusproject.org/ -.. _`Ninefold`: http://ninefold.com/ .. _`NTTAmerica`: http://www.nttamerica.com/ .. _`OnApp`: http://onapp.com/ .. _`OpenNebula (v3.8)`: http://opennebula.org/ .. _`OpenStack`: http://openstack.org/ -.. _`Opsource`: http://www.opsource.net/ .. _`Outscale INC`: http://www.outscale.com .. _`Outscale SAS`: http://www.outscale.com .. _`Packet`: http://www.packet.net/ http://git-wip-us.apache.org/repos/asf/libcloud/blob/fad83850/docs/compute/_supported_providers.rst ---------------------------------------------------------------------- diff --git a/docs/compute/_supported_providers.rst b/docs/compute/_supported_providers.rst index e048d18..ad829f3 100644 --- a/docs/compute/_supported_providers.rst +++ b/docs/compute/_supported_providers.rst @@ -10,7 +10,6 @@ Provider Documentation `Brightbox`_ BRIGHTBOX :mod:`libcloud.compute.drivers.brightbox` :class:`BrightboxNodeDriver` `BSNL`_ :doc:`Click </compute/drivers/bsnl>` BSNL :mod:`libcloud.compute.drivers.bsnl` :class:`BSNLNodeDriver` `CiscoCCS`_ CISCOCCS :mod:`libcloud.compute.drivers.ciscoccs` :class:`CiscoCCSNodeDriver` -`CloudFrames`_ :doc:`Click </compute/drivers/cloudframes>` CLOUDFRAMES :mod:`libcloud.compute.drivers.cloudframes` :class:`CloudFramesNodeDriver` `CloudSigma (API v2.0)`_ :doc:`Click </compute/drivers/cloudsigma>` CLOUDSIGMA :mod:`libcloud.compute.drivers.cloudsigma` :class:`CloudSigmaNodeDriver` `CloudStack`_ :doc:`Click </compute/drivers/cloudstack>` CLOUDSTACK :mod:`libcloud.compute.drivers.cloudstack` :class:`CloudStackNodeDriver` `Cloudwatt`_ :doc:`Click </compute/drivers/cloudwatt>` CLOUDWATT :mod:`libcloud.compute.drivers.cloudwatt` :class:`CloudwattNodeDriver` @@ -44,8 +43,6 @@ Provider Documentation `Google Compute Engine`_ :doc:`Click </compute/drivers/gce>` GCE :mod:`libcloud.compute.drivers.gce` :class:`GCENodeDriver` `GoGrid`_ GOGRID :mod:`libcloud.compute.drivers.gogrid` :class:`GoGridNodeDriver` `HostVirtual`_ HOSTVIRTUAL :mod:`libcloud.compute.drivers.hostvirtual` :class:`HostVirtualNodeDriver` -`HP Public Cloud (Helion)`_ :doc:`Click </compute/drivers/hpcloud>` HPCLOUD :mod:`libcloud.compute.drivers.hpcloud` :class:`HPCloudNodeDriver` -`IBM SmartCloud Enterprise`_ IBM :mod:`libcloud.compute.drivers.ibm_sce` :class:`IBMNodeDriver` `Ikoula`_ :doc:`Click </compute/drivers/ikoula>` IKOULA :mod:`libcloud.compute.drivers.ikoula` :class:`IkoulaNodeDriver` `Indosat`_ :doc:`Click </compute/drivers/indosat>` INDOSAT :mod:`libcloud.compute.drivers.indosat` :class:`IndosatNodeDriver` `InternetSolutions`_ :doc:`Click </compute/drivers/internetsolutions>` INTERNETSOLUTIONS :mod:`libcloud.compute.drivers.internetsolutions` :class:`InternetSolutionsNodeDriver` @@ -57,12 +54,10 @@ Provider Documentation `MedOne`_ :doc:`Click </compute/drivers/medone>` MEDONE :mod:`libcloud.compute.drivers.medone` :class:`MedOneNodeDriver` `NephoScale`_ NEPHOSCALE :mod:`libcloud.compute.drivers.nephoscale` :class:`NephoscaleNodeDriver` `Nimbus`_ :doc:`Click </compute/drivers/nimbus>` NIMBUS :mod:`libcloud.compute.drivers.ec2` :class:`NimbusNodeDriver` -`Ninefold`_ NINEFOLD :mod:`libcloud.compute.drivers.ninefold` :class:`NinefoldNodeDriver` `NTTAmerica`_ :doc:`Click </compute/drivers/ntta>` NTTA :mod:`libcloud.compute.drivers.ntta` :class:`NTTAmericaNodeDriver` `OnApp`_ :doc:`Click </compute/drivers/onapp>` ONAPP :mod:`libcloud.compute.drivers.onapp` :class:`OnAppNodeDriver` `OpenNebula (v3.8)`_ OPENNEBULA :mod:`libcloud.compute.drivers.opennebula` :class:`OpenNebulaNodeDriver` `OpenStack`_ :doc:`Click </compute/drivers/openstack>` OPENSTACK :mod:`libcloud.compute.drivers.openstack` :class:`OpenStackNodeDriver` -`Opsource`_ OPSOURCE :mod:`libcloud.compute.drivers.opsource` :class:`OpsourceNodeDriver` `Outscale INC`_ :doc:`Click </compute/drivers/outscale_inc>` OUTSCALE_INC :mod:`libcloud.compute.drivers.ec2` :class:`OutscaleINCNodeDriver` `Outscale SAS`_ :doc:`Click </compute/drivers/outscale_sas>` OUTSCALE_SAS :mod:`libcloud.compute.drivers.ec2` :class:`OutscaleSASNodeDriver` `Packet`_ :doc:`Click </compute/drivers/packet>` PACKET :mod:`libcloud.compute.drivers.packet` :class:`PacketNodeDriver` @@ -90,7 +85,6 @@ Provider Documentation .. _`Brightbox`: http://www.brightbox.co.uk/ .. _`BSNL`: http://www.bsnlcloud.com/ .. _`CiscoCCS`: http://www.cisco.com/ -.. _`CloudFrames`: http://www.cloudframes.net/ .. _`CloudSigma (API v2.0)`: http://www.cloudsigma.com/ .. _`CloudStack`: http://cloudstack.org/ .. _`Cloudwatt`: https://www.cloudwatt.com/ @@ -124,8 +118,6 @@ Provider Documentation .. _`Google Compute Engine`: https://cloud.google.com/ .. _`GoGrid`: http://www.gogrid.com/ .. _`HostVirtual`: http://www.hostvirtual.com -.. _`HP Public Cloud (Helion)`: http://www.hpcloud.com/ -.. _`IBM SmartCloud Enterprise`: http://ibm.com/services/us/en/cloud-enterprise/ .. _`Ikoula`: http://express.ikoula.co.uk/cloudstack .. _`Indosat`: http://www.indosat.com/ .. _`InternetSolutions`: http://www.is.co.za/ @@ -137,12 +129,10 @@ Provider Documentation .. _`MedOne`: http://www.med-1.com/ .. _`NephoScale`: http://www.nephoscale.com .. _`Nimbus`: http://www.nimbusproject.org/ -.. _`Ninefold`: http://ninefold.com/ .. _`NTTAmerica`: http://www.nttamerica.com/ .. _`OnApp`: http://onapp.com/ .. _`OpenNebula (v3.8)`: http://opennebula.org/ .. _`OpenStack`: http://openstack.org/ -.. _`Opsource`: http://www.opsource.net/ .. _`Outscale INC`: http://www.outscale.com .. _`Outscale SAS`: http://www.outscale.com .. _`Packet`: http://www.packet.net/ http://git-wip-us.apache.org/repos/asf/libcloud/blob/fad83850/libcloud/compute/deprecated.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/deprecated.py b/libcloud/compute/deprecated.py new file mode 100644 index 0000000..d68e47f --- /dev/null +++ b/libcloud/compute/deprecated.py @@ -0,0 +1,50 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +""" +Database of deprecated drivers +""" + +from libcloud.compute.types import Provider + +DEPRECATED_DRIVERS = { + Provider.OPSOURCE: { + 'reason': 'OpSource cloud is now part of Dimension Data, ' + 'use the DIMENSIONDATA provider instead.', + 'url': 'http://www.ntt.co.jp/news2011/1107e/110701a.html' + }, + Provider.NINEFOLD: { + 'reason': 'We will shortly notify our customers that we ' + 'will be sunsetting our Public Cloud Computing ' + '(Server) platform, the last day of operation ' + 'being January 30, 2016', + 'url': 'https://ninefold.com/news/' + }, + Provider.IBM: { + 'reason': 'IBM SmartCloud Enterprise has been deprecated ' + 'in favour of IBM SoftLayer Public Cloud, please' + ' use the SOFTLAYER provider.', + 'url': 'http://www.ibm.com/midmarket/us/en/article_cloud6_1310.html' + }, + Provider.HPCLOUD: { + 'reason': 'HP Helion Public Cloud was shut down in January 2016.', + 'url': 'http://libcloud.apache.org/blog/' + '2016/02/16/new-drivers-deprecated-drivers.html' + }, + Provider.CLOUDFRAMES: { + 'reason': 'The CloudFrames Provider is no longer supported', + 'url': 'http://libcloud.apache.org/blog/2016/02/16/new-drivers-' + 'deprecated-drivers.html' + } +} http://git-wip-us.apache.org/repos/asf/libcloud/blob/fad83850/libcloud/compute/drivers/cloudframes.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/cloudframes.py b/libcloud/compute/drivers/cloudframes.py deleted file mode 100644 index 8385b59..0000000 --- a/libcloud/compute/drivers/cloudframes.py +++ /dev/null @@ -1,435 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -CloudFrames Driver - -""" - -# (name, ram, disk, bandwidth, price, vcpus) -SIZES = [ - ('512mb_1core_10gb', 512, 10, 512, 0.025, 1), - ('1024mb_1core_20gb', 1024, 20, 512, 0.05, 1), - ('2048mb_2core_50gb', 2048, 50, 1024, 0.10, 2), - ('4096mb_2core_100gb', 4096, 100, 2048, 0.20, 2), - ('8192mb_4core_200gb', 8192, 200, 2048, 0.40, 4), - ('16384mb_4core_400gb', 16384, 400, 4096, 0.80, 4), -] - -import base64 -import random - -from libcloud.utils.py3 import urlparse, b -from libcloud.common.base import ConnectionKey -from libcloud.common.xmlrpc import XMLRPCResponse, XMLRPCConnection -from libcloud.common.types import ProviderError -from libcloud.compute.base import NodeImage, NodeSize, Node, NodeLocation -from libcloud.compute.base import NodeDriver -from libcloud.compute.types import Provider, NodeState - - -class CloudFramesException(ProviderError): - pass - - -class CloudFramesComponent(object): - """ - Represents a node in the cloudapi path. - """ - - def __init__(self, cloudFramesConnection, name): - self.cloudFramesConnection = cloudFramesConnection - self.name = name - - def __getattr__(self, key): - return self.method(key) - - def method(self, methodname): - def foo(*args, **kwargs): - async = kwargs.get('async', False) - args = list(args) - args.append('') # jobguid - args.append({'wait': False} if async else {}) # executionparams - response = self.cloudFramesConnection.request( - 'cloud_api_%s.%s' % (self.name, methodname), *args) - if not response.success(): - response.parse_error() - if async: - return response.parse_body()['jobguid'] - else: - return response.parse_body()['result'] - return foo - - -class CloudFramesNodeSize(NodeSize): - - def __init__(self, id, name, ram, disk, bandwidth, price, driver, - vcpus=None): - super(CloudFramesNodeSize, self).__init__( - id, name, ram, disk, bandwidth, price, driver) - self.vcpus = vcpus - - -class CloudFramesNode(Node): - - def list_snapshots(self): - return self.driver.ex_list_snapshots(self) - - def snapshot(self, label='', description=''): - return self.driver.ex_snapshot_node(self, label, description) - - def rollback(self, snapshot): - return self.driver.ex_rollback_node(self, snapshot) - - -class CloudFramesSnapshot(object): - - def __init__(self, id, timestamp, label, description, driver): - self.id = id - self.timestamp = timestamp - self.label = label - self.description = description - self.driver = driver - - def destroy(self): - self.driver.ex_destroy_snapshot(self) - - -class CloudFramesConnection(XMLRPCConnection, ConnectionKey): - """ - Cloudapi connection class - """ - - repsonseCls = XMLRPCResponse - base_url = None - - def __init__(self, key=None, secret=None, secure=True, - host=None, port=None, url=None, timeout=None, - retry_delay=None, backoff=None, proxy_url=None): - """ - :param key: The username to connect with to the cloudapi - :type key: ``str`` - - :param secret: The password to connect with to the cloudapi - :type secret: ``str`` - - :param secure: Should always be false at the moment - :type secure: ``bool`` - - :param host: The hostname of the cloudapi - :type host: ``str`` - - :param port: The port on which to connect to the cloudapi - :type port: ``int`` - - :param url: Url to the cloudapi (can replace all above) - :type url: ``str`` - """ - - super(CloudFramesConnection, self).__init__(key=key, secure=secure, - host=host, port=port, - url=url, timeout=timeout, - retry_delay=retry_delay, - backoff=backoff, - proxy_url=proxy_url) - self._auth = base64.b64encode( - b('%s:%s' % (key, secret))).decode('utf-8') - self.endpoint = url - - def __getattr__(self, key): - return CloudFramesComponent(self, key) - - def add_default_headers(self, headers): - headers['Authorization'] = 'Basic %s' % self._auth - return headers - - -class CloudFramesNodeDriver(NodeDriver): - """ - CloudFrames node driver - """ - - connectionCls = CloudFramesConnection - - name = 'CloudFrames' - api_name = 'cloudframes' - website = 'http://www.cloudframes.net/' - type = Provider.CLOUDFRAMES - - NODE_STATE_MAP = { - 'CONFIGURED': NodeState.PENDING, - 'CREATED': NodeState.PENDING, - 'DELETING': NodeState.PENDING, - 'HALTED': NodeState.TERMINATED, - 'IMAGEONLY': NodeState.UNKNOWN, - 'ISCSIEXPOSED': NodeState.PENDING, - 'MOVING': NodeState.PENDING, - 'OVERLOADED': NodeState.UNKNOWN, - 'PAUSED': NodeState.TERMINATED, - 'RUNNING': NodeState.RUNNING, - 'STARTING': NodeState.PENDING, - 'STOPPING': NodeState.PENDING, - 'SYNCING': NodeState.PENDING, - 'TODELETE': NodeState.PENDING, - } - - # subclassed internal methods - def __init__(self, key=None, secret=None, secure=True, - host=None, port=None, url=None, **kwargs): - if not port: - port = 443 if secure else 80 - if url: - if not url.endswith('/'): - url += '/' - scheme, netloc, _, _, _, _ = urlparse.urlparse(url) - secure = (scheme == 'https') - if '@' in netloc: - auth, hostport = netloc.rsplit('@', 1) - if ':' in auth: - key, secret = auth.split(':', 1) - else: - key = auth - else: - hostport = netloc - if ':' in hostport: - host, port = hostport.split(':') - else: - host = hostport - hostport = '%s:%s' % (host, port) - url = url.replace(netloc, hostport) - else: - url = '%s://%s:%s/appserver/xmlrpc/' % ( - 'https' if secure else 'http', host, port) - - if secure: - raise NotImplementedError( - 'The cloudapi only supports unsecure connections') - - if key is None or secret is None: - raise NotImplementedError( - 'Unauthenticated support to the cloudapi is not supported') - - # connection url - self._url = url - - # cached attributes - self.__cloudspaceguid = None - self.__languid = None - self.__locations = [] - - super(CloudFramesNodeDriver, self).__init__( - key, secret, secure, host, port, **kwargs) - - def _ex_connection_class_kwargs(self): - return {'url': self._url} - - # internal methods - @property - def _cloudspaceguid(self): - if not self.__cloudspaceguid: - self.__cloudspaceguid = self.connection.cloudspace.find( - '', '', 'cloud', '')[0] - return self.__cloudspaceguid - - @property - def _languid(self): - if not self.__languid: - self.__languid = self.connection.lan.find( - '', '', 'public_virtual', '', '', '', '', '', '', '', '', '', - '', '', '', '', '')[0] - return self.__languid - - def _get_machine_data(self, guid): - """ - Looks up some basic data related to the given machine guid. - """ - try: - d = self.connection.machine.list('', '', '', guid, '')[0] - except IndexError: - raise CloudFramesException('VM no longer exists', 404, self) - d['public_ips'] = [] - d['private_ips'] = [] - d['size'] = None - d['image'] = None - return d - - def _machine_find(self, template=False, machinetype=None, - machinerole=None): - # the cloudframes xmlrpc api requires you to pass all args and kwargs - # as positional arguments, you can't use keywords arguments - if not machinetype: - guids = [] - for machinetype in ['VIRTUALSERVER', 'VIRTUALDESKTOP']: - guids += self.connection.machine.find( - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', machinetype, template, '', '', '', '', '', '', '', - '', '', '', '', '', '', '') - else: - guids = self.connection.machine.find( - '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', machinetype, '', '', '', '', '', '', '', '', - machinerole, '', '', '', '', '', '') - return guids - - def _to_image(self, image_dict): - return NodeImage(id=image_dict['guid'], - name=image_dict['name'], - driver=self.connection.driver) - - def _to_size(self, id, name, ram, disk, bandwidth, price, vcpus): - return CloudFramesNodeSize( - id, name, ram, disk, bandwidth, price, self, vcpus) - - def _to_location(self, location_dict): - return NodeLocation(id=location_dict['guid'], - name=location_dict['name'], - country=None, - driver=self) - - def _to_node(self, node_dict): - # only return nodes which can be worked with - # (ignore cloudframes internal autotests and deleted nodes) - if node_dict['status'] == 'CONFIGURED': - return None - return CloudFramesNode(id=node_dict['guid'], - name=node_dict['name'], - state=self.NODE_STATE_MAP.get( - node_dict['status'], NodeState.UNKNOWN), - public_ips=node_dict['public_ips'], - private_ips=node_dict['private_ips'], - driver=self.connection.driver, - size=node_dict['size'], - image=node_dict['image'], - extra={}) - - def _to_snapshot(self, snapshot_dict): - return CloudFramesSnapshot(id=snapshot_dict['guid'], - timestamp=snapshot_dict['timestamp'], - label=snapshot_dict['backuplabel'], - description=snapshot_dict['description'], - driver=self) - - # subclassed public methods, and provider specific public methods - def list_images(self, location=None): - image_ids = self._machine_find(template=True) - image_list = [] - for image_id in image_ids: - image_list.append(self._to_image(self._get_machine_data(image_id))) - return image_list - - def list_sizes(self, location=None): - sizes = [] - for id in range(len(SIZES)): - sizes.append(self._to_size(id, *SIZES[id])) - return sizes - - def list_locations(self, ex_use_cached=True): - if not self.__locations or not ex_use_cached: - self.__locations = [] - for location_id in self._machine_find(machinetype='PHYSICAL', - machinerole='COMPUTENODE'): - self.__locations.append( - self._to_location(self._get_machine_data(location_id))) - return self.__locations - - def list_nodes(self): - node_ids = self._machine_find() - node_list = [] - for node_id in node_ids: - node = self._to_node(self._get_machine_data(node_id)) - if node: - node_list.append(node) - return node_list - - def create_node(self, **kwargs): - """ - Creates a new node, by cloning the template provided. - - If no location object is passed, a random location will be used. - - - :param image: The template to be cloned (required) - :type image: ``list`` of :class:`NodeImage` - - :param name: The name for the new node (required) - :type name: ``str`` - - :param size: The size of the new node (required) - :type size: ``list`` of :class:`NodeSize` - - :param location: The location to create the new node - :type location: ``list`` of :class:`NodeLocation` - - :param default_gateway: The default gateway to be used - :type default_gateway: ``str`` - - :param extra: Additional requirements (extra disks fi.) - :type extra: ``dict`` - - - :returns: ``list`` of :class:`Node` -- The newly created Node object - - :raises: CloudFramesException - """ - - additionalinfo = kwargs.get('extra', {}) - additionalinfo.update({ - 'memory': kwargs['size'].ram, - 'cpu': kwargs['size'].vcpus, - }) - guid = self.connection.machine.createFromTemplate( - self._cloudspaceguid, kwargs['image'].id, kwargs['name'], - [{'languid': self._languid}], kwargs['name'], - kwargs.get('location', random.choice(self.list_locations())).id, - kwargs.get('default_gateway', ''), None, additionalinfo) - if not self.connection.machine.start(guid): - raise CloudFramesException( - 'failed to start machine after creation', 500, self) - return self._to_node(self._get_machine_data(guid)) - - def destroy_node(self, node): - return self.connection.machine.delete(node.id, False) - - def reboot_node(self, node, ex_clean=True): - return self.connection.machine.reboot(node.id, ex_clean) - - def ex_snapshot_node(self, node, label='', description=''): - guid = self.connection.machine.snapshot( - node.id, label, description, False, False, 'PAUSED') - for snapshot in self.ex_list_snapshots(node): - if snapshot.id == guid: - return snapshot - else: - raise CloudFramesException('Snapshot creation failed', 500, self) - - def ex_rollback_node(self, node, snapshot): - if not node.state == NodeState.TERMINATED: - self.connection.machine.stop(node.id, False, 930) - success = self.connection.machine.rollback(node.id, snapshot.id) - self.connection.machine.start(node.id) - return success - - def ex_list_snapshots(self, node): - return [self._to_snapshot(snapshot_dict) for snapshot_dict in - self.connection.machine.listSnapshots(node.id, False, '', '')] - - def ex_destroy_snapshot(self, node, snapshot): - return self.connection.machine.delete(snapshot.id, False) - - -if __name__ == "__main__": - import doctest - - doctest.testmod() http://git-wip-us.apache.org/repos/asf/libcloud/blob/fad83850/libcloud/compute/drivers/hpcloud.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/hpcloud.py b/libcloud/compute/drivers/hpcloud.py deleted file mode 100644 index 5a50d1f..0000000 --- a/libcloud/compute/drivers/hpcloud.py +++ /dev/null @@ -1,99 +0,0 @@ -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -HP Public cloud driver which is essentially just a small wrapper around -OpenStack driver. -""" - -from libcloud.compute.types import Provider, LibcloudError -from libcloud.compute.drivers.openstack import OpenStack_1_1_Connection -from libcloud.compute.drivers.openstack import OpenStack_1_1_NodeDriver - - -__all__ = [ - 'HPCloudNodeDriver' -] - -ENDPOINT_ARGS_MAP = { - 'region-a.geo-1': { - 'service_type': 'compute', - 'name': 'Compute', - 'region': 'region-a.geo-1' - }, - 'region-b.geo-1': { - 'service_type': 'compute', - 'name': 'Compute', - 'region': 'region-b.geo-1' - }, -} - -AUTH_URL_TEMPLATE = 'https://%s.identity.hpcloudsvc.com:35357/v2.0/tokens' - - -class HPCloudConnection(OpenStack_1_1_Connection): - _auth_version = '2.0_password' - - def __init__(self, *args, **kwargs): - self.region = kwargs.pop('region', None) - self.get_endpoint_args = kwargs.pop('get_endpoint_args', None) - super(HPCloudConnection, self).__init__(*args, **kwargs) - - def get_endpoint(self): - if not self.get_endpoint_args: - raise LibcloudError( - 'HPCloudConnection must have get_endpoint_args set') - - if '2.0_password' in self._auth_version: - ep = self.service_catalog.get_endpoint(**self.get_endpoint_args) - else: - raise LibcloudError( - 'Auth version "%s" not supported' % (self._auth_version)) - - public_url = ep.url - - if not public_url: - raise LibcloudError('Could not find specified endpoint') - - return public_url - - -class HPCloudNodeDriver(OpenStack_1_1_NodeDriver): - name = 'HP Public Cloud (Helion)' - website = 'http://www.hpcloud.com/' - connectionCls = HPCloudConnection - type = Provider.HPCLOUD - - def __init__(self, key, secret, tenant_name, secure=True, - host=None, port=None, region='region-b.geo-1', **kwargs): - """ - Note: tenant_name argument is required for HP cloud. - """ - self.tenant_name = tenant_name - super(HPCloudNodeDriver, self).__init__(key=key, secret=secret, - secure=secure, host=host, - port=port, - region=region, - **kwargs) - - def _ex_connection_class_kwargs(self): - endpoint_args = ENDPOINT_ARGS_MAP[self.region] - - kwargs = self.openstack_connection_kwargs() - kwargs['region'] = self.region - kwargs['get_endpoint_args'] = endpoint_args - kwargs['ex_force_auth_url'] = AUTH_URL_TEMPLATE % (self.region) - kwargs['ex_tenant_name'] = self.tenant_name - - return kwargs http://git-wip-us.apache.org/repos/asf/libcloud/blob/fad83850/libcloud/compute/drivers/ibm_sce.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/ibm_sce.py b/libcloud/compute/drivers/ibm_sce.py deleted file mode 100644 index d01e5d4..0000000 --- a/libcloud/compute/drivers/ibm_sce.py +++ /dev/null @@ -1,752 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -""" -Driver for IBM SmartCloud Enterprise - -Formerly known as: -- IBM Developer Cloud -- IBM Smart Business Development and Test on the IBM Cloud -- IBM SmartBusiness Cloud -""" - -import base64 -import time - -from libcloud.utils.py3 import urlencode -from libcloud.utils.py3 import httplib -from libcloud.utils.py3 import b - -from libcloud.common.base import XmlResponse, ConnectionUserAndKey -from libcloud.common.types import InvalidCredsError, LibcloudError -from libcloud.compute.types import NodeState, Provider -from libcloud.compute.base import NodeDriver, Node, NodeImage, \ - NodeSize, NodeLocation, NodeAuthSSHKey, StorageVolume - -HOST = 'www-147.ibm.com' -REST_BASE = '/computecloud/enterprise/api/rest/20100331' - - -class IBMResponse(XmlResponse): - def success(self): - return int(self.status) == 200 - - def parse_error(self): - if int(self.status) == 401: - if not self.body: - raise InvalidCredsError(str(self.status) + ': ' + self.error) - else: - raise InvalidCredsError(self.body) - return self.body - - -class IBMConnection(ConnectionUserAndKey): - """ - Connection class for the IBM SmartCloud Enterprise driver - """ - - host = HOST - responseCls = IBMResponse - - def add_default_headers(self, headers): - headers['Accept'] = 'text/xml' - headers['Authorization'] = ('Basic %s' % (base64.b64encode( - b('%s:%s' % (self.user_id, self.key))).decode('utf-8'))) - if 'Content-Type' not in headers: - headers['Content-Type'] = 'text/xml' - return headers - - def encode_data(self, data): - return urlencode(data) - - -class IBMNodeLocation(NodeLocation): - """ - Extends the base LibCloud NodeLocation to contain additional attributes - """ - def __init__(self, id, name, country, driver, extra=None): - self.id = str(id) - self.name = name - self.country = country - self.driver = driver - self.extra = extra or {} - - def __repr__(self): - return ('<IBMNodeLocation: id=%s, name=%s, country=%s, ' - 'driver=%s, extra=%s>' % - (self.id, self.name, self.country, self.driver.name, - self.extra)) - - -class VolumeState(object): - """ - The SCE specific states for a storage volume - """ - NEW = '0' - CREATING = '1' - DELETING = '2' - DELETED = '3' - DETACHED = '4' - ATTACHED = '5' - FAILED = '6' - DELETE_PENDING = '7' - BEING_CLONED = '8' - CLONING = '9' - ATTACHING = '10' - DETACHING = '11' - ATTACHIED = '12' - IMPORTING = '13' - TRANSFER_RETRYING = '14' - - -class VolumeOffering(object): - """ - An SCE specific storage volume offering class. - The volume offering ID is needed to create a volume. - Volume offering IDs are different for each data center. - """ - def __init__(self, id, name, location, extra=None): - self.id = id - self.location = location - self.name = name - self.extra = extra or {} - - def __repr__(self): - return ('<VolumeOffering: id=%s, location=%s, name=%s, extra=%s>' % - (self.id, self.location, self.name, self.extra)) - - -class Address(object): - """ - A reserved IP address that can be attached to an instance. - Properties: id, ip, state, options(location, type, created_time, state, - hostname, instance_ids, vlan, owner, mode, offering_id) - """ - def __init__(self, id, ip, state, options): - self.id = id - self.ip = ip - self.state = state - self.options = options - - def __repr__(self): - return ('<Address: id=%s, ip=%s, state=%s, options=%s>' % - (self.id, self.ip, self.state, self.options)) - - -class IBMNodeDriver(NodeDriver): - """ - Node driver for IBM SmartCloud Enterprise - """ - connectionCls = IBMConnection - type = Provider.IBM - name = "IBM SmartCloud Enterprise" - website = 'http://ibm.com/services/us/en/cloud-enterprise/' - - NODE_STATE_MAP = { - 0: NodeState.PENDING, # New - 1: NodeState.PENDING, # Provisioning - 2: NodeState.TERMINATED, # Failed - 3: NodeState.TERMINATED, # Removed - 4: NodeState.TERMINATED, # Rejected - 5: NodeState.RUNNING, # Active - 6: NodeState.UNKNOWN, # Unknown - 7: NodeState.PENDING, # Deprovisioning - 8: NodeState.REBOOTING, # Restarting - 9: NodeState.PENDING, # Starting - 10: NodeState.PENDING, # Stopping - 11: NodeState.TERMINATED, # Stopped - 12: NodeState.PENDING, # Deprovision Pending - 13: NodeState.PENDING, # Restart Pending - 14: NodeState.PENDING, # Attaching - 15: NodeState.PENDING, # Detaching - } - - def create_node(self, **kwargs): - """ - Creates a node in the IBM SmartCloud Enterprise. - - See :class:`NodeDriver.create_node` for more keyword args. - - @inherits: :class:`NodeDriver.create_node` - - :keyword auth: Name of the pubkey to use. When constructing - :class:`NodeAuthSSHKey` instance, 'pubkey' argument must be the - name of the public key to use. You chose this name when creating - a new public key on the IBM server. - :type auth: :class:`NodeAuthSSHKey` - - :keyword ex_configurationData: Image-specific configuration - parameters. Configuration parameters are defined in the parameters - .xml file. The URL to this file is defined in the NodeImage at - extra[parametersURL]. - Note: This argument must be specified when launching a Windows - instance. It must contain 'UserName' and 'Password' keys. - :type ex_configurationData: ``dict`` - """ - - # Compose headers for message body - data = {} - data.update({'name': kwargs['name']}) - data.update({'imageID': kwargs['image'].id}) - data.update({'instanceType': kwargs['size'].id}) - if 'location' in kwargs: - data.update({'location': kwargs['location'].id}) - else: - data.update({'location': '1'}) - if 'auth' in kwargs and isinstance(kwargs['auth'], NodeAuthSSHKey): - data.update({'publicKey': kwargs['auth'].pubkey}) - if 'ex_configurationData' in kwargs: - configurationData = kwargs['ex_configurationData'] - if configurationData: - for key in configurationData.keys(): - data.update({key: configurationData.get(key)}) - - # Send request! - resp = self.connection.request( - action=REST_BASE + '/instances', - headers={'Content-Type': 'application/x-www-form-urlencoded'}, - method='POST', - data=data).object - return self._to_nodes(resp)[0] - - def create_volume(self, size, name, location, **kwargs): - """ - Create a new block storage volume (virtual disk) - - :param size: Size of volume in gigabytes (required). - Find out the possible sizes from the - offerings/storage REST interface - :type size: ``int`` - - :keyword name: Name of the volume to be created (required) - :type name: ``str`` - - :keyword location: Which data center to create a volume in. If - empty, it will fail for IBM SmartCloud Enterprise - (required) - :type location: :class:`NodeLocation` - - :keyword snapshot: Not supported for IBM SmartCloud Enterprise - :type snapshot: ``str`` - - :keyword kwargs.format: Either RAW or EXT3 for IBM SmartCloud - Enterprise (optional) - :type kwargs.format: ``str`` - - :keyword kwargs.offering_id: The storage offering ID for IBM - SmartCloud Enterprise - Find this from the REST interface - storage/offerings. (optional) - :type kwargs.offering_id: ``str`` - - :keyword kwargs.source_disk_id: If cloning a volume, the storage - disk to make a copy from (optional) - :type kwargs.source_disk_id: ``str`` - - :keyword kwargs.storage_area_id: The id of the storage availability - area to create the volume in - (optional) - :type kwargs.storage_area_id: ``str`` - - :keyword kwargs.target_location_id: If cloning a volume, the - storage disk to make a copy - from (optional) - :type kwargs.target_location_id: ``str`` - - :return: The newly created :class:`StorageVolume`. - :rtype: :class:`StorageVolume` - """ - data = {} - data.update({'name': name}) - data.update({'size': size}) - data.update({'location': location}) - if (('format' in kwargs) and (kwargs['format'] is not None)): - data.update({'format': kwargs['format']}) - if (('offering_id' in kwargs) and (kwargs['offering_id'] is not None)): - data.update({'offeringID': kwargs['offering_id']}) - if (('storage_area_id' in kwargs) and - (kwargs['storage_area_id'] is not None)): - data.update({'storageAreaID': kwargs['storage_area_id']}) - if 'source_disk_id' in kwargs: - data.update({'sourceDiskID': kwargs['source_disk_id']}) - data.update({'type': 'clone'}) - if 'target_location_id' in kwargs: - data.update({'targetLocationID': kwargs['target_location_id']}) - resp = self.connection.request( - action=REST_BASE + '/storage', - headers={'Content-Type': 'application/x-www-form-urlencoded'}, - method='POST', - data=data).object - return self._to_volumes(resp)[0] - - def create_image(self, name, description=None, **kwargs): - """ - Create a new node image from an existing volume or image. - - :param name: Name of the image to be created (required) - :type name: ``str`` - - :param description: Description of the image to be created - :type description: ``str`` - - :keyword image_id: The ID of the source image if cloning the image - :type image_id: ``str`` - - :keyword volume_id: The ID of the storage volume if - importing the image - :type volume_id: ``str`` - - :return: The newly created :class:`NodeImage`. - :rtype: :class:`NodeImage` - """ - data = {} - data.update({'name': name}) - if description is not None: - data.update({'description': description}) - if (('image_id' in kwargs) and (kwargs['image_id'] is not None)): - data.update({'imageId': kwargs['image_id']}) - if (('volume_id' in kwargs) and (kwargs['volume_id'] is not None)): - data.update({'volumeId': kwargs['volume_id']}) - resp = self.connection.request( - action=REST_BASE + '/offerings/image', - headers={'Content-Type': 'application/x-www-form-urlencoded'}, - method='POST', - data=data).object - return self._to_images(resp)[0] - - def destroy_node(self, node): - url = REST_BASE + '/instances/%s' % (node.id) - status = int(self.connection.request(action=url, - method='DELETE').status) - return status == httplib.OK - - def destroy_volume(self, volume): - """ - Destroys a storage volume. - - :param volume: Volume to be destroyed - :type volume: :class:`StorageVolume` - - :rtype: ``bool`` - """ - url = REST_BASE + '/storage/%s' % (volume.id) - status = int(self.connection.request(action=url, - method='DELETE').status) - return status == httplib.OK - - def ex_destroy_image(self, image): - """ - Destroys an image. - - :param image: Image to be destroyed - :type image: :class:`NodeImage` - - :return: ``bool`` - """ - - url = REST_BASE + '/offerings/image/%s' % (image.id) - status = int(self.connection.request(action=url, - method='DELETE').status) - return status == 200 - - def attach_volume(self, node, volume): - """ - Attaches volume to node. - - :param node: Node to attach volume to - :type node: :class:`Node` - - :param volume: Volume to attach - :type volume: :class:`StorageVolume` - - :rtype: ``bool`` - """ - url = REST_BASE + '/instances/%s' % (node.id) - headers = {'Content-Type': 'application/x-www-form-urlencoded'} - data = {'storageID': volume.id, 'type': 'attach'} - resp = self.connection.request(action=url, - method='PUT', - headers=headers, - data=data) - return int(resp.status) == 200 - - def detach_volume(self, node, volume): - """ - Detaches a volume from a node. - - :param node: Node which should be used - :type node: :class:`Node` - - :param volume: Volume to be detached - :type volume: :class:`StorageVolume` - - :rtype: ``bool`` - """ - url = REST_BASE + '/instances/%s' % (node.id) - headers = {'Content-Type': 'application/x-www-form-urlencoded'} - data = {'storageID': volume.id, 'type': 'detach'} - resp = self.connection.request(action=url, - method='PUT', - headers=headers, - data=data) - return int(resp.status) == 200 - - def reboot_node(self, node): - url = REST_BASE + '/instances/%s' % (node.id) - headers = {'Content-Type': 'application/x-www-form-urlencoded'} - data = {'state': 'restart'} - - resp = self.connection.request(action=url, - method='PUT', - headers=headers, - data=data) - return int(resp.status) == 200 - - def list_nodes(self): - return self._to_nodes( - self.connection.request(REST_BASE + '/instances').object) - - def list_images(self, location=None): - return self._to_images( - self.connection.request(REST_BASE + '/offerings/image').object) - - def list_volumes(self): - """ - List storage volumes. - - :rtype: ``list`` of :class:`StorageVolume` - """ - return self._to_volumes( - self.connection.request(REST_BASE + '/storage').object) - - def list_sizes(self, location=None): - """ - Returns a generic list of sizes. See list_images() for a list of - supported sizes for specific images. In particular, you need to have - a size that matches the architecture (32-bit vs 64-bit) of the virtual - machine image operating system. - - @inherits: :class:`NodeDriver.list_sizes` - """ - return [ - NodeSize('BRZ32.1/2048/60*175', 'Bronze 32 bit', None, None, None, - None, self.connection.driver), - NodeSize('BRZ64.2/4096/60*500*350', 'Bronze 64 bit', None, None, - None, None, self.connection.driver), - NodeSize('COP32.1/2048/60', 'Copper 32 bit', None, None, None, - None, self.connection.driver), - NodeSize('COP64.2/4096/60', 'Copper 64 bit', None, None, None, - None, self.connection.driver), - NodeSize('SLV32.2/4096/60*350', 'Silver 32 bit', None, None, None, - None, self.connection.driver), - NodeSize('SLV64.4/8192/60*500*500', 'Silver 64 bit', None, None, - None, None, self.connection.driver), - NodeSize('GLD32.4/4096/60*350', 'Gold 32 bit', None, None, None, - None, self.connection.driver), - NodeSize('GLD64.8/16384/60*500*500', 'Gold 64 bit', None, None, - None, None, self.connection.driver), - NodeSize('PLT64.16/16384/60*500*500*500*500', 'Platinum 64 bit', - None, None, None, None, self.connection.driver)] - - def list_locations(self): - return self._to_locations( - self.connection.request(REST_BASE + '/locations').object) - - def ex_list_storage_offerings(self): - """ - List the storage center offerings - - :rtype: ``list`` of :class:`VolumeOffering` - """ - return self._to_volume_offerings( - self.connection.request(REST_BASE + '/offerings/storage').object) - - def ex_allocate_address(self, location_id, offering_id, vlan_id=None): - """ - Allocate a new reserved IP address - - :param location_id: Target data center - :type location_id: ``str`` - - :param offering_id: Offering ID for address to create - :type offering_id: ``str`` - - :param vlan_id: ID of target VLAN - :type vlan_id: ``str`` - - :return: :class:`Address` object - :rtype: :class:`Address` - """ - url = REST_BASE + '/addresses' - headers = {'Content-Type': 'application/x-www-form-urlencoded'} - data = {'location': location_id, 'offeringID': offering_id} - if vlan_id is not None: - data.update({'vlanID': vlan_id}) - resp = self.connection.request(action=url, - method='POST', - headers=headers, - data=data).object - return self._to_addresses(resp)[0] - - def ex_list_addresses(self, resource_id=None): - """ - List the reserved IP addresses - - :param resource_id: If this is supplied only a single address will - be returned (optional) - :type resource_id: ``str`` - - :rtype: ``list`` of :class:`Address` - """ - url = REST_BASE + '/addresses' - if resource_id: - url += '/' + resource_id - return self._to_addresses(self.connection.request(url).object) - - def ex_copy_to(self, image, volume): - """ - Copies a node image to a storage volume - - :param image: source image to copy - :type image: :class:`NodeImage` - - :param volume: Target storage volume to copy to - :type volume: :class:`StorageVolume` - - :return: ``bool`` The success of the operation - :rtype: ``bool`` - """ - url = REST_BASE + '/storage/%s' % (volume.id) - headers = {'Content-Type': 'application/x-www-form-urlencoded'} - data = {'imageId': image.id} - resp = self.connection.request(action=url, - method='PUT', - headers=headers, - data=data) - return int(resp.status) == 200 - - def ex_delete_address(self, resource_id): - """ - Delete a reserved IP address - - :param resource_id: The address to delete (required) - :type resource_id: ``str`` - - :rtype: ``bool`` - """ - url = REST_BASE + '/addresses/' + resource_id - status = int(self.connection.request(action=url, - method='DELETE').status) - return status == 200 - - def ex_wait_storage_state(self, volume, state=VolumeState.DETACHED, - wait_period=60, timeout=1200): - """ - Block until storage volume state changes to the given value - - :param volume: Storage volume. - :type volume: :class:`StorageVolume` - - :param state: The target state to wait for - :type state: ``int`` - - :param wait_period: How many seconds to between each loop - iteration (default is 3) - :type wait_period: ``int`` - - :param timeout: How many seconds to wait before timing out - (default is 1200) - :type timeout: ``int`` - - :rtype: :class:`StorageVolume` - """ - start = time.time() - end = start + timeout - - while time.time() < end: - volumes = self.list_volumes() - volumes = list([v for v in volumes if v.uuid == volume.uuid]) - - if (len(volumes) == 1 and volumes[0].extra['state'] == state): - return volumes[0] - else: - time.sleep(wait_period) - continue - - raise LibcloudError(value='Timed out after %d seconds' % (timeout), - driver=self) - - def _to_nodes(self, object): - return [self._to_node(instance) for instance in - object.findall('Instance')] - - def _to_node(self, instance): - public_ips = [] - - ip = instance.findtext('IP') - if ip: - public_ips.append(ip) - - return Node( - id=instance.findtext('ID'), - name=instance.findtext('Name'), - state=self.NODE_STATE_MAP[int(instance.findtext('Status'))], - public_ips=public_ips, - private_ips=[], - driver=self.connection.driver - ) - - def _to_images(self, object): - # Converts data retrieved from SCE /offerings/image REST call to - # a NodeImage - return [self._to_image(image) for image in object.findall('Image')] - - def _to_image(self, image): - # Converts an SCE Image object to a NodeImage - imageID = image.findtext('ID') - imageName = image.findtext('Name') - parametersURL = image.findtext('Manifest') - location = image.findtext('Location') - state = image.findtext('State') - owner = image.findtext('Owner') - visibility = image.findtext('Visibility') - platform = image.findtext('Platform') - description = image.findtext('Description') - documentation = image.findtext('Documentation') - instanceTypes = image.findall('SupportedInstanceTypes') - nodeSizes = self._to_node_sizes(image.find('SupportedInstanceTypes')) - return NodeImage(id=imageID, - name=imageName, - driver=self.connection.driver, - extra={ - 'parametersURL': parametersURL, - 'location': location, - 'state': state, - 'owner': owner, - 'visibility': visibility, - 'platform': platform, - 'description': description, - 'documentation': documentation, - 'instanceTypes': instanceTypes, - 'node_sizes': nodeSizes - } - ) - - def _to_locations(self, object): - return [self._to_location(location) for location in - object.findall('Location')] - - def _to_location(self, location): - # Converts an SCE Location object to a Libcloud NodeLocation object - name_text = location.findtext('Name') - description = location.findtext('Description') - state = location.findtext('State') - (nameVal, separator, countryVal) = name_text.partition(',') - capabiltyElements = location.findall('Capabilities/Capability') - capabilities = {} - for elem in capabiltyElements: - capabilityID = elem.attrib['id'] - entryElements = elem.findall('Entry') - entries = [] - for entryElem in entryElements: - key = entryElem.attrib['key'] - valueElements = elem.findall('Value') - values = [] - for valueElem in valueElements: - values.append(valueElem.text) - entry = {'key': key, 'values': values} - entries.append(entry) - capabilities[capabilityID] = entries - extra = {'description': description, 'state': state, - 'capabilities': capabilities} - return IBMNodeLocation(id=location.findtext('ID'), - name=nameVal, - country=countryVal.strip(), - driver=self.connection.driver, - extra=extra) - - def _to_node_sizes(self, object): - # Converts SCE SupportedInstanceTypes object to - # a list of Libcloud NodeSize objects - return [self._to_node_size(iType) for iType in - object.findall('InstanceType')] - - def _to_node_size(self, object): - # Converts to an SCE InstanceType to a Libcloud NodeSize - return NodeSize(object.findtext('ID'), - object.findtext('Label'), - None, - None, - None, - object.findtext('Price/Rate'), - self.connection.driver) - - def _to_volumes(self, object): - return [self._to_volume(iType) for iType in - object.findall('Volume')] - - def _to_volume(self, object): - # Converts an SCE Volume to a Libcloud StorageVolume - extra = {'state': object.findtext('State'), - 'location': object.findtext('Location'), - 'instanceID': object.findtext('instanceID'), - 'owner': object.findtext('Owner'), - 'format': object.findtext('Format'), - 'createdTime': object.findtext('CreatedTime'), - 'storageAreaID': object.findtext('StorageArea/ID')} - return StorageVolume(object.findtext('ID'), - object.findtext('Name'), - object.findtext('Size'), - self.connection.driver, - extra=extra) - - def _to_volume_offerings(self, object): - return [self._to_volume_offering(iType) for iType in - object.findall('Offerings')] - - def _to_volume_offering(self, object): - # Converts an SCE DescribeVolumeOfferingsResponse/Offerings XML object - # to an SCE VolumeOffering - extra = {'label': object.findtext('Label'), - 'supported_sizes': object.findtext('SupportedSizes'), - 'formats': object.findall('SupportedFormats/Format/ID'), - 'price': object.findall('Price')} - return VolumeOffering(object.findtext('ID'), - object.findtext('Name'), - object.findtext('Location'), - extra) - - def _to_addresses(self, object): - # Converts an SCE DescribeAddressesResponse XML object to a list of - # Address objects - return [self._to_address(iType) for iType in - object.findall('Address')] - - def _to_address(self, object): - # Converts an SCE DescribeAddressesResponse/Address XML object to - # an Address object - extra = {'location': object.findtext('Location'), - 'type': object.findtext('Label'), - 'created_time': object.findtext('SupportedSizes'), - 'hostname': object.findtext('Hostname'), - 'instance_ids': object.findtext('InstanceID'), - 'vlan': object.findtext('VLAN'), - 'owner': object.findtext('owner'), - 'mode': object.findtext('Mode'), - 'offering_id': object.findtext('OfferingID')} - return Address(object.findtext('ID'), - object.findtext('IP'), - object.findtext('State'), - extra) http://git-wip-us.apache.org/repos/asf/libcloud/blob/fad83850/libcloud/compute/drivers/ninefold.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/ninefold.py b/libcloud/compute/drivers/ninefold.py deleted file mode 100644 index 2689aad..0000000 --- a/libcloud/compute/drivers/ninefold.py +++ /dev/null @@ -1,29 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from libcloud.compute.providers import Provider - -from libcloud.compute.drivers.cloudstack import CloudStackNodeDriver - - -class NinefoldNodeDriver(CloudStackNodeDriver): - "Driver for Ninefold's Compute platform." - - host = 'api.ninefold.com' - path = '/compute/v1.0/' - - type = Provider.NINEFOLD - name = 'Ninefold' - website = 'http://ninefold.com/'
