Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Ansible playbooks still use Traffic Ops API v1 #5377

@zrhoffman

Description

@zrhoffman

I'm submitting a ...

  • improvement request (usability, performance, tech debt, etc.)

Traffic Control components affected ...

  • Ansible playbooks

Current behavior:

The following references to the Traffic Ops API in our Ansible playbooks need to be updated:

HTTP Method Endpoint Line of Code
POST api/1.3/user/login
url: "{{ to_url }}/api/1.3/user/login"
GET api/1.3/servers
url: "{{ to_url }}/api/1.3/servers"
* 1.3
GET internal/api/1.3/federations.json
value: https://${toHostname}/internal/api/1.3/federations.json
GET api/1.3/profiles/name/{{name}}/parameters
3. Curl to get the response of https://{{ TO_BASE_URL }}/api/1.3/profiles/name/{{ TARGET_PROFILE }}/parameters and save that to a file named `profile.parameters.json`
POST api/1.2/user/login
url: "{{ to_api_base_url }}/api/1.2/user/login"
GET api/1.2/cdns
url: "{{ to_api_base_url }}/api/1.2/cdns"
POST api/1.2/cdns/{{name}}/queue_update
url: "{{ to_api_base_url }}/api/1.2/cdns/{{ cdns_details.json.response | selectattr('name','equalto',to_api_target_cdn) | map(attribute='id') | list | first }}/queue_update"
GET api/1.2/servers/hostname/{{name}}/details
url: "{{ to_api_base_url }}/api/1.2/servers/hostname/{{ to_api_target_host.split('.')[0] }}/details"
PUT api/1.2/servers/{{id}}/status
url: "{{ to_api_base_url }}/api/1.2/servers/{{ server_details.json.response.id }}/status"
GET api/1.2/cdns/{{name}}/snapshot/new
url: "{{ to_api_base_url }}/api/1.2/cdns/{{ to_api_target_cdn }}/snapshot/new"
GET api/1.3/servers/checks
should include an entry for each of your extensions or you can check GET api/1.3/servers/checks
* 1.3

New behavior:

Those lines of code should reference API v3, reference API v4, or be removed.

See https://traffic-control-cdn.readthedocs.io/en/latest/api/migrating-from-v1.html#updating-endpoints-manually for which Traffic Ops API v3 endpoint to update each API v1 endpoint to.

Metadata

Metadata

Assignees

Labels

ansibleRelated to the Ansible rolesautomationrelated to automated testing/deployment/packaging etc.improvementThe functionality exists but it could be improved in some way.tech debtrework due to choosing easy/limited solution

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions