2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 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=========================================================
20 package org.onap.aai.schemagen.genxsd;
22 import org.junit.Before;
23 import org.junit.BeforeClass;
24 import org.junit.Test;
25 import org.junit.runner.RunWith;
26 import org.onap.aai.edges.EdgeIngestor;
27 import org.onap.aai.nodes.NodeIngestor;
28 import org.onap.aai.schemagen.SwaggerGenerationConfiguration;
29 import org.onap.aai.schemagen.testutils.TestUtilConfigTranslatorforEdges;
30 import org.onap.aai.setup.SchemaLocationsBean;
31 import org.onap.aai.setup.SchemaVersion;
32 import org.onap.aai.setup.SchemaVersions;
33 import org.slf4j.Logger;
34 import org.slf4j.LoggerFactory;
35 import org.springframework.beans.factory.annotation.Autowired;
36 import org.springframework.context.annotation.AnnotationConfigApplicationContext;
37 import org.springframework.test.context.ContextConfiguration;
38 import org.springframework.test.context.TestPropertySource;
39 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
40 import org.w3c.dom.Element;
42 import java.io.BufferedWriter;
44 import java.io.FileWriter;
45 import java.io.IOException;
46 import java.nio.charset.Charset;
47 import java.nio.file.Files;
48 import java.nio.file.Path;
49 import java.nio.file.Paths;
51 import static org.hamcrest.CoreMatchers.is;
52 import static org.junit.Assert.assertThat;
54 @RunWith(SpringJUnit4ClassRunner.class)
55 @ContextConfiguration(classes = {
57 SchemaLocationsBean.class,
58 TestUtilConfigTranslatorforEdges.class,
61 SwaggerGenerationConfiguration.class
64 @TestPropertySource(properties = {
65 "schema.uri.base.path = /aai",
66 "schema.xsd.maxoccurs = 5000"
68 public class NodesYAMLfromOXMTest {
69 //public class NodesYAMLfromOXMTest extends AAISetup {
70 private static final Logger logger = LoggerFactory.getLogger("NodesYAMLfromOXMTest.class");
71 private static final String OXMFILENAME = "src/test/resources/oxm/business_v11.xml";
72 private static final String EDGEFILENAME = "src/test/resources/dbedgerules/EdgeDescriptionRules_test.json";
73 public static AnnotationConfigApplicationContext ctx = null;
74 private static String testXML;
77 NodesYAMLfromOXM nodesYamlFromOxm;
79 SchemaVersions schemaVersions;
82 public static void setUpBeforeClass() throws Exception {
84 XSDElementTest x = new XSDElementTest();
87 logger.debug(testXML);
88 BufferedWriter bw = new BufferedWriter(new FileWriter(OXMFILENAME));
91 BufferedWriter bw1 = new BufferedWriter(new FileWriter(EDGEFILENAME));
92 bw1.write(YAMLfromOXMTest.EdgeDefs());
99 public void setUp() throws Exception {
101 NodeGetOperation.checklist.clear();
102 XSDElementTest x = new XSDElementTest();
106 logger.debug(testXML);
110 public void testGetDocumentHeader() {
111 SchemaVersion v = schemaVersions.getAppRootVersion();
112 String apiVersion = v.toString();
113 String header = null;
115 nodesYamlFromOxm.setXmlVersion(testXML, v);
116 nodesYamlFromOxm.process();
117 header = nodesYamlFromOxm.getDocumentHeader();
118 } catch(Exception e) {
121 assertThat("Header:\n"+header,header, is(YAMLheader()));
125 public void testProcess() {
127 SchemaVersion v = schemaVersions.getAppRootVersion();
128 String apiVersion = v.toString();
129 String fileContent = null;
131 nodesYamlFromOxm.setXmlVersion(testXML, v);
132 fileContent = nodesYamlFromOxm.process();
133 } catch(Exception e) {
136 assertThat("FileContent-I:\n"+fileContent,fileContent, is(YAMLresult()));
140 public void testNodesYAMLfromOXMFileVersionFile() throws IOException {
141 String outfileName = "testXML.xml";
142 File XMLfile = new File(outfileName);
143 XMLfile.createNewFile();
144 BufferedWriter bw = null;
145 Charset charset = Charset.forName("UTF-8");
146 Path path = Paths.get(outfileName);
147 bw = Files.newBufferedWriter(path, charset);
150 SchemaVersion v = schemaVersions.getAppRootVersion();
151 String apiVersion = v.toString();
152 String fileContent = null;
154 nodesYamlFromOxm.setXmlVersion(testXML, v);
155 fileContent = nodesYamlFromOxm.process();
156 } catch(Exception e) {
160 assertThat("FileContent:\n"+fileContent,fileContent, is(YAMLresult()));
164 public void testNodesYAMLfromOXMStringVersionFile() {
165 SchemaVersion v = schemaVersions.getAppRootVersion();
166 String apiVersion = v.toString();
167 String fileContent = null;
169 nodesYamlFromOxm.setXmlVersion(testXML, v);
170 fileContent = nodesYamlFromOxm.process();
171 } catch(Exception e) {
174 assertThat("FileContent-II:\n"+fileContent,fileContent, is(YAMLresult()));
178 public void testAppendDefinitions() {
179 SchemaVersion v = schemaVersions.getAppRootVersion();
180 String apiVersion = v.toString();
181 String definitions = null;
183 nodesYamlFromOxm.setXmlVersion(testXML, v);
184 nodesYamlFromOxm.process();
185 definitions = nodesYamlFromOxm.appendDefinitions();
186 } catch(Exception e) {
189 assertThat("Definitions:\n"+definitions,definitions, is(YAMLgetDefs()));
193 public void testGetXMLRootElementName() {
194 String target = "RootElement=customer";
195 SchemaVersion v = schemaVersions.getAppRootVersion();
196 String apiVersion = v.toString();
197 Element customer = null;
200 nodesYamlFromOxm.setXmlVersion(testXML, v);
201 nodesYamlFromOxm.process();
202 customer = nodesYamlFromOxm.getJavaTypeElementSwagger("Customer");
203 root = nodesYamlFromOxm.getXMLRootElementName(customer);
204 } catch(Exception e) {
207 assertThat("RootElement="+root, is(target));
211 public void testGetXmlRootElementName() {
212 String target = "RootElement=customer";
213 SchemaVersion v = schemaVersions.getAppRootVersion();
214 String apiVersion = v.toString();
217 nodesYamlFromOxm.setXmlVersion(testXML, v);
218 nodesYamlFromOxm.process();
219 root = nodesYamlFromOxm.getXmlRootElementName("Customer");
220 } catch(Exception e) {
223 assertThat("RootElement="+root, is(target));
227 public void testGetJavaTypeElementSwagger() {
228 String target = "Element=java-type/Customer";
229 SchemaVersion v = schemaVersions.getAppRootVersion();
230 String apiVersion = v.toString();
231 Element customer = null;
233 nodesYamlFromOxm.setXmlVersion(testXML, v);
234 nodesYamlFromOxm.process();
235 customer = nodesYamlFromOxm.getJavaTypeElementSwagger("Customer");
236 } catch(Exception e) {
239 assertThat("Element="+customer.getNodeName()+"/"+customer.getAttribute("name"), is(target));
242 public String YAMLresult() {
243 StringBuilder sb = new StringBuilder(32368);
244 sb.append(YAMLheader());
245 sb.append(YAMLops());
246 // sb.append(YAMLdefs());
247 // sb.append(YAMLpatchDefs());
248 sb.append(YAMLgetDefs());
249 return sb.toString();
251 public String YAMLheader() {
252 StringBuilder sb = new StringBuilder(1500);
253 sb.append("swagger: \"2.0\"\n");
254 sb.append("info:\n");
255 sb.append(" description: |\n");
257 sb.append(" [Differences versus the previous schema version](apidocs/aai_swagger_v11.diff)\n");
259 sb.append(" Copyright © 2017-18 AT&T Intellectual Property. All rights reserved.\n");
261 sb.append(" Licensed under the Creative Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except in compliance with the License.\n");
263 sb.append(" You may obtain a copy of the License at\n");
265 sb.append(" (https://creativecommons.org/licenses/by/4.0/)\n");
267 sb.append(" Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n");
269 sb.append(" This document is best viewed with Firefox or Chrome. Nodes can be found by appending /#/definitions/node-type-to-find to the path to this document. Edge definitions can be found with the node definitions.\n");
270 sb.append(" version: \"v11\"\n");
271 sb.append(" title: Active and Available Inventory REST API\n");
272 sb.append(" license:\n");
273 sb.append(" name: Apache 2.0\n");
274 sb.append(" url: http://www.apache.org/licenses/LICENSE-2.0.html\n");
275 sb.append(" contact:\n");
276 sb.append(" name:\n");
277 sb.append(" url:\n");
278 sb.append(" email:\n");
279 sb.append("host:\n");
280 sb.append("basePath: /aai/v11\n");
281 sb.append("schemes:\n");
282 sb.append(" - https\n");
283 sb.append("paths:\n");
284 return sb.toString();
287 public String YAMLops() {
288 StringBuilder sb = new StringBuilder(16384);
289 sb.append(" /nodes/customers/customer/{global-customer-id}:\n");
290 sb.append(" get:\n");
291 sb.append(" tags:\n");
292 sb.append(" - Operations\n");
293 sb.append(" summary: returns customer\n");
294 sb.append(" description: returns customer\n");
295 sb.append(" operationId: getBusinessCustomersCustomer\n");
296 sb.append(" produces:\n");
297 sb.append(" - application/json\n");
298 sb.append(" - application/xml\n");
299 sb.append(" responses:\n");
300 sb.append(" \"200\":\n");
301 sb.append(" description: successful operation\n");
302 sb.append(" schema:\n");
303 sb.append(" $ref: \"#/definitions/customer\"\n");
304 sb.append(" \"default\":\n");
305 sb.append(" null\n parameters:\n");
306 sb.append(" - name: global-customer-id\n");
307 sb.append(" in: path\n");
308 sb.append(" description: Global customer id used across to uniquely identify customer.\n");
309 sb.append(" required: true\n");
310 sb.append(" type: string\n");
311 sb.append(" example: __GLOBAL-CUSTOMER-ID__\n");
312 sb.append(" /nodes/customers?parameter=value[¶meter2=value2]:\n");
313 sb.append(" get:\n");
314 sb.append(" tags:\n");
315 sb.append(" - Operations\n");
316 sb.append(" summary: returns customers\n");
317 sb.append(" description: returns customers\n");
318 sb.append(" operationId: getBusinessCustomers\n");
319 sb.append(" produces:\n");
320 sb.append(" - application/json\n");
321 sb.append(" - application/xml\n");
322 sb.append(" responses:\n");
323 sb.append(" \"200\":\n");
324 sb.append(" description: successful operation\n");
325 sb.append(" schema:\n");
326 sb.append(" $ref: \"#/definitions/customers\"\n");
327 sb.append(" \"default\":\n");
328 sb.append(" null\n parameters:\n");
329 sb.append(" - name: global-customer-id\n");
330 sb.append(" in: query\n");
331 sb.append(" description:\n");
332 sb.append(" required: false\n");
333 sb.append(" type: string\n");
334 sb.append(" - name: subscriber-name\n");
335 sb.append(" in: query\n");
336 sb.append(" description:\n");
337 sb.append(" required: false\n");
338 sb.append(" type: string\n");
339 sb.append(" - name: subscriber-type\n");
340 sb.append(" in: query\n");
341 sb.append(" description:\n");
342 sb.append(" required: false\n");
343 sb.append(" type: string\n");
344 sb.append(" /nodes/service-subscriptions?parameter=value[¶meter2=value2]:\n");
345 sb.append(" get:\n");
346 sb.append(" tags:\n");
347 sb.append(" - Operations\n");
348 sb.append(" summary: returns service-subscriptions\n");
349 sb.append(" description: returns service-subscriptions\n");
350 sb.append(" operationId: getBusinessCustomersCustomerServiceSubscriptions\n");
351 sb.append(" produces:\n");
352 sb.append(" - application/json\n");
353 sb.append(" - application/xml\n");
354 sb.append(" responses:\n");
355 sb.append(" \"200\":\n");
356 sb.append(" description: successful operation\n");
357 sb.append(" schema:\n");
358 sb.append(" $ref: \"#/definitions/service-subscriptions\"\n");
359 sb.append(" \"default\":\n");
360 sb.append(" null\n parameters:\n");
361 sb.append(" - name: service-type\n");
362 sb.append(" in: query\n");
363 sb.append(" description:\n");
364 sb.append(" required: false\n");
365 sb.append(" type: string\n");
366 return sb.toString();
368 public String YAMLdefs() {
369 StringBuilder sb = new StringBuilder(8092);
370 sb.append("definitions:\n");
371 sb.append(" business:\n");
372 sb.append(" description: |\n");
373 sb.append(" Namespace for business related constructs\n");
374 sb.append(" properties:\n");
375 sb.append(" customers:\n");
376 sb.append(" type: array\n");
377 sb.append(" items:\n");
378 sb.append(" $ref: \"#/definitions/customer\"\n");
379 sb.append(" customer:\n");
380 sb.append(" description: |\n");
381 sb.append(" customer identifiers to provide linkage back to BSS information.\n");
382 sb.append(" ###### Related Nodes\n");
383 sb.append(" - FROM service-subscription (CHILD of customer, service-subscription BelongsTo customer, MANY2ONE)(1)\n");
385 sb.append(" -(1) IF this CUSTOMER node is deleted, this FROM node is DELETED also\n");
386 sb.append(" required:\n");
387 sb.append(" - global-customer-id\n");
388 sb.append(" - subscriber-name\n");
389 sb.append(" - subscriber-type\n");
390 sb.append(" properties:\n");
391 sb.append(" global-customer-id:\n");
392 sb.append(" type: string\n");
393 sb.append(" description: Global customer id used across to uniquely identify customer.\n");
394 sb.append(" subscriber-name:\n");
395 sb.append(" type: string\n");
396 sb.append(" description: Subscriber name, an alternate way to retrieve a customer.\n");
397 sb.append(" subscriber-type:\n");
398 sb.append(" type: string\n");
399 sb.append(" description: Subscriber type, a way to provide VID with only the INFRA customers.\n");
400 sb.append(" resource-version:\n");
401 sb.append(" type: string\n");
402 sb.append(" description: Used for optimistic concurrency. Must be empty on create, valid on update and delete.\n");
403 sb.append(" service-subscriptions:\n");
404 sb.append(" type: array\n");
405 sb.append(" items:\n");
406 sb.append(" $ref: \"#/definitions/service-subscription\"\n");
407 sb.append(" customers:\n");
408 sb.append(" description: |\n");
409 sb.append(" Collection of customer identifiers to provide linkage back to BSS information.\n");
410 sb.append(" properties:\n");
411 sb.append(" customer:\n");
412 sb.append(" type: array\n");
413 sb.append(" items: \n");
414 sb.append(" $ref: \"#/definitions/customer\"\n");
415 sb.append(" inventory:\n");
416 sb.append(" properties:\n");
417 sb.append(" business:\n");
418 sb.append(" type: object\n");
419 sb.append(" $ref: \"#/definitions/business\"\n");
420 sb.append(" nodes:\n");
421 sb.append(" properties:\n");
422 sb.append(" inventory-item-data:\n");
423 sb.append(" type: array\n");
424 sb.append(" items:\n");
425 sb.append(" $ref: \"#/definitions/inventory-item-data\"\n");
426 sb.append(" service-subscription:\n");
427 sb.append(" description: |\n");
428 sb.append(" Object that group service instances.\n");
429 sb.append(" ###### Related Nodes\n");
430 sb.append(" - TO customer (PARENT of service-subscription, service-subscription BelongsTo customer, MANY2ONE)(4)\n");
431 sb.append(" - TO tenant( service-subscription Uses tenant, MANY2MANY)\n");
432 sb.append(" - FROM service-instance (CHILD of service-subscription, service-instance BelongsTo service-subscription, MANY2ONE)(1)\n");
434 sb.append(" -(1) IF this SERVICE-SUBSCRIPTION node is deleted, this FROM node is DELETED also\n");
435 sb.append(" -(4) IF this TO node is deleted, this SERVICE-SUBSCRIPTION is DELETED also\n");
436 sb.append(" required:\n");
437 sb.append(" - service-type\n");
438 sb.append(" properties:\n");
439 sb.append(" service-type:\n");
440 sb.append(" type: string\n");
441 sb.append(" description: Value defined by orchestration to identify this service.\n");
442 sb.append(" temp-ub-sub-account-id:\n");
443 sb.append(" type: string\n");
444 sb.append(" description: This property will be deleted from A&AI in the near future. Only stop gap solution.\n");
445 sb.append(" resource-version:\n");
446 sb.append(" type: string\n");
447 sb.append(" description: Used for optimistic concurrency. Must be empty on create, valid on update and delete.\n");
448 sb.append(" service-subscriptions:\n");
449 sb.append(" description: |\n");
450 sb.append(" Collection of objects that group service instances.\n");
451 sb.append(" properties:\n");
452 sb.append(" service-subscription:\n");
453 sb.append(" type: array\n");
454 sb.append(" items: \n");
455 sb.append(" $ref: \"#/definitions/service-subscription\"\n");
456 return sb.toString();
458 public String YAMLpatchDefs() {
459 StringBuilder sb = new StringBuilder(8092);
460 sb.append("patchDefinitions:\n");
461 sb.append(" business:\n");
462 sb.append(" description: |\n");
463 sb.append(" Namespace for business related constructs\n");
464 sb.append(" properties:\n");
465 sb.append(" customers:\n");
466 sb.append(" type: array\n");
467 sb.append(" items:\n");
468 sb.append(" $ref: \"#/patchDefinitions/customer\"\n");
469 sb.append(" customer:\n");
470 sb.append(" description: |\n");
471 sb.append(" customer identifiers to provide linkage back to BSS information.\n");
472 sb.append(" ###### Related Nodes\n");
473 sb.append(" - FROM service-subscription (CHILD of customer, service-subscription BelongsTo customer, MANY2ONE)(1)\n");
475 sb.append(" -(1) IF this CUSTOMER node is deleted, this FROM node is DELETED also\n");
476 sb.append(" required:\n");
477 sb.append(" - global-customer-id\n");
478 sb.append(" - subscriber-name\n");
479 sb.append(" - subscriber-type\n");
480 sb.append(" properties:\n");
481 sb.append(" global-customer-id:\n");
482 sb.append(" type: string\n");
483 sb.append(" description: Global customer id used across to uniquely identify customer.\n");
484 sb.append(" subscriber-name:\n");
485 sb.append(" type: string\n");
486 sb.append(" description: Subscriber name, an alternate way to retrieve a customer.\n");
487 sb.append(" subscriber-type:\n");
488 sb.append(" type: string\n");
489 sb.append(" description: Subscriber type, a way to provide VID with only the INFRA customers.\n");
490 sb.append(" customers:\n");
491 sb.append(" description: |\n");
492 sb.append(" Collection of customer identifiers to provide linkage back to BSS information.\n");
493 sb.append(" properties:\n");
494 sb.append(" customer:\n");
495 sb.append(" type: array\n");
496 sb.append(" items: \n");
497 sb.append(" $ref: \"#/patchDefinitions/customer\"\n");
498 sb.append(" inventory:\n");
499 sb.append(" properties:\n");
500 sb.append(" business:\n");
501 sb.append(" type: object\n");
502 sb.append(" $ref: \"#/patchDefinitions/business\"\n");
503 sb.append(" nodes:\n");
504 sb.append(" properties:\n");
505 sb.append(" inventory-item-data:\n");
506 sb.append(" type: array\n");
507 sb.append(" items:\n");
508 sb.append(" $ref: \"#/patchDefinitions/inventory-item-data\"\n");
509 sb.append(" service-subscription:\n");
510 sb.append(" description: |\n");
511 sb.append(" Object that group service instances.\n");
512 sb.append(" ###### Related Nodes\n");
513 sb.append(" - TO customer (CHILD of customer, service-subscription BelongsTo customer, MANY2ONE)(4)\n");
514 sb.append(" - TO tenant( service-subscription Uses tenant, MANY2MANY)\n");
515 sb.append(" - FROM service-instance (CHILD of service-subscription, service-instance BelongsTo service-subscription, MANY2ONE)(1)\n");
517 sb.append(" -(1) IF this SERVICE-SUBSCRIPTION node is deleted, this FROM node is DELETED also\n");
518 sb.append(" -(4) IF this TO node is deleted, this SERVICE-SUBSCRIPTION is DELETED also\n");
519 sb.append(" required:\n");
520 sb.append(" - service-type\n");
521 sb.append(" properties:\n");
522 sb.append(" service-type:\n");
523 sb.append(" type: string\n");
524 sb.append(" description: Value defined by orchestration to identify this service.\n");
525 sb.append(" temp-ub-sub-account-id:\n");
526 sb.append(" type: string\n");
527 sb.append(" description: This property will be deleted from A&AI in the near future. Only stop gap solution.\n");
528 sb.append(" service-subscriptions:\n");
529 sb.append(" description: |\n");
530 sb.append(" Collection of objects that group service instances.\n");
531 sb.append(" properties:\n");
532 sb.append(" service-subscription:\n");
533 sb.append(" type: array\n");
534 sb.append(" items: \n");
535 sb.append(" $ref: \"#/patchDefinitions/service-subscription\"\n");
536 return sb.toString();
538 public String YAMLgetDefs() {
539 StringBuilder sb = new StringBuilder(8092);
540 sb.append("definitions:\n");
541 sb.append(" business:\n");
542 sb.append(" description: |\n");
543 sb.append(" Namespace for business related constructs\n");
544 sb.append(" properties:\n");
545 sb.append(" customers:\n");
546 sb.append(" type: array\n");
547 sb.append(" items:\n");
548 sb.append(" $ref: \"#/definitions/customer\"\n");
549 sb.append(" customer:\n");
550 sb.append(" description: |\n");
551 sb.append(" customer identifiers to provide linkage back to BSS information.\n");
552 sb.append(" ###### Related Nodes\n");
553 sb.append(" - FROM service-subscription (CHILD of customer, service-subscription BelongsTo customer, MANY2ONE)(1)\n");
555 sb.append(" -(1) IF this CUSTOMER node is deleted, this FROM node is DELETED also\n");
556 sb.append(" required:\n");
557 sb.append(" - global-customer-id\n");
558 sb.append(" - subscriber-name\n");
559 sb.append(" - subscriber-type\n");
560 sb.append(" properties:\n");
561 sb.append(" global-customer-id:\n");
562 sb.append(" type: string\n");
563 sb.append(" description: Global customer id used across to uniquely identify customer.\n");
564 sb.append(" subscriber-name:\n");
565 sb.append(" type: string\n");
566 sb.append(" description: Subscriber name, an alternate way to retrieve a customer.\n");
567 sb.append(" subscriber-type:\n");
568 sb.append(" type: string\n");
569 sb.append(" description: Subscriber type, a way to provide VID with only the INFRA customers.\n");
570 sb.append(" resource-version:\n");
571 sb.append(" type: string\n");
572 sb.append(" description: Used for optimistic concurrency. Must be empty on create, valid on update and delete.\n");
573 sb.append(" service-subscriptions:\n");
574 sb.append(" type: array\n");
575 sb.append(" items:\n");
576 sb.append(" $ref: \"#/definitions/service-subscription\"\n");
577 sb.append(" customers:\n");
578 sb.append(" description: |\n");
579 sb.append(" Collection of customer identifiers to provide linkage back to BSS information.\n");
580 sb.append(" properties:\n");
581 sb.append(" customer:\n");
582 sb.append(" type: array\n");
583 sb.append(" items: \n");
584 sb.append(" $ref: \"#/definitions/customer\"\n");
585 sb.append(" inventory:\n");
586 sb.append(" properties:\n");
587 sb.append(" business:\n");
588 sb.append(" type: object\n");
589 sb.append(" $ref: \"#/definitions/business\"\n");
590 sb.append(" nodes:\n");
591 sb.append(" properties:\n");
592 sb.append(" inventory-item-data:\n");
593 sb.append(" type: array\n");
594 sb.append(" items:\n");
595 sb.append(" $ref: \"#/definitions/inventory-item-data\"\n");
596 sb.append(" service-subscription:\n");
597 sb.append(" description: |\n");
598 sb.append(" Object that group service instances.\n");
599 sb.append(" ###### Related Nodes\n");
600 sb.append(" - TO customer (PARENT of service-subscription, service-subscription BelongsTo customer, MANY2ONE)(4)\n");
601 sb.append(" - TO tenant( service-subscription Uses tenant, MANY2MANY)\n");
602 sb.append(" - FROM service-instance (CHILD of service-subscription, service-instance BelongsTo service-subscription, MANY2ONE)(1)\n");
604 sb.append(" -(1) IF this SERVICE-SUBSCRIPTION node is deleted, this FROM node is DELETED also\n");
605 sb.append(" -(4) IF this TO node is deleted, this SERVICE-SUBSCRIPTION is DELETED also\n");
606 sb.append(" required:\n");
607 sb.append(" - service-type\n");
608 sb.append(" properties:\n");
609 sb.append(" service-type:\n");
610 sb.append(" type: string\n");
611 sb.append(" description: Value defined by orchestration to identify this service.\n");
612 sb.append(" temp-ub-sub-account-id:\n");
613 sb.append(" type: string\n");
614 sb.append(" description: This property will be deleted from A&AI in the near future. Only stop gap solution.\n");
615 sb.append(" resource-version:\n");
616 sb.append(" type: string\n");
617 sb.append(" description: Used for optimistic concurrency. Must be empty on create, valid on update and delete.\n");
618 sb.append(" service-subscriptions:\n");
619 sb.append(" description: |\n");
620 sb.append(" Collection of objects that group service instances.\n");
621 sb.append(" properties:\n");
622 sb.append(" service-subscription:\n");
623 sb.append(" type: array\n");
624 sb.append(" items: \n");
625 sb.append(" $ref: \"#/definitions/service-subscription\"\n");
626 return sb.toString();