blob: 99dc337f783102acd769f8b1104796fc71803c77 [file] [log] [blame]
ivan-zhu566fc3d2013-12-17 16:03:50 +08001# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2013 IBM Corp
4# All Rights Reserved.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
17
18
19from tempest.common.rest_client import RestClientXML
20
21
ivan-zhu0e062922013-12-17 16:14:12 +080022class CertificatesV3ClientXML(RestClientXML):
ivan-zhu566fc3d2013-12-17 16:03:50 +080023
24 def __init__(self, config, username, password, auth_url, tenant_name=None):
ivan-zhu0e062922013-12-17 16:14:12 +080025 super(CertificatesV3ClientXML, self).__init__(config, username,
26 password,
27 auth_url, tenant_name)
28 self.service = self.config.compute.catalog_v3_type
ivan-zhu566fc3d2013-12-17 16:03:50 +080029
30 def get_certificate(self, id):
31 url = "os-certificates/%s" % (id)
32 resp, body = self.get(url, self.headers)
33 body = self._parse_resp(body)
34 return resp, body
35
36 def create_certificate(self):
37 """create certificates."""
38 url = "os-certificates"
39 resp, body = self.post(url, None, self.headers)
40 body = self._parse_resp(body)
41 return resp, body