aboutsummaryrefslogtreecommitdiffstats
path: root/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIFilterServiceInstanceById.java
blob: 5fca9f392df2892a9b1872af5208497d20d104dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package org.onap.simulator.presetGenerator.presets.aai;

import com.google.common.collect.ImmutableMap;

import java.util.Collections;
import java.util.List;
import java.util.Map;

public class PresetAAIFilterServiceInstanceById extends PresetAAIBaseSearchNodeQuery {

    private String subscriberId;
    private String serviceType;
    private String serviceInstanceId;

    public PresetAAIFilterServiceInstanceById(String subscriberId, String serviceType, String serviceInstanceId) {
        this.subscriberId = subscriberId;
        this.serviceType = serviceType;
        this.serviceInstanceId = serviceInstanceId;
    }

    @Override
    public Map<String, List> getQueryParams() {
        return ImmutableMap.of("search-node-type", Collections.singletonList("service-instance"),
                "filter", Collections.singletonList("service-instance-id:EQUALS:" + this.serviceInstanceId));
    }

    @Override
    public Object getResponseBody() {
        return "" +
                "{" +
                 "\"result-data\": [\n" +
                "        {\n" +
                "          \"resource-type\": \"service-instance\",\n" +
                "          \"resource-link\": \"/aai/v11/business/customers/customer/" + this.subscriberId + "/service-subscriptions/service-subscription/" + this.serviceType + "/service-instances/service-instance/" + this.serviceInstanceId + "\"\n" +
                "        }\n" +
                "    ]" +
                "}";
    }
}