diff options
author | 2022-07-25 10:46:57 +0100 | |
---|---|---|
committer | 2022-07-26 10:18:58 +0100 | |
commit | 751aa0f3c7f090bc10bc59f74aaace1f297a7c2c (patch) | |
tree | acc983fd58594b56b24846e3ee6becb8c494418c /examples/examples-grpc/src/main/resources/schemas | |
parent | cfa642373420fa2bc429c94f17e4f0c0798e5791 (diff) |
Update APEX example to use JSON Schema plugin
Change-Id: Ic8b412ce0ca71b4452d67b1e4445e423b0ec5b54
Issue-ID: POLICY-4292
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
Diffstat (limited to 'examples/examples-grpc/src/main/resources/schemas')
18 files changed, 538 insertions, 407 deletions
diff --git a/examples/examples-grpc/src/main/resources/schemas/CDSActionIdentifiersType.avsc b/examples/examples-grpc/src/main/resources/schemas/CDSActionIdentifiersType.avsc deleted file mode 100644 index 1d5551704..000000000 --- a/examples/examples-grpc/src/main/resources/schemas/CDSActionIdentifiersType.avsc +++ /dev/null @@ -1,23 +0,0 @@ -{ - "type": "record", - "name": "CDSActionIdentifiers_Type", - "namespace": "org.onap.policy.apex.onap.helloworld", - "fields": [ - { - "name": "actionName", - "type": "string" - }, - { - "name": "blueprintName", - "type": "string" - }, - { - "name": "blueprintVersion", - "type": "string" - }, - { - "name": "mode", - "type": "string" - } - ] -} diff --git a/examples/examples-grpc/src/main/resources/schemas/CDSActionIdentifiersType.json b/examples/examples-grpc/src/main/resources/schemas/CDSActionIdentifiersType.json new file mode 100644 index 000000000..a02d51f56 --- /dev/null +++ b/examples/examples-grpc/src/main/resources/schemas/CDSActionIdentifiersType.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "actionName": { + "type": "string" + }, + "blueprintName": { + "type": "string" + }, + "blueprintVersion": { + "type": "string" + }, + "mode": { + "type": "string" + } + }, + "required": [ + "actionName", + "blueprintName", + "blueprintVersion", + "mode" + ] +} diff --git a/examples/examples-grpc/src/main/resources/schemas/CDSCreateSubscriptionPayloadType.avsc b/examples/examples-grpc/src/main/resources/schemas/CDSCreateSubscriptionPayloadType.avsc deleted file mode 100644 index 4dc03d300..000000000 --- a/examples/examples-grpc/src/main/resources/schemas/CDSCreateSubscriptionPayloadType.avsc +++ /dev/null @@ -1,91 +0,0 @@ -{ - "type": "map", - "values": { - "type": "record", - "name": "CDSRequestPayloadEntry", - "fields": [ - { - "name": "create_DasH_subscription_DasH_properties", - "type": { - "name": "create_DasH_subscription_DasH_properties_record", - "type": "record", - "fields": [ - { - "name": "nfName", - "type": "string" - }, - { - "name": "subscriptionName", - "type": "string" - }, - { - "name": "administrativeState", - "type": "string" - }, - { - "name": "fileBasedGP", - "type": "string" - }, - { - "name": "fileLocation", - "type": "string" - }, - { - "name": "measurementGroups", - "type": { - "type": "array", - "items": { - "name": "measurementGroups_record", - "type": "record", - "fields": [ - { - "name": "measurementGroup", - "type": { - "name": "measurementGroup", - "type": "record", - "fields": [ - { - "name": "measurementTypes", - "type": { - "type": "array", - "items": { - "name": "measurementTypes_record", - "type": "record", - "fields": [ - { - "name": "measurementType", - "type": "string" - } - ] - } - } - }, - { - "name": "managedObjectDNsBasic", - "type": { - "type": "array", - "items": { - "name": "managedObjectDNsBasic_record", - "type": "record", - "fields": [ - { - "name": "DN", - "type": "string" - } - ] - } - } - } - ] - } - } - ] - } - } - } - ] - } - } - ] - } -}
\ No newline at end of file diff --git a/examples/examples-grpc/src/main/resources/schemas/CDSCreateSubscriptionPayloadType.json b/examples/examples-grpc/src/main/resources/schemas/CDSCreateSubscriptionPayloadType.json new file mode 100644 index 000000000..10f961f76 --- /dev/null +++ b/examples/examples-grpc/src/main/resources/schemas/CDSCreateSubscriptionPayloadType.json @@ -0,0 +1,133 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "required": [ + "create-subscription-request" + ], + "properties": { + "create-subscription-request": { + "type": "object", + "required": [ + "create-subscription-properties" + ], + "properties": { + "create-subscription-properties": { + "type": "object", + "required": [ + "nfName", + "administrativeState", + "subscriptionName", + "measurementGroups", + "fileBasedGP", + "fileLocation" + ], + "properties": { + "nfName": { + "type": "string", + "default": "", + "examples": [ + "pnf300" + ], + "pattern": "^.*$" + }, + "administrativeState": { + "type": "string", + "default": "", + "examples": [ + "UNLOCKED" + ], + "pattern": "^.*$" + }, + "subscriptionName": { + "type": "string", + "default": "", + "examples": [ + "testPolicyB" + ], + "pattern": "^.*$" + }, + "measurementGroups": { + "type": "array", + "default": [], + "items": { + "type": "object", + "required": [ + "measurementGroup" + ], + "properties": { + "measurementGroup": { + "type": "object", + "required": [ + "measurementTypes", + "managedObjectDNsBasic" + ], + "properties": { + "measurementTypes": { + "type": "array", + "default": [], + "items": { + "type": "object", + "required": [ + "measurementType" + ], + "properties": { + "measurementType": { + "type": "string", + "default": "", + "examples": [ + "countera" + ], + "pattern": "^.*$" + } + } + } + }, + "managedObjectDNsBasic": { + "type": "array", + "default": [], + "items": { + "$id": "#root/create-subscription-request/create-subscription-properties/measurementGroups/items/measurementGroup/managedObjectDNsBasic/items", + "title": "Items", + "type": "object", + "required": [ + "DN" + ], + "properties": { + "DN": { + "type": "string", + "default": "", + "examples": [ + "dna" + ], + "pattern": "^.*$" + } + } + } + } + } + } + } + } + }, + "fileBasedGP": { + "type": "string", + "default": "", + "examples": [ + "15.0" + ], + "pattern": "^.*$" + }, + "fileLocation": { + "type": "string", + "default": "", + "examples": [ + "/pm/pm.xml" + ], + "pattern": "^.*$" + } + } + } + } + } + } +}
\ No newline at end of file diff --git a/examples/examples-grpc/src/main/resources/schemas/CDSRequestCommonHeaderType.avsc b/examples/examples-grpc/src/main/resources/schemas/CDSRequestCommonHeaderType.avsc deleted file mode 100644 index 7e7e9256c..000000000 --- a/examples/examples-grpc/src/main/resources/schemas/CDSRequestCommonHeaderType.avsc +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "record", - "name": "CDSRequestCommonHeader_Type", - "namespace": "org.onap.policy.apex.onap.helloworld", - "fields": [ - { - "name": "originatorId", - "type": "string" - }, - { - "name": "requestId", - "type": "string" - }, - { - "name": "subRequestId", - "type": "string" - } - ] -} diff --git a/examples/examples-grpc/src/main/resources/schemas/CDSRequestCommonHeaderType.json b/examples/examples-grpc/src/main/resources/schemas/CDSRequestCommonHeaderType.json new file mode 100644 index 000000000..c1890f963 --- /dev/null +++ b/examples/examples-grpc/src/main/resources/schemas/CDSRequestCommonHeaderType.json @@ -0,0 +1,43 @@ +{ + "definitions": {}, + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Root", + "type": "object", + "required": [ + "requestId", + "subRequestId", + "originatorId" + ], + "properties": { + "requestId": { + "$id": "#root/requestId", + "title": "Requestid", + "type": "string", + "default": "", + "examples": [ + "123456-1000" + ], + "pattern": "^.*$" + }, + "subRequestId": { + "$id": "#root/subRequestId", + "title": "Subrequestid", + "type": "string", + "default": "", + "examples": [ + "sub-123456-1000" + ], + "pattern": "^.*$" + }, + "originatorId": { + "$id": "#root/originatorId", + "title": "Originatorid", + "type": "string", + "default": "", + "examples": [ + "sdnc" + ], + "pattern": "^.*$" + } + } +} diff --git a/examples/examples-grpc/src/main/resources/schemas/CDSResponseCommonHeaderType.avsc b/examples/examples-grpc/src/main/resources/schemas/CDSResponseCommonHeaderType.avsc deleted file mode 100644 index fe2fae8c7..000000000 --- a/examples/examples-grpc/src/main/resources/schemas/CDSResponseCommonHeaderType.avsc +++ /dev/null @@ -1,23 +0,0 @@ -{ - "type": "record", - "name": "CDSResponseCommonHeader_Type", - "namespace": "org.onap.policy.apex.onap.helloworld", - "fields": [ - { - "name": "originatorId", - "type": "string" - }, - { - "name": "requestId", - "type": "string" - }, - { - "name": "subRequestId", - "type": "string" - }, - { - "name": "timestamp", - "type": "string" - } - ] -} diff --git a/examples/examples-grpc/src/main/resources/schemas/CDSResponseCommonHeaderType.json b/examples/examples-grpc/src/main/resources/schemas/CDSResponseCommonHeaderType.json new file mode 100644 index 000000000..08bc87c93 --- /dev/null +++ b/examples/examples-grpc/src/main/resources/schemas/CDSResponseCommonHeaderType.json @@ -0,0 +1,28 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "timestamp": { + "type": "string" + }, + "requestId": { + "type": "string" + }, + "subRequestId": { + "type": "string" + }, + "flag": { + "type": "object" + }, + "originatorId": { + "type": "string" + } + }, + "required": [ + "timestamp", + "requestId", + "subRequestId", + "flag", + "originatorId" + ] +} diff --git a/examples/examples-grpc/src/main/resources/schemas/CDSResponsePayloadType.avsc b/examples/examples-grpc/src/main/resources/schemas/CDSResponsePayloadType.avsc deleted file mode 100644 index e8a958119..000000000 --- a/examples/examples-grpc/src/main/resources/schemas/CDSResponsePayloadType.avsc +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "CDSResponsePayloadEntry", - "type": "record", - "namespace": "com.acme.avro", - "fields": [ - { - "name": "create_DasH_subscription_DasH_response", - "type": { - "name": "create_DasH_subscription_DasH_response", - "type": "record", - "fields": [ - { - "name": "odl_DasH_response", - "type": { - "name": "odl_DasH_response", - "type": "record", - "fields": [ - { - "name": "status", - "type": "string" - } - ] - } - } - ] - } - } - ] -} diff --git a/examples/examples-grpc/src/main/resources/schemas/CDSResponsePayloadType.json b/examples/examples-grpc/src/main/resources/schemas/CDSResponsePayloadType.json new file mode 100644 index 000000000..a3cbd9f5b --- /dev/null +++ b/examples/examples-grpc/src/main/resources/schemas/CDSResponsePayloadType.json @@ -0,0 +1,28 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "create-subscription-response": { + "type": "object", + "properties": { + "odl-response": { + "type": "object", + "properties": { + "status": { + "type": "string" + } + }, + "required": [ + "status" + ] + } + }, + "required": [ + "odl-response" + ] + } + }, + "required": [ + "create-subscription-response" + ] +} diff --git a/examples/examples-grpc/src/main/resources/schemas/CDSResponseStatusType.avsc b/examples/examples-grpc/src/main/resources/schemas/CDSResponseStatusType.avsc deleted file mode 100644 index fa2dfa7d6..000000000 --- a/examples/examples-grpc/src/main/resources/schemas/CDSResponseStatusType.avsc +++ /dev/null @@ -1,23 +0,0 @@ -{ - "type": "record", - "name": "CDSResponseStatus_Type", - "namespace": "org.onap.policy.apex.onap.helloworld", - "fields": [ - { - "name": "code", - "type": "int" - }, - { - "name": "eventType", - "type": "string" - }, - { - "name": "timestamp", - "type": "string" - }, - { - "name": "message", - "type": "string" - } - ] -} diff --git a/examples/examples-grpc/src/main/resources/schemas/CDSResponseStatusType.json b/examples/examples-grpc/src/main/resources/schemas/CDSResponseStatusType.json new file mode 100644 index 000000000..9f3da62b6 --- /dev/null +++ b/examples/examples-grpc/src/main/resources/schemas/CDSResponseStatusType.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "message": { + "type": "string" + }, + "eventType": { + "type": "string" + }, + "timestamp": { + "type": "string" + } + }, + "required": [ + "code", + "message", + "eventType", + "timestamp" + ] +} diff --git a/examples/examples-grpc/src/main/resources/schemas/PMSubscriptionType.avsc b/examples/examples-grpc/src/main/resources/schemas/PMSubscriptionType.avsc deleted file mode 100644 index 1d9c7d4b4..000000000 --- a/examples/examples-grpc/src/main/resources/schemas/PMSubscriptionType.avsc +++ /dev/null @@ -1,101 +0,0 @@ -{ - "name": "PMSubscription", - "type": "record", - "namespace": "org.onap.policy.apex.onap.pmcontrol", - "fields": [ - { - "name": "nfName", - "type": "string" - }, - { - "name": "changeType", - "type": "string" - }, - { - "name": "closedLoopControlName", - "type": "string" - }, - { - "name": "policyName", - "type": "string" - }, - { - "name": "subscription", - "type": { - "name": "subscription", - "type": "record", - "fields": [ - { - "name": "subscriptionName", - "type": "string" - }, - { - "name": "administrativeState", - "type": "string" - }, - { - "name": "fileBasedGP", - "type": "int" - }, - { - "name": "fileLocation", - "type": "string" - }, - { - "name": "measurementGroups", - "type": { - "type": "array", - "items": { - "name": "Measurement_Groups_Type", - "type": "record", - "fields": [ - { - "name": "measurementGroup", - "type": { - "name": "Measurement_Group_Type", - "type": "record", - "fields": [ - { - "name": "measurementTypes", - "type": { - "type": "array", - "items": { - "name": "Measurement_Types_Type", - "type": "record", - "fields": [ - { - "name": "measurementType", - "type": "string" - } - ] - } - } - }, - { - "name": "managedObjectDNsBasic", - "type": { - "type": "array", - "items": { - "name": "Managed_Object_Dns_Basic_Type", - "type": "record", - "fields": [ - { - "name": "DN", - "type": "string" - } - ] - } - } - } - ] - } - } - ] - } - } - } - ] - } - } - ] -}
\ No newline at end of file diff --git a/examples/examples-grpc/src/main/resources/schemas/PMSubscriptionType.json b/examples/examples-grpc/src/main/resources/schemas/PMSubscriptionType.json new file mode 100644 index 000000000..ab0aaa228 --- /dev/null +++ b/examples/examples-grpc/src/main/resources/schemas/PMSubscriptionType.json @@ -0,0 +1,101 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "changeType": { + "type": "string" + }, + "closedLoopControlName": { + "type": "string" + }, + "policyName": { + "type": "string" + }, + "nfName": { + "type": "string" + }, + "subscription": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "measurementGroup": { + "type": "object", + "properties": { + "measurementTypes": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "measurementType": { + "type": "string" + } + }, + "required": [ + "measurementType" + ] + }, + { + "type": "object", + "properties": { + "measurementType": { + "type": "string" + } + }, + "required": [ + "measurementType" + ] + } + ] + }, + "managedObjectDNsBasic": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "DN": { + "type": "string" + } + }, + "required": [ + "DN" + ] + }, + { + "type": "object", + "properties": { + "DN": { + "type": "string" + } + }, + "required": [ + "DN" + ] + } + ] + } + }, + "required": [ + "measurementTypes", + "managedObjectDNsBasic" + ] + } + }, + "required": [ + "measurementGroup" + ] + } + ] + } + }, + "required": [ + "changeType", + "closedLoopControlName", + "policyName", + "nfName", + "subscription" + ] +} diff --git a/examples/examples-grpc/src/main/resources/schemas/SubscriptionStatusType.avsc b/examples/examples-grpc/src/main/resources/schemas/SubscriptionStatusType.avsc deleted file mode 100644 index 247ba8a8c..000000000 --- a/examples/examples-grpc/src/main/resources/schemas/SubscriptionStatusType.avsc +++ /dev/null @@ -1,23 +0,0 @@ -{ - "type": "record", - "name": "ActivateSubscriptionStatus_Type", - "namespace": "org.onap.policy.apex.onap.helloworld", - "fields": [ - { - "name": "subscriptionName", - "type": "string" - }, - { - "name": "nfName", - "type": "string" - }, - { - "name": "changeType", - "type": "string" - }, - { - "name": "message", - "type": "string" - } - ] -}
\ No newline at end of file diff --git a/examples/examples-grpc/src/main/resources/schemas/SubscriptionStatusType.json b/examples/examples-grpc/src/main/resources/schemas/SubscriptionStatusType.json new file mode 100644 index 000000000..fb81768e0 --- /dev/null +++ b/examples/examples-grpc/src/main/resources/schemas/SubscriptionStatusType.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "subscriptionName": { + "type": "string" + }, + "nfName": { + "type": "string" + }, + "changeType": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "required": [ + "subscriptionName", + "nfName", + "changeType", + "message" + ] +} diff --git a/examples/examples-grpc/src/main/resources/schemas/SubscriptionType.avsc b/examples/examples-grpc/src/main/resources/schemas/SubscriptionType.avsc deleted file mode 100644 index 7172b7aab..000000000 --- a/examples/examples-grpc/src/main/resources/schemas/SubscriptionType.avsc +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "subscription", - "type": "record", - "fields": [ - { - "name": "subscriptionName", - "type": "string" - }, - { - "name": "administrativeState", - "type": "string" - }, - { - "name": "fileBasedGP", - "type": "int" - }, - { - "name": "fileLocation", - "type": "string" - }, - { - "name": "measurementGroups", - "type": { - "type": "array", - "items": { - "name": "Measurement_Groups_Type", - "type": "record", - "fields": [ - { - "name": "measurementGroup", - "type": { - "name": "Measurement_Group_Type", - "type": "record", - "fields": [ - { - "name": "measurementTypes", - "type": { - "type": "array", - "items": { - "name": "Measurement_Types_Type", - "type": "record", - "fields": [ - { - "name": "measurementType", - "type": "string" - } - ] - } - } - }, - { - "name": "managedObjectDNsBasic", - "type": { - "type": "array", - "items": { - "name": "Managed_Object_Dns_Basic_Type", - "type": "record", - "fields": [ - { - "name": "DN", - "type": "string" - } - ] - } - } - } - ] - } - } - ] - } - } - } - ] -}
\ No newline at end of file diff --git a/examples/examples-grpc/src/main/resources/schemas/SubscriptionType.json b/examples/examples-grpc/src/main/resources/schemas/SubscriptionType.json new file mode 100644 index 000000000..4dbade513 --- /dev/null +++ b/examples/examples-grpc/src/main/resources/schemas/SubscriptionType.json @@ -0,0 +1,133 @@ +{ + "definitions": {}, + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Root", + "type": "object", + "required": [ + "subscriptionName", + "administrativeState", + "fileBasedGP", + "fileLocation", + "measurementGroups" + ], + "properties": { + "subscriptionName": { + "$id": "#root/subscriptionName", + "title": "Subscriptionname", + "type": "string", + "default": "", + "examples": [ + "testPolicyB" + ], + "pattern": "^.*$" + }, + "administrativeState": { + "$id": "#root/administrativeState", + "title": "Administrativestate", + "type": "string", + "default": "", + "examples": [ + "UNLOCKED" + ], + "pattern": "^.*$" + }, + "fileBasedGP": { + "$id": "#root/fileBasedGP", + "title": "Filebasedgp", + "type": "integer", + "examples": [ + 15 + ], + "default": 0 + }, + "fileLocation": { + "$id": "#root/fileLocation", + "title": "Filelocation", + "type": "string", + "default": "", + "examples": [ + "/pm/pm.xml" + ], + "pattern": "^.*$" + }, + "measurementGroups": { + "$id": "#root/measurementGroups", + "title": "Measurementgroups", + "type": "array", + "default": [], + "items": { + "$id": "#root/measurementGroups/items", + "title": "Items", + "type": "object", + "required": [ + "measurementGroup" + ], + "properties": { + "measurementGroup": { + "$id": "#root/measurementGroups/items/measurementGroup", + "title": "Measurementgroup", + "type": "object", + "required": [ + "measurementTypes", + "managedObjectDNsBasic" + ], + "properties": { + "measurementTypes": { + "$id": "#root/measurementGroups/items/measurementGroup/measurementTypes", + "title": "Measurementtypes", + "type": "array", + "default": [], + "items": { + "$id": "#root/measurementGroups/items/measurementGroup/measurementTypes/items", + "title": "Items", + "type": "object", + "required": [ + "measurementType" + ], + "properties": { + "measurementType": { + "$id": "#root/measurementGroups/items/measurementGroup/measurementTypes/items/measurementType", + "title": "Measurementtype", + "type": "string", + "default": "", + "examples": [ + "countera" + ], + "pattern": "^.*$" + } + } + } + }, + "managedObjectDNsBasic": { + "$id": "#root/measurementGroups/items/measurementGroup/managedObjectDNsBasic", + "title": "Managedobjectdnsbasic", + "type": "array", + "default": [], + "items": { + "$id": "#root/measurementGroups/items/measurementGroup/managedObjectDNsBasic/items", + "title": "Items", + "type": "object", + "required": [ + "DN" + ], + "properties": { + "DN": { + "$id": "#root/measurementGroups/items/measurementGroup/managedObjectDNsBasic/items/DN", + "title": "Dn", + "type": "string", + "default": "", + "examples": [ + "dna" + ], + "pattern": "^.*$" + } + } + } + } + } + } + } + } + } + } +} |