diff options
author | Kiran Kamineni <kiran.k.kamineni@intel.com> | 2018-09-17 12:52:01 -0700 |
---|---|---|
committer | Girish Havaldar <hg0071052@techmahindra.com> | 2018-09-18 03:32:00 +0000 |
commit | 8937d330c4d5eed863a4083627eba797f8325b1b (patch) | |
tree | 71bd1b41ca87a350359ce3351fbdf01183711557 /sms-client/python | |
parent | a33fe5704dddd5018c131677f114c0952ff47d86 (diff) |
Update client to reflect server changes
Update client to reflect name based URL changes in server
Issue-ID: AAF-494
Change-Id: I320e8f539b50a0666e12588bf1c1cbc9e54deb52
Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'sms-client/python')
-rw-r--r-- | sms-client/python/onapsmsclient/onapsmsclient/__init__.py | 40 | ||||
-rw-r--r-- | sms-client/python/onapsmsclient/setup.py | 2 |
2 files changed, 21 insertions, 21 deletions
diff --git a/sms-client/python/onapsmsclient/onapsmsclient/__init__.py b/sms-client/python/onapsmsclient/onapsmsclient/__init__.py index 69900c7..7f5beb1 100644 --- a/sms-client/python/onapsmsclient/onapsmsclient/__init__.py +++ b/sms-client/python/onapsmsclient/onapsmsclient/__init__.py @@ -158,45 +158,45 @@ class Client(object): response = self._request('post', url, json=data) return response.json()['uuid'] - def deleteDomain(self, domainUUID): + def deleteDomain(self, domainName): """Deletes a Secret Domain Args: - domainUUID (str): UUID of the secret domain to delete + domainName (str): Name of the secret domain to delete Returns: bool: True. An exception will be raised if delete failed. """ - domainUUID = domainUUID.strip() - url = self._urlJoin(self._base_api_url, 'domain', domainUUID) + domainName = domainName.strip() + url = self._urlJoin(self._base_api_url, 'domain', domainName) self._request('delete', url) return True - def getSecretNames(self, domainUUID): + def getSecretNames(self, domainName): """Get all Secret Names in Domain Args: - domainUUID (str): UUID of the secret domain + domainName (str): Name of the secret domain Returns: string[]: List of strings each corresponding to a Secret's Name in this Domain. """ - domainUUID = domainUUID.strip() - url = self._urlJoin(self._base_api_url, 'domain', domainUUID, + domainName = domainName.strip() + url = self._urlJoin(self._base_api_url, 'domain', domainName, 'secret') response = self._request('get', url) return response.json()['secretnames'] - def storeSecret(self, domainUUID, secretName, values): + def storeSecret(self, domainName, secretName, values): """Store a Secret in given Domain Args: - domainUUID (str): UUID of the secret domain + domainName (str): Name of the secret domain secretName (str): Name for the Secret values (dict): A dict containing name-value pairs which form the secret @@ -205,9 +205,9 @@ class Client(object): bool: True. An exception will be raised if store failed. """ - domainUUID = domainUUID.strip() + domainName = domainName.strip() secretName = secretName.strip() - url = self._urlJoin(self._base_api_url, 'domain', domainUUID, + url = self._urlJoin(self._base_api_url, 'domain', domainName, 'secret') if not isinstance(values, dict): @@ -217,11 +217,11 @@ class Client(object): self._request('post', url, json=data) return True - def getSecret(self, domainUUID, secretName): + def getSecret(self, domainName, secretName): """Get a particular Secret from Domain. Args: - domainUUID (str): UUID of the secret domain + domainName (str): Name of the secret domain secretName (str): Name of the secret Returns: @@ -229,28 +229,28 @@ class Client(object): which form the secret """ - domainUUID = domainUUID.strip() + domainName = domainName.strip() secretName = secretName.strip() - url = self._urlJoin(self._base_api_url, 'domain', domainUUID, + url = self._urlJoin(self._base_api_url, 'domain', domainName, 'secret', secretName) response = self._request('get', url) return response.json()['values'] - def deleteSecret(self, domainUUID, secretName): + def deleteSecret(self, domainName, secretName): """Delete a particular Secret from Domain. Args: - domainUUID (str): UUID of the secret domain + domainName (str): Name of the secret domain secretName (str): Name of the secret Returns: bool: True. An exception will be raised if delete failed. """ - domainUUID = domainUUID.strip() + domainName = domainName.strip() secretName = secretName.strip() - url = self._urlJoin(self._base_api_url, 'domain', domainUUID, + url = self._urlJoin(self._base_api_url, 'domain', domainName, 'secret', secretName) self._request('delete', url) diff --git a/sms-client/python/onapsmsclient/setup.py b/sms-client/python/onapsmsclient/setup.py index e4c2c5c..66714a2 100644 --- a/sms-client/python/onapsmsclient/setup.py +++ b/sms-client/python/onapsmsclient/setup.py @@ -23,7 +23,7 @@ setup( long_description="python-package onapsmsclient client library for using" " Secret Management Service (SMS) inside ONAP. Refer " "https://wiki.onap.org/display/DW/Secret+Management+Service for more details.", - version="0.0.3", + version="0.0.4", url="https://gerrit.onap.org/r/gitweb?p=aaf%2Fsms.git;a=summary", license="Apache 2", author="Kiran Kamineni", |