Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Understanding Common CRUD Operations

    The Junos Space Network Director API application runs on the Junos Space Network Management Platform, and is exposed by the Network Director orchestration services.

    This topic describes:

    Common CRUD Operations

    Requests are sent to the URI of the resource. For each resource, you can perform one or more of the four common CRUD operations. (A CRUD operation is also called a resource method.) Interactions with each resource follow specific formats, depending on the operation.

    Table 1 describes the common CRUD operations.

    Table 1: Common CRUD Operations

    Operation

    Description

    Request Format

    Response Format

    Create (POST)

    Creates an instance of the resource by sending an HTTP POST request to the designated URI for that resource type.

    POST <resourceURI> HTTP/1.1
    
    URL = https://
    <server-ip>/api/
    juniper/nd/orchestration/<resource> Content-Type = application/vnd/juniper/
    nd/<resource>+(json|xml);
    version=2;charset=UTF-8 Accept = application/vnd.juniper.nd.
    <resource>+(json|xml);version=1 <body of request>
    HTTP/1.1 200 OK
    
    https://
    <server-ip>/api/
    juniper/nd/orchestration/<resource>/<resource-id>

    Read (GET)

    Retrieves the representation of a resource by sending an HTTP GET request to the resource URI.

    GET <resourceURI> HTTP/1.1
    
    URL = https://
    <server-ip>/api/
    juniper/nd/orchestration/<resource> Content-Type = application/vnd/juniper/
    nd/<resource>+(json|xml);
    version=2;charset=UTF-8 Accept = application/vnd.juniper.nd.
    <resource>+(json|xml);version=2 <body of request>
    HTTP/1.1 200 OK
    
    <body of response>

    Update (PUT)

    Updates the representation of a resource by sending an HTTP PUT request to the resource URI.

    Note: If the server detects that the request attempts to update a read-only attribute, the server ignores the update request, but does not generate an error.

    PUT <resourceURI> HTTP/1.1
    
    URL = https://
    <server-ip>/api/
    juniper/nd/orchestration/<resource> Content-Type = application/vnd/juniper/
    nd/<resource>+(json|xml);
    version=2;charset=UTF-8 Accept = application/vnd.juniper.nd.
    <resource>+(json|xml);version=2 <body of request>
    HTTP/1.1 200 OK
    

    Delete (DELETE)

    Deletes a resource by sending an HTTP DELETE request to the resource URI.

    DELETE <resourceURI> HTTP/1.1
    
    URL = https://
    <server-ip>/api/
    juniper/nd/orchestration/<resource> Content-Type = application/vnd/juniper/
    nd/<resource>+(json|xml);
    version=2;charset=UTF-8 Accept = application/vnd.juniper.nd.
    <resource>+(json|xml);version=2 <body of request>
    HTTP/1.1 204 OK
    
    https://
    <server-ip>/api/
    juniper/nd/orchestration/<resource>/<resource-id>

    Modified: 2016-12-15