federations

GET

Retrieves a list of Federation mappings (i.e. Federation Resolvers) for the current user.

Auth. Required:

Yes

Roles Required:

“admin”, “Federation”, “operations”, “Portal”, or “Steering”

Response Type:

Array

Request Structure

No parameters available.

Response Structure

deliveryService:

The xml_id that uniquely identifies the Delivery Service that uses the federation mappings in mappings

mappings:

An array of objects that represent the mapping of a Federation’s CNAME to one or more Resolvers

cname:

The actual CNAME used by the Federation

resolve4:

An array of IPv4 addresses (or subnets in CIDR notation) capable of resolving the Federation’s CNAME

resolve6:

An array of IPv6 addresses (or subnets in CIDR notation) capable of resolving the Federation’s CNAME

ttl:

The TTL of the CNAME in hours

#366 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-Type: application/json
Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: d6Llm5qNc2sfgVH9IimW7hA4wvtBUq6EzUmpJf805kB0k6v2WysNgFEWK4hBXNdAYkr8hYuKPrwDy3tCx0OZ8Q==
X-Server-Name: traffic_ops_golang/
Date: Mon, 03 Dec 2018 17:19:13 GMT
Content-Length: 136

{ "response": [
    {
        "mappings": [
            {
                "ttl": 300,
                "cname": "blah.blah.",
                "resolve4": [
                    "0.0.0.0/32"
                ],
                "resolve6": [
                    "::/128"
                ]
            }
        ],
        "deliveryService": "demo1"
    }
]}

POST

Allows a user to create Federation Resolvers for Delivery Services, providing the Delivery Service is within a CDN that has some associated Federation.

Warning

Confusingly, this method of this endpoint does not create a new Federation; to do that, the cdns/{{name}}/federations endpoint must be used. Furthermore, the Federation must properly be assigned to a Delivery Service using the federations/{{ID}}/deliveryservices and assigned to the user creating Resolvers using federations/{{ID}}/users.

See also

The federations/{{ID}}/federation_resolvers endpoint duplicates this functionality.

Auth. Required:

Yes

Roles Required:

“admin”, “Federation”, “operations”, “Portal”, or “Steering”

Response Type:

Object (string)

Request Structure

The request payload is an array of objects that describe Delivery Service Federation Resolver mappings. Each object in the array must be in the following format.

deliveryService:

The xml_id of the Delivery Service which will use the Federation Resolvers specified in mappings

mappings:

An object containing two arrays of IP addresses (or subnets in CIDR notation) to use as Federation Resolvers

resolve4:

An array of IPv4 addresses (or subnets in CIDR notation) that can resolve the Delivery Service’s Federation

resolve6:

An array of IPv6 addresses (or subnets in CIDR notation) that can resolve the Delivery Service’s Federation

#367 Request Example
POST /api/3.0/federations HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
Content-Length: 118
Content-Type: application/json


[{
    "deliveryService":"demo1",
    "mappings":{
        "resolve4":["127.0.0.1", "0.0.0.0/32"],
        "resolve6":["::1", "5efa::ff00/128"]
    }
}]

Response Structure

#368 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-Type: application/json
Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: B7TSUOYZPRPyi3mVy+CuxiXR5k/d0s07w4i6kYzpWS+YL79juEfkuSqfedaYG/kMA8O9XbjkWRjcBAdxOVrdTQ==
X-Server-Name: traffic_ops_golang/
Date: Wed, 23 Oct 2019 22:28:02 GMT
Content-Length: 152

{ "alerts": [
    {
        "text": "admin successfully created federation resolvers.",
        "level": "success"
    }
],
"response": "admin successfully created federation resolvers."
}

DELETE

Deletes all Federation Resolvers associated with the logged-in user’s Federations.

Auth. Required:

Yes

Roles Required:

“admin”, “Federation”, “operations”, “Portal”, or “Steering”

Response Type:

Object (string)

Request Structure

No parameters available

#369 Request Example
DELETE /api/3.0/federations HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...

Response Structure

#370 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-Type: application/json
Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: fd7P45mIiHuYqZZW6+8K+YjY1Pe504Aaw4J4Zp9AhrqLX72ERytTqWtAp1msutzNSRUdUSC72+odNPtpv3O8uw==
X-Server-Name: traffic_ops_golang/
Date: Wed, 23 Oct 2019 23:34:53 GMT
Content-Length: 184

{ "alerts": [
    {
        "text": "admin successfully deleted all federation resolvers: [ 8.8.8.8 ]",
        "level": "success"
    }
],
"response": "admin successfully deleted all federation resolvers: [ 8.8.8.8 ]"
}

PUT

Replaces all Federations associated with a user’s Delivery Service(s) with those defined inside the request payload.

Auth. Required:

Yes

Roles Required:

“admin”, “Federation”, “operations”, “Portal”, or “Steering”

Response Type:

Object (string)

Request Structure

The request payload is an array of objects that describe Delivery Service Federation Resolver mappings. Each object in the array must be in the following format.

deliveryService:

The xml_id of the Delivery Service which will use the Federation Resolvers specified in mappings

mappings:

An object containing two arrays of IP addresses (or subnets in CIDR notation) to use as Federation Resolvers

resolve4:

An array of IPv4 addresses (or subnets in CIDR notation) that can resolve the Delivery Service’s Federation

resolve6:

An array of IPv6 addresses (or subnets in CIDR notation) that can resolve the Delivery Service’s Federation

#371 Request Example
PUT /api/3.0/federations HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
Content-Length: 95
Content-Type: application/json

[{ "mappings": {
    "resolve4": ["8.8.8.8"],
    "resolve6": []
},
"deliveryService":"demo1"
}]

Response Structure

#372 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: *
Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: dQ5AvQULhc254zQwgUpBl1/CHbLr/clKtkbs0Ju9f1BM4xIfbbO3puFNN9zaEaZ1iz0lBvHFp/PgfUqisD3QHA==
X-Server-Name: traffic_ops_golang/
Date: Wed, 23 Oct 2019 23:22:03 GMT
Content-Length: 258
Content-Type: application/json

{ "alerts": [
    {
        "text": "admin successfully deleted all federation resolvers: [ 8.8.8.8 ]",
        "level": "success"
    },
    {
        "text": "admin successfully created federation resolvers.",
        "level": "success"
    }
],
"response": "admin successfully created federation resolvers."
}