2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.policy.sdnc;
22 import java.util.HashMap;
25 import org.junit.Test;
26 import org.openecomp.policy.sdnc.SDNCRequest;
27 import org.openecomp.policy.sdnc.util.Serialization;
29 public class TestDemo {
34 SDNCRequest request = new SDNCRequest();
35 request.input = new SDNCRequestInput();
36 request.input.requestHeader = new SDNCRequestHeader();
37 request.input.vnfTopolgyInformation = new SDNCVnfTopologyInformation();
38 request.input.vnfTopolgyInformation.vnfTopologyIdentifier = new SDNCVnfTopologyIdentifier();
39 request.input.vnfTopolgyInformation.vnfAssignments = new SDNCVnfAssignments();
40 request.input.requestInformation = new SDNCRequestInformation();
42 request.input.vnfTopolgyInformation.vnfTopologyIdentifier.serviceType = "my_serviceType";
43 request.input.vnfTopolgyInformation.vnfTopologyIdentifier.vnfName = "my_vnfName";
44 request.input.vnfTopolgyInformation.vnfTopologyIdentifier.vnfType = "my_vnfType";
45 request.input.vnfTopolgyInformation.vnfTopologyIdentifier.genericVnfName = "my_genericVnfName";
46 request.input.vnfTopolgyInformation.vnfTopologyIdentifier.genericVnfType = "my_genericVnfType";
48 request.input.vnfTopolgyInformation.vnfAssignments.availabilityZones.add("zone1");
49 request.input.vnfTopolgyInformation.vnfAssignments.availabilityZones.add("zone2");
50 request.input.vnfTopolgyInformation.vnfAssignments.vnfNetworks.add("network1");
51 request.input.vnfTopolgyInformation.vnfAssignments.vnfNetworks.add("network2");
52 request.input.vnfTopolgyInformation.vnfAssignments.vnfVms.add("vnfVm1");
53 request.input.vnfTopolgyInformation.vnfAssignments.vnfVms.add("vnfVm2");
55 Map<String, String> vnfParams1 = new HashMap<String, String>();
56 vnfParams1.put("name1", "value1");
57 request.input.vnfTopolgyInformation.vnfParameters.add(vnfParams1);
59 Map<String, String> vnfParams2 = new HashMap<String, String>();
60 vnfParams2.put("name2", "value2");
61 request.input.vnfTopolgyInformation.vnfParameters.add(vnfParams2);
64 request.input.requestInformation.requestId = "ff5256d1-5a33-55df-13ab-12abad84e7ff";
65 request.input.requestInformation.orderNumber = "1";
66 request.input.requestInformation.orderVersion = "1";
67 request.input.requestInformation.notificationUrl = "sdnc.myDomain.com";
68 request.input.requestInformation.requestAction = "PreloadVNFRequest";
70 request.input.requestHeader.svcRequestId = "ff5256d1-5a33-55df-13ab-12abad84e7ff";
71 request.input.requestHeader.svcNotificationUrl = "some_url.myDomain.com:8080";
72 request.input.requestHeader.svcAction = "reserve";
74 String body = Serialization.gsonPretty.toJson(request);
75 System.out.println(body);