This is an automated email from the ASF dual-hosted git repository.
micafer pushed a commit to branch unify_create_node
in repository https://gitbox.apache.org/repos/asf/libcloud.git
The following commit(s) were added to refs/heads/unify_create_node by this push:
new 13ef9c400 Update docs
13ef9c400 is described below
commit 13ef9c400df2d3bffa6de873bd567328a191e96a
Author: Miguel Caballer <[email protected]>
AuthorDate: Fri Jul 24 08:37:59 2026 +0200
Update docs
---
CHANGES.rst | 10 +++++++
docs/development.rst | 4 +--
.../compute/nttcis/Nodes_Create_mcp2_Customized.py | 7 +++--
docs/examples/compute/onapp/functionality.py | 2 ++
docs/examples/compute/vmware_vcloud_1.5.py | 18 ++++++++----
docs/upgrade_notes.rst | 26 +++++++++++++++++
libcloud/compute/drivers/digitalocean.py | 15 ++++++----
libcloud/compute/drivers/ec2.py | 8 +++---
libcloud/compute/drivers/equinixmetal.py | 4 +--
libcloud/compute/drivers/gig_g8.py | 10 +++----
libcloud/compute/drivers/kubevirt.py | 33 +++++++++++-----------
libcloud/compute/drivers/linode.py | 16 +++++------
libcloud/compute/drivers/openstack.py | 8 +++---
libcloud/compute/drivers/vultr.py | 4 +--
14 files changed, 108 insertions(+), 57 deletions(-)
diff --git a/CHANGES.rst b/CHANGES.rst
index bb38bc214..fd5b06e97 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -14,6 +14,16 @@ Common
Compute
~~~~~~~
+- [Compute] Unify ``NodeDriver`` method signatures across drivers.
+
+ Driver implementations now preserve the standard argument order and
+ optionality declared by ``NodeDriver``. Provider-specific arguments follow
+ the standard arguments and are optional. ``list_nodes`` is excluded because
+ its ``*args, **kwargs`` contract is intentionally unrestricted.
+
+ This can be a backward-incompatible change for code which passes arguments
+ positionally to affected methods.
+
- [SSH] Support paramiko 4
RSA key support has been removed as of paramiko 4, so only import it
diff --git a/docs/development.rst b/docs/development.rst
index f21d80313..f73e5bba3 100644
--- a/docs/development.rst
+++ b/docs/development.rst
@@ -177,10 +177,10 @@ For example:
def list_nodes(self):
pass
- def list_images(self):
+ def list_images(self, location=None):
pass
- def create_node(self):
+ def create_node(self, name, size, image, location=None, auth=None):
pass
def reboot_node(self):
diff --git a/docs/examples/compute/nttcis/Nodes_Create_mcp2_Customized.py
b/docs/examples/compute/nttcis/Nodes_Create_mcp2_Customized.py
index 642b840cd..6160963f4 100644
--- a/docs/examples/compute/nttcis/Nodes_Create_mcp2_Customized.py
+++ b/docs/examples/compute/nttcis/Nodes_Create_mcp2_Customized.py
@@ -17,9 +17,10 @@ vlan_name = "vlan1"
vlans = driver.ex_list_vlans()
vlan = [v for v in vlans if v.name == vlan_name][0]
new_node = driver.create_node(
- "Suse_12",
- image,
- psswd,
+ name="Suse_12",
+ size=None,
+ image=image,
+ auth=psswd,
ex_description="Customized_Suse server",
ex_network_domain=net_domain,
ex_primary_nic_vlan=vlan,
diff --git a/docs/examples/compute/onapp/functionality.py
b/docs/examples/compute/onapp/functionality.py
index 66c944d12..9e40815b8 100644
--- a/docs/examples/compute/onapp/functionality.py
+++ b/docs/examples/compute/onapp/functionality.py
@@ -31,6 +31,8 @@ rate_limit = None
node = driver.create_node(
name=name,
+ size=None,
+ image=None,
ex_memory=memory,
ex_cpus=cpus,
ex_cpu_shares=cpu_shares,
diff --git a/docs/examples/compute/vmware_vcloud_1.5.py
b/docs/examples/compute/vmware_vcloud_1.5.py
index 327044b47..c6051a5db 100644
--- a/docs/examples/compute/vmware_vcloud_1.5.py
+++ b/docs/examples/compute/vmware_vcloud_1.5.py
@@ -26,20 +26,23 @@ images = driver.list_images()
image = [i for i in images if i.name == "natty-server-cloudimg-amd64"][0]
# Create node with minimum set of parameters
-node = driver.create_node(name="test node 1", image=image)
+node = driver.create_node(name="test node 1", size=None, image=image)
# Destroy the node
driver.destroy_node(node)
# Create node without deploying and powering it on
-node = driver.create_node(name="test node 2", image=image, ex_deploy=False)
+node = driver.create_node(name="test node 2", size=None, image=image,
ex_deploy=False)
# Create node with custom CPU & Memory values
-node = driver.create_node(name="test node 3", image=image, ex_vm_cpu=3,
ex_vm_memory=1024)
+node = driver.create_node(
+ name="test node 3", size=None, image=image, ex_vm_cpu=3, ex_vm_memory=1024
+)
# Create node with customised networking parameters (eg. for OVF
# imported images)
node = driver.create_node(
name="test node 4",
+ size=None,
image=image,
ex_vm_network="your vm net name",
ex_network="your org net name",
@@ -48,9 +51,14 @@ node = driver.create_node(
)
# Create node in a custom virtual data center
-node = driver.create_node(name="test node 4", image=image, ex_vdc="your vdc
name")
+node = driver.create_node(
+ name="test node 4", size=None, image=image, ex_vdc="your vdc name"
+)
# Create node with guest OS customisation script to be run at first boot
node = driver.create_node(
- name="test node 5", image=image, ex_vm_script="filesystem path to your
script"
+ name="test node 5",
+ size=None,
+ image=image,
+ ex_vm_script="filesystem path to your script",
)
diff --git a/docs/upgrade_notes.rst b/docs/upgrade_notes.rst
index 097cbf085..1214f07d4 100644
--- a/docs/upgrade_notes.rst
+++ b/docs/upgrade_notes.rst
@@ -5,6 +5,32 @@ This page describes how to upgrade from a previous version to
a new version
which contains backward incompatible or semi-incompatible changes and how to
preserve the old behavior when this is possible.
+Libcloud 3.9.2
+--------------
+
+Compute driver implementations now use the same argument order and optionality
+as the corresponding methods on ``NodeDriver``. Provider-specific arguments
+are optional and appear after the standard arguments. ``list_nodes`` is not
+affected because its ``*args, **kwargs`` contract is intentionally
+unrestricted.
+
+This affects methods including ``create_node``, ``list_sizes``,
+``list_images``, image management, key pair management, and block storage
+operations. Code which passes arguments positionally may need to be updated.
+Using keyword arguments for provider-specific options is recommended.
+
+For example, the standard node creation signature is:
+
+.. sourcecode:: python
+
+ def create_node(self, name, size, image, location=None, auth=None, ...)
+
+The standard volume creation signature is:
+
+.. sourcecode:: python
+
+ def create_volume(self, size, name, location=None, snapshot=None, ...)
+
Libcloud 3.9.0
--------------
diff --git a/libcloud/compute/drivers/digitalocean.py
b/libcloud/compute/drivers/digitalocean.py
index 3fb7fa635..e1d75c834 100644
--- a/libcloud/compute/drivers/digitalocean.py
+++ b/libcloud/compute/drivers/digitalocean.py
@@ -248,8 +248,11 @@ class
DigitalOcean_v2_NodeDriver(DigitalOcean_v2_BaseDriver, DigitalOceanNodeDri
:param node: Node to use as base for image
:type node: :class:`Node`
- :param node: Name for image
- :type node: ``str``
+ :param name: Name for image
+ :type name: ``str``
+
+ :param description: Optional image description.
+ :type description: ``str``
:rtype: ``bool``
"""
@@ -267,8 +270,8 @@ class
DigitalOcean_v2_NodeDriver(DigitalOcean_v2_BaseDriver, DigitalOceanNodeDri
@inherits: :class:`NodeDriver.delete_image`
- :param image: the image to be deleted
- :type image: :class:`NodeImage`
+ :param node_image: the image to be deleted
+ :type node_image: :class:`NodeImage`
:rtype: ``bool``
"""
@@ -393,8 +396,8 @@ class
DigitalOcean_v2_NodeDriver(DigitalOcean_v2_BaseDriver, DigitalOceanNodeDri
"""
Delete an existing SSH key.
- :param key: SSH key (required)
- :type key: :class:`KeyPair`
+ :param key_pair: SSH key (required)
+ :type key_pair: :class:`KeyPair`
"""
key = key_pair
key_id = key.extra["id"]
diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py
index ef7ae5476..8d62c7873 100644
--- a/libcloud/compute/drivers/ec2.py
+++ b/libcloud/compute/drivers/ec2.py
@@ -2039,8 +2039,8 @@ class BaseEC2NodeDriver(NodeDriver):
:param source_region: The region where the image resides
:type source_region: ``str``
- :param image: Instance of class NodeImage
- :type image: :class:`NodeImage`
+ :param node_image: Instance of class NodeImage
+ :type node_image: :class:`NodeImage`
:param name: The name of the new image
:type name: ``str``
@@ -2131,8 +2131,8 @@ class BaseEC2NodeDriver(NodeDriver):
@inherits: :class:`NodeDriver.delete_image`
- :param image: Instance of ``NodeImage``
- :type image: :class: `NodeImage`
+ :param node_image: Instance of ``NodeImage``
+ :type node_image: :class: `NodeImage`
:rtype: ``bool``
"""
diff --git a/libcloud/compute/drivers/equinixmetal.py
b/libcloud/compute/drivers/equinixmetal.py
index a7103cdc4..acfacf38f 100644
--- a/libcloud/compute/drivers/equinixmetal.py
+++ b/libcloud/compute/drivers/equinixmetal.py
@@ -450,8 +450,8 @@ def _list_async(driver):
"""
Delete an existing SSH key.
- :param key: SSH key (required)
- :type key: :class:`KeyPair`
+ :param key_pair: SSH key (required)
+ :type key_pair: :class:`KeyPair`
"""
key = key_pair
key_id = key.name
diff --git a/libcloud/compute/drivers/gig_g8.py
b/libcloud/compute/drivers/gig_g8.py
index e8d299a18..3c0e80975 100644
--- a/libcloud/compute/drivers/gig_g8.py
+++ b/libcloud/compute/drivers/gig_g8.py
@@ -523,12 +523,12 @@ class G8NodeDriver(NodeDriver):
:param name: Name of the volume
:type name: ``str``
- :param description: Description of the volume
- :type description: ``str``
+ :param ex_description: Description of the volume
+ :type ex_description: ``str``
- :param disk_type: Type of the disk depending on the G8
- D for datadisk is always available
- :type disk_type: ``str``
+ :param ex_disk_type: Type of the disk depending on the G8.
+ ``D`` for a data disk is always available.
+ :type ex_disk_type: ``str``
:rtype: class:`StorageVolume`
"""
diff --git a/libcloud/compute/drivers/kubevirt.py
b/libcloud/compute/drivers/kubevirt.py
index f0a46dcd6..c04291f6f 100644
--- a/libcloud/compute/drivers/kubevirt.py
+++ b/libcloud/compute/drivers/kubevirt.py
@@ -1217,9 +1217,9 @@ class KubeVirtNodeDriver(KubernetesDriverMixin,
NodeDriver):
:param size: The size in Gigabytes
:type size: `int`
- :param volume_type: This is the type of volume to be created that is
- dependent on the underlying cloud where Kubernetes
- is deployed. K8s is supporting the following types:
+ :param ex_volume_type: This is the type of volume to be created that is
+ dependent on the underlying cloud where
Kubernetes
+ is deployed. K8s is supporting the following
types:
-gcePersistentDisk
-awsElasticBlockStore
-azureFile
@@ -1244,19 +1244,20 @@ class KubeVirtNodeDriver(KubernetesDriverMixin,
NodeDriver):
where type is one of the above and key1, key2...
are type specific keys and
their corresponding values. eg: {nsf: {server:
"172.0.0.0", path: "/tmp"}}
{awsElasticBlockStore: {fsType:
'ext4', volumeID: "1234"}}
- :type volume_type: `str`
-
- :param volume_params: A dict with the key:value that the
- volume_type needs.
- This parameter is a dict in the form
- {key1:value1, key2:value2,...},
- where type is one of the above and key1, key2...
- are type specific keys and
- their corresponding values.
- eg: for nsf volume_type
- {server: "172.0.0.0", path: "/tmp"}
- for awsElasticBlockStore volume_type
- {fsType: 'ext4', volumeID: "1234"}
+ :type ex_volume_type: `str`
+
+ :param ex_volume_params: A dict with the key:value that the
+ ``ex_volume_type`` needs.
+ This parameter is a dict in the form
+ {key1:value1, key2:value2,...},
+ where type is one of the above and key1,
key2...
+ are type specific keys and
+ their corresponding values.
+ eg: for nfs ``ex_volume_type``
+ {server: "172.0.0.0", path: "/tmp"}
+ for awsElasticBlockStore ``ex_volume_type``
+ {fsType: 'ext4', volumeID: "1234"}
+ :type ex_volume_params: ``dict``
"""
if ex_dynamic:
diff --git a/libcloud/compute/drivers/linode.py
b/libcloud/compute/drivers/linode.py
index 2fd487f40..ac0e390c8 100644
--- a/libcloud/compute/drivers/linode.py
+++ b/libcloud/compute/drivers/linode.py
@@ -555,8 +555,8 @@ class LinodeNodeDriverV4(LinodeNodeDriver):
Required if node is not given.
:type location: :class:`NodeLocation`
- :keyword volume: Node to attach the volume to
- :type volume: :class:`Node`
+ :keyword node: Node to attach the volume to
+ :type node: :class:`Node`
:keyword tags: tags to apply to volume
:type tags: `list` of `str`
@@ -733,8 +733,8 @@ class LinodeNodeDriverV4(LinodeNodeDriver):
"""
Lookup a Linode image
- :param image: The name to image to be looked up (required).\
- :type name: `str`
+ :param image_id: The ID of the image to look up (required).
+ :type image_id: ``str``
:rtype: :class: `NodeImage`
"""
@@ -751,8 +751,8 @@ class LinodeNodeDriverV4(LinodeNodeDriver):
"""Creates a private image from a LinodeDisk.
Images are limited to three per account.
- :param disk: LinodeDisk to create the image from (required)
- :type disk: :class:`LinodeDisk`
+ :param node: LinodeDisk to create the image from (required)
+ :type node: :class:`LinodeDisk`
:keyword name: A name for the image.\
Defaults to the name of the disk \
@@ -783,8 +783,8 @@ class LinodeNodeDriverV4(LinodeNodeDriver):
):
"""Deletes a private image
- :param image: NodeImage to delete (required)
- :type image: :class:`NodeImage`
+ :param node_image: NodeImage to delete (required)
+ :type node_image: :class:`NodeImage`
:rtype: ``bool``
"""
diff --git a/libcloud/compute/drivers/openstack.py
b/libcloud/compute/drivers/openstack.py
index 06edd7a12..21a613a2c 100644
--- a/libcloud/compute/drivers/openstack.py
+++ b/libcloud/compute/drivers/openstack.py
@@ -1136,8 +1136,8 @@ class OpenStack_1_0_NodeDriver(OpenStackNodeDriver):
@inherits: :class:`NodeDriver.delete_image`
- :param image: the image to be deleted
- :type image: :class:`NodeImage`
+ :param node_image: the image to be deleted
+ :type node_image: :class:`NodeImage`
:rtype: ``bool``
"""
@@ -2383,8 +2383,8 @@ class OpenStack_1_1_NodeDriver(OpenStackNodeDriver):
@inherits: :class:`NodeDriver.delete_image`
- :param image: image witch should be used
- :type image: :class:`NodeImage`
+ :param node_image: image which should be used
+ :type node_image: :class:`NodeImage`
:rtype: ``bool``
"""
diff --git a/libcloud/compute/drivers/vultr.py
b/libcloud/compute/drivers/vultr.py
index 9e4d50a4f..e429391cb 100644
--- a/libcloud/compute/drivers/vultr.py
+++ b/libcloud/compute/drivers/vultr.py
@@ -1538,8 +1538,8 @@ class VultrNodeDriverV2(VultrNodeDriver):
):
"""Retrieve a single key pair.
- :param key_id: ID of the key pair to retrieve.
- :type key_id: ``str``
+ :param name: ID of the key pair to retrieve.
+ :type name: ``str``
:rtype: :class: `KeyPair`
"""