Skip to content

Latest commit

 

History

History
184 lines (160 loc) · 6.92 KB

phys_locations_id.rst

File metadata and controls

184 lines (160 loc) · 6.92 KB

phys_locations/{{ID}}

PUT

Updates a Physical Location

Auth. Required

Yes

Roles Required

"admin" or "operations"

Response Type

Array

Request Structure

Request Path Parameters
Name Description
ID The integral, unique identifier of the Physical Location being modified
address

The physical location's street address

city

The name of the city in which the physical location lies

comments

An optional string for containing any and all human-readable comments

email

An optional string containing email address of the physical location's poc

name

An optional name of the physical location

phone

An optional string containing the phone number where the the physical location's poc might be reached

poc

The name of a "point of contact" for the physical location

region

An optional string naming the region that contains this physical location1

regionId

An integral, unique identifier for the region within which the physical location lies2

shortName

An abbreviation of the name

state

An abbreviation of the name of the state or province within which this physical location lies

zip

The zip code of the physical location

PUT /api/3.0/phys_locations/2 HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
Content-Length: 268
Content-Type: application/json

{
    "address": "1600 Pennsylvania Avenue NW",
    "city": "Washington",
    "comments": "The White House",
    "email": "the@white.house",
    "name": "CDN_in_a_Box",
    "phone": "1-202-456-1414",
    "poc": "Donald J. Trump",
    "regionId": 2,
    "shortName": "ciab",
    "state": "DC",
    "zip": "20500"
}

Response Structure

address

The physical location's street address

city

The name of the city in which the physical location lies

comments

Any and all human-readable comments

email

The email address of the physical location's poc

id

An integral, unique identifier for the physical location

lastUpdated

The date and time at which the physical location was last updated, in non-rfc-datetime

name

The name of the physical location

phone

A phone number where the the physical location's poc might be reached

poc

The name of a "point of contact" for the physical location

region

The name of the region within which the physical location lies

regionId

An integral, unique identifier for the region within which the physical location lies

shortName

An abbreviation of the name

state

An abbreviation of the name of the state or province within which this physical location lies

zip

The zip code of the physical location

HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie
Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE
Access-Control-Allow-Origin: *
Content-Type: application/json
Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: qnMe6OqxjSU8H1njlh00HWNR20YnVlOCufqCTdMBcdC1322jk2ICFQsQQ3XuOOR0WSb7h7OHCfXqDC1/jA1xjA==
X-Server-Name: traffic_ops_golang/
Date: Wed, 05 Dec 2018 23:39:17 GMT
Content-Length: 385

{ "alerts": [
    {
        "text": "physLocation was updated.",
        "level": "success"
    }
],
"response": {
    "address": "1600 Pennsylvania Avenue NW",
    "city": "Washington",
    "comments": "The White House",
    "email": "the@white.house",
    "id": 2,
    "lastUpdated": "2018-12-05 23:39:17+00",
    "name": "CDN_in_a_Box",
    "phone": "1-202-456-1414",
    "poc": "Donald J. Trump",
    "regionId": 2,
    "region": null,
    "shortName": "ciab",
    "state": "DC",
    "zip": "20500"
}}

DELETE

Deletes a Physical Location

Auth. Required

Yes

Roles Required

"admin" or "operations"

Response Type

undefined

Request Structure

Request Path Parameters
Name Description
ID The integral, unique identifier of the Physical Location being deleted
DELETE /api/3.0/phys_locations/3 HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...

Response Structure

HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie
Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE
Access-Control-Allow-Origin: *
Content-Type: application/json
Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: KeW/tEmICwpCGC8F0YMTqHdeR9J6W6Z3w/U+HOSbeCGyaEheCIhIsWlngT3dyfH1tiu8UyzaPB6QrJyXdybBkw==
X-Server-Name: traffic_ops_golang/
Date: Thu, 06 Dec 2018 00:28:48 GMT
Content-Length: 67

{ "alerts": [
    {
        "text": "physLocation was deleted.",
        "level": "success"
    }
]}

  1. The only "region" key that actually matters in the request body is regionId; region is not validated and has no effect - particularly not the effect of re-naming the region - beyond changing the name in the API response to this request. Subsequent requests will reveal the true name of the region. Note that if region is not present in the request body it will be null in the response, but again further requests will show the true region name.

  2. The only "region" key that actually matters in the request body is regionId; region is not validated and has no effect - particularly not the effect of re-naming the region - beyond changing the name in the API response to this request. Subsequent requests will reveal the true name of the region. Note that if region is not present in the request body it will be null in the response, but again further requests will show the true region name.