- public Mono<String> putPolicy(String nearRtRicUrl, String policyId, String policyString) {
- logger.debug("putPolicy nearRtRicUrl = {}, policyId = {}, policyString = {}", nearRtRicUrl, policyId,
- policyString);
- AsyncRestClient client = new AsyncRestClient(getBaseUrl(nearRtRicUrl));
- Mono<String> response = client.put("/policies/" + policyId, policyString);
- return response.flatMap(this::createPolicyMono);
+ public Mono<String> putPolicy(Policy policy) {
+ logger.debug("putPolicy nearRtRicUrl = {}, policyId = {}, policyString = {}", //
+ policy.ric().getConfig().baseUrl(), policy.id(), policy.json());
+ AsyncRestClient client = createClient(policy.ric().getConfig().baseUrl());
+ // TODO update when simulator is updated to include policy type
+ // Mono<String> response = client.put("/policies/" + policy.id() + "?policyTypeId=" + policy.type().name(),
+ // policy.json());
+ Mono<String> response = client.put("/policies/" + policy.id(), policy.json());
+
+ return response.flatMap(this::createMono);