libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [libcloud] Kami commented on a change in pull request #1549: Make libcloud compliant with the latest Outscale API.
Date Mon, 22 Feb 2021 22:45:30 GMT

Kami commented on a change in pull request #1549:
URL: https://github.com/apache/libcloud/pull/1549#discussion_r580644736



##########
File path: libcloud/compute/drivers/outscale.py
##########
@@ -7709,6 +7709,318 @@ def ex_list_vpn_connections(
             return response.json()["VpnConnections"]
         return response.json()
 
+    def ex_create_certificate_authority(
+        self,
+        ca_perm: str = None,
+        description: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Creates a Client Certificate Authority (CA).
+
+        :param      ca_perm: The CA in PEM format. (required)
+        :type       ca_perm: ``str``
+
+        :param      description: The description of the CA.
+        :type       description: ``bool``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "CreateCa"
+        data = {"DryRun": dry_run}
+        if ca_perm is not None:

Review comment:
       Hm, I'm a bit confused, docstring says it's required, but code makes it look like it's
not.

##########
File path: libcloud/compute/drivers/outscale.py
##########
@@ -7709,6 +7709,318 @@ def ex_list_vpn_connections(
             return response.json()["VpnConnections"]
         return response.json()
 
+    def ex_create_certificate_authority(
+        self,
+        ca_perm: str = None,
+        description: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Creates a Client Certificate Authority (CA).
+
+        :param      ca_perm: The CA in PEM format. (required)
+        :type       ca_perm: ``str``
+
+        :param      description: The description of the CA.
+        :type       description: ``bool``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "CreateCa"
+        data = {"DryRun": dry_run}
+        if ca_perm is not None:
+            data.update({"CaPerm": ca_perm})
+        if description is not None:
+            data.update({"Description": description})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return response.json()["Ca"]
+        return response.json()
+
+    def ex_delete_certificate_authority(
+        self,
+        ca_id: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Deletes a specified Client Certificate Authority (CA).
+
+        :param      ca_id: The ID of the CA you want to delete. (required)
+        :type       ca_id: ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "DeleteCa"
+        data = {"DryRun": dry_run}
+        if ca_id is not None:

Review comment:
       If ca_id is required, this if check should not be there.

##########
File path: libcloud/compute/drivers/outscale.py
##########
@@ -7709,6 +7709,318 @@ def ex_list_vpn_connections(
             return response.json()["VpnConnections"]
         return response.json()
 
+    def ex_create_certificate_authority(
+        self,
+        ca_perm: str = None,
+        description: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Creates a Client Certificate Authority (CA).
+
+        :param      ca_perm: The CA in PEM format. (required)
+        :type       ca_perm: ``str``
+
+        :param      description: The description of the CA.
+        :type       description: ``bool``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "CreateCa"
+        data = {"DryRun": dry_run}
+        if ca_perm is not None:
+            data.update({"CaPerm": ca_perm})
+        if description is not None:
+            data.update({"Description": description})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return response.json()["Ca"]
+        return response.json()
+
+    def ex_delete_certificate_authority(
+        self,
+        ca_id: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Deletes a specified Client Certificate Authority (CA).
+
+        :param      ca_id: The ID of the CA you want to delete. (required)
+        :type       ca_id: ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "DeleteCa"
+        data = {"DryRun": dry_run}
+        if ca_id is not None:
+            data.update({"CaId": ca_id})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return True
+        return response.json()
+
+    def ex_read_certificate_authorities(
+        self,
+        ca_fingerprints: List[str] = None,
+        ca_ids: List[str] = None,
+        descriptions: List[str] = None,
+        dry_run: bool = False
+    ):
+        """
+        Returns information about one or more of your Client Certificate
+        Authorities (CAs).
+
+        :param      ca_fingerprints: The fingerprints of the CAs.
+        :type       ca_fingerprints: ``list`` of ``str``
+
+        :param      ca_ids: The IDs of the CAs.
+        :type       ca_ids: ``list`` of ``str``
+
+        :param      descriptions: The descriptions of the CAs.
+        :type       descriptions: ``list`` of ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "ReadCas"
+        data = {"DryRun": dry_run, "Filters": {}}
+        if ca_fingerprints is not None:

Review comment:
       I assume at least one of those filters needs to be provided, right? If so, we should
check that in the code and throw if it's not true.

##########
File path: libcloud/compute/drivers/outscale.py
##########
@@ -7709,6 +7709,318 @@ def ex_list_vpn_connections(
             return response.json()["VpnConnections"]
         return response.json()
 
+    def ex_create_certificate_authority(
+        self,
+        ca_perm: str = None,
+        description: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Creates a Client Certificate Authority (CA).
+
+        :param      ca_perm: The CA in PEM format. (required)
+        :type       ca_perm: ``str``
+
+        :param      description: The description of the CA.
+        :type       description: ``bool``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "CreateCa"
+        data = {"DryRun": dry_run}
+        if ca_perm is not None:
+            data.update({"CaPerm": ca_perm})
+        if description is not None:
+            data.update({"Description": description})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return response.json()["Ca"]
+        return response.json()
+
+    def ex_delete_certificate_authority(
+        self,
+        ca_id: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Deletes a specified Client Certificate Authority (CA).
+
+        :param      ca_id: The ID of the CA you want to delete. (required)
+        :type       ca_id: ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "DeleteCa"
+        data = {"DryRun": dry_run}
+        if ca_id is not None:
+            data.update({"CaId": ca_id})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return True
+        return response.json()
+
+    def ex_read_certificate_authorities(
+        self,
+        ca_fingerprints: List[str] = None,
+        ca_ids: List[str] = None,
+        descriptions: List[str] = None,
+        dry_run: bool = False
+    ):
+        """
+        Returns information about one or more of your Client Certificate
+        Authorities (CAs).
+
+        :param      ca_fingerprints: The fingerprints of the CAs.
+        :type       ca_fingerprints: ``list`` of ``str``
+
+        :param      ca_ids: The IDs of the CAs.
+        :type       ca_ids: ``list`` of ``str``
+
+        :param      descriptions: The descriptions of the CAs.
+        :type       descriptions: ``list`` of ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "ReadCas"
+        data = {"DryRun": dry_run, "Filters": {}}
+        if ca_fingerprints is not None:
+            data["Filters"].update({"CaFingerprints": ca_fingerprints})
+        if ca_ids is not None:
+            data["Filters"].update({"CaIds": ca_ids})
+        if descriptions is not None:
+            data["Filters"].update({"Descriptions": descriptions})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return response.json()["Cas"]
+        return response.json()
+
+    def ex_update_certificate_authority(
+        self,
+        ca_id: str = None,
+        description: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Modifies the specified attribute of a Client Certificate Authority
+        (CA).
+
+        :param      ca_id: The ID of the CA. (required)
+        :type       ca_id: ``str``
+
+        :param      description: The description of the CA.
+        :type       description: ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "UpdateCa"
+        data = {"DryRun": dry_run}
+        if ca_id is not None:
+            data.update({"CaId": ca_id})
+        if description is not None:
+            data.update({"Description": description})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return response.json()["Ca"]
+        return response.json()
+
+    def ex_create_api_access_rule(
+        self,
+        description: str = None,
+        ip_ranges: List[str] = None,
+        ca_ids: List[str] = None,
+        cns: List[str] = None,
+        dry_run: bool = False,
+    ):
+        """
+        Create an API access rule.
+        It is a rule to allow access to the API from your account.
+        You need to specify at least the CaIds or the IpRanges parameter.
+
+        :param      description: The description of the new rule.
+        :type       description: ``str``
+
+        :param      ip_ranges: One or more IP ranges, in CIDR notation
+        (for example, 192.0.2.0/16).
+        :type       ip_ranges: ``List`` of ``str``
+
+        :param      ca_ids: One or more IDs of Client Certificate Authorities
+        (CAs).
+        :type       ca_ids: ``List`` of ``str``
+
+        :param      cns: One or more Client Certificate Common Names (CNs).
+        If this parameter is specified, you must also specify the ca_ids
+        parameter.
+        :type       cns: ``List`` of ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+
+        :return: a dict containing the API access rule created.
+        :rtype: ``dict``
+        """
+        action = "CreateApiAccessRule"
+        data = {"DryRun": dry_run}
+        if description is not None:
+            data["Description"] = description
+        if ip_ranges is not None:
+            data["IpRanges"] = ip_ranges
+        if ca_ids is not None:
+            data["CaIds"] = ca_ids
+        if cns is not None:
+            data["Cns"] = cns
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return response.json()["ApiAccessRule"]
+        return response.json()
+
+    def ex_delete_api_access_rule(
+        self,
+        api_access_rule_id: str = None,
+        dry_run: bool = False,
+    ):
+        """
+        Delete an API access rule.
+        You cannot delete the last remaining API access rule.
+
+        :param      api_access_rule_id: The id of the targeted rule.
+        :type       api_access_rule_id: ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+
+        :return: true if successfull.
+        :rtype: ``bool`` if successful or  ``dict``
+        """
+        action = "DeleteApiAccessRule"
+        data = {"ApiAccessRuleId": api_access_rule_id, "DryRun": dry_run}
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return True
+        return response.json()
+
+    def ex_read_api_access_rules(
+        self,
+        api_access_rules_ids: List[str] = None,
+        ca_ids: List[str] = None,
+        cns: List[str] = None,
+        descriptions: List[str] = None,
+        ip_ranges: List[str] = None,
+        dry_run: bool = False,
+    ):
+        """
+        Read API access rules.
+
+        :param      api_access_rules_ids: The List containing rules ids to
+        filter the request.
+        :type       api_access_rules_ids: ``List`` of ``str``
+
+        :param      ca_ids: The List containing CA ids to filter the request.
+        :type       ca_ids: ``List`` of ``str``
+
+        :param      cns: The List containing cns to filter the request.
+        :type       cns: ``List`` of ``str``
+
+        :param      descriptions: The List containing descriptions to filter
+        the request.
+        :type       descriptions: ``List`` of ``str``
+
+        :param      ip_ranges: The List containing ip ranges in CIDR notation
+        (for example, 192.0.2.0/16) to filter the request.
+        :type       ip_ranges: ``List`` of ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+
+        :return: a List of API access rules.
+        :rtype: ``List`` of ``dict`` if successfull or  ``dict``
+        """
+
+        action = "ReadApiAccessRules"
+        filters = {}
+        if api_access_rules_ids is not None:
+            filters["ApiAccessRulesIds"] = api_access_rules_ids
+        if ca_ids is not None:
+            filters["CaIds"] = ca_ids
+        if cns is not None:
+            filters["Cns"] = cns
+        if descriptions is not None:
+            filters["Descriptions"] = descriptions
+        if ip_ranges is not None:
+            filters["IpRanges"] = ip_ranges
+        data = {"Filters": filters, "DryRun": dry_run}
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return response.json()["ApiAccessRules"]
+        return response.json()
+
+    def ex_update_api_access_rule(
+        self,
+        api_access_rule_id: str = None,

Review comment:
       Please remove None from a required argument.

##########
File path: libcloud/compute/drivers/outscale.py
##########
@@ -7709,6 +7709,318 @@ def ex_list_vpn_connections(
             return response.json()["VpnConnections"]
         return response.json()
 
+    def ex_create_certificate_authority(
+        self,
+        ca_perm: str = None,
+        description: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Creates a Client Certificate Authority (CA).
+
+        :param      ca_perm: The CA in PEM format. (required)
+        :type       ca_perm: ``str``
+
+        :param      description: The description of the CA.
+        :type       description: ``bool``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "CreateCa"
+        data = {"DryRun": dry_run}
+        if ca_perm is not None:
+            data.update({"CaPerm": ca_perm})
+        if description is not None:
+            data.update({"Description": description})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return response.json()["Ca"]
+        return response.json()
+
+    def ex_delete_certificate_authority(
+        self,
+        ca_id: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Deletes a specified Client Certificate Authority (CA).
+
+        :param      ca_id: The ID of the CA you want to delete. (required)
+        :type       ca_id: ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "DeleteCa"
+        data = {"DryRun": dry_run}
+        if ca_id is not None:
+            data.update({"CaId": ca_id})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return True
+        return response.json()
+
+    def ex_read_certificate_authorities(
+        self,
+        ca_fingerprints: List[str] = None,
+        ca_ids: List[str] = None,
+        descriptions: List[str] = None,
+        dry_run: bool = False
+    ):
+        """
+        Returns information about one or more of your Client Certificate
+        Authorities (CAs).
+
+        :param      ca_fingerprints: The fingerprints of the CAs.

Review comment:
       Which arguments in this method are required? I assume either ca_ids or ca_fingersprints?
And perhaps they are even mutually exclusive? Or what happens if both are provided? Same with
descriptions.

##########
File path: libcloud/compute/drivers/outscale.py
##########
@@ -7709,6 +7709,318 @@ def ex_list_vpn_connections(
             return response.json()["VpnConnections"]
         return response.json()
 
+    def ex_create_certificate_authority(
+        self,
+        ca_perm: str = None,
+        description: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Creates a Client Certificate Authority (CA).
+
+        :param      ca_perm: The CA in PEM format. (required)
+        :type       ca_perm: ``str``
+
+        :param      description: The description of the CA.
+        :type       description: ``bool``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "CreateCa"
+        data = {"DryRun": dry_run}
+        if ca_perm is not None:
+            data.update({"CaPerm": ca_perm})
+        if description is not None:
+            data.update({"Description": description})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return response.json()["Ca"]
+        return response.json()
+
+    def ex_delete_certificate_authority(
+        self,
+        ca_id: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Deletes a specified Client Certificate Authority (CA).
+
+        :param      ca_id: The ID of the CA you want to delete. (required)
+        :type       ca_id: ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "DeleteCa"
+        data = {"DryRun": dry_run}
+        if ca_id is not None:
+            data.update({"CaId": ca_id})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return True
+        return response.json()
+
+    def ex_read_certificate_authorities(
+        self,
+        ca_fingerprints: List[str] = None,
+        ca_ids: List[str] = None,
+        descriptions: List[str] = None,
+        dry_run: bool = False
+    ):
+        """
+        Returns information about one or more of your Client Certificate
+        Authorities (CAs).
+
+        :param      ca_fingerprints: The fingerprints of the CAs.
+        :type       ca_fingerprints: ``list`` of ``str``
+
+        :param      ca_ids: The IDs of the CAs.
+        :type       ca_ids: ``list`` of ``str``
+
+        :param      descriptions: The descriptions of the CAs.
+        :type       descriptions: ``list`` of ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "ReadCas"
+        data = {"DryRun": dry_run, "Filters": {}}
+        if ca_fingerprints is not None:
+            data["Filters"].update({"CaFingerprints": ca_fingerprints})
+        if ca_ids is not None:
+            data["Filters"].update({"CaIds": ca_ids})
+        if descriptions is not None:
+            data["Filters"].update({"Descriptions": descriptions})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return response.json()["Cas"]
+        return response.json()
+
+    def ex_update_certificate_authority(
+        self,
+        ca_id: str = None,
+        description: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Modifies the specified attribute of a Client Certificate Authority
+        (CA).
+
+        :param      ca_id: The ID of the CA. (required)
+        :type       ca_id: ``str``
+
+        :param      description: The description of the CA.
+        :type       description: ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "UpdateCa"
+        data = {"DryRun": dry_run}
+        if ca_id is not None:
+            data.update({"CaId": ca_id})
+        if description is not None:
+            data.update({"Description": description})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return response.json()["Ca"]
+        return response.json()
+
+    def ex_create_api_access_rule(
+        self,
+        description: str = None,
+        ip_ranges: List[str] = None,
+        ca_ids: List[str] = None,
+        cns: List[str] = None,
+        dry_run: bool = False,
+    ):
+        """
+        Create an API access rule.
+        It is a rule to allow access to the API from your account.
+        You need to specify at least the CaIds or the IpRanges parameter.
+
+        :param      description: The description of the new rule.
+        :type       description: ``str``
+
+        :param      ip_ranges: One or more IP ranges, in CIDR notation
+        (for example, 192.0.2.0/16).
+        :type       ip_ranges: ``List`` of ``str``
+
+        :param      ca_ids: One or more IDs of Client Certificate Authorities
+        (CAs).
+        :type       ca_ids: ``List`` of ``str``
+
+        :param      cns: One or more Client Certificate Common Names (CNs).
+        If this parameter is specified, you must also specify the ca_ids
+        parameter.
+        :type       cns: ``List`` of ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+
+        :return: a dict containing the API access rule created.
+        :rtype: ``dict``
+        """
+        action = "CreateApiAccessRule"
+        data = {"DryRun": dry_run}
+        if description is not None:
+            data["Description"] = description
+        if ip_ranges is not None:
+            data["IpRanges"] = ip_ranges
+        if ca_ids is not None:
+            data["CaIds"] = ca_ids
+        if cns is not None:
+            data["Cns"] = cns
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return response.json()["ApiAccessRule"]
+        return response.json()
+
+    def ex_delete_api_access_rule(
+        self,
+        api_access_rule_id: str = None,

Review comment:
       Same here, None should be removed.

##########
File path: libcloud/compute/drivers/outscale.py
##########
@@ -7709,6 +7709,318 @@ def ex_list_vpn_connections(
             return response.json()["VpnConnections"]
         return response.json()
 
+    def ex_create_certificate_authority(
+        self,
+        ca_perm: str = None,

Review comment:
       If the argument is required, it should not default to None.

##########
File path: libcloud/compute/drivers/outscale.py
##########
@@ -7709,6 +7709,318 @@ def ex_list_vpn_connections(
             return response.json()["VpnConnections"]
         return response.json()
 
+    def ex_create_certificate_authority(
+        self,
+        ca_perm: str = None,
+        description: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Creates a Client Certificate Authority (CA).
+
+        :param      ca_perm: The CA in PEM format. (required)
+        :type       ca_perm: ``str``
+
+        :param      description: The description of the CA.
+        :type       description: ``bool``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "CreateCa"
+        data = {"DryRun": dry_run}
+        if ca_perm is not None:
+            data.update({"CaPerm": ca_perm})
+        if description is not None:
+            data.update({"Description": description})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return response.json()["Ca"]
+        return response.json()
+
+    def ex_delete_certificate_authority(
+        self,
+        ca_id: str = None,

Review comment:
       I assume id is required so it should not default to None.

##########
File path: libcloud/compute/drivers/outscale.py
##########
@@ -7709,6 +7709,318 @@ def ex_list_vpn_connections(
             return response.json()["VpnConnections"]
         return response.json()
 
+    def ex_create_certificate_authority(
+        self,
+        ca_perm: str = None,
+        description: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Creates a Client Certificate Authority (CA).
+
+        :param      ca_perm: The CA in PEM format. (required)
+        :type       ca_perm: ``str``
+
+        :param      description: The description of the CA.
+        :type       description: ``bool``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "CreateCa"
+        data = {"DryRun": dry_run}
+        if ca_perm is not None:
+            data.update({"CaPerm": ca_perm})
+        if description is not None:
+            data.update({"Description": description})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return response.json()["Ca"]
+        return response.json()
+
+    def ex_delete_certificate_authority(
+        self,
+        ca_id: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Deletes a specified Client Certificate Authority (CA).
+
+        :param      ca_id: The ID of the CA you want to delete. (required)
+        :type       ca_id: ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "DeleteCa"
+        data = {"DryRun": dry_run}
+        if ca_id is not None:
+            data.update({"CaId": ca_id})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return True
+        return response.json()
+
+    def ex_read_certificate_authorities(
+        self,
+        ca_fingerprints: List[str] = None,
+        ca_ids: List[str] = None,
+        descriptions: List[str] = None,
+        dry_run: bool = False
+    ):
+        """
+        Returns information about one or more of your Client Certificate
+        Authorities (CAs).
+
+        :param      ca_fingerprints: The fingerprints of the CAs.
+        :type       ca_fingerprints: ``list`` of ``str``
+
+        :param      ca_ids: The IDs of the CAs.
+        :type       ca_ids: ``list`` of ``str``
+
+        :param      descriptions: The descriptions of the CAs.
+        :type       descriptions: ``list`` of ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "ReadCas"
+        data = {"DryRun": dry_run, "Filters": {}}
+        if ca_fingerprints is not None:
+            data["Filters"].update({"CaFingerprints": ca_fingerprints})
+        if ca_ids is not None:
+            data["Filters"].update({"CaIds": ca_ids})
+        if descriptions is not None:
+            data["Filters"].update({"Descriptions": descriptions})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return response.json()["Cas"]
+        return response.json()
+
+    def ex_update_certificate_authority(
+        self,
+        ca_id: str = None,

Review comment:
       Same here, required argument should not default to None.

##########
File path: libcloud/compute/drivers/outscale.py
##########
@@ -7709,6 +7709,318 @@ def ex_list_vpn_connections(
             return response.json()["VpnConnections"]
         return response.json()
 
+    def ex_create_certificate_authority(
+        self,
+        ca_perm: str = None,
+        description: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Creates a Client Certificate Authority (CA).
+
+        :param      ca_perm: The CA in PEM format. (required)
+        :type       ca_perm: ``str``
+
+        :param      description: The description of the CA.
+        :type       description: ``bool``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "CreateCa"
+        data = {"DryRun": dry_run}
+        if ca_perm is not None:
+            data.update({"CaPerm": ca_perm})
+        if description is not None:
+            data.update({"Description": description})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return response.json()["Ca"]
+        return response.json()
+
+    def ex_delete_certificate_authority(
+        self,
+        ca_id: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Deletes a specified Client Certificate Authority (CA).
+
+        :param      ca_id: The ID of the CA you want to delete. (required)
+        :type       ca_id: ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "DeleteCa"
+        data = {"DryRun": dry_run}
+        if ca_id is not None:
+            data.update({"CaId": ca_id})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return True
+        return response.json()
+
+    def ex_read_certificate_authorities(
+        self,
+        ca_fingerprints: List[str] = None,
+        ca_ids: List[str] = None,
+        descriptions: List[str] = None,
+        dry_run: bool = False
+    ):
+        """
+        Returns information about one or more of your Client Certificate
+        Authorities (CAs).
+
+        :param      ca_fingerprints: The fingerprints of the CAs.
+        :type       ca_fingerprints: ``list`` of ``str``
+
+        :param      ca_ids: The IDs of the CAs.
+        :type       ca_ids: ``list`` of ``str``
+
+        :param      descriptions: The descriptions of the CAs.
+        :type       descriptions: ``list`` of ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "ReadCas"
+        data = {"DryRun": dry_run, "Filters": {}}
+        if ca_fingerprints is not None:
+            data["Filters"].update({"CaFingerprints": ca_fingerprints})
+        if ca_ids is not None:
+            data["Filters"].update({"CaIds": ca_ids})
+        if descriptions is not None:
+            data["Filters"].update({"Descriptions": descriptions})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return response.json()["Cas"]
+        return response.json()
+
+    def ex_update_certificate_authority(
+        self,
+        ca_id: str = None,
+        description: str = None,
+        dry_run: bool = False
+    ):
+        """
+        Modifies the specified attribute of a Client Certificate Authority
+        (CA).
+
+        :param      ca_id: The ID of the CA. (required)
+        :type       ca_id: ``str``
+
+        :param      description: The description of the CA.
+        :type       description: ``str``
+
+        :param      dry_run: If true, checks whether you have the required
+        permissions to perform the action.
+        :type       dry_run: ``bool``
+        """
+        action = "UpdateCa"
+        data = {"DryRun": dry_run}
+        if ca_id is not None:
+            data.update({"CaId": ca_id})
+        if description is not None:
+            data.update({"Description": description})
+        response = self._call_api(action, json.dumps(data))
+        if response.status_code == 200:
+            return response.json()["Ca"]
+        return response.json()
+
+    def ex_create_api_access_rule(
+        self,
+        description: str = None,
+        ip_ranges: List[str] = None,
+        ca_ids: List[str] = None,
+        cns: List[str] = None,
+        dry_run: bool = False,
+    ):
+        """
+        Create an API access rule.
+        It is a rule to allow access to the API from your account.
+        You need to specify at least the CaIds or the IpRanges parameter.

Review comment:
       Please remove default None value for required arguments.




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

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



Mime
View raw message