Skip to content

Commit

Permalink
Servers RFC3339 timestamps (#7718)
Browse files Browse the repository at this point in the history
* Add some missing deprecation notices

* Remove duplicated functionality

* add a utility function to deep copy arbitrary maps

* add deep copy methods for server interface data

* Add v5 server types

* Remove a seemingly unused property

* Add a wrapper for eliminating boilerplate when constructing apiinfos

(cherry picked from commit eae7f40652d11609a4d1f55b62d88d3cd8bc0732)

* Add convenience methods on APIInfos for wrapped handlers

(cherry picked from commit 887033af01cd8f9a64d29bbcb2d7f816ab8190e9)

* fix a bug where error codes weren't being set when they were handled

(cherry picked from commit 1c02baea02c23d93a80c850b0eea1f999af7e300)

* Fix debug binaries no longer ignored

* add a check for proper api version in wrapper

* Update GET handler for APIv5

Also converted the handler to make use of api.Wrap

* Update PUT handler for APIv5

* Update POST handler for APIv5

* update DELETE handler for APIv5

* fix broken unit test

* Replace redundancies in dsserver stuff

* Fix up client methods and tests to use v5 structures

* Update docs

* Add the ability to quickly check if updates or revalidations are pending

* Update CHANGELOG

* Clarify error message

* Fix updPending and revalPending logic

* Remove unused field

* Fix edge case for uninitialized timestamps

Previously, comparison would consider equal timestamps to mean that
updates were in order, but now the update flag must have been set
strictly after the queued flag is set.

* Update docs

* fix incorrect naming in fixtures

* Fix unhelpful error message

* Fix hard-coded v4 structures inside v5 tests

* Remove unused function

* Use version methods for comparisons (where possible)
  • Loading branch information
ocket8888 authored Aug 25, 2023
1 parent 0c3a248 commit 0fb433d
Show file tree
Hide file tree
Showing 32 changed files with 2,609 additions and 1,613 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ local.tar.gz
*.sublime-project
*.sublime-workspace
.vscode/
__debug_bin
__debug_bin*
*.code-workspace
*.pydevproject
.idea/
Expand Down
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- [#7665](https://github.com/apache/trafficcontrol/pull/7665) *Automation* Changes to Ansible role dataset_loader to add ATS 9 support
### Added
- [#7672](https://github.com/apache/trafficcontrol/pull/7672) *Traffic Control Health Client* Added peer monitor flag while using `strategies.yaml`
- [#7609](https://github.com/apache/trafficcontrol/pull/7609) *Traffic Portal* Added Scope Query Param to SSO login.
- [#7609](https://github.com/apache/trafficcontrol/pull/7609) *Traffic Portal* Added Scope Query Param to SSO login.
- [#7450](https://github.com/apache/trafficcontrol/pull/7450) *Traffic Ops* Removed hypnotoad section and added listen field to traffic_ops_golang section in order to simplify cdn config.
- [#7290](https://github.com/apache/trafficcontrol/pull/7302) *Traffic Monitor* Update TM results with hostname from via header, syncronize health on caches with same service address
- [#7291](https://github.com/apache/trafficcontrol/pull/7291) *Traffic Ops* Extended Layered Profile feature to aggregate parameters for all server profiles.
Expand Down Expand Up @@ -72,9 +72,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- [##7605](https://github.com/apache/trafficcontrol/pull/#7605) *Traffic Ops* Fixes `cachegroups_request_comments` v5 apis to respond with `RFC3339` date/time Format.
- [#7621](https://github.com/apache/trafficcontrol/pull/7621) *Traffic Ops* Use ID token for OAuth authentication, not Access Token
- [#7694](https://github.com/apache/trafficcontrol/pull/7694) *t3c*, *Traffic Control Health Client* Upgrade to ATS 9.2
- [#7966](https://github.com/apache/trafficcontrol/pull/7696) *t3c* will no longer clear update flag when config failure occurs and will also give a cache config error msg on exit.
- [#7966](https://github.com/apache/trafficcontrol/pull/7696) *t3c* will no longer clear update flag when config failure occurs and will also give a cache config error msg on exit.
- [#7716](https://github.com/apache/trafficcontrol/pull/7716) *Apache Traffic Server* Use GCC 11 for building.
- [#7742](https://github.com/apache/trafficcontrol/pull/7742) *Traffic Ops* Changed api tests to supply the absolute path of certs.
- [#7718](https://github.com/apache/trafficcontrol/pull/7718) *Traffic Ops* `/servers` endpoint now responds with RFC3339 timestamps for all timestamp fields. Cleaned up naming conventions and superfluous data.

### Fixed
- [#7708] (https://github.com/apache/trafficcontrol/pull/7708) *Traffic Ops* Fixes Parameters V5 apis to respond with RFC3339 date/time Format
Expand All @@ -91,7 +92,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- [#7561](https://github.com/apache/trafficcontrol/pull/7561) *Traffic Ops* *Traffic Ops* Fixed `ASN` V5 apis to respond with `RFC3339` date/time Format.
- [#7598](https://github.com/apache/trafficcontrol/pull/7598) *Traffic Ops* Fixes Server Capability V5 Type Name Minor version
- [#7570](https://github.com/apache/trafficcontrol/pull/7570) *Traffic Ops* Fixes `deliveryservice_request_comments` v5 apis to respond with `RFC3339` date/time Format.
- [#7312](https://github.com/apache/trafficcontrol/issues/7312) *Docs* Changing docs for CDN locks for DELETE response structure v4 and v5.
- [#7312](https://github.com/apache/trafficcontrol/issues/7312) *Docs* Changing docs for CDN locks for DELETE response structure v4 and v5.
- [#7572](https://github.com/apache/trafficcontrol/pull/7572) *Traffic Ops* Fixes Delivery Service Requests V5 apis docs with RFC3339 date/time Format
- [#7544](https://github.com/apache/trafficcontrol/issues/7544) *Traffic Ops* Fixes stats_summary v5 apis to respond with RFC3339 date/time Format.
- [#7542](https://github.com/apache/trafficcontrol/pull/7542) *Traffic Ops* Fixed `CDN Locks` documentation to reflect the correct RFC3339 timestamps.
Expand Down
8 changes: 8 additions & 0 deletions docs/source/api/v4/servers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ Response Structure
:physLocationId: An integral, unique identifier for the physical location where the server resides
:profileNames: List of :ref:`profile-name` of the :term:`Profiles` used by this server
:revalPending: A boolean value which, if ``true`` indicates that this server has pending content invalidation/revalidation

.. deprecated:: 4.1
With the addition of ``revalUpdateTime`` and ``revalApplyTime``, this field is superfluous as it is trivially calculated from those other properties. It has been removed in version 5.0 of the API.

:revalUpdateTime: The last time a content invalidation/revalidation request was submitted for this server. This field defaults to standard epoch
:revalApplyTime: The last time a content invalidation/revalidation request was applied by this server. This field defaults to standard epoch
:rack: A string indicating "server rack" location
Expand Down Expand Up @@ -427,6 +431,10 @@ Response Structure
:physLocationId: An integral, unique identifier for the :term:`Physical Location` where the server resides
:profileNames: List of :ref:`profile-name` of the :term:`Profiles` used by this server
:revalPending: A boolean value which, if ``true`` indicates that this server has pending content invalidation/revalidation

.. deprecated:: 4.1
With the addition of ``revalUpdateTime`` and ``revalApplyTime``, this field is superfluous as it is trivially calculated from those other properties. It has been removed in version 5.0 of the API.

:revalUpdateTime: The last time a content invalidation/revalidation request was submitted for this server. This field defaults to standard epoch
:revalApplyTime: The last time a content invalidation/revalidation request was applied by this server. This field defaults to standard epoch
:rack: A string indicating "server rack" location
Expand Down
8 changes: 8 additions & 0 deletions docs/source/api/v4/servers_id.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ Response Structure
:physLocationId: An integral, unique identifier for the :term:`Physical Location` where the server resides
:profileNames: List of :ref:`profile-name` of the :term:`Profiles` used by this server
:revalPending: A boolean value which, if ``true`` indicates that this server has pending content invalidation/revalidation

.. deprecated:: 4.1
With the addition of ``revalUpdateTime`` and ``revalApplyTime``, this field is superfluous as it is trivially calculated from those other properties. It has been removed in version 5.0 of the API.

:revalUpdateTime: The last time a content invalidation/revalidation request was submitted for this server. This field defaults to standard epoch
:revalApplyTime: The last time a content invalidation/revalidation request was applied by this server. This field defaults to standard epoch
:rack: A string indicating "server rack" location
Expand Down Expand Up @@ -413,6 +417,10 @@ Response Structure
:physLocationId: An integral, unique identifier for the physical location where the server resided
:profileNames: List of :ref:`profile-name` of the :term:`Profiles` which was used by this server
:revalPending: A boolean value which, if ``true`` indicates that this server has pending content invalidation/revalidation

.. deprecated:: 4.1
With the addition of ``revalUpdateTime`` and ``revalApplyTime``, this field is superfluous as it is trivially calculated from those other properties. It has been removed in version 5.0 of the API.

:revalUpdateTime: The last time a content invalidation/revalidation request was submitted for this server. This field defaults to standard epoch
:revalApplyTime: The last time a content invalidation/revalidation request was applied by this server. This field defaults to standard epoch
:rack: A string indicating "server rack" location
Expand Down
Loading

0 comments on commit 0fb433d

Please sign in to comment.