Junos Space SDK > Developer Guides > Junos Space Application Developer Guide > Programming with the Junos Space SDK > Using the Junos Space SDK Plug-in > Using the EJB-REST Wizard > Documentation Management > Sample Documentation > REST API Services

/api/jssdk/hello-world/hello-world/hello-world/countries/{country-id}

The following operations are supported on this resource:

GET /api/jssdk/hello-world/hello-world/hello-world/countries/{country-id} (v1)


This method allows to obtain a country from the countries primary collection by it's id.
(Edit Method Documentation dialog, Description tab)

Access Control:

Following capabilities are required to access this API:
"HelloWorldCap"


Example Usage:

GET /api/jssdk/hello-world/hello-world/hello-world/countries/{country-id}


Parameters:

Name Type URI Type Description Required
country-id int Path id of the desired country
(Edit Method Parameter
Description
dialog)
Y

Content Types:

  • Produces content types :
    application/vnd.jssdk.hello-world.hello-world.country+xml;version=1;q=0.01
    application/vnd.jssdk.hello-world.hello-world.country+json;version=1;q=0.01


  • Sample Output XML:
    (Edit Method Documentation dialog, Output XML tab)

    <country href="/api/jssdk/hello-world/hello-world/countries/{id}"
       uri="/api/jssdk/hello-world/hello-world/countries/{country-id}">
       <id>int</id>
       <name>String</name>
       <population>Integer</population>
       <states
         uri="/api/jssdk/hello-world/hello-world/countries/{country-id}/states">
         <state href="/api/jssdk/hello-world/hello-world/states/{id}"
           uri="/api/jssdk/hello-world/hello-world/countries/{country-id}/states/{id}">
           <id>int</id>
           <name>String</name>
         </state>
       </states>
    </country>


  • Sample Output JSON:
    (Edit Method Documentation dialog, Output JSON tab)

    {
       "country" : {
         "@href" : "/api/jssdk/hello-world/hello-world/countries/{id}" ,
         "@uri" : "/api/jssdk/hello-world/hello-world/countries/{country-id}" ,
         "id" : "int" ,
         "name" : "String" ,
         "population" : "Integer" ,
         "states" : {
           "@uri" : "/api/jssdk/hello-world/hello-world/countries/{country-id}/states"
           ,
           "state" : {
             "@href" : "/api/jssdk/hello-world/hello-world/states/{id}" ,
             "@uri" :
             "/api/jssdk/hello-world/hello-world/countries/{country-id}/states/{id}" ,
             "id" : "int" ,
             "name" : "String"
           }
         }
       }
    }



PUT /api/jssdk/hello-world/hello-world/hello-world/countries/{country-id} (v1)


This method allows to update a country inside the countries primary collection.
(Edit Method Documentation dialog, Description tab)

Access Control:

Following capabilities are required to access this API:
"HelloWorldCap"


Example Usage:

PUT /api/jssdk/hello-world/hello-world/hello-world/countries/{country-id}


Parameters:

Name Type URI Type Description Required
country-id int Path id of the country
(Edit Method Parameter
Description
dialog)
Y

Content Types:

  • Consumes content types :
    application/vnd.jssdk.hello-world.hello-world.country+xml;version=1;charset=UTF-8
    application/vnd.jssdk.hello-world.hello-world.country+json;version=1;charset=UTF-8


  • Produces content types :
    application/vnd.jssdk.hello-world.hello-world.country+xml;version=1;q=0.01
    application/vnd.jssdk.hello-world.hello-world.country+json;version=1;q=0.01


  • Sample Input XML:
    (Edit Method Documentation dialog, Input XML tab)

    <country>
       <name>String</name>
       <population>Integer</population>
    </country>


  • Sample Input JSON:
    (Edit Method Documentation dialog, Input JSON tab)

    {
       "country" : {
         "name" : "String" ,
         "population" : "Integer"
       }
    }


  • Sample Output XML:
    (Edit Method Documentation dialog, Output XML tab)

    <country href="/api/jssdk/hello-world/hello-world/countries/{id}"
       uri="/api/jssdk/hello-world/hello-world/countries/{country-id}">
       <id>int</id>
       <name>String</name>
       <population>Integer</population>
       <states
         uri="/api/jssdk/hello-world/hello-world/countries/{country-id}/states">
         <state href="/api/jssdk/hello-world/hello-world/states/{id}"
           uri="/api/jssdk/hello-world/hello-world/countries/{country-id}/states/{id}">
           <id>int</id>
           <name>String</name>
         </state>
       </states>
    </country>


  • Sample Output JSON:
    (Edit Method Documentation dialog, Output JSON tab)

    {
       "country" : {
         "@href" : "/api/jssdk/hello-world/hello-world/countries/{id}" ,
         "@uri" : "/api/jssdk/hello-world/hello-world/countries/{country-id}" ,
         "id" : "int" ,
         "name" : "String" ,
         "population" : "Integer" ,
         "states" : {
           "@uri" : "/api/jssdk/hello-world/hello-world/countries/{country-id}/states"
           ,
           "state" : {
             "@href" : "/api/jssdk/hello-world/hello-world/states/{id}" ,
             "@uri" :
             "/api/jssdk/hello-world/hello-world/countries/{country-id}/states/{id}" ,
             "id" : "int" ,
             "name" : "String"
           }
         }
       }
    }



DELETE /api/jssdk/hello-world/hello-world/hello-world/countries/{country-id} (v1)


This method allows to delete a country from the countries primary collection.
(Edit Method Documentation dialog, Description tab)

Access Control:

Following capabilities are required to access this API:
"HelloWorldCap"


Example Usage:

DELETE /api/jssdk/hello-world/hello-world/hello-world/countries/{country-id}


Parameters:

Name Type URI Type Description Required
country-id int Path id of the country to be deleted
(Edit Method Parameter
Description
dialog)
Y