UNIS Logo
  • UNIS Representations Reference
  • UNIS REST API
    • Introduction
    • UNIS REST API Reference
      • Node
      • Port
      • Link
        • List/Query Links
        • Get Link
        • Insert Link
        • Update Link
        • Delete Link
        • Patch Link
      • Path
      • Service
      • Domain
      • Network
      • Topology
      • Metadata
UNIS
  • Docs »
  • UNIS REST API »
  • UNIS REST API Reference »
  • Link »
  • Insert Link
  • View page source

Insert Link¶

Creates a new Link(s).

Request¶

HTTP Request:

POST https://example.com/links

Request Body¶

Link representation or list of Links representations.

Response¶

Response Status Codes¶

  • 201 Created The Link(s) was inserted successfully.
  • 400 Bad Request The data given in the request failed validation.
  • 401 Unauthorized The supplied credentials are not enough to create new Link(s).
  • 409 Conflict The Link(s) already inserted before.
  • 500 Internal Server Error Link(s) couldn’t be inserted, try again.

Response Body¶

If one Link submitted: The new Link representation and Location HTTP header of that Link.

If list of Links submitted: List of Links created.

Examples¶

The examples include only important HTTP header fields for clarity.

Insert single Link¶

Request:

POST /links HTTP/1.1
Host: example.com
Accept: application/perfsonar+json
Content-Type: application/perfsonar+json ;profile=http://unis.crest.iu.edu/schema/20120709/link#
Content-Length: 248

{
    "directed": true,
    "capacity": 10000000000,
    "endpoints": {
        "source": {
            "href": "https://example.com/ports/1",
            "ref": "full"
        },
        "sink": {
            "href": "https://example.com/ports/2",
            "ref": "full"
        }
    }
}

Response

Note that the id, ts and selfRef were created by the server.:

HTTP/1.1 201 Created
Content-Type: application/perfsonar+json ;profile=http://unis.crest.iu.edu/schema/20120709/link#
Location: https://example.com/links/link1

{
    "$schema": "http://unis.crest.iu.edu/schema/20120709/link#",
    "id": "link1",
    "selfRef": "https://example.com/links/link1"
    "ts": 1337711394175048,
    "directed": true,
    "capacity": 10000000000,
    "endpoints": {
        "source": {
            "href": "https://example.com/ports/1",
            "ref": "full"
        },
        "sink": {
            "href": "https://example.com/ports/2",
            "ref": "full"
        }
    }
}
Next Previous

© Copyright 2019, Indiana University

Built with Sphinx using a theme provided by Read the Docs.