diff --git a/tempest/api/telemetry/base.py b/tempest/api/telemetry/base.py
index 1f661a6..c4614c6 100644
--- a/tempest/api/telemetry/base.py
+++ b/tempest/api/telemetry/base.py
@@ -10,7 +10,9 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from tempest.common.utils import data_utils
 from tempest import config
+from tempest import exceptions
 import tempest.test
 
 CONF = config.CONF
@@ -22,6 +24,28 @@
 
     @classmethod
     def setUpClass(cls):
-        super(BaseTelemetryTest, cls).setUpClass()
         if not CONF.service_available.ceilometer:
             raise cls.skipException("Ceilometer support is required")
+        super(BaseTelemetryTest, cls).setUpClass()
+        os = cls.get_client_manager()
+        cls.telemetry_client = os.telemetry_client
+        cls.alarm_ids = []
+
+    @classmethod
+    def create_alarm(cls, **kwargs):
+        resp, body = cls.telemetry_client.create_alarm(
+            name=data_utils.rand_name('telemetry_alarm'),
+            type='threshold', **kwargs)
+        if resp['status'] == '201':
+            cls.alarm_ids.append(body['alarm_id'])
+        return resp, body
+
+    @classmethod
+    def tearDownClass(cls):
+        for alarm_id in cls.alarm_ids:
+            try:
+                cls.telemetry_client.delete_alarm(alarm_id)
+            except exceptions.NotFound:
+                pass
+        cls.clear_isolated_creds()
+        super(BaseTelemetryTest, cls).tearDownClass()
diff --git a/tempest/api/telemetry/test_telemetry_alarming_api.py b/tempest/api/telemetry/test_telemetry_alarming_api.py
new file mode 100644
index 0000000..907d3d0
--- /dev/null
+++ b/tempest/api/telemetry/test_telemetry_alarming_api.py
@@ -0,0 +1,43 @@
+#    Licensed 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.
+
+from tempest.api.telemetry import base
+from tempest import exceptions
+from tempest.test import attr
+
+
+class TelemetryAlarmingAPITestJSON(base.BaseTelemetryTest):
+    _interface = 'json'
+
+    @attr(type="gate")
+    def test_alarm_list(self):
+        resp, _ = self.telemetry_client.list_alarms()
+        self.assertEqual(int(resp['status']), 200)
+
+    @attr(type="gate")
+    def test_create_alarm(self):
+        rules = {'meter_name': 'cpu_util',
+                 'comparison_operator': 'gt',
+                 'threshold': 80.0,
+                 'period': 70}
+        resp, body = self.create_alarm(threshold_rule=rules)
+        self.alarm_id = body['alarm_id']
+        self.assertEqual(int(resp['status']), 201)
+        self.assertDictContainsSubset(rules, body['threshold_rule'])
+        resp, body = self.telemetry_client.get_alarm(self.alarm_id)
+        self.assertEqual(int(resp['status']), 200)
+        self.assertDictContainsSubset(rules, body['threshold_rule'])
+        resp, _ = self.telemetry_client.delete_alarm(self.alarm_id)
+        self.assertEqual(int(resp['status']), 204)
+        self.assertRaises(exceptions.NotFound,
+                          self.telemetry_client.get_alarm,
+                          self.alarm_id)
diff --git a/tempest/services/telemetry/json/telemetry_client.py b/tempest/services/telemetry/json/telemetry_client.py
index 747d7c1..e666475 100644
--- a/tempest/services/telemetry/json/telemetry_client.py
+++ b/tempest/services/telemetry/json/telemetry_client.py
@@ -29,10 +29,6 @@
     def serialize(self, body):
         return json.dumps(body)
 
-    def create_alarm(self, **kwargs):
-        uri = "%s/alarms" % self.uri_prefix
-        return self.post(uri, kwargs)
-
     def add_sample(self, sample_list, meter_name, meter_unit, volume,
                    sample_type, resource_id, **kwargs):
         sample = {"counter_name": meter_name, "counter_unit": meter_unit,
diff --git a/tempest/services/telemetry/telemetry_client_base.py b/tempest/services/telemetry/telemetry_client_base.py
index 200c94a..a35a1ab 100644
--- a/tempest/services/telemetry/telemetry_client_base.py
+++ b/tempest/services/telemetry/telemetry_client_base.py
@@ -77,7 +77,7 @@
         return self.rest_client.put(uri, body, self.headers)
 
     def get(self, uri):
-        resp, body = self.rest_client.get(uri)
+        resp, body = self.rest_client.get(uri, self.headers)
         body = self.deserialize(body)
         return resp, body
 
@@ -124,9 +124,13 @@
         return self.get(uri)
 
     def get_alarm(self, alarm_id):
-        uri = '%s/meter/%s' % (self.uri_prefix, alarm_id)
+        uri = '%s/alarms/%s' % (self.uri_prefix, alarm_id)
         return self.get(uri)
 
     def delete_alarm(self, alarm_id):
         uri = "%s/alarms/%s" % (self.uri_prefix, alarm_id)
         return self.delete(uri)
+
+    def create_alarm(self, **kwargs):
+        uri = "%s/alarms" % self.uri_prefix
+        return self.post(uri, kwargs)
