{"type":"api","title":"Add Subscription","meta":{"id":"/apps/pubhub/media/crosswork-network-controller-7-2/76fd4bb9d069fd2530d7a02f0b3a4ca00eccfd35/80d47b4b-45fb-3fe5-9677-6b13ca96ca96","info":{"title":"External Kafka/gRPC Subscription APIs","description":"External Kafka/gRPC subscription APIs exposed by Notification service.","contact":{"name":"Crosswork Team, Cisco","email":"support@cisco.com"},"license":{"name":"Cisco Software License Agreement","url":"http://www.cisco.com/public/sw-license-agreement.html"},"version":"7.2.0"},"x-parser-conf":{"overview":{"markdownPath":"reference/EMF/Notification/extrnl-kafka-v2-api-overview.md"}},"openapi":"3.1.0","servers":[{"url":"https://{server_ip}:30603/crosswork/notification/v2","description":"Generated server url"}]},"spec":{"tags":["External Kafka/gRPC Subscription"],"summary":"Add Subscription","description":"Payload attributes: \n\u003cb\u003edestinationName\u003c/b\u003e: string (destination name created as part of Data Gateways destination UI/API) \n\u003cb\u003edestinationType\u003c/b\u003e: string (possible values [Kafka, gRPC]) \n\u003cb\u003efilter\u003c/b\u003e: string(optional) (Only supported for Inventory) \n Inventory : Filter based on Device type (productFamily/productSeries/productType). \n **Filters are combined using an OR condition. A notification is forwarded if any one of the configured filter conditions is met. \n E.g \u003ci\u003e\"filter\": \"Routers,Switches and Hubs\"\u003c/i\u003e \n E.g \u003ci\u003e\"filter\": \"Cisco 1000 Series,Switches and Hubs\"\u003c/i\u003e \n E.g \u003ci\u003e\"filter\": \"Cisco 1000 Series,Cisco ASR 9904 Router\"\u003c/i\u003e \n\u003cb\u003etopicName\u003c/b\u003e: string (topic name to be subscribed for) \n\u003cb\u003esubscriptionData\u003c/b\u003e: string (For Device_Performance_Monitoring: possible values [policy_type=, policy_instance=], For Network_Performance_Monitoring: possible values [SR_PM_Interface, SR_PM_Policy], For Service_Health_Monitoring: possible values [Y1731_Probes, PCA_Probes]) \n\u003cb\u003esubscriptionDataType\u003c/b\u003e: string (possible values [Inventory_Changes, Alarm, System_Audit, Device_Performance_Monitoring, Network_Performance_Monitoring, Service_Health_Monitoring]) \n* For Kafka [Inventory_Changes, Alarm, System_Audit, Device_Performance_Monitoring, Network_Performance_Monitoring, Service_Health_Monitoring] \n* For gRPC [Device_Performance_Monitoring, Network_Performance_Monitoring] \n\n\u003cb\u003eNote: Encoding formats are as follows:\u003c/b\u003e \nInventory_Changes, Alarm, System_Audit: \u003cb\u003eJson\u003c/b\u003e \nDevice_Performance_Monitoring, Network_Performance_Monitoring, Service_Health_Monitoring: \u003cb\u003eGpbkv\u003c/b\u003e","operationId":"addSubscription","requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"This is a record of subscription","required":["destinationName","destinationType","topicName"],"properties":{"destinationName":{"type":"string","description":"The destination name created as part of Data Gateways destination UI/API"},"destinationType":{"type":"string","description":"The type of destination, (possible values [Kafka])"},"filter":{"type":["string","null"],"description":"This field is optional. (Only supported for Inventory & Performance) Inventory : Filter based on Device type. E.g \"filter\": \"Routers/Cisco 1000 Series Routers/Cisco 1004 Router\" Performance : Filter based on Policy type & Policy Instance (Policy name)E.g \"filter\": \"policy_type=OpticalSFP, policy_instance=instance1"},"topicName":{"type":"string","description":"Topic name to be subscribed for"},"subscriptionData":{"type":["string","null"],"description":"For Device_Performance_Monitoring: possible values [policy_type=, policy_instance=], For Network_Performance_Monitoring: possible values [SR_PM_Interface, SR_PM_Policy], For Service_Health_Monitoring: possible values [Y1731_Probes, PCA_Probes]"},"subscriptionDataType":{"type":"string","description":"The type of data subscribed for, (possible values [Inventory_Changes, Alarm, System_Audit, Device_Performance_Monitoring, Network_Performance_Monitoring, Service_Health_Monitoring])"}},"$$ref":"#/components/schemas/SubscriptionDTO"},"examples":{"System_Audit":{"summary":"Sample request_Audit","value":{"destinationName":"kafkadest","destinationType":"Kafka","filter":null,"topicName":"audit123","subscriptionData":null,"subscriptionDataType":"System_Audit"},"$$ref":"#/components/examples/PostSubscriptionSystem_Audit"},"Alarm":{"summary":"Sample request_Alarm","value":{"destinationName":"kafkadest","destinationType":"Kafka","filter":null,"topicName":"topicalarm","subscriptionData":null,"subscriptionDataType":"Alarm"},"$$ref":"#/components/examples/PostSubscriptionAlarm"},"Inventory_Changes":{"summary":"Sample request_Inventory","value":{"destinationName":"kafkadest","destinationType":"Kafka","filter":null,"topicName":"topic_ic","subscriptionData":null,"subscriptionDataType":"Inventory_Changes"},"$$ref":"#/components/examples/PostSubscriptionInventory_Changes"},"Network_Performance_Monitoring":{"summary":"Sample request_NPM","value":{"destinationName":"kafkadest","destinationType":"Kafka","filter":null,"topicName":"topicnpm","subscriptionData":"SR_PM_Interface","subscriptionDataType":"Network_Performance_Monitoring"},"$$ref":"#/components/examples/PostSubscriptionNetwork_Performance_Monitoring"},"Network_Performance_Monitoring_gRPC":{"summary":"Sample request_NPM_gRPC","value":{"destinationName":"GrpcDest","destinationType":"gRPC","filter":null,"topicName":"grpc.npm","subscriptionData":"SR_PM_Interface","subscriptionDataType":"Network_Performance_Monitoring"},"$$ref":"#/components/examples/PostSubscriptionNetwork_Performance_Monitoring_gRPC"},"Device_Performance_Monitoring":{"summary":"Sample request_DPM","value":{"destinationName":"kafkadest","destinationType":"Kafka","filter":null,"topicName":"topicdpm","subscriptionData":"policy_type=OpticalSFP,policy_instance=instance1","subscriptionDataType":"Device_Performance_Monitoring"},"$$ref":"#/components/examples/PostSubscriptionDevice_Performance_Monitoring"},"Service_Health_Monitoring":{"summary":"Sample request_SHM","value":{"destinationName":"kafkadest","destinationType":"Kafka","filter":null,"topicName":"topicshm","subscriptionData":"Y1731_Probes","subscriptionDataType":"Service_Health_Monitoring"},"$$ref":"#/components/examples/PostSubscriptionService_Health_Monitoring"}}}},"required":true},"responses":{"200":{"description":"Success"},"400":{"description":"Bad Request - Invalid request"},"401":{"description":"Unauthorized. The request has not been applied because it lacks valid authentication credentials for the target resource."},"403":{"description":"Forbidden. The server recognizes the authentication credentials, but the client is not authorized to perform this request."},"500":{"description":"Internal Server Error - operation-failed"}},"method":"post","path":"/subscription"}}