diff options
author | 2016-01-29 16:00:57 -0800 | |
---|---|---|
committer | 2016-01-29 16:00:57 -0800 | |
commit | 82f1a7eb5535b30a95b1e71ff18c315d40d1e6f0 (patch) | |
tree | f930c90f75846ec8d8e33cf27325ff8fafc85d5c /Testcases/vnc_api/common/rest.py | |
parent | 5c04f2e22eb6b5e7a671bc02ba53a438eb66e90d (diff) |
OpenContrail test suitestable/colorado
Change-Id: I61168093a2a05d47377ef47c8638ae1554b1a999
Signed-off-by: Stuart Mackie <wsmackie@juniper.net>
Diffstat (limited to 'Testcases/vnc_api/common/rest.py')
-rw-r--r-- | Testcases/vnc_api/common/rest.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Testcases/vnc_api/common/rest.py b/Testcases/vnc_api/common/rest.py new file mode 100644 index 0000000..7287f8d --- /dev/null +++ b/Testcases/vnc_api/common/rest.py @@ -0,0 +1,41 @@ +# +# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. +# +OP_POST = 1 +OP_GET = 2 +OP_PUT = 3 +OP_DELETE = 4 + + +def hdr_client_tenant(): + return 'X-Tenant-Name' +# end hdr_tenant_client + +# TODO transform from client value + + +def hdr_server_tenant(): + return 'HTTP_X_TENANT_NAME' +# end hdr_tenant_server + + +class LinkObject(object): + + def __init__(self, rel, base_url, uri, name): + self.rel = rel + self.base_url = base_url + self.uri = uri + self.name = name + # end __init__ + + def to_dict(self, with_url=None): + if not with_url: + url = self.base_url + else: + url = with_url + return {'rel': self.rel, + 'href': url + self.uri, + 'name': self.name} + # end to_dict + +# end class LinkObject |