Skip to content

Commit b348cf2

Browse files
d-linkoDavid Linko
andauthored
removed unneeded routes (#223)
* removed unneeded routes * update test json files --------- Co-authored-by: David Linko <david.linko@jhuapl.edu>
1 parent 4e38364 commit b348cf2

File tree

5 files changed

+4449
-3939
lines changed

5 files changed

+4449
-3939
lines changed

anms-core/anms/routes/network_manager.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,6 @@ async def nm_register_agent(addr: Data):
8181
return request.status_code
8282

8383

84-
# PUT /agents/idx/{idx}/hex Body is CBOR-encoded HEX ARI to send. $idx is index of node from agents listing
85-
@router.put("/agents/idx/{idx}/hex", status_code=status.HTTP_200_OK)
86-
async def nm_put_hex_idx(idx: str, ari: Data):
87-
url = nm_url + "/agents/idx/{}/send?form=hex".format(idx)
88-
logger.info('post to nm manager %s with idx %s and data %s' % (url, idx, ari.data))
89-
try:
90-
request = requests.post(url=url, data=ari.data, headers={'Content-Type': 'text/plain'})
91-
except Exception:
92-
return status.HTTP_500_INTERNAL_SERVER_ERROR
93-
return request.status_code
94-
95-
9684
# PUT /agents/eid/{eid}/hex Body is CBOR-encoded HEX ARI to send. $eid is the agent to query
9785
@router.put("/agents/eid/{eid}/hex", status_code=status.HTTP_200_OK)
9886
def nm_put_hex_eid(eid: str, ari: Data):

anms-core/anms/routes/system_status.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,3 @@ async def sys_status_get_services_status():
137137
statuses = get_containers_status()
138138
logger.debug(f"Checking all services' status: {str(statuses)}")
139139
return json.dumps(statuses)
140-
141-
# POST /agents Register a new Agent at specified eid (in body of request)
142-
@router.post("/agents",status_code=status.HTTP_200_OK)
143-
async def nm_register_agent(addr: Address):
144-
url = nm_url + "/agents"
145-
logger.info('POST to nm manager %s with addr %s', url, addr)
146-
request = requests.post(url=url, data=addr.data)
147-
return request.status_code
148-
149-
# PUT /agents/eid/{addr}/clear_tables Clear all tables for given node
150-
@router.put("/agents/eid/{addr}/clear_tables",status_code=status.HTTP_200_OK)
151-
async def nm_clear_tables(addr: str):
152-
url = nm_url + "/agents/eid/{}/clear_tables".format(addr)
153-
logger.info('PUT to nm manager %s with addr %s', url, addr)
154-
request = requests.put(url=url)
155-
return request.status_code

anms-core/integration_test/integration_tests.json

Lines changed: 0 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -3429,147 +3429,6 @@
34293429
}
34303430
]
34313431
},
3432-
{
3433-
"name": "Nm Put Hex Idx",
3434-
"request": {
3435-
"method": "PUT",
3436-
"header": [
3437-
{
3438-
"key": "Content-Type",
3439-
"value": "application/json"
3440-
},
3441-
{
3442-
"key": "Accept",
3443-
"value": "application/json"
3444-
}
3445-
],
3446-
"body": {
3447-
"mode": "raw",
3448-
"raw": "{\n \"data\": \"dolore ut Lorem ea\"\n}",
3449-
"options": {
3450-
"raw": {
3451-
"language": "json"
3452-
}
3453-
}
3454-
},
3455-
"url": {
3456-
"raw": "{{baseUrl}}/nm/agents/idx/:idx/hex",
3457-
"host": [
3458-
"{{baseUrl}}"
3459-
],
3460-
"path": [
3461-
"nm",
3462-
"agents",
3463-
"idx",
3464-
":idx",
3465-
"hex"
3466-
],
3467-
"variable": [
3468-
{
3469-
"key": "idx",
3470-
"value": "veniam ut eu Excepteur",
3471-
"description": "(Required) "
3472-
}
3473-
]
3474-
}
3475-
},
3476-
"response": [
3477-
{
3478-
"name": "Successful Response",
3479-
"originalRequest": {
3480-
"method": "PUT",
3481-
"header": [],
3482-
"body": {
3483-
"mode": "raw",
3484-
"raw": "{\n \"data\": \"dolore ut Lorem ea\"\n}",
3485-
"options": {
3486-
"raw": {
3487-
"language": "json"
3488-
}
3489-
}
3490-
},
3491-
"url": {
3492-
"raw": "{{baseUrl}}/nm/agents/idx/:idx/hex",
3493-
"host": [
3494-
"{{baseUrl}}"
3495-
],
3496-
"path": [
3497-
"nm",
3498-
"agents",
3499-
"idx",
3500-
":idx",
3501-
"hex"
3502-
],
3503-
"variable": [
3504-
{
3505-
"key": "idx",
3506-
"value": "veniam ut eu Excepteur",
3507-
"description": "(Required) "
3508-
}
3509-
]
3510-
}
3511-
},
3512-
"status": "OK",
3513-
"code": 200,
3514-
"_postman_previewlanguage": "json",
3515-
"header": [
3516-
{
3517-
"key": "Content-Type",
3518-
"value": "application/json"
3519-
}
3520-
],
3521-
"cookie": [],
3522-
"body": "{}"
3523-
},
3524-
{
3525-
"name": "Validation Error",
3526-
"originalRequest": {
3527-
"method": "PUT",
3528-
"header": [],
3529-
"body": {
3530-
"mode": "raw",
3531-
"raw": "{\n \"data\": \"dolore ut Lorem ea\"\n}",
3532-
"options": {
3533-
"raw": {
3534-
"language": "json"
3535-
}
3536-
}
3537-
},
3538-
"url": {
3539-
"raw": "{{baseUrl}}/nm/agents/idx/:idx/hex",
3540-
"host": [
3541-
"{{baseUrl}}"
3542-
],
3543-
"path": [
3544-
"nm",
3545-
"agents",
3546-
"idx",
3547-
":idx",
3548-
"hex"
3549-
],
3550-
"variable": [
3551-
{
3552-
"key": "idx",
3553-
"value": "veniam ut eu Excepteur",
3554-
"description": "(Required) "
3555-
}
3556-
]
3557-
}
3558-
},
3559-
"status": "Unprocessable Entity (WebDAV) (RFC 4918)",
3560-
"code": 422,
3561-
"_postman_previewlanguage": "json",
3562-
"header": [
3563-
{
3564-
"key": "Content-Type",
3565-
"value": "application/json"
3566-
}
3567-
],
3568-
"cookie": [],
3569-
"body": "{\n \"detail\": [\n {\n \"loc\": [\n \"eiusmod exercitation nulla occae\",\n \"Ut consequat irure quis id\"\n ],\n \"msg\": \"in Ut sed aliquip occaecat\",\n \"type\": \"cupidatat es\"\n },\n {\n \"loc\": [\n \"in ea in ex sit\",\n \"magna exercitation mollit dolore\"\n ],\n \"msg\": \"sit magna elit\",\n \"type\": \"ipsum adipisicing deserunt\"\n }\n ]\n}"
3570-
}
3571-
]
3572-
},
35733432
{
35743433
"name": "Nm Get Agents Info",
35753434
"request": {

0 commit comments

Comments
 (0)