Mappage d'applications
La version 10.0.1 prend en charge l'API de mappage d'applications.
nfa1000
Network Flow Analysis
10.0.1 prend en charge l'API de mappage d'applications.Le mappage d'applications permet de détecter et de mapper toutes vos entités et leurs interdépendances.
Network Flow Analysis
prend en charge les applications ToS, d'hôte et de sous-réseau. L'API de mappage d'applications permet de gérer les entités de l'une des manières suivantes :Informations complémentaires :
Configuration du mappage d'applicationsMappages d'applications
Lire une entité unique
URI de la ressource
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings(applicationMappings_Id)
Méthode
GET
Exemple de demande
http://127.0.0.1:8981/odata/api/applicationMappings(108)
Exemple de réponse
{ "@odata.context": "$metadata#applicationMappings","protocol": -1,"description": "11","nbar2EngineId": -1,"endPort": -1,"nbar2ApplicationId": -1,"Name": "test","ip": "127.0.0.1","tos": 12,"newPort": 11,"mask": 0,"ruleType": "Tos","ID": 108,"beginPort": -1}
Lire des entités en bloc
URI de la ressource
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings
Méthode
GET
Exemple de demande
http://127.0.0.1:8981/odata/api/applicationMappings
Exemple de réponse
{ "@odata.context": "http://localhost:8981/odata/api/$metadata#applicationMappings","value":[ { "protocol": -1, "description": "11", "nbar2EngineId": -1, "endPort": -1, "nbar2ApplicationId": -1, "Name": "test", "ip": "127.0.0.1", "tos": 12, "newPort": 11, "mask": 0, "ruleType": "Tos", "ID": 108, "beginPort": -1 }, { "protocol": -1, "description": "", "nbar2EngineId": -1, "endPort": -1, "nbar2ApplicationId": -1, "Name": "test", "ip": "127.0.0.1", "tos": 1, "newPort": 11, "mask": 0, "ruleType": "Tos", "ID": 109, "beginPort": -1 } ] }
Créer un type de service (ToS)
URI de la
ressource
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings
Méthode
POST
Charge utile
{ "ruleType" : "<Enter the rule type>","Name" : "<Enter the application mapping name>","newPort" : "<Enter a value between 0 and 65535>","tos" : "<Enter the ToS>"}
Exemple de demande
http://127.0.0.1:8981/odata/api/applicationMappings
Exemple de charge utile
{ "ruleType" : "All","Name" : "Tes1t","newPort" :23457,"tos" : 66}
Exemple de réponse
{ "@odata.context": "$metadata#applicationMappings", "ID": 150, "description": null, "protocol": null, "tos": 66, "ip": null, "mask": null, "beginPort": null, "endPort": null, "newPort": 23457, "nbar2EngineId": null, "nbar2ApplicationId": null, "ruleType": "All", "Name": "Tes1t"}
Créer un hôte
Lors de l'affectation de valeurs aux paramètres, tenez compte des conditions suivantes :
- Si beginPort est égal à -1, le type de service et le protocole doivent être définis sur -1.
- Si beginPort n'est pas égal à -1, définissez le type de service entre -1 et 255, et le protocole doit être 6 pour TCP ou 7 pour UDP.
URI de la
ressource
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings
Méthode
POST
Exemple 1
Charge utile
{ "ruleType" : "<Enter the rule type>","Name" : "<Enter the application mapping name>","newPort" : "<Enter a value between 0 and 65535>","beginPort" : "<Enter a value between -1 and 255>>","tos" : "<Enter a value between -1 and 255>","protocol" : "<Enter-1>","ip" : "<Enter the Host IP address>"}
Exemple de demande
http://127.0.0.1:8981/odata/api/applicationMappings
Exemple de charge utile
{ "ruleType" : "Host", "Name" : "Test22", "newPort" :123, "beginPort" :-1, "tos" : -1, "protocol" : -1, "ip" : "127.0.0.1"}
Exemple de réponse
{ "@odata.context": "$metadata#applicationMappings", "ID": 152, "description": null, "protocol": -1, "tos": -1, "ip": "127.0.0.1", "mask": null, "beginPort": -1, "endPort": null, "newPort": 123, "nbar2EngineId": null, "nbar2ApplicationId": null, "ruleType": "Host", "Name": "Test22"}
Exemple 2
Charge utile
{ "ruleType" : "<Enter the rule type>","Name" : "<Enter the rule name>","newPort" : "<Enter a value between 0 and 65535>","beginPort" : "<Enter a value between 0 and 65535>","tos" : "<Enter a value between -1 and 255>","protocol" : "<Enter 6 or 17>","ip" : "<Enter the Host IP address>"}
Exemple de demande
http://127.0.0.1:8981/odata/api/applicationMappings
Exemple de charge utile
{ "ruleType" : "Host","Name" : "Test211","newPort" :888,"beginPort" :211,"tos" : -1,"protocol": 6,"ip": "127.0.0.1"}
Exemple de réponse
{"ID": 155,"description": null,"protocol": 6,"tos": -1,"ip": "127.0.0.1","mask": null,"beginPort": 211,"endPort": null,"newPort": 888,"nbar2EngineId": null,"nbar2ApplicationId": null,"ruleType": "Host","Name": "Test211"}
Créer un sous-réseau
Pour le mappage d'applications de sous-réseau de type TCP, la valeur de protocole doit être définie sur 6 et la valeur de protocole UDP sur 17.
URI de la ressource
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings
Méthode
POST
Charge utile
{ "ruleType" : "<Enter the rule type>","Name" : "<Enter the application mapping name>","newPort" : "<Enter a value between 0 and 65535>","beginPort" : "<Enter a value between 0 and 65535>","endPort" : "<Enter a value between 0 and 65535>","protocol" : "<Enter 6 or 17>","ip" : "<Enter the Host IP address>""mask": "<Enter a value between 0 and 32>"}
Exemple de demande
http://127.0.0.1:8981/odata/api/applicationMappings
Exemple de charge utile
{ "ruleType" : "Subnet","Name" : "Test4","newPort" :23411,"beginPort" :255,"endPort" : 255,"protocol": 6,"ip": "127.0.0.1","mask": 22}
Exemple de réponse
{ "@odata.context": "$metadata#applicationMappings", "ID": 156, "description": null, "protocol": 6, "tos": null, "ip": "127.0.0.1", "mask": 22, "beginPort": 255, "endPort": 255, "newPort": 23411, "nbar2EngineId": null, "nbar2ApplicationId": null, "ruleType": "Subnet", "Name": "Test4"}
Modifier le type de service (ToS)
URI de la ressource
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings(applicationMappings_id)
Méthode
PATCH
Charge utile
{ "ruleType" : "<Enter the rule type>","Name" : "<Enter the application mapping name>","newPort" : "<Enter a value between 0 and 65535>","tos" : "<Enter the ToS>"}
Exemple de demande
{ "ruleType" : "All","Name" : "Tes1t","newPort" :23457,"tos" : 66}
Exemple de réponse
Cette API ne renvoie aucune réponse.
Modifier l'hôte
URI de la ressource
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings(applicationMapping_id)
Méthode
PATCH
Exemple 1
Charge utile
{"ruleType" : "<Enter the rule type>","Name" : "<Enter the application mapping name>","newPort" : "<Enter a value between 0 and 65535>","beginPort" : "<Enter a value between -1 and 255>>","tos" : "<Enter a value between -1 and 255>","protocol" : "<Enter-1>","ip" : "<Enter the Host IP address>"}
Exemple de demande
{ "ruleType" : "Host","Name" : "Test22","newPort" :23457,"beginPort" :-1,"tos" : -1,"protocol" : -1,"ip" : "127.0.0.1"}
Exemple de réponse
Cette API ne renvoie aucune réponse.
Exemple 2
Charge utile
{ "ruleType" : "<Enter the rule type>","Name" : "<Enter the rule name>","newPort" : "<Enter a value between 0 and 65535>","beginPort" : "<Enter a value between 0 and 65535>","tos" : "<Enter a value between -1 and 255>","protocol" : "<Enter 6 or 17>","ip" : "<Enter the Host IP address>"}
Exemple de demande
{ "ruleType" : "Host","Name" : "Test2","newPort" :23457,"beginPort" :255,"tos" : -1,"protocol": 6,"ip": "127.0.0.1"}
Exemple de réponse
Cette API ne renvoie aucune réponse.
Modifier le sous-réseau
Pour le mappage d'applications de sous-réseau de type TCP, la valeur de protocole doit être définie sur 6 et la valeur de protocole UDP sur 17.
URI de la ressource
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings(applicationMapping_id)
Méthode
PATCH
Charge utile
{"ruleType" : "<Enter the rule type>","Name" : "<Enter the application mapping name>","newPort" : "<Enter a value between 0 and 65535>","beginPort" : "<Enter a value between 0 and 65535>","endPort" : "<Enter a value between 0 and 65535>","protocol" : "<Enter 6 or 17>","ip" : "<Enter the Host IP address>""mask": "<Enter a value between 0 and 32>"}
Exemple de demande
{ "ruleType" : "Subnet","Name" : "Test4","newPort" :23411,"beginPort" :255,"endPort" : 255,"protocol": 6,"ip": "127.0.0.1","mask": 22}
Exemple de réponse
Il n'y a pas de réponse pour cette API.
Supprimer une entité unique
URI de la ressource
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings(applicationMappings_id)
Méthode
DELETE
Charge utile
{ "ApplicationMapping_Id": [<Enter id of the application mapping that should be deleted>]}
Exemple de demande
http://127.0.0.1:8981/odata/api/applicationMappings(108)
Exemple de réponse
Il n'y a pas de réponse pour cette API.
Supprimer des entités en bloc
URI de la ressource
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings/com.ca.nfa.odata.removeApplicationMappings
Méthode
POST
Charge utile
{ ApplicationMappingIds: [<Enter the list of ApplicationMapping_Ids separated by a comma>]}
Exemple de demande
La demande suivante illustre la suppression en bloc d'entités de mappage d'applications.
http://127.0.0.1:8080/odata/api/routers/com.ca.nfa.odata.removeApplicationMappings
Exemple de charge utile
{ "ApplicationMappingIds":[4, 5] }
Exemple de réponse
{ "@odata.context": "$metadata#Collection(com.ca.nfa.odata.applicationMappings)", "value": [ { "ID": 4, "description": "", "protocol": -1, "tos": 123, "ip": "127.0.0.1", "mask": 0, "beginPort": -1, "endPort": -1, "newPort": 125, "nbar2EngineId": -1, "nbar2ApplicationId": -1, "ruleType": "All", "Name": "locus-map" }, { "ID": 5, "description": "", "protocol": -1, "tos": 124, "ip": "127.0.0.1", "mask": 0, "beginPort": -1, "endPort": -1, "newPort": 125, "nbar2EngineId": -1, "nbar2ApplicationId": -1, "ruleType": "All", "Name": "ftp"} ]}
Mappages d'applications prédéfinis
Pour obtenir tous les mappages d'applications prédéfinis, utilisez l'API de mappages d'applications prédéfinis.
Lire une entité unique
URI de la ressource
http://<nfa odata host>:<nfa odata port>/odata/api/predefinedApplicationMappings
Méthode
GET
Charge utile
None
Exemple de demande
http://127.0.0.1:8981/odata/api/applicationMappings
Exemple de réponse
{ "@odata.context": "http://127.0.0.1:8981/odata/api/$metadata#predefinedApplicationMappings", "value": [ { "newPort": 0, "Description": "TCP Fragments", "Name": "fragment", "ID": 630, "portType": "tcp" }, { "newPort": 1, "Description": "TCP Port Service Multiplexer Port", "Name": "tcpmux", "ID": 68, "portType": "tcp" }, { "newPort": 2, "Description": "Remote Job Entry Protocol", "Name": "rje", "ID": 69, "portType": "tcp" }, { "newPort": 3, "Description": "Compression Process", "Name": "compressnet", "ID": 634, "portType": "tcp" }, { "newPort": 5, "Description": "Remote Job Entry", "Name": "rje", "ID": 636, "portType": "tcp" }, { "newPort": 7, "Description": "Echo Protocol", "Name": "echo", "ID": 70, "portType": "tcp" }, { "newPort": 9, "Description": "Discard Protocol", "Name": "discard", "ID": 72, "portType": "tcp" }, { "newPort": 11, "Description": "Active Users Protocol", "Name": "systat", "ID": 74, "portType": "tcp" }, { "newPort": 13, "Description": "Daytime Protocol", "Name": "daytime", "ID": 76, "portType": "tcp" }, { "newPort": 17, "Description": "Quote of the Day Protocol", "Name": "qotd", "ID": 78, "portType": "tcp" } ], "@odata.nextLink": "http://127.0.0.1:8981/odata/api/predefinedApplicationMappings?$skiptoken=10" }
Créer une règle de mappage d'applications NBAR2
URI de la ressource
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings
Méthode
POST
Charge utile
{ "ruleType": "<Enter the rule type>", "Name": "<Enter the application mapping name>", "Description": "<Enter the mapping description>", "nbar2EngineId": <Enter the NBAR2 Engine ID>, "nbar2ApplicationId": <Enter the NBAR2 Application ID>, "newPort": <Enter a value between 0 and 65535> }
Exemple de demande
http://127.0.0.1:8981/odata/api/applicationMappings
Exemple de charge utile
{ "ruleType": "NBAR2", "Name": "NBAR2_NBAR2", "Description": "NBAR2_NBAR2", "nbar2EngineId": 13, "nbar2ApplicationId": 664421, "newPort": 32324 }
Exemple de réponse
{ "@odata.context": "$metadata#applicationMappings", "ID": 1, "Description": "NBAR2_NBAR2", "protocol": null, "tos": null, "ip": null, "mask": null, "beginPort": null, "endPort": null, "newPort": 32324, "nbar2EngineId": 13, "nbar2ApplicationId": 664421, "ruleType": "NBAR2", "Name": "NBAR2_NBAR2" }
Modifier une règle de mappage d'applications NBAR2
URI de la ressource
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings(NBar2Application_ID)
Méthode
PATCH
Charge utile
{ "ruleType": "<Enter the rule type>", "Name": "<Enter the application mapping name>", "Description": "<Enter the mapping description>", "nbar2ApplicationId": <Enter the NBAR2 Application ID> }
Exemple de demande
http://127.0.0.1:8981/odata/api/applicationMappings(1)
Exemple de charge utile
{ "ruleType": "NBAR2", "Name": "NBAR2_NBAR2_EDIT", "Description": "NBAR2_NBAR2_EDIT", "nbar2ApplicationId": 664422 }
Exemple de réponse
Cette API ne renvoie aucune réponse.
Obtenir le statut du trafic de port unique
URI de la ressource
http://<nfa odata host>:<nfa odata port>/odata/api/applicationMappings/com.ca.nfa.odata.PortTrafficStatus(port=<port number>)
Méthode
GET
Exemple de demande
http://127.0.0.1:8981/odata/api/applicationMappings/com.ca.nfa.odata.PortTrafficStatus(port=161)
Exemple de réponse
{ "@odata.context": "http://127.0.0.1:8981/odata/api/$metadata#com.ca.nfa.odata.portTrafficStatus", "PortName": "snmp" }