diff options
author | brunomilitzer <bruno.militzer@est.tech> | 2022-05-05 15:20:30 +0100 |
---|---|---|
committer | brunomilitzer <bruno.militzer@est.tech> | 2022-05-25 15:01:02 +0100 |
commit | f35587328e1bd99882ed8a4df85d01660d54c007 (patch) | |
tree | 668b2e35b88a24dbf60ce84d62c21c463e2c0449 /runtime/src/test | |
parent | b77b61847ddd169da9a71b05742ed51bc826f5f6 (diff) |
Added Edit Instance Properties Functionality
Issue-ID: POLICY-4094
Change-Id: Id52dba3c0912486fa551697be170c05542a0ee22
Signed-off-by: brunomilitzer <bruno.militzer@est.tech>
Diffstat (limited to 'runtime/src/test')
-rw-r--r-- | runtime/src/test/resources/http-cache/third_party_proxy.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/runtime/src/test/resources/http-cache/third_party_proxy.py b/runtime/src/test/resources/http-cache/third_party_proxy.py index 9c22f3ff5..e116c92ce 100644 --- a/runtime/src/test/resources/http-cache/third_party_proxy.py +++ b/runtime/src/test/resources/http-cache/third_party_proxy.py @@ -5,7 +5,7 @@ # ================================================================================ # Copyright (C) 2018 AT&T Intellectual Property. All rights # reserved. -# Modifications Copyright (C) 2021 Nordix Foundation. +# Modifications Copyright (C) 2021-2022 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -340,6 +340,15 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler): with open(cached_file_content, 'w+') as f: f.write(self.data_string) return True + elif (self.path.startswith("/onap/policy/clamp/acm/v2/instanceProperties")) and http_type == "PUT": + print("self.path start with PUT /onap/policy/clamp/acm/v2/instanceProperties, updating body to response ...") + if not os.path.exists(cached_file_folder): + os.makedirs(cached_file_folder, 0o777) + with open(cached_file_header, 'w+') as f: + f.write("{\"Content-Length\": \"" + str(len(self.data_string)) + "\", \"Content-Type\": \""+str(self.headers['Content-Type'])+"\"}") + with open(cached_file_content, 'w+') as f: + f.write(self.data_string) + return True elif (self.path.startswith("/onap/policy/clamp/acm/v2/instanceProperties")) and http_type == "DELETE": print("self.path start with /instanceProperties Deleting instance properties, generating response json...") jsonGenerated = "{\"errorDetails\": null,\"affectedControlLoopDefinitions\": [{ \"name\": \"PMSH_Instance1\", \"version\": \"2.3.1\" }]}" |