You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2014/11/25 13:00:34 UTC

[1/3] libcloud git commit: Allow user to specify which version of SSL protocol to use by setting libcloud.security.SSL_VERSION variable (we still default to ssl.PROTOCOL_TLSv1).

Repository: libcloud
Updated Branches:
  refs/heads/trunk 43cec4eb3 -> ec4ac702f


Allow user to specify which version of SSL protocol to use by setting
libcloud.security.SSL_VERSION variable (we still default to
ssl.PROTOCOL_TLSv1).


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/c3ad78b5
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/c3ad78b5
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/c3ad78b5

Branch: refs/heads/trunk
Commit: c3ad78b55963f5b34a0a805fb74294ba8e6854e3
Parents: c0f0de7
Author: Tomaz Muraus <to...@apache.org>
Authored: Sat Nov 22 15:10:26 2014 +0800
Committer: Tomaz Muraus <to...@apache.org>
Committed: Sat Nov 22 15:11:01 2014 +0800

----------------------------------------------------------------------
 libcloud/httplib_ssl.py | 2 +-
 libcloud/security.py    | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/c3ad78b5/libcloud/httplib_ssl.py
----------------------------------------------------------------------
diff --git a/libcloud/httplib_ssl.py b/libcloud/httplib_ssl.py
index 00eef93..bb569fb 100644
--- a/libcloud/httplib_ssl.py
+++ b/libcloud/httplib_ssl.py
@@ -277,7 +277,7 @@ class LibcloudHTTPSConnection(httplib.HTTPSConnection, LibcloudBaseConnection):
                                     self.cert_file,
                                     cert_reqs=ssl.CERT_REQUIRED,
                                     ca_certs=self.ca_cert,
-                                    ssl_version=ssl.PROTOCOL_TLSv1)
+                                    ssl_version=libcloud.security.SSL_VERSION)
         cert = self.sock.getpeercert()
         try:
             match_hostname(cert, self.host)

http://git-wip-us.apache.org/repos/asf/libcloud/blob/c3ad78b5/libcloud/security.py
----------------------------------------------------------------------
diff --git a/libcloud/security.py b/libcloud/security.py
index 81d7a51..4d024db 100644
--- a/libcloud/security.py
+++ b/libcloud/security.py
@@ -24,9 +24,18 @@ Usage:
 """
 
 import os
+import ssl
+
+__all__ = [
+    'VERIFY_SSL_CERT',
+    'SSL_VERSION',
+    'CA_CERTS_PATH'
+]
 
 VERIFY_SSL_CERT = True
 
+SSL_VERSION = ssl.PROTOCOL_TLSv1
+
 # File containing one or more PEM-encoded CA certificates
 # concatenated together.
 CA_CERTS_PATH = [


[2/3] libcloud git commit: Merge branch 'trunk' of https://git-wip-us.apache.org/repos/asf/libcloud into trunk

Posted by to...@apache.org.
Merge branch 'trunk' of https://git-wip-us.apache.org/repos/asf/libcloud into trunk


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/b5b6a174
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/b5b6a174
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/b5b6a174

Branch: refs/heads/trunk
Commit: b5b6a17451f1867139cf2f11e8f9dd19341e7499
Parents: c3ad78b 43cec4e
Author: Tomaz Muraus <to...@apache.org>
Authored: Mon Nov 24 13:49:44 2014 +0800
Committer: Tomaz Muraus <to...@apache.org>
Committed: Mon Nov 24 13:49:44 2014 +0800

----------------------------------------------------------------------
 CHANGES.rst                                     |  8 ++
 libcloud/compute/drivers/gce.py                 | 95 ++++++++++++++++----
 .../projects_debian-cloud_global_images.json    |  8 +-
 libcloud/test/compute/test_gce.py               | 19 +++-
 4 files changed, 110 insertions(+), 20 deletions(-)
----------------------------------------------------------------------



[3/3] libcloud git commit: Global IP addresses handling in the GCE driver.

Posted by to...@apache.org.
Global IP addresses handling in the GCE driver.

Closes #394

Signed-off-by: Tomaz Muraus <to...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/ec4ac702
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/ec4ac702
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/ec4ac702

Branch: refs/heads/trunk
Commit: ec4ac702f3c98567da481928fff4cddd30ebde39
Parents: b5b6a17
Author: Eric Johnson <er...@google.com>
Authored: Wed Nov 19 18:48:16 2014 +0000
Committer: Tomaz Muraus <to...@apache.org>
Committed: Tue Nov 25 19:56:23 2014 +0800

----------------------------------------------------------------------
 CHANGES.rst                                     |  4 ++
 libcloud/compute/drivers/gce.py                 | 46 +++++++++++-----
 .../fixtures/gce/aggregated_addresses.json      | 16 +++++-
 .../compute/fixtures/gce/global_addresses.json  | 17 ++++++
 .../gce/global_addresses_lcaddressglobal.json   | 10 ++++
 ...global_addresses_lcaddressglobal_delete.json | 14 +++++
 .../fixtures/gce/global_addresses_post.json     | 13 +++++
 ...global_addresses_lcaddressglobal_delete.json | 14 +++++
 ...rations_operation_global_addresses_post.json | 14 +++++
 libcloud/test/compute/test_gce.py               | 55 +++++++++++++++++++-
 10 files changed, 187 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/ec4ac702/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index 943f714..aa565fc 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -53,6 +53,10 @@ Compute
   (GITHUB-395)
   [Eric Johnson]
 
+- GCE: Support for global IP addresses.
+  (GITHUB-390, GITHUB-394)
+  [Eric Johnson]
+
 Changes with Apache Libcloud 0.16.0
 -----------------------------------
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/ec4ac702/libcloud/compute/drivers/gce.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py
index 065075a..a6ba961 100644
--- a/libcloud/compute/drivers/gce.py
+++ b/libcloud/compute/drivers/gce.py
@@ -97,8 +97,9 @@ class GCEAddress(UuidMixin):
         return self.driver.ex_destroy_address(address=self)
 
     def __repr__(self):
-        return '<GCEAddress id="%s" name="%s" address="%s">' % (
-            self.id, self.name, self.address)
+        return '<GCEAddress id="%s" name="%s" address="%s" region="%s">' % (
+            self.id, self.name, self.address,
+            (hasattr(self.region, "name") and self.region.name or self.region))
 
 
 class GCEFailedDisk(object):
@@ -634,21 +635,25 @@ class GCENodeDriver(NodeDriver):
 
     def ex_list_addresses(self, region=None):
         """
-        Return a list of static addresses for a region or all.
+        Return a list of static addresses for a region, 'global', or all.
 
         :keyword  region: The region to return addresses from. For example:
                           'us-central1'.  If None, will return addresses from
                           region of self.zone.  If 'all', will return all
-                          addresses.
+                          addresses. If 'global', it will return addresses in
+                          the global namespace.
         :type     region: ``str`` or ``None``
 
         :return: A list of static address objects.
         :rtype: ``list`` of :class:`GCEAddress`
         """
         list_addresses = []
-        region = self._set_region(region)
+        if region != 'global':
+            region = self._set_region(region)
         if region is None:
             request = '/aggregated/addresses'
+        elif region == 'global':
+            request = '/global/addresses'
         else:
             request = '/regions/%s/addresses' % (region.name)
         response = self.connection.request(request, method='GET').object
@@ -958,12 +963,13 @@ class GCENodeDriver(NodeDriver):
     def ex_create_address(self, name, region=None, address=None,
                           description=None):
         """
-        Create a static address in a region.
+        Create a static address in a region, or a global address.
 
         :param  name: Name of static address
         :type   name: ``str``
 
         :keyword  region: Name of region for the address (e.g. 'us-central1')
+                          Use 'global' to create a global address.
         :type     region: ``str`` or :class:`GCERegion`
 
         :keyword  address: Ephemeral IP address to promote to a static one
@@ -977,7 +983,7 @@ class GCENodeDriver(NodeDriver):
         :rtype:   :class:`GCEAddress`
         """
         region = region or self.region
-        if not hasattr(region, 'name'):
+        if region != 'global' and not hasattr(region, 'name'):
             region = self.ex_get_region(region)
         elif region is None:
             raise ValueError('REGION_NOT_SPECIFIED',
@@ -987,7 +993,10 @@ class GCENodeDriver(NodeDriver):
             address_data['address'] = address
         if description:
             address_data['description'] = description
-        request = '/regions/%s/addresses' % (region.name)
+        if region == 'global':
+            request = '/global/addresses'
+        else:
+            request = '/regions/%s/addresses' % (region.name)
         self.connection.async_request(request, method='POST',
                                       data=address_data)
         return self.ex_get_address(name, region=region)
@@ -2181,8 +2190,11 @@ class GCENodeDriver(NodeDriver):
         if not hasattr(address, 'name'):
             address = self.ex_get_address(address)
 
-        request = '/regions/%s/addresses/%s' % (address.region.name,
-                                                address.name)
+        if hasattr(address.region, 'name'):
+            request = '/regions/%s/addresses/%s' % (address.region.name,
+                                                    address.name)
+        else:
+            request = '/global/addresses/%s' % (address.name)
 
         self.connection.async_request(request, method='DELETE')
         return True
@@ -2522,9 +2534,12 @@ class GCENodeDriver(NodeDriver):
         :return:  An Address object for the address
         :rtype:   :class:`GCEAddress`
         """
-        region = self._set_region(region) or self._find_zone_or_region(
-            name, 'addresses', region=True, res_name='Address')
-        request = '/regions/%s/addresses/%s' % (region.name, name)
+        if region == 'global':
+            request = '/global/addresses/%s' % (name)
+        else:
+            region = self._set_region(region) or self._find_zone_or_region(
+                name, 'addresses', region=True, res_name='Address')
+            request = '/regions/%s/addresses/%s' % (region.name, name)
         response = self.connection.request(request, method='GET').object
         return self._to_address(response)
 
@@ -3344,7 +3359,10 @@ class GCENodeDriver(NodeDriver):
         """
         extra = {}
 
-        region = self.ex_get_region(address['region'])
+        if 'region' in address:
+            region = self.ex_get_region(address['region'])
+        else:
+            region = 'global'
 
         extra['selfLink'] = address.get('selfLink')
         extra['status'] = address.get('status')

http://git-wip-us.apache.org/repos/asf/libcloud/blob/ec4ac702/libcloud/test/compute/fixtures/gce/aggregated_addresses.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/gce/aggregated_addresses.json b/libcloud/test/compute/fixtures/gce/aggregated_addresses.json
index 4bab3a2..29cb67a 100644
--- a/libcloud/test/compute/fixtures/gce/aggregated_addresses.json
+++ b/libcloud/test/compute/fixtures/gce/aggregated_addresses.json
@@ -64,8 +64,22 @@
         ],
         "message": "There are no results for scope 'regions/us-central2' on this page."
       }
+    },
+    "global": {
+      "addresses": [
+        {
+          "address": "173.99.99.99",
+          "creationTimestamp": "2013-06-26T12:21:40.625-07:00",
+          "description": "",
+          "id": "01531551729918243104",
+          "kind": "compute#address",
+          "name": "lcaddressglobal",
+          "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/addresses/lcaddressglobal",
+          "status": "RESERVED"
+        }
+      ]
     }
   },
   "kind": "compute#addressAggregatedList",
   "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/aggregated/addresses"
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/ec4ac702/libcloud/test/compute/fixtures/gce/global_addresses.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/gce/global_addresses.json b/libcloud/test/compute/fixtures/gce/global_addresses.json
new file mode 100644
index 0000000..a83e093
--- /dev/null
+++ b/libcloud/test/compute/fixtures/gce/global_addresses.json
@@ -0,0 +1,17 @@
+{
+  "id": "projects/project_name/global/addresses",
+  "items": [
+    {
+      "address": "173.99.99.99",
+      "creationTimestamp": "2013-06-26T09:48:31.184-07:00",
+      "description": "",
+      "id": "17634862894218443422",
+      "kind": "compute#address",
+      "name": "lcaddressglobal",
+      "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/addresses/lcaddressglobal",
+      "status": "RESERVED"
+    }
+  ],
+  "kind": "compute#addressList",
+  "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/addresses"
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/ec4ac702/libcloud/test/compute/fixtures/gce/global_addresses_lcaddressglobal.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/gce/global_addresses_lcaddressglobal.json b/libcloud/test/compute/fixtures/gce/global_addresses_lcaddressglobal.json
new file mode 100644
index 0000000..71027de
--- /dev/null
+++ b/libcloud/test/compute/fixtures/gce/global_addresses_lcaddressglobal.json
@@ -0,0 +1,10 @@
+{
+  "address": "173.99.99.99",
+  "creationTimestamp": "2013-06-26T12:21:40.625-07:00",
+  "description": "",
+  "id": "01531551729918243104",
+  "kind": "compute#address",
+  "name": "lcaddressglobal",
+  "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/addresses/lcaddressglobal",
+  "status": "RESERVED"
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/ec4ac702/libcloud/test/compute/fixtures/gce/global_addresses_lcaddressglobal_delete.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/gce/global_addresses_lcaddressglobal_delete.json b/libcloud/test/compute/fixtures/gce/global_addresses_lcaddressglobal_delete.json
new file mode 100644
index 0000000..f0fc4c8
--- /dev/null
+++ b/libcloud/test/compute/fixtures/gce/global_addresses_lcaddressglobal_delete.json
@@ -0,0 +1,14 @@
+{
+  "id": "7128783508312083402",
+  "insertTime": "2013-06-26T12:21:44.075-07:00",
+  "kind": "compute#operation",
+  "name": "operation-global_addresses_lcaddressglobal_delete",
+  "operationType": "delete",
+  "progress": 0,
+  "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/operations/operation-global_addresses_lcaddressglobal_delete",
+  "startTime": "2013-06-26T12:21:44.110-07:00",
+  "status": "PENDING",
+  "targetId": "01531551729918243104",
+  "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/addresses/lcaddressglobal",
+  "user": "foo@developer.gserviceaccount.com"
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/ec4ac702/libcloud/test/compute/fixtures/gce/global_addresses_post.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/gce/global_addresses_post.json b/libcloud/test/compute/fixtures/gce/global_addresses_post.json
new file mode 100644
index 0000000..1683987
--- /dev/null
+++ b/libcloud/test/compute/fixtures/gce/global_addresses_post.json
@@ -0,0 +1,13 @@
+{
+  "id": "16064059851942653139",
+  "insertTime": "2013-06-26T12:21:40.299-07:00",
+  "kind": "compute#operation",
+  "name": "operation-global_addresses_post",
+  "operationType": "insert",
+  "progress": 0,
+  "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/operations/operation-global_addresses_post",
+  "startTime": "2013-06-26T12:21:40.358-07:00",
+  "status": "PENDING",
+  "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/addresses/lcaddressglobal",
+  "user": "foo@developer.gserviceaccount.com"
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/ec4ac702/libcloud/test/compute/fixtures/gce/operations_operation_global_addresses_lcaddressglobal_delete.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/gce/operations_operation_global_addresses_lcaddressglobal_delete.json b/libcloud/test/compute/fixtures/gce/operations_operation_global_addresses_lcaddressglobal_delete.json
new file mode 100644
index 0000000..9abfcaa
--- /dev/null
+++ b/libcloud/test/compute/fixtures/gce/operations_operation_global_addresses_lcaddressglobal_delete.json
@@ -0,0 +1,14 @@
+{
+  "id": "7128783508312083402",
+  "insertTime": "2013-06-26T12:21:44.075-07:00",
+  "kind": "compute#operation",
+  "name": "operation-global_addresses_lcaddressglobal_delete",
+  "operationType": "delete",
+  "progress": 100,
+  "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/operations/operation-global_addresses_lcaddressglobal_delete",
+  "startTime": "2013-06-26T12:21:44.110-07:00",
+  "status": "DONE",
+  "targetId": "01531551729918243104",
+  "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/addresses/lcaddressglobal",
+  "user": "foo@developer.gserviceaccount.com"
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/ec4ac702/libcloud/test/compute/fixtures/gce/operations_operation_global_addresses_post.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/gce/operations_operation_global_addresses_post.json b/libcloud/test/compute/fixtures/gce/operations_operation_global_addresses_post.json
new file mode 100644
index 0000000..6ee08e4
--- /dev/null
+++ b/libcloud/test/compute/fixtures/gce/operations_operation_global_addresses_post.json
@@ -0,0 +1,14 @@
+{
+  "id": "16064059851942653139",
+  "insertTime": "2013-06-26T12:21:40.299-07:00",
+  "kind": "compute#operation",
+  "name": "operation-global_addresses_post",
+  "operationType": "insert",
+  "progress": 100,
+  "selfLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/operations/operation-global_addresses_post",
+  "startTime": "2013-06-26T12:21:40.358-07:00",
+  "status": "DONE",
+  "targetId": "01531551729918243104",
+  "targetLink": "https://www.googleapis.com/compute/v1/projects/project_name/global/addresses/lcaddressglobal",
+  "user": "foo@developer.gserviceaccount.com"
+}

http://git-wip-us.apache.org/repos/asf/libcloud/blob/ec4ac702/libcloud/test/compute/test_gce.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_gce.py b/libcloud/test/compute/test_gce.py
index 05ab6fc..de91aaf 100644
--- a/libcloud/test/compute/test_gce.py
+++ b/libcloud/test/compute/test_gce.py
@@ -110,10 +110,13 @@ class GCENodeDriverTest(LibcloudTestCase, TestCaseMixin):
         address_list = self.driver.ex_list_addresses()
         address_list_all = self.driver.ex_list_addresses('all')
         address_list_uc1 = self.driver.ex_list_addresses('us-central1')
+        address_list_global = self.driver.ex_list_addresses('global')
         self.assertEqual(len(address_list), 2)
-        self.assertEqual(len(address_list_all), 4)
+        self.assertEqual(len(address_list_all), 5)
+        self.assertEqual(len(address_list_global), 1)
         self.assertEqual(address_list[0].name, 'libcloud-demo-address')
         self.assertEqual(address_list_uc1[0].name, 'libcloud-demo-address')
+        self.assertEqual(address_list_global[0].name, 'lcaddressglobal')
         names = [a.name for a in address_list_all]
         self.assertTrue('libcloud-demo-address' in names)
 
@@ -220,6 +223,13 @@ class GCENodeDriverTest(LibcloudTestCase, TestCaseMixin):
         self.assertEqual(len(zones), 5)
         self.assertEqual(zones[0].name, 'europe-west1-a')
 
+    def test_ex_create_address_global(self):
+        address_name = 'lcaddressglobal'
+        address = self.driver.ex_create_address(address_name, 'global')
+        self.assertTrue(isinstance(address, GCEAddress))
+        self.assertEqual(address.name, address_name)
+        self.assertEqual(address.region, 'global')
+
     def test_ex_create_address(self):
         address_name = 'lcaddress'
         address = self.driver.ex_create_address(address_name)
@@ -517,6 +527,13 @@ class GCENodeDriverTest(LibcloudTestCase, TestCaseMixin):
         detach = self.driver.detach_volume(volume, node)
         self.assertTrue(detach)
 
+    def test_ex_destroy_address_global(self):
+        address = self.driver.ex_get_address('lcaddressglobal', 'global')
+        self.assertTrue(address.name, 'lcaddressglobal')
+        self.assertTrue(address.region, 'global')
+        destroyed = address.destroy()
+        self.assertTrue(destroyed)
+
     def test_ex_destroy_address(self):
         address = self.driver.ex_get_address('lcaddress')
         destroyed = address.destroy()
@@ -596,6 +613,14 @@ class GCENodeDriverTest(LibcloudTestCase, TestCaseMixin):
         destroyed = snapshot.destroy()
         self.assertTrue(destroyed)
 
+    def test_ex_get_address_global(self):
+        address_name = 'lcaddressglobal'
+        address = self.driver.ex_get_address(address_name, 'global')
+        self.assertEqual(address.name, address_name)
+        self.assertEqual(address.address, '173.99.99.99')
+        self.assertEqual(address.region, 'global')
+        self.assertEqual(address.extra['status'], 'RESERVED')
+
     def test_ex_get_address(self):
         address_name = 'lcaddress'
         address = self.driver.ex_get_address(address_name)
@@ -943,12 +968,24 @@ class GCEMockHttp(MockHttpTestCase):
             'operations_operation_global_image_post.json')
         return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK])
 
+    def _global_operations_operation_global_addresses_lcaddressglobal_delete(
+            self, method, url, body, headers):
+        body = self.fixtures.load(
+            'operations_operation_global_addresses_lcaddressglobal_delete.json')
+        return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK])
+
     def _regions_us_central1_operations_operation_regions_us_central1_addresses_lcaddress_delete(
             self, method, url, body, headers):
         body = self.fixtures.load(
             'operations_operation_regions_us-central1_addresses_lcaddress_delete.json')
         return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK])
 
+    def _global_operations_operation_global_addresses_post(
+            self, method, url, body, headers):
+        body = self.fixtures.load(
+            'operations_operation_global_addresses_post.json')
+        return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK])
+
     def _regions_us_central1_operations_operation_regions_us_central1_addresses_post(
             self, method, url, body, headers):
         body = self.fixtures.load(
@@ -1100,6 +1137,14 @@ class GCEMockHttp(MockHttpTestCase):
             'regions.json')
         return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK])
 
+    def _global_addresses(self, method, url, body, headers):
+        if method == 'POST':
+            body = self.fixtures.load(
+                'global_addresses_post.json')
+        else:
+            body = self.fixtures.load('global_addresses.json')
+        return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK])
+
     def _regions_us_central1_addresses(self, method, url, body, headers):
         if method == 'POST':
             body = self.fixtures.load(
@@ -1108,6 +1153,14 @@ class GCEMockHttp(MockHttpTestCase):
             body = self.fixtures.load('regions_us-central1_addresses.json')
         return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK])
 
+    def _global_addresses_lcaddressglobal(self, method, url, body, headers):
+        if method == 'DELETE':
+            body = self.fixtures.load(
+                'global_addresses_lcaddressglobal_delete.json')
+        else:
+            body = self.fixtures.load('global_addresses_lcaddressglobal.json')
+        return (httplib.OK, body, self.json_hdr, httplib.responses[httplib.OK])
+
     def _regions_us_central1_addresses_lcaddress(self, method, url, body,
                                                  headers):
         if method == 'DELETE':