diff options
author | stark, steven <steven.stark@att.com> | 2021-01-04 11:40:12 -0800 |
---|---|---|
committer | stark, steven <steven.stark@att.com> | 2021-01-04 11:40:12 -0800 |
commit | 76144a9a772f50cb3ec80757d9f1c1ec119eee6a (patch) | |
tree | 72fdaa300f09c5aeaa7fc7eac0ab80b173e522ae /onap-client/onap_client/sdc/vsp.py | |
parent | e618989d37d8b786b5b0a9f2fa42bafa32475eed (diff) |
[VVP] ONAP client performance improvement
First of multiple performance patches.
Adding ability to cache data for use by the onap-client.
Changing API call for SDC to get VF and Service models.
Previously to find a service model, onap-client queried
for all models and then searched by name. New api call
to query by name, then find latest version.
Issue-ID: VVP-503
Signed-off-by: stark, steven <steven.stark@att.com>
Change-Id: I071cadbe52163f0b375bc81ac4a9fd640bd5ca4a
Diffstat (limited to 'onap-client/onap_client/sdc/vsp.py')
-rw-r--r-- | onap-client/onap_client/sdc/vsp.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/onap-client/onap_client/sdc/vsp.py b/onap-client/onap_client/sdc/vsp.py index 3a8dcde..100fca0 100644 --- a/onap-client/onap_client/sdc/vsp.py +++ b/onap-client/onap_client/sdc/vsp.py @@ -124,6 +124,9 @@ class VSP(Resource): vsp = self.oc.sdc.vsp.get_software_product(**self.attributes) self.attributes["tosca"] = vsp.response_data + self.oc.cache("vsp", self.software_product_name, "tosca", self.tosca) + self.oc.cache("vsp", self.software_product_name, "owner", self.owner) + def _output(self): return self.tosca @@ -136,14 +139,16 @@ def update_vsp(existing_vsp, vsp_input, oc=None): existing_vsp_version_id = existing_vsp.get("version") if get_vsp_version_id(existing_vsp_id, search_key="status", oc=oc) == "Certified": - oc.sdc.vsp.update_software_product( + response_data = oc.sdc.vsp.update_software_product( software_product_id=existing_vsp_id, software_product_version_id=existing_vsp_version_id, description=vsp_input.get("update_message", "New VSP Version") - ) + ).response_data + oc.cache("vsp", existing_vsp.get("name"), "csar_version", response_data.get("name")) + existing_vsp_version_id = response_data.get("id") vsp_input["software_product_id"] = existing_vsp_id - vsp_input["software_product_version_id"] = get_vsp_version_id(existing_vsp_id, oc=oc) + vsp_input["software_product_version_id"] = existing_vsp_version_id oc.sdc.vsp.upload_heat_package(**vsp_input) oc.sdc.vsp.validate_software_product(**vsp_input) |