aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-dao/src/test/java
diff options
context:
space:
mode:
authoraribeiro <anderson.ribeiro@est.tech>2021-05-18 16:31:28 +0100
committerMichael Morris <michael.morris@est.tech>2021-05-28 16:00:03 +0000
commitb3d55d3dd8508919ae48d5f60425aa13e5731ac2 (patch)
tree7f2f26ac9465e77fc6b6b45ff88a2289b6c3996b /catalog-dao/src/test/java
parentf12b2ea0267014cd347ae5f87468b7831fa5ff1b (diff)
Add Support for creating model type
Add new vertex type called "model" was added to represent models Add new edge type called MODEL_ELEMENT was added to connect a tosca type to a model Add new edge type called MODEL was added to connect a resource/service to the model it is based on Issue-ID: SDC-3596 Signed-off-by: MichaelMorris <michael.morris@est.tech> Signed-off-by: aribeiro <anderson.ribeiro@est.tech> Change-Id: I310e14d0cf5a9ca0eb0bda592efe8a3baf73749c
Diffstat (limited to 'catalog-dao/src/test/java')
-rw-r--r--catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ModelDataTest.java70
1 files changed, 70 insertions, 0 deletions
diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ModelDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ModelDataTest.java
new file mode 100644
index 0000000000..1fb34dd5e6
--- /dev/null
+++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ModelDataTest.java
@@ -0,0 +1,70 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2021 Nordix Foundation
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.sdc.be.resources.data;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInstance;
+import org.junit.jupiter.api.TestInstance.Lifecycle;
+
+@TestInstance(Lifecycle.PER_CLASS)
+class ModelDataTest {
+
+ private final String modelName = "ETSI-SDC-MODEL-TEST";
+ private final String modelId = UUID.randomUUID().toString();
+ ModelData modelData;
+
+ @BeforeAll
+ void initTestData() {
+ modelData = new ModelData(modelName, modelId);
+ }
+
+ @Test
+ void modelDataTest() {
+ assertThat(modelData).isNotNull();
+ assertThat(modelData.getUniqueId()).isEqualTo(modelId);
+ assertThat(modelData.getName()).isEqualTo(modelName);
+ }
+
+ @Test
+ void modelDataFromPropertiesMapTest() {
+ final Map<String, Object> properties = new HashMap();
+ properties.put("name", modelData.getName());
+ properties.put("uid", modelData.getUniqueId());
+ final ModelData modelDataFromPropertiesMap = new ModelData(properties);
+ assertThat(modelDataFromPropertiesMap).isNotNull();
+ assertThat(modelDataFromPropertiesMap.getUniqueId()).isEqualTo(modelId);
+ assertThat(modelDataFromPropertiesMap.getName()).isEqualTo(modelName);
+ }
+
+ @Test
+ void modelDataToGraphTest() {
+ final var result = modelData.toGraphMap();
+ assertThat(result).isNotNull();
+ assertThat(result).isNotEmpty();
+ assertThat(result.values()).contains(modelId);
+ assertThat(result.values()).contains(modelName);
+ }
+
+}
/a> 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900
{
  "swagger" : "2.0",
  "basePath" : "/",
  "tags" : [ {
    "name" : "Policy"
  } ],
  "schemes" : [ "http", "https" ],
  "paths" : {
    "/policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies" : {
      "get" : {
        "tags" : [ "Policy" ],
        "summary" : "Retrieve all versions of a policy created for a particular policy type version",
        "description" : "Returns a list of all versions of specified policy created for the specified policy type version",
        "operationId" : "getAllPolicies",
        "produces" : [ "application/json", "application/yaml" ],
        "parameters" : [ {
          "name" : "policyTypeId",
          "in" : "path",
          "description" : "ID of policy type",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "policyTypeVersion",
          "in" : "path",
          "description" : "Version of policy type",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "X-ONAP-RequestID",
          "in" : "header",
          "description" : "RequestID for http transaction",
          "required" : false,
          "type" : "string",
          "format" : "uuid"
        } ],
        "responses" : {
          "200" : {
            "description" : "successful operation; All policies matching specified policy type will be returned.",
            "headers" : {
              "X-MinorVersion" : {
                "type" : "string",
                "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
              },
              "X-PatchVersion" : {
                "type" : "string",
                "description" : "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
              },
              "X-LatestVersion" : {
                "type" : "string",
                "description" : "Used only to communicate an API's latest version"
              },
              "X-ONAP-RequestID" : {
                "type" : "string",
                "format" : "uuid",
                "description" : "Used to track REST transactions for logging purpose"
              }
            },
            "schema" : {
              "$ref" : "#/definitions/ToscaServiceTemplate"
            }
          },
          "401" : {
            "description" : "Authentication Error"
          },
          "403" : {
            "description" : "Authorization Error"
          },
          "404" : {
            "description" : "Resource Not Found"
          },
          "500" : {
            "description" : "Internal Server Error"
          }
        },
        "security" : [ {
          "basicAuth" : [ ]
        } ],
        "x-interface info" : {
          "api-version" : "1.0.0",
          "last-mod-release" : "Dublin"
        }
      },
      "post" : {
        "tags" : [ "Policy" ],
        "summary" : "Create a new policy for a policy type version",
        "description" : "Create a new policy for a policy type. Client should provide TOSCA body of the new policy",
        "operationId" : "createPolicy",
        "consumes" : [ "application/json", "application/yaml" ],
        "produces" : [ "application/json", "application/yaml" ],
        "parameters" : [ {
          "name" : "policyTypeId",
          "in" : "path",
          "description" : "ID of policy type",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "policyTypeVersion",
          "in" : "path",
          "description" : "Version of policy type",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "X-ONAP-RequestID",
          "in" : "header",
          "description" : "RequestID for http transaction",
          "required" : false,
          "type" : "string",
          "format" : "uuid"
        }, {
          "in" : "body",
          "name" : "body",
          "description" : "Entity body of policy",
          "required" : true,
          "type" : "ToscaServiceTemplate",
          "schema" : {
            "$ref" : "#/definitions/ToscaServiceTemplate"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "successful operation; Newly created policy matching specified policy type will be returned.",
            "headers" : {
              "X-MinorVersion" : {
                "type" : "string",
                "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
              },
              "X-PatchVersion" : {
                "type" : "string",
                "description" : "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
              },
              "X-LatestVersion" : {
                "type" : "string",
                "description" : "Used only to communicate an API's latest version"
              },
              "X-ONAP-RequestID" : {
                "type" : "string",
                "format" : "uuid",
                "description" : "Used to track REST transactions for logging purpose"
              }
            },
            "schema" : {
              "$ref" : "#/definitions/ToscaServiceTemplate"
            }
          },
          "400" : {
            "description" : "Invalid Body"
          },
          "401" : {
            "description" : "Authentication Error"
          },
          "403" : {
            "description" : "Authorization Error"
          },
          "404" : {
            "description" : "Resource Not Found"
          },
          "500" : {
            "description" : "Internal Server Error"
          }
        },
        "security" : [ {
          "basicAuth" : [ ]
        } ],
        "x-interface info" : {
          "api-version" : "1.0.0",
          "last-mod-release" : "Dublin"
        }
      }
    },
    "/policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}" : {
      "get" : {
        "tags" : [ "Policy" ],
        "summary" : "Retrieve all version details of a policy created for a particular policy type version",
        "description" : "Returns a list of all version details of the specified policy",
        "operationId" : "getAllVersionsOfPolicy",
        "produces" : [ "application/json", "application/yaml" ],
        "parameters" : [ {
          "name" : "policyTypeId",
          "in" : "path",
          "description" : "ID of policy type",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "policyTypeVersion",
          "in" : "path",
          "description" : "Version of policy type",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "policyId",
          "in" : "path",
          "description" : "ID of policy",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "X-ONAP-RequestID",
          "in" : "header",
          "description" : "RequestID for http transaction",
          "required" : false,
          "type" : "string",
          "format" : "uuid"
        } ],
        "responses" : {
          "200" : {
            "description" : "successful operation; All versions of specified policy matching specified policy type will be returned.",
            "headers" : {
              "X-MinorVersion" : {
                "type" : "string",
                "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
              },
              "X-PatchVersion" : {
                "type" : "string",
                "description" : "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
              },
              "X-LatestVersion" : {
                "type" : "string",
                "description" : "Used only to communicate an API's latest version"
              },
              "X-ONAP-RequestID" : {
                "type" : "string",
                "format" : "uuid",
                "description" : "Used to track REST transactions for logging purpose"
              }
            },
            "schema" : {
              "$ref" : "#/definitions/ToscaServiceTemplate"
            }
          },
          "401" : {
            "description" : "Authentication Error"
          },
          "403" : {
            "description" : "Authorization Error"
          },
          "404" : {
            "description" : "Resource Not Found"
          },
          "500" : {
            "description" : "Internal Server Error"
          }
        },
        "security" : [ {
          "basicAuth" : [ ]
        } ],
        "x-interface info" : {
          "api-version" : "1.0.0",
          "last-mod-release" : "Dublin"
        }
      }
    },
    "/policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}/versions/{policyVersion}" : {
      "get" : {
        "tags" : [ "Policy" ],
        "summary" : "Retrieve one version of a policy created for a particular policy type version",
        "description" : "Returns a particular version of specified policy created for the specified policy type version",
        "operationId" : "getSpecificVersionOfPolicy",
        "produces" : [ "application/json", "application/yaml" ],
        "parameters" : [ {
          "name" : "policyTypeId",
          "in" : "path",
          "description" : "ID of policy type",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "policyTypeVersion",
          "in" : "path",
          "description" : "Version of policy type",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "policyId",
          "in" : "path",
          "description" : "ID of policy",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "policyVersion",
          "in" : "path",
          "description" : "Version of policy",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "X-ONAP-RequestID",
          "in" : "header",
          "description" : "RequestID for http transaction",
          "required" : false,
          "type" : "string",
          "format" : "uuid"
        } ],
        "responses" : {
          "200" : {
            "description" : "successful operation; The specified policy matching specified policy type will be returned.",
            "headers" : {
              "X-MinorVersion" : {
                "type" : "string",
                "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
              },
              "X-PatchVersion" : {
                "type" : "string",
                "description" : "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
              },
              "X-LatestVersion" : {
                "type" : "string",
                "description" : "Used only to communicate an API's latest version"
              },
              "X-ONAP-RequestID" : {
                "type" : "string",
                "format" : "uuid",
                "description" : "Used to track REST transactions for logging purpose"
              }
            },
            "schema" : {
              "$ref" : "#/definitions/ToscaServiceTemplate"
            }
          },
          "401" : {
            "description" : "Authentication Error"
          },
          "403" : {
            "description" : "Authorization Error"
          },
          "404" : {
            "description" : "Resource Not Found"
          },
          "500" : {
            "description" : "Internal Server Error"
          }
        },
        "security" : [ {
          "basicAuth" : [ ]
        } ],
        "x-interface info" : {
          "api-version" : "1.0.0",
          "last-mod-release" : "Dublin"
        }
      },
      "delete" : {
        "tags" : [ "Policy" ],
        "summary" : "Delete a particular version of a policy",
        "description" : "Delete a particular version of a policy. It must follow one rule. Rule: the version that has been deployed in PDP group(s) cannot be deleted",
        "operationId" : "deleteSpecificVersionOfPolicy",
        "produces" : [ "application/json", "application/yaml" ],
        "parameters" : [ {
          "name" : "policyTypeId",
          "in" : "path",
          "description" : "PolicyType ID",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "policyTypeVersion",
          "in" : "path",
          "description" : "Version of policy type",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "policyId",
          "in" : "path",
          "description" : "ID of policy",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "policyVersion",
          "in" : "path",
          "description" : "Version of policy",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "X-ONAP-RequestID",
          "in" : "header",
          "description" : "RequestID for http transaction",
          "required" : false,
          "type" : "string",
          "format" : "uuid"
        } ],
        "responses" : {
          "200" : {
            "description" : "successful operation; Newly deleted policy matching specified policy type will be returned.",
            "headers" : {
              "X-MinorVersion" : {
                "type" : "string",
                "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
              },
              "X-PatchVersion" : {
                "type" : "string",
                "description" : "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
              },
              "X-LatestVersion" : {
                "type" : "string",
                "description" : "Used only to communicate an API's latest version"
              },
              "X-ONAP-RequestID" : {
                "type" : "string",
                "format" : "uuid",
                "description" : "Used to track REST transactions for logging purpose"
              }
            },
            "schema" : {
              "$ref" : "#/definitions/ToscaServiceTemplate"
            }
          },
          "401" : {
            "description" : "Authentication Error"
          },
          "403" : {
            "description" : "Authorization Error"
          },
          "404" : {
            "description" : "Resource Not Found"
          },
          "409" : {
            "description" : "Delete Conflict, Rule Violation"
          },
          "500" : {
            "description" : "Internal Server Error"
          }
        },
        "security" : [ {
          "basicAuth" : [ ]
        } ],
        "x-interface info" : {
          "api-version" : "1.0.0",
          "last-mod-release" : "Dublin"
        }
      }
    },
    "/policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}/versions/latest" : {
      "get" : {
        "tags" : [ "Policy" ],
        "summary" : "Retrieve the latest version of a particular policy",
        "description" : "Returns the latest version of specified policy",
        "operationId" : "getLatestVersionOfPolicy",
        "produces" : [ "application/json", "application/yaml" ],
        "parameters" : [ {
          "name" : "policyTypeId",
          "in" : "path",
          "description" : "ID of policy type",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "policyTypeVersion",
          "in" : "path",
          "description" : "Version of policy type",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "policyId",
          "in" : "path",
          "description" : "ID of policy",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "X-ONAP-RequestID",
          "in" : "header",
          "description" : "RequestID for http transaction",
          "required" : false,
          "type" : "string",
          "format" : "uuid"
        } ],
        "responses" : {
          "200" : {
            "description" : "successful operation; Latest version of specified policy matching specified policy type will be returned.",
            "headers" : {
              "X-MinorVersion" : {
                "type" : "string",
                "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
              },
              "X-PatchVersion" : {
                "type" : "string",
                "description" : "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
              },
              "X-LatestVersion" : {
                "type" : "string",
                "description" : "Used only to communicate an API's latest version"
              },
              "X-ONAP-RequestID" : {
                "type" : "string",
                "format" : "uuid",
                "description" : "Used to track REST transactions for logging purpose"
              }
            },
            "schema" : {
              "$ref" : "#/definitions/ToscaServiceTemplate"
            }
          },
          "401" : {
            "description" : "Authentication Error"
          },
          "403" : {
            "description" : "Authorization Error"
          },
          "404" : {
            "description" : "Resource Not Found"
          },
          "500" : {
            "description" : "Internal Server Error"
          }
        },
        "security" : [ {
          "basicAuth" : [ ]
        } ],
        "x-interface info" : {
          "api-version" : "1.0.0",
          "last-mod-release" : "Dublin"
        }
      }
    },
    "/policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}/versions/deployed" : {
      "get" : {
        "tags" : [ "Policy" ],
        "summary" : "Retrieve deployed versions of a particular policy in pdp groups",
        "description" : "Returns deployed versions of specified policy in pdp groups",
        "operationId" : "getDeployedVersionsOfPolicy",
        "produces" : [ "application/json", "application/yaml" ],
        "parameters" : [ {
          "name" : "policyTypeId",
          "in" : "path",
          "description" : "ID of policy type",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "policyTypeVersion",
          "in" : "path",
          "description" : "Version of policy type",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "policyId",
          "in" : "path",
          "description" : "ID of policy",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "X-ONAP-RequestID",
          "in" : "header",
          "description" : "RequestID for http transaction",
          "required" : false,
          "type" : "string",
          "format" : "uuid"
        } ],
        "responses" : {
          "200" : {
            "description" : "successful operation; Deployed versions of specified policy matching specified policy type will be returned.",
            "headers" : {
              "X-MinorVersion" : {
                "type" : "string",
                "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
              },
              "X-PatchVersion" : {
                "type" : "string",
                "description" : "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
              },
              "X-LatestVersion" : {
                "type" : "string",
                "description" : "Used only to communicate an API's latest version"
              },
              "X-ONAP-RequestID" : {
                "type" : "string",
                "format" : "uuid",
                "description" : "Used to track REST transactions for logging purpose"
              }
            },
            "schema" : {
              "type" : "array",
              "items" : {
                "$ref" : "#/definitions/ToscaPolicy"
              }
            }
          },
          "401" : {
            "description" : "Authentication Error"
          },
          "403" : {
            "description" : "Authorization Error"
          },
          "404" : {
            "description" : "Resource Not Found"
          },
          "500" : {
            "description" : "Internal Server Error"
          }
        },
        "security" : [ {
          "basicAuth" : [ ]
        } ],
        "x-interface info" : {
          "api-version" : "1.0.0",
          "last-mod-release" : "Dublin"
        }
      }
    },
    "/policy/api/v1/policies" : {
      "post" : {
        "tags" : [ "Policy" ],
        "summary" : "Create one or more new policies",
        "description" : "Create one or more new policies. Client should provide TOSCA body of the new policies",
        "operationId" : "createPolicies",
        "consumes" : [ "application/json", "application/yaml" ],
        "produces" : [ "application/json", "application/yaml" ],
        "parameters" : [ {
          "name" : "X-ONAP-RequestID",
          "in" : "header",
          "description" : "RequestID for http transaction",
          "required" : false,
          "type" : "string",
          "format" : "uuid"
        }, {
          "in" : "body",
          "name" : "body",
          "description" : "Entity body of policies",
          "required" : true,
          "type" : "ToscaServiceTemplate",
          "schema" : {
            "$ref" : "#/definitions/ToscaServiceTemplate"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "successful operation; Newly created policies will be returned.",
            "headers" : {
              "X-MinorVersion" : {
                "type" : "string",
                "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
              },
              "X-PatchVersion" : {
                "type" : "string",
                "description" : "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
              },
              "X-LatestVersion" : {
                "type" : "string",
                "description" : "Used only to communicate an API's latest version"
              },
              "X-ONAP-RequestID" : {
                "type" : "string",
                "format" : "uuid",
                "description" : "Used to track REST transactions for logging purpose"
              }
            },
            "schema" : {
              "$ref" : "#/definitions/ToscaServiceTemplate"
            }
          },
          "400" : {
            "description" : "Invalid Body"
          },
          "401" : {
            "description" : "Authentication Error"
          },
          "403" : {
            "description" : "Authorization Error"
          },
          "404" : {
            "description" : "Resource Not Found"
          },
          "500" : {
            "description" : "Internal Server Error"
          }
        },
        "security" : [ {
          "basicAuth" : [ ]
        } ],
        "x-interface info" : {
          "api-version" : "1.0.0",
          "last-mod-release" : "Frankfurt"
        }
      }
    }
  },
  "securityDefinitions" : {
    "basicAuth" : {
      "description" : "",
      "type" : "basic"
    }
  },
  "definitions" : {
    "ToscaConstraint" : {
      "type" : "object",
      "properties" : {
        "valid_values" : {
          "type" : "array",
          "items" : {
            "type" : "string"
          }
        },
        "equal" : {
          "type" : "string"
        },
        "greater_than" : {
          "type" : "string"
        },
        "greater_or_equal" : {
          "type" : "string"
        },
        "less_than" : {
          "type" : "string"
        },
        "less_or_equal" : {
          "type" : "string"
        }
      }
    },
    "ToscaDataType" : {
      "type" : "object",
      "properties" : {
        "name" : {
          "type" : "string"
        },
        "version" : {
          "type" : "string"
        },
        "derived_from" : {
          "type" : "string"
        },
        "metadata" : {
          "type" : "object",
          "additionalProperties" : {
            "type" : "string"
          }
        },
        "description" : {
          "type" : "string"
        },
        "constraints" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/ToscaConstraint"
          }
        },
        "properties" : {
          "type" : "object",
          "additionalProperties" : {
            "$ref" : "#/definitions/ToscaProperty"
          }
        }
      }
    },
    "ToscaEntrySchema" : {
      "type" : "object",
      "properties" : {
        "name" : {
          "type" : "string"
        },
        "type" : {
          "type" : "string"
        },
        "typeVersion" : {
          "type" : "string"
        },
        "description" : {
          "type" : "string"
        },
        "constraints" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/ToscaConstraint"
          }
        }
      }
    },
    "ToscaPolicyType" : {
      "type" : "object",
      "properties" : {
        "name" : {
          "type" : "string"
        },
        "version" : {
          "type" : "string"
        },
        "derived_from" : {
          "type" : "string"
        },
        "metadata" : {
          "type" : "object",
          "additionalProperties" : {
            "type" : "string"
          }
        },
        "description" : {
          "type" : "string"
        },
        "properties" : {
          "type" : "object",
          "additionalProperties" : {
            "$ref" : "#/definitions/ToscaProperty"
          }
        }
      }
    },
    "ToscaPolicyTypeIdentifier" : {
      "type" : "object",
      "properties" : {
        "name" : {
          "type" : "string"
        },
        "version" : {
          "type" : "string"
        }
      }
    },
    "ToscaProperty" : {
      "type" : "object",
      "properties" : {
        "name" : {
          "type" : "string"
        },
        "type" : {
          "type" : "string"
        },
        "typeVersion" : {
          "type" : "string"
        },
        "description" : {
          "type" : "string"
        },
        "default" : {
          "type" : "string"
        },
        "required" : {
          "type" : "boolean"
        },
        "status" : {
          "type" : "string",
          "enum" : [ "SUPPORTED", "UNSUPPORTED", "EXPERIMENTAL", "DEPRECATED" ]
        },
        "constraints" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/ToscaConstraint"
          }
        },
        "entry_schema" : {
          "$ref" : "#/definitions/ToscaEntrySchema"
        }
      }
    },
    "ToscaServiceTemplate" : {
      "type" : "object",
      "properties" : {
        "name" : {
          "type" : "string"
        },
        "version" : {
          "type" : "string"
        },
        "derived_from" : {
          "type" : "string"
        },
        "metadata" : {
          "type" : "object",
          "additionalProperties" : {
            "type" : "string"
          }
        },
        "description" : {
          "type" : "string"
        },
        "tosca_definitions_version" : {
          "type" : "string"
        },
        "topology_template" : {
          "$ref" : "#/definitions/ToscaTopologyTemplate"
        },
        "policy_types" : {
          "type" : "array",
          "items" : {
            "type" : "object",
            "additionalProperties" : {
              "$ref" : "#/definitions/ToscaPolicyType"
            }
          }
        },
        "data_types" : {
          "type" : "array",
          "items" : {
            "type" : "object",
            "additionalProperties" : {
              "$ref" : "#/definitions/ToscaDataType"
            }
          }
        }
      }
    },
    "ToscaTopologyTemplate" : {
      "type" : "object",
      "properties" : {
        "description" : {
          "type" : "string"
        },
        "policies" : {
          "type" : "array",
          "items" : {
            "type" : "object",
            "additionalProperties" : {
              "$ref" : "#/definitions/ToscaPolicy"
            }
          }
        }
      }
    }
  }
}