dtolabs / yana2

Yet Another Node Authority ... because you wanted an agile Real-Time Service Model (RTSM)
8 stars 1 forks source link

Add import to api #35

Closed ahonor closed 12 years ago

ahonor commented 12 years ago

Currently the URL to import XML is under /admin. Eg it currently is under /admin/savexml:

curl --form yanaimport=@yana_import.xml "http://localhost:8080/admin/savexml" --cookie cookies.txt

Proposed:

curl --form yanaimport=@yana_import.xml "http://localhost:8080/api/import" --cookie cookies.txt

orubel commented 12 years ago

well a good point but all REST api for node are used. POST > save, GET > show, PUT > update, DELETE, delete

This is why its sent to a separate controller.

ahonor commented 12 years ago

Since the import (and theoretically export) is for the whole model perhaps we should state the resource is 'model'. Eg.

curl --form yanaimport=@yana_import.xml "http://localhost:8080/api/model" --cookie cookies.txt

orubel commented 12 years ago

Well 'model' is a reserved keyword but just on the off chance i could be wrong i gave it a shot. Unfortunately I was right and it did not route properly and I had to revert.

Cant name a controller that.