7ff5fC1E397d opened a new issue, #8095:
URL: https://github.com/apache/trafficcontrol/issues/8095

   <!--
   ************ STOP!! ************
   If this issue identifies a security vulnerability, DO NOT submit it! 
Instead, contact
   the Apache Traffic Control Security Team at 
[email protected] and follow the
   guidelines at https://apache.org/security regarding vulnerability disclosure.
   
   - For *SUPPORT QUESTIONS*, use the #traffic-control channel on the ASF slack 
(https://s.apache.org/tc-slack-request)
   or the Traffic Control Users mailing list (send an email to 
[email protected] to subscribe).
   - Before submitting, please **SEARCH GITHUB** for a similar issue or PR
       * https://github.com/apache/trafficcontrol/issues
       * https://github.com/apache/trafficcontrol/pulls
   -->
   
   <!-- Do not submit security vulnerabilities or support requests here - see 
above -->
   ## This Bug Report affects these Traffic Control components:
   
   - Traffic Ops
   - Documentation
   - CDN in a Box
   
   
   ## What did you do?
   I have setup CDN-in-a-Box to explore its features , using Portal I was not 
able to [configure 
federation](https://traffic-control-cdn.readthedocs.io/en/latest/admin/quick_howto/federations.html)
   Next I tried API 
    - 
[`federation`](https://traffic-control-cdn.readthedocs.io/en/latest/api/v5/federations.html)
    - 
[`cdns/{{name}}/federations`](https://traffic-control-cdn.readthedocs.io/en/latest/api/v5/cdns_name_federations.html#to-api-cdns-name-federations)
    - 
[`federations/all`](https://traffic-control-cdn.readthedocs.io/en/latest/api/v5/federations_all.html)
   
   and 
   
   > Confusingly, this method of this endpoint does not create a new 
[Federation](https://traffic-control-cdn.readthedocs.io/en/latest/glossary.html#term-Federation);
 to do that, the 
[cdns/{{name}}/federations](https://traffic-control-cdn.readthedocs.io/en/latest/api/v5/cdns_name_federations.html#to-api-cdns-name-federations)
 endpoint must be used. Furthermore, the 
[Federation](https://traffic-control-cdn.readthedocs.io/en/latest/glossary.html#term-Federation)
 must properly be assigned to a [Delivery 
Service](https://traffic-control-cdn.readthedocs.io/en/latest/glossary.html#term-Delivery-Service)
 using the 
[federations/{{ID}}/deliveryservices](https://traffic-control-cdn.readthedocs.io/en/latest/api/v5/federations_id_deliveryservices.html#to-api-federations-id-deliveryservices)
 and assigned to the user creating Resolvers using 
[federations/{{ID}}/users](https://traffic-control-cdn.readthedocs.io/en/latest/api/v5/federations_id_users.html#to-api-federations-id-users).
   
   I understood it that I should do 
    1. `cdns/{{name}}/federations` to create
    2. `federations/{{ID}}/deliveryservices` to assign to a DS
    3. `federations/{{ID}}/users.` to assign to a USER
   
   Continuing with **1. `cdns/{{name}}/federations`** I did 
   
   ```bash
   curl -X POST ... api/5.0/cdns/CDN-in-a-Box/federations"  -H "Content-Type: 
application/json" --data @create.json
   ```
   where create.json is
   
   ```json
   {
     "ttl": 300,
     "cname": "demo1.example.net.",
     "description": "Demo1 Your Federation Description",
   }
   ```
   
   and response was (sample, because I tired several times)
   
   ```json
   {
     "alerts": [
       {
         "text": "Federation was created",
         "level": "success"
       }
     ],
     "response": {
       "id": 12,
       "cname": "demo1.example.net.",
       "ttl": 300,
       "description": "Demo1 Your Federation Description",
       "lastUpdated": "2024-10-27T09:21:56.967206Z"
     }
   }
   ```
   
   Next I tried to GET the added ones , but it lists just the default one:
   
   ```bash
   curl -X GET ... api/5.0/cdns/CDN-in-a-Box/federations"  -H "Content-Type: 
application/json"
   ```
   or
   
   ```bash
   curl -X GET api/5.0/federations/all"  -H "Content-Type: application/json"
   ```
   
   and its response 
   
   ```json
   {
     "response": [
       {
         "id": 1,
         "cname": "foo.kabletown.net.",
         "ttl": 60,
         "description": null,
         "lastUpdated": "2024-10-26T07:22:08.45335Z",
         "deliveryService": {
           "id": 2,
           "xmlID": "demo2"
         }
       }
     ]
   }
   
   ```
   Then I noticed another caution 
   
   > Despite the URL of this endpoint, this does **not** create a 
[Federation](https://traffic-control-cdn.readthedocs.io/en/latest/glossary.html#term-Federation)
 within any particular CDN. A 
[Federation](https://traffic-control-cdn.readthedocs.io/en/latest/glossary.html#term-Federation)
 is associated with a CDN purely because any [Delivery 
Service](https://traffic-control-cdn.readthedocs.io/en/latest/glossary.html#term-Delivery-Service)
 to which it is assigned is scoped to a CDN. Therefore, upon creation a 
[Federation](https://traffic-control-cdn.readthedocs.io/en/latest/glossary.html#term-Federation)
 is not associated with any CDN in particular.
   
   
   So if  "*this does not create a 
[Federation](https://traffic-control-cdn.readthedocs.io/en/latest/glossary.html#term-Federation)
 within any particular CDN*" why the URI address (API) includes a CDN name ?
   
   ## What did you expect to happen?
   - if we create a federation , be able to get / list it/them
   - if a federation should be assigned to a CDN, we could set it using JSON 
data (?)
   
   
   ## What actually happened?
   List of federations only shows the fist (default) one added by CDN-in-a-Box 
demo . Mine are not  listed
   
   ## more info
   I created a federation user . Also tired Admin , results are the same 
   It is about a week I am exploring ATC/ATS so see me as a newbie 
   
   ```bash
   Traffic Portal Info
   Version: 8.1.0-12478.c27d3d99.el8
   Build Date: 2024-10-21 08:23
   API URL: https://trafficops.infra.ciab.test:443
   ```
   
   Please guide  me on how to properly create a federation , my final goal is 
to create a CNAME for a DS
   
   Regards 
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to