blob: aad20a47865d9f45681802da7e820d6537885503 [file] [log] [blame]
ivan-zhud57f3cf2013-11-06 16:59:52 +08001# Copyright 2013 IBM Corp
2# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
16
17from tempest.common.rest_client import RestClientXML
Matthew Treinish684d8992014-01-30 16:27:40 +000018from tempest import config
19
20CONF = config.CONF
ivan-zhud57f3cf2013-11-06 16:59:52 +080021
22
23class CertificatesClientXML(RestClientXML):
24
Andrea Frittoli8bbdb162014-01-06 11:06:13 +000025 def __init__(self, auth_provider):
26 super(CertificatesClientXML, self).__init__(auth_provider)
Matthew Treinish684d8992014-01-30 16:27:40 +000027 self.service = CONF.compute.catalog_type
ivan-zhud57f3cf2013-11-06 16:59:52 +080028
29 def get_certificate(self, id):
30 url = "os-certificates/%s" % (id)
31 resp, body = self.get(url, self.headers)
32 body = self._parse_resp(body)
33 return resp, body
34
35 def create_certificate(self):
36 """create certificates."""
37 url = "os-certificates"
38 resp, body = self.post(url, None, self.headers)
39 body = self._parse_resp(body)
40 return resp, body