Profiles are unwieldy and dangerous for Operations.
Currently, we have countless Profiles, in broad categories. For example, “EDGE_123_FOO_ABC_ATS_714-RC0-42” might represent servers which are
Suppose we have Amiga 456 machines, at DEF datacenters, and a Bar CDN, and some servers are running ATS 7.15, 8.0, and 8.1. We make profiles for each server we have fitting all those categories:
EDGE_123_FOO_ABC_ATS_714-RC0-27, EDGE_456_FOO_ABC_ATS_714-RC0-27, EDGE_123_BAR_ABC_ATS_714-RC0-42, EDGE_456_FOO_DEF_ATS_714-RC1-27, EDGE_123_FOO_DEF_ATS_800-RC4-29
Layered Profiles allow assigning multiple profiles to Servers. If multiple profiles have a parameter with the same name and config file, the parameter from the last profile in the ordering is applied.
Layered Profiles is exactly as powerful as the existing profiles, it doesn't enable any new things. It makes profiles much easier to manage.
With Layered Profiles, hundreds of profiles become a few dozen, each representing a logical group. For example, a server might have the profiles, in order:
Name | Config File | Value | Profile |
---|---|---|---|
location | url_sig_myds.config | /opt/trafficserver/etc/trafficserver | EDGE |
Drive_Prefix | storage.config | /dev/sd | AMIGA_123 |
error_url | url_sig_myotherds.config | 403 | EDGE |
CONFIG proxy.config.exec_thread.autoconfig.scale | records.config | FLOAT 1.5 | ATS_714 |
Add backend logic to the below-mentioned existing API endpoints, in order to show/create/update/delete a sorted list of profiles for server.
/servers/ GET, POST
/servers/{id} PUT, DELETE
/servers/details
/deliveryservices/{{ID}}/servers
/deliveryservices/{{ID}}/servers/eligible
Existing Endpoints
profileId
, profileDesc
and profile
, remain same.profile
changes to profiles
and profileId
and profileDesc
are no longer part of response structure/servers?id=5
{ "response": [{ "id": 5, "profileNames": ["MID", "AMIGA_123", "CDN_FOO"] }] }
/servers
{ "response": [{ "profileNames": ["MID", "AMIGA_123", "CDN_FOO"] }] }
JSON request with the proposed change will look as follows:
POST /servers
{ "cachegroupId": 6, "cdnId": 2, "profileNames": ["MID", "AMIGA_123", "CDN_FOO"] }
PUT /servers/5
{ "cachegroupId": 6, "cdnId": 2, "profileNames": ["MID", "AMIGA_123", "CDN_FOO"] }
return following response
{ "alerts": [ { "text": "Server created/updated", "level": "success" } ], "response": { "cachegroup": "CDN_in_a_Box_Mid", "cachegroupId": 6, "cdnId": 2, "id": 5, "profileNames": ["MID", "AMIGA_123", "CDN_FOO"] } }
The following table describes the top level layered_profile
object for servers:
field | type | optionality | description |
---|---|---|---|
server | bigint | required | the server id associated with a given profile |
profile_name | text | required | the profile name associated with a server |
order | bigint | required | the order in which a profile is applied to a server |
API constraints
/servers
object, profiles
field is an array,/servers
allows multiple profiles to be assigned, and displayed in the UI, etc. The UI may or may not display a list (which can only add 1), but the client implements handling multiple, and the API is documented to potentially return multiple and how their parameters must be applied.Profiles
key to API endpoints for Server objects/servers
endpoints in order to write TO API tests for the exising endpoints.server_profiles
as described below, will be created:Table "traffic_ops.server_profiles" Column | Type | Collation | Nullable | Default ---------------+--------------------------+-----------+----------+-------- server | bigint | | not null | profile_name | text | | not null | order | bigint | | not null | Indexes: "pk_server_profile" PRIMARY KEY(profile_name, server) Foreign-key constraints: "fk_server_id" FOREIGN KEY (server) REFERENCES public.server(id) ON DELETE CASCADE ON UPDATE CASCADE "fk_server_profile_name_profile" FOREIGN KEY (profile_name) REFERENCES public.profile(name) ON DELETE RESTRICT ON UPDATE CASCADE,
All profiles assigned to a given server will have the same values of:
New set of profiles will be created and the profile-parameter relationship will change.
No impact
These changes will affect the Snapshot generation (both crconfig and monitoring). Even though that is more of a TO impact. Reason being that Snapshots and Monitoring Configurations for a CDN include Profile and Parameter information for the servers, Traffic Monitors, and Traffic Routersz.
No impact
No impact
All existing endpoints will need to be updated, along with the documentation explaining layered_profile
.
Client/API integration tests should be updated to verify the layered_profile
functionality on existing API /servers
endpoints.
We do not anticipate any performance impact with layered_profile approach.
We do not anticipate any impact on security.
The profile-parameter relationship will change based on new sets of profile and Operations will have to learn on how to assign profile order to a server.
Developers will most likely need to use layered_profile, so they'll need to be familiar with the process of adding, sorting, deleting, debugging and working with layered_profiles. When searching for any parameters assigned to a profile for a given server, one will need to look up all profiles assigned to the server and then process all the parameters in order to get the “final” view of the profile.
None, except to keep using existing Profiles.
None
None