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



##########
File path: libcloud/compute/drivers/outscale.py
##########
@@ -0,0 +1,1109 @@
+# 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.
+"""
+Outscale SDK
+"""
+
+import json
+
+import requests
+
+from libcloud.compute.base import NodeDriver
+from libcloud.compute.types import Provider
+from libcloud.common.osc import OSCRequestSignerAlgorithmV4
+from libcloud.common.base import ConnectionUserAndKey
+
+
+class OutscaleNodeDriver(NodeDriver):
+    """
+    Outscale SDK node driver
+    """
+
+    type = Provider.OUTSCALE
+    name = 'Outscale API'
+    website = 'http://www.outscale.com'
+
+    def __init__(self,
+                 key=None,
+                 secret=None,
+                 region='eu-west-2',
+                 service='api',
+                 version='latest'
+                 ):
+        self.key = key
+        self.secret = secret
+        self.region = region
+        self.connection = ConnectionUserAndKey(self.key, self.secret)
+        self.connection.region_name = region
+        self.connection.service_name = service
+        self.service_name = service
+        self.version = version
+
+    def list_locations(self, dry_run=False):
+        """
+        Lists available regions details.
+
+        :return: regions details
+        :rtype: ``dict``
+        """
+        action = "ReadRegions"
+        data = json.dumps({"DryRun": dry_run})
+        signer = OSCRequestSignerAlgorithmV4(access_key=self.key,
+                                             access_secret=self.secret,
+                                             version=self.version,
+                                             connection=self.connection)
+        headers = signer.get_request_headers(action=action,
+                                             data=data,
+                                             service_name=self.service_name,
+                                             region=self.region)
+        endpoint = self._get_outscale_endpoint(self.region,
+                                               self.version,
+                                               action)
+        return requests.post(endpoint, data=data, headers=headers)
+
+    def create_public_ip(self, dry_run=False):

Review comment:
       Methods which are not part of a standard Libcloud API need to be 
prefixed with ``ex_`` - so ``ex_create_public_ip``, ``ex_delete_public_ip``, 
etc.




----------------------------------------------------------------
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:
[email protected]


Reply via email to