You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by GitBox <gi...@apache.org> on 2022/09/21 20:15:16 UTC

[GitHub] [libcloud] jwk404 commented on a diff in pull request #1744: Azure: Add the ability to use Ultra SSDs

jwk404 commented on code in PR #1744:
URL: https://github.com/apache/libcloud/pull/1744#discussion_r976947124


##########
libcloud/compute/drivers/azure_arm.py:
##########
@@ -2065,6 +2079,41 @@ def ex_create_tags(self, resource, tags, replace=False):
             method="PATCH",
         )
 
+    def ex_create_additional_capabilities(
+        self, node, additional_capabilities, resource_group,
+    ):
+        """
+        Set the additional capabilities on a stopped node.
+
+        :param node: The node to be updated
+        :type node: ``str``
+        :param ex_additional_capabilities: Optional additional capabilities
+            allowing Ultra SSD and hibernation on this node.
+        :type ex_additional_capabilities: ``dict``
+        :param resource_group: The resource group of the node to be updated
+        :type resource_group: ``str``
+        """
+
+        target = (
+            "/subscriptions/%s/resourceGroups/%s/providers"
+            "/Microsoft.Compute/virtualMachines/%s"
+            % (self.subscription_id, resource_group, node.name)
+        )
+
+        data = {
+            "location": node.extra["location"],
+            "properties": {
+                "additionalCapabilities": additional_capabilities
+            }
+        }
+
+        self.connection.request(
+            target,
+            data=data,
+            params={"api-version": VM_API_VERSION},
+            method="PUT",
+        )
+

Review Comment:
   Thanks for catching that. I updated the method as suggested.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org