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 2021/10/11 14:10:04 UTC

[GitHub] [libcloud] micafer commented on a change in pull request #1586: Enable to get Volume Quota details in OpenStack driver

micafer commented on a change in pull request #1586:
URL: https://github.com/apache/libcloud/pull/1586#discussion_r726153913



##########
File path: libcloud/compute/drivers/openstack.py
##########
@@ -4010,12 +4010,37 @@ def ex_get_network_quotas(self, project_id):
         :param      project_id: The ID of the project.
         :type       project_id: ``str``
 
-        :rtype: :class:`OpenStack_2_QuotaSet`
+        :rtype: :class:`OpenStack_2_NetworkQuota`
         """
         url = '/v2.0/quotas/%s/details.json' % project_id
         return self._to_network_quota(
             self.network_connection.request(url).object['quota'])
 
+    def _to_volume_quota(self, obj):
+        res = OpenStack_2_VolumeQuota(
+            backup_gigabytes=obj.get('backup_gigabytes', None),
+            gigabytes=obj.get('gigabytes', None),
+            per_volume_gigabytes=obj.get('per_volume_gigabytes', None),
+            backups=obj.get('backups', None),
+            snapshots=obj.get('snapshots', None),
+            volumes=obj.get('volumes', None),
+            driver=self.connection.driver)
+
+        return res
+
+    def ex_get_volume_quotas(self, project_id):

Review comment:
       Where is the best way to get it?




-- 
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