1 package org.onap.simulator.presetGenerator.presets.aai;
3 import com.google.common.collect.ImmutableMap;
4 import java.util.Collections;
8 import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset;
9 import org.springframework.http.HttpMethod;
11 public class PresetAAIGetModelsByProject extends BaseAAIPreset {
12 private String projectName;
13 private String serviceInstanceId;
15 public PresetAAIGetModelsByProject(String projectName) {
16 this.projectName = projectName;
17 ImmutableMap servicesPerProject = ImmutableMap.of ("x1","7e4f8130-5dee-47c4-8770-1abc5f5ded83",
18 "yyy1","13695dfb-db99-4c2f-905e-fe7bf2fc7b9f");
19 this.serviceInstanceId = (servicesPerProject.containsKey(projectName)) ? servicesPerProject.get(projectName).toString(): UUID.randomUUID().toString();
23 public HttpMethod getReqMethod() {
24 return HttpMethod.GET;
28 public String getReqPath() {
29 return getRootPath() + "/business/projects";
33 public Map<String, List> getQueryParams() {
34 return ImmutableMap.of(
35 "project-name", Collections.singletonList(projectName)
40 public Object getResponseBody() {
44 " \"project-name\": \"" + projectName + "\"," +
45 " \"resource-version\": \"1527026201826\"," +
46 " \"relationship-list\": {" +
47 " \"relationship\": [" +
49 " \"related-to\": \"service-instance\"," +
50 " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," +
51 " \"related-link\": \"/aai/v12/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/Emanuel/service-instances/service-instance/3f826016-3ac9-4928-9561-beee75fd91d5\"," +
52 " \"relationship-data\": [" +
54 " \"relationship-key\": \"customer.global-customer-id\"," +
55 " \"relationship-value\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"" +
58 " \"relationship-key\": \"service-subscription.service-type\"," +
59 " \"relationship-value\": \"Emanuel\"" +
62 " \"relationship-key\": \"service-instance.service-instance-id\"," +
63 " \"relationship-value\": \"3f826016-3ac9-4928-9561-beee75fd91d5\"" +
66 " \"related-to-property\": [" +
68 " \"property-key\": \"service-instance.service-instance-name\"," +
69 " \"property-value\": \"Lital_SRIOV2_001\"" +
74 " \"related-to\": \"service-instance\"," +
75 " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," +
76 " \"related-link\": \"/aai/v12/business/customers/customer/DHV1707-TestSubscriber-2/service-subscriptions/service-subscription/HNGATEWAY/service-instances/service-instance/45713f81-04b8-4fd0-b824-64536d493984\"," +
77 " \"relationship-data\": [" +
79 " \"relationship-key\": \"customer.global-customer-id\"," +
80 " \"relationship-value\": \"DHV1707-TestSubscriber-2\"" +
83 " \"relationship-key\": \"service-subscription.service-type\"," +
84 " \"relationship-value\": \"HNGATEWAY\"" +
87 " \"relationship-key\": \"service-instance.service-instance-id\"," +
88 " \"relationship-value\": \"45713f81-04b8-4fd0-b824-64536d493984\"" +
91 " \"related-to-property\": [" +
93 " \"property-key\": \"service-instance.service-instance-name\"," +
94 " \"property-value\": \"kkkk\"" +
99 " \"related-to\": \"service-instance\"," +
100 " \"relationship-label\": \"org.onap.relationships.inventory.BelongsTo\"," +
101 " \"related-link\": \"/aai/v12/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vMOG/service-instances/service-instance/" + serviceInstanceId + "\"," +
102 " \"relationship-data\": [" +
104 " \"relationship-key\": \"customer.global-customer-id\"," +
105 " \"relationship-value\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"" +
108 " \"relationship-key\": \"service-subscription.service-type\"," +
109 " \"relationship-value\": \"vMOG\"" +
112 " \"relationship-key\": \"service-instance.service-instance-id\"," +
113 " \"relationship-value\": \"" + serviceInstanceId + "\"" +
116 " \"related-to-property\": [" +
118 " \"property-key\": \"service-instance.service-instance-name\"," +
119 " \"property-value\": \"FIRSTNET_DEMO\"" +
124 " \"related-to\": \"service-instance\"," +
125 " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," +
126 " \"related-link\": \"/aai/v12/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/Emanuel/service-instances/service-instance/ff2d9326-1ef5-4760-aba0-0eaf372ae675\"," +
127 " \"relationship-data\": [" +
129 " \"relationship-key\": \"customer.global-customer-id\"," +
130 " \"relationship-value\": \"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\"" +
133 " \"relationship-key\": \"service-subscription.service-type\"," +
134 " \"relationship-value\": \"Emanuel\"" +
137 " \"relationship-key\": \"service-instance.service-instance-id\"," +
138 " \"relationship-value\": \"ff2d9326-1ef5-4760-aba0-0eaf372ae675\"" +
141 " \"related-to-property\": [" +
143 " \"property-key\": \"service-instance.service-instance-name\"," +
144 " \"property-value\": \"VNF_INSTANCE_DEMO_THREE\"" +