2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 - 2019 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.onap.vid.model.serviceInstantiation;
23 import com.fasterxml.jackson.annotation.JsonProperty;
24 import org.onap.vid.job.JobAdapter;
25 import org.onap.vid.mso.model.ModelInfo;
27 import java.util.Collections;
28 import java.util.List;
31 public class ServiceInstantiation extends BaseResource implements JobAdapter.AsyncJobRequest {
33 private final String owningEntityId;
35 private final String owningEntityName;
37 private final String projectName;
39 private final String subscriberName;
41 private final String globalSubscriberId;
43 private final String productFamilyId;
45 private final String subscriptionServiceType;
47 private final String tenantName;
49 private final String aicZoneId;
51 private final String aicZoneName;
53 private final Map<String, Vnf> vnfs;
55 private final Map<String, Network> networks;
57 private final Map<String, InstanceGroup> vnfGroups;
59 private final boolean isPause;
61 private final int bulkSize;
63 private final String testApi;
65 private final boolean isALaCarte;
67 public ServiceInstantiation(@JsonProperty("modelInfo") ModelInfo modelInfo,
68 @JsonProperty("owningEntityId") String owningEntityId,
69 @JsonProperty("owningEntityName") String owningEntityName,
70 @JsonProperty("projectName") String projectName,
71 @JsonProperty("globalSubscriberId") String globalSubscriberId,
72 @JsonProperty("subscriberName") String subscriberName,
73 @JsonProperty("productFamilyId") String productFamilyId,
74 @JsonProperty("instanceName") String instanceName,
75 @JsonProperty("subscriptionServiceType") String subscriptionServiceType,
76 @JsonProperty("lcpCloudRegionId") String lcpCloudRegionId,
77 @JsonProperty("legacyRegion") String legacyRegion,
78 @JsonProperty("tenantId") String tenantId,
79 @JsonProperty("tenantName") String tenantName,
80 @JsonProperty("aicZoneId") String aicZoneId,
81 @JsonProperty("aicZoneName") String aicZoneName,
82 @JsonProperty("vnfs") Map<String, Vnf> vnfs,
83 @JsonProperty("networks") Map<String, Network> networks,
84 @JsonProperty("vnfGroups") Map<String, InstanceGroup> vnfGroups,
85 @JsonProperty("instanceParams") List<Map<String, String>> instanceParams,
86 @JsonProperty("pause") boolean isPause,
87 @JsonProperty("bulkSize") int bulkSize,
88 @JsonProperty("rollbackOnFailure") boolean rollbackOnFailure,
89 @JsonProperty("isALaCarte") boolean isALaCarte,
90 @JsonProperty("testApi") String testApi,
91 @JsonProperty("instanceId") String instanceId,
92 @JsonProperty("action") String action
94 super(modelInfo, instanceName, action, lcpCloudRegionId, legacyRegion, tenantId, instanceParams, rollbackOnFailure, instanceId);
95 this.owningEntityId = owningEntityId;
96 this.owningEntityName = owningEntityName;
97 this.projectName = projectName;
98 this.globalSubscriberId = globalSubscriberId;
99 this.subscriberName = subscriberName;
100 this.productFamilyId = productFamilyId;
101 this.subscriptionServiceType = subscriptionServiceType;
102 this.tenantName = tenantName;
103 this.aicZoneId = aicZoneId;
104 this.aicZoneName = aicZoneName;
106 this.networks = networks;
107 this.vnfGroups = vnfGroups;
108 this.isPause = isPause;
109 this.bulkSize = bulkSize;
110 this.isALaCarte = isALaCarte;
111 this.testApi = isALaCarte ? testApi : null;
114 public String getOwningEntityId() {
115 return owningEntityId;
118 public String getOwningEntityName() {
119 return owningEntityName;
122 public String getProjectName() {
126 public String getGlobalSubscriberId() {
127 return globalSubscriberId;
130 public String getSubscriberName() {
131 return subscriberName;
134 public String getProductFamilyId() {
135 return productFamilyId;
138 public String getSubscriptionServiceType() {
139 return subscriptionServiceType;
142 public String getTenantName() {
146 public String getAicZoneId() {
150 public String getAicZoneName() {
154 public Map<String, Vnf> getVnfs() {
155 return vnfs == null ? Collections.emptyMap() : vnfs;
158 public Map<String, Network> getNetworks() {
159 return networks == null ? Collections.emptyMap() : networks;
162 public Map<String, InstanceGroup> getVnfGroups() {
163 return vnfGroups == null ? Collections.emptyMap() : vnfGroups;
166 public boolean isPause() {
170 public int getBulkSize() { return bulkSize; }
173 protected String getModelType() {
177 @JsonProperty("isALaCarte")
178 public boolean isALaCarte() {
182 public String getTestApi() {