# Path: contrail_api_cli/utils.py
# class FQName(collections.Sequence):
# 
#     def __init__(self, init=None):
#         if isinstance(init, string_types):
#             self._data = init.split(':')
#         elif isinstance(init, list):
#             self._data = init
#         elif isinstance(init, FQName):
#             self._data = init._data
#         else:
#             self._data = []
# 
#     def __getitem__(self, idx):
#         return self._data[idx]
# 
#     def __len__(self):
#         return len(self._data)
# 
#     def __eq__(self, other):
#         if isinstance(other, FQName):
#             return self._data == other._data
#         return self._data == other
# 
#     def __ne__(self, other):
#         if isinstance(other, FQName):
#             return self._data != other._data
#         return self._data != other
# 
#     def __repr__(self):
#         return repr(self._data)
# 
#     def __str__(self):
#         return ':'.join(self._data)
# 
#     def __bytes__(self):
#         return b(':'.join(self._data))
# 
#     def __lt__(self, b):
#         return len(text_type(self)) < len(text_type(b))
# 
#     def __gt__(self, b):
#         return not self.__lt__(b)
# 
# def to_json(resource_dict, cls=None):
#     return json.dumps(resource_dict,
#                       indent=2,
#                       sort_keys=True,
#                       skipkeys=True,
#                       cls=cls)


from .utils import FQName, to_json
from argparse import Namespace
from functools import wraps
from keystoneauth1 import loading
from keystoneauth1.session import Session
from keystoneauth1.exceptions.http import HttpError
import os
import platform
import requests
        """
        data = {
            'operation': 'RETRIEVE',
            'key': None
        }
        return self.post_json(self.make_url("/useragent-kv"), data)['value']

    def add_kv_store(self, key, value):
        """Add a key-value store entry.

        :param key: string
        :param value: string
        """
        data = {
            'operation': 'STORE',
            'key': key,
            'value': value
        }
        return self.post(self.make_url("/useragent-kv"), data=to_json(data),
                         headers=self.default_headers).text

    def remove_kv_store(self, key):
        """Remove a key-value store entry.

        :param key: string
        """
        data = {
            'operation': 'DELETE',
            'key': key
        }

# Path: contrail_api_cli/utils.py
# class FQName(collections.Sequence):
# 
#     def __init__(self, init=None):
#         if isinstance(init, string_types):
#             self._data = init.split(':')
#         elif isinstance(init, list):
#             self._data = init
#         elif isinstance(init, FQName):
#             self._data = init._data
#         else:
#             self._data = []
# 
#     def __getitem__(self, idx):
#         return self._data[idx]
# 
#     def __len__(self):
#         return len(self._data)
# 
#     def __eq__(self, other):
#         if isinstance(other, FQName):
#             return self._data == other._data
#         return self._data == other
# 
#     def __ne__(self, other):
#         if isinstance(other, FQName):
#             return self._data != other._data
#         return self._data != other
# 
#     def __repr__(self):
#         return repr(self._data)
# 
#     def __str__(self):
#         return ':'.join(self._data)
# 
#     def __bytes__(self):
#         return b(':'.join(self._data))
# 
#     def __lt__(self, b):
#         return len(text_type(self)) < len(text_type(b))
# 
#     def __gt__(self, b):
#         return not self.__lt__(b)
# 
# def to_json(resource_dict, cls=None):
#     return json.dumps(resource_dict,
#                       indent=2,
#                       sort_keys=True,
#                       skipkeys=True,
#                       cls=cls)


# Path: contrail_api_cli/client.py
from .utils import FQName, to_json
from argparse import Namespace
from functools import wraps
from keystoneauth1 import loading
from keystoneauth1.session import Session
from keystoneauth1.exceptions.http import HttpError
import os
import platform
import requests

        """
        data = {
            'operation': 'RETRIEVE',
            'key': None
        }
        return self.post_json(self.make_url("/useragent-kv"), data)['value']

    def add_kv_store(self, key, value):
        """Add a key-value store entry.

        :param key: string
        :param value: string
        """
        data = {
            'operation': 'STORE',
            'key': key,
            'value': value
        }
        return self.post(self.make_url("/useragent-kv"), data=to_json(data),
                         headers=self.default_headers).text

    def remove_kv_store(self, key):
        """Remove a key-value store entry.

        :param key: string
        """
        data = {
            'operation': 'DELETE',
            'key': key
        }

        return self.post(self.make_url("/useragent-kv"), data=to_json(data),