Skip to content

REST API(POST/PUT/GET/DELETE) help required #31

@sureshkvl

Description

@sureshkvl

Hi Peter,

I am implementing the sample students yang model, and want to try POST/PUT/GET/DELETE REST API endpoints.

https://github.com/sureshkvl/yangforge-examples/blob/master/students.yang

I am able to run the students.yang as below,
yfc run students.yang

  1. POST API.
    I am able to POST the student in the below API
    POST - http://localhost:5000/restjson/students-yang/students-container/students-list
  2. GET API
    I am able to get the students lists as below,
    http://localhost:5000/restjson/students-yang/students-container/students-list

output :

[
{
"name": "ramesh",
"rollno": 22,
"address": "bangalore,india"
},
{
"name": "suresh",
"rollno": 34,
"address": "chennai,india"
}
]

Query: How to get the specific index or key student object from the student list.?
Basically i want to get only "suresh" student details from the list.

  1. PUT API:
    What is the API(URL) to modify the specific student details?
    http://localhost:5000/restjson/students-yang/students-container/students-list/xxxxxxx
  2. DELETE API:
    Is it possible to delete the object from the list..?

Thanks
suresh

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions