asns

See also

The Autonomous System Wikipedia page for an explanation of what an ASN actually is.

GET

List all ASNs.

Auth. Required

Yes

Roles Required

None

Permissions Required

ASN:READ, CACHE-GROUP:READ

Response Type

Array

Request Structure

Table 263 Request Query Parameters

Parameter

Required

Description

cachegroup

no

The ID of a Cache Group - only ASNs for this Cache Group will be returned.

id

no

The integral, unique identifier of the desired ASN-to-Cache Group association

orderby

no

Choose the ordering of the results - must be the name of one of the fields of the objects in the response array

sortOrder

no

Changes the order of sorting. Either ascending (default or “asc”) or descending (“desc”)

limit

no

Choose the maximum number of results to return

offset

no

The number of results to skip before beginning to return results. Must use in conjunction with limit

page

no

Return the nth page of results, where “n” is the value of this parameter, pages are limit long and the first page is 1. If offset was defined, this query parameter has no effect. limit must be defined to make use of page.

#627 Request Example
GET /api/4.0/asns HTTP/1.1
User-Agent: python-requests/2.22.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Cookie: mojolicious=...

Response Structure

asn

An ASN as specified by IANA for identifying a service provider

cachegroup

A string that is the Name of the Cache Group that is associated with this ASN

cachegroupId

An integer that is the ID of the Cache Group that is associated with this ASN

id

An integral, unique identifier for this association between an ASN and a Cache Group

lastUpdated

The time and date this server entry was last updated in Traffic Ops’s Custom Date/Time Format

#628 Response Example
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-Encoding: gzip
Content-Type: application/json
Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 02 Dec 2019 22:51:14 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: F2NmDbTpXqrIQDX7IBKH9+1drtTL4XedSfJv6klMgLEZwbLCkddIXuSLpmgVCID6kTVqy3fTKjZS3U+HJ3YUEQ==
X-Server-Name: traffic_ops_golang/
Date: Mon, 02 Dec 2019 21:51:14 GMT
Content-Length: 128

{ "response": [
    {
        "asn": 1,
        "cachegroup": "TRAFFIC_ANALYTICS",
        "cachegroupId": 1,
        "id": 1,
        "lastUpdated": "2019-12-02 21:49:08+00"
    }
]}

POST

Creates a new ASN.

Note

There cannot be two different ASN object with the same asn. An ASN may only belong to one cachegroup, but a cachegroup can have zero or more ASNs.

Auth. Required

Yes

Roles Required

“admin” or “operations”

Permissions Required

ASN:CREATE, ASN:READ, CACHE-GROUP:READ, CACHE-GROUP:UPDATE

Response Type

Object

Request Structure

asn

The value of the new ASN

cachegroup

An optional field which, if present, is a string that specifies the Name of a Cache Group to which this ASN will be assigned

Note

While this endpoint accepts the cachegroup field, sending this in the request payload has no effect except that the response will (erroneously) name the Cache Group to which the ASN was assigned. Any subsequent requests will reveal that, in fact, the Cache Group is set entirely by the cachegroupId field, and so the actual Name may differ from what was in the request.

cachegroupId

An integer that is the ID of a Cache Group to which this ASN will be assigned

#629 Request Example
POST /api/4.0/asns HTTP/1.1
User-Agent: python-requests/2.22.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Cookie: mojolicious=...
Content-Length: 29

{"asn": 1, "cachegroupId": 1}

Response Structure

asn

An ASN as specified by IANA for identifying a service provider

cachegroup

A string that is the Name of the Cache Group that is associated with this ASN

cachegroupId

An integer that is the ID of the Cache Group that is associated with this ASN

id

An integral, unique identifier for this association between an ASN and a Cache Group

lastUpdated

The time and date this server entry was last updated in Traffic Ops’s Custom Date/Time Format

#630 Response Example
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-Encoding: gzip
Content-Type: application/json
Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 02 Dec 2019 22:49:08 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: mx8b2GTYojz4QtMxXCMoQyZogCB504vs0yv6WGly4dwM81W3XiejWNuUwchRBYYi8QHaWsMZ3DaiGGfQi/8Giw==
X-Server-Name: traffic_ops_golang/
Date: Mon, 02 Dec 2019 21:49:08 GMT
Content-Length: 150

{ "alerts": [
    {
        "text": "asn was created.",
        "level": "success"
    }
],
"response": {
    "asn": 1,
    "cachegroup": null,
    "cachegroupId": 1,
    "id": 1,
    "lastUpdated": "2019-12-02 21:49:08+00"
}}

PUT

Updates an existing ASN.

Auth. Required

Yes

Roles Required

“admin” or “operations”

Permissions Required

ASN:UPDATE, ASN:READ, CACHE-GROUP:READ, CACHE-GROUP:UPDATE

Response Type

Object

Request Structure

asn

The value of the new ASN.

cachegroup

A string that specifies the Name of a Cache Group to which this ASN will be assigned. If you do not pass this field, the cachegroup will be null.

cachegroupId

The integral, unique identifier of the status of the Cache Group.

#631 Request Example
PUT /api/4.0/asns?id=1 HTTP/1.1
User-Agent: python-requests/2.22.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Cookie: mojolicious=...
Content-Length: 53

{
    "asn": 1,
    "cachegroup": "TRAFFIC_OPS",
    "cachegroupId": 2
}

Response Structure

asn

An ASN as specified by IANA for identifying a service provider

cachegroup

A string that is the Name of the Cache Group that is associated with this ASN

cachegroupId

An integer that is the ID of the Cache Group that is associated with this ASN

id

An integral, unique identifier for this association between an ASN and a Cache Group

lastUpdated

The time and date this server entry was last updated in Traffic Ops’s Custom Date/Time Format

#632 Response Example
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-Encoding: gzip
Content-Type: application/json
Set-Cookie: mojolicious=...; Path=/; Expires=Tue, 25 Feb 2020 07:21:10 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: MjvwJg6AFbdqGPlAhK+2pfiN+VFjzgeNnhXoMVbh6+fRQYKeej6CCj3x09hwOl4uhp9d9RySrE/CQ3+L1b2VGQ==
X-Server-Name: traffic_ops_golang/
Date: Tue, 25 Feb 2020 06:21:10 GMT
Content-Length: 164

{
    "alerts": [
        {
            "text": "asn was updated.",
            "level": "success"
        }
    ],
    "response": {
        "asn": 1,
        "cachegroup": "TRAFFIC_OPS",
        "cachegroupId": 2,
        "id": 1,
        "lastUpdated": "2020-02-25 06:21:10+00"
    }
}

DELETE

Deletes an existing ASN.

Auth. Required

Yes

Roles Required

“admin” or “operations”

Permissions Required

ASN:DELETE, ASN:READ, CACHE-GROUP:READ, CACHE-GROUP:UPDATE

Response Type

undefined

Request Structure

#633 Request Example
DELETE /api/4.0/asns?id=1 HTTP/1.1
User-Agent: python-requests/2.22.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Cookie: mojolicious=...
Content-Length: 0

Response Structure

#634 Response Example
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-Encoding: gzip
Content-Type: application/json
Set-Cookie: mojolicious=...; Path=/; Expires=Tue, 25 Feb 2020 08:27:33 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: Woz8NSHIYVpX4V5X4xZWZIX1hvGL2uian7nUhjZ8F23Nb9RWQRMIg/cc+1vXEzkT/ehKV9t11FKRLX+avSae0g==
X-Server-Name: traffic_ops_golang/
Date: Tue, 25 Feb 2020 07:27:33 GMT
Content-Length: 83

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