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 »
  • Update Link
  • View page source

Update Link¶

Updates the specified Link with new representation.

Request¶

HTTP Request:

PUT https://example.com/links/{id}

where id is the Link’s identifier.

Request Body¶

Link representation.

Response¶

Response Status Codes¶

  • 201 Created The Link was updated successfully.
  • 400 Bad Request The data given in the request failed validation.
  • 401 Unauthorized The supplied credentials are not enough to update the Link.
  • 409 Conflict The same ts exists before.
  • 500 Internal Server Error Link couldn’t be updated, try again.

Response Body¶

The new Link representation and Location HTTP header of that Link.

Examples¶

The examples include only important HTTP header fields for clarity.

Updating a Link¶

Request:

PUT /links/link1 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/5",
            "ref": "full"
        },
        "sink": {
            "href": "https://example.com/ports/6",
            "ref": "full"
        }
    }
}

Response

Note that the ts was updated by the server.:

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

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

© Copyright 2019, Indiana University

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