This repository was archived by the owner on Nov 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 354
Added CDNi Capacity and Telemetry #6524
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
26d89b5
Added CDNi Capacity and Telemetry
mattjackson220 2e3cff3
updated changelog
mattjackson220 b2cfa5a
added cdni doc to toc
mattjackson220 3d8b2d5
added config check
mattjackson220 a3fc6ce
updated per comments
mattjackson220 611fc2c
updated per comments
mattjackson220 7f131c6
got the one i missed
mattjackson220 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| .. | ||
| .. | ||
| .. Licensed under the Apache License, Version 2.0 (the "License"); | ||
| .. you may not use this file except in compliance with the License. | ||
| .. You may obtain a copy of the License at | ||
| .. | ||
| .. http://www.apache.org/licenses/LICENSE-2.0 | ||
| .. | ||
| .. Unless required by applicable law or agreed to in writing, software | ||
| .. distributed under the License is distributed on an "AS IS" BASIS, | ||
| .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| .. See the License for the specific language governing permissions and | ||
| .. limitations under the License. | ||
| .. | ||
|
|
||
| .. _cdni_admin: | ||
|
|
||
| **************************** | ||
| CDNi Administration | ||
| **************************** | ||
|
|
||
| :abbr:`CDNi (Content Delivery Network Interconnect)` specifications define the standards for interoperability within the :abbr:`CDN (Content Delivery Network)` and open caching ecosystems set forth by the :abbr:`IETF (Internet Engineering Task Force)`. This integration utilizes the :abbr:`APIs (Application Programming Interfaces)` defined by the :abbr:`SVA (Streaming Video Alliance)`. | ||
|
|
||
| .. seealso:: For complete details on CDNi and the related API specifications see :rfc:`8006`, :rfc:`8007`, :rfc:`8008`, and the :abbr:`SVA (Streaming Video Alliance)` documents titled `Footprint and Capabilities Interface: Open Caching API`, `Open Caching API Implementation Guidelines`, `Configuration Interface: Part 1 Specification - Overview & Architecture`, `Configuration Interface: Part 2 Specification – CDNi Metadata Model Extensions`, and `Configuration Interface: Part 3 Specification – Publishing Layer APIs`. | ||
|
|
||
| In short, these documents describe the :abbr:`CDNi (Content Delivery Network Interconnect)` metadata interface that enables interconnected :abbr:`CDNs (Content Delivery Networks)` to exchange content distribution metadata to enable content acquisition and delivery. These define the interfaces through which a :abbr:`uCDN (Upstream Content Delivery Network)` and a :abbr:`dCDN (Downstream Content Delivery Network)` can communicate configuration and capacity information. | ||
|
|
||
| For our use case, it is assumed that :abbr:`ATC (Apache Traffic Control)` is the :abbr:`dCDN (Downstream Content Delivery Network)`. | ||
|
|
||
| .. Note:: This is currently under construction and will be for a while. This document will be updated as new features are supported. | ||
|
|
||
| /OC/FCI/advertisement | ||
| ===================== | ||
| .. seealso:: :ref:`to-api-oc-fci-advertisement` | ||
|
|
||
| The advertisement response is unique for the :abbr:`uCDN (Upstream Content Delivery Network)` and contains the complete footprint and capabilities information structure the :abbr:`dCDN (Downstream Content Delivery Network)` wants to expose. This endpoint will return an array of generic :abbr:`FCI (Footprint and Capabilities Advertisement Interface)` base objects, including type, value, and footprint for each. Currently supported base object types are `FCI.Capacitiy` and `FCI.Telemetry` but these will be expanded in the future. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| .. | ||
| .. | ||
| .. Licensed under the Apache License, Version 2.0 (the "License"); | ||
| .. you may not use this file except in compliance with the License. | ||
| .. You may obtain a copy of the License at | ||
| .. | ||
| .. http://www.apache.org/licenses/LICENSE-2.0 | ||
| .. | ||
| .. Unless required by applicable law or agreed to in writing, software | ||
| .. distributed under the License is distributed on an "AS IS" BASIS, | ||
| .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| .. See the License for the specific language governing permissions and | ||
| .. limitations under the License. | ||
| .. | ||
|
|
||
| .. _to-api-oc-fci-advertisement: | ||
|
|
||
| ************************ | ||
| ``OC/FCI/advertisement`` | ||
| ************************ | ||
|
|
||
| ``GET`` | ||
| ======= | ||
| Returns the complete footprint and capabilities information structure the :abbr:`dCDN (Downstream Content Delivery Network)` wants to expose to a given :abbr:`uCDN (Upstream Content Delivery Network)`. | ||
|
|
||
| :Auth. Required: No | ||
| :Roles Required: "admin" or "operations" | ||
| :Permissions Required: CDNI:READ | ||
| :Response Type: Array | ||
| :Headers Required: "Authorization" | ||
|
|
||
| Request Structure | ||
| ----------------- | ||
| .. table:: Request Required Headers | ||
|
|
||
| +-----------------+------------------------------------------------------------------------------------------------------------------------------+ | ||
| | Name | Description | | ||
| +=================+==============================================================================================================================+ | ||
| | Authorization | A :abbr:`JWT (JSON Web Token)` provided by the :abbr:`dCDN (Downstream Content Delivery Network)` to identify the | | ||
| | | :abbr:`uCDN (Upstream Content Delivery Network)`. This token must include the following claims: | | ||
| | | | | ||
| | | - ``iss`` Issuer claim as a string key for the :abbr:`uCDN (Upstream Content Delivery Network)` | | ||
| | | - ``aud`` Audience claim as a string key for the :abbr:`dCDN (Downstream Content Delivery Network)` | | ||
| | | - ``exp`` Expiration claim as the expiration date as a Unix epoch timestamp (in seconds) | | ||
| +-----------------+------------------------------------------------------------------------------------------------------------------------------+ | ||
|
|
||
| Response Structure | ||
| ------------------ | ||
| :capabilities: An array of generic :abbr:`FCI (Footprint and Capabilities Advertisement Interface)` base objects. | ||
| :capability-type: A string of the type of base object. | ||
| :capability-value: An array of the value for the base object. | ||
| :footprints: An array of footprints impacted by this generic base object. | ||
|
|
||
| .. note:: These are meant to be generic and therefore there is not much information in these documents. For further information please see :rfc:`8006`, :rfc:`8007`, :rfc:`8008`, and the :abbr:`SVA (Streaming Video Alliance)` documents titled `Footprint and Capabilities Interface: Open Caching API`, `Open Caching API Implementation Guidelines`, `Configuration Interface: Part 1 Specification - Overview & Architecture`, `Configuration Interface: Part 2 Specification – CDNi Metadata Model Extensions`, and `Configuration Interface: Part 3 Specification – Publishing Layer APIs`. | ||
|
|
||
| .. code-block:: json | ||
| :caption: Example /OC/FCI/advertisement Response | ||
|
|
||
| { | ||
| "capabilities": [ | ||
| { | ||
| "capability-type": "FCI.CapacityLimits", | ||
| "capability-value": [ | ||
| { | ||
| "total-limits": [ | ||
| { | ||
| "limit-type": "egress", | ||
| "maximum-hard": 5000, | ||
| "maximum-soft": 2500, | ||
| "telemetry-source": { | ||
| "id": "capacity_metrics", | ||
| "metric": "capacity" | ||
| } | ||
| } | ||
| ], | ||
| "host-limits": [ | ||
| { | ||
| "host": "example.com", | ||
| "limits": [ | ||
| { | ||
| "limit-type": "requests", | ||
| "maximum-hard": 100, | ||
| "maximum-soft": 50, | ||
| "telemetry-source": { | ||
| "id": "request_metrics", | ||
| "metric": "requests" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "footprints": [ | ||
| { | ||
| "footprint-type": "countrycode", | ||
| "footprint-value": [ | ||
| "us" | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "capability-type": "FCI.Telemetry", | ||
| "capability-value": { | ||
| "sources": [ | ||
| { | ||
| "id": "capacity_metrics", | ||
| "type": "generic", | ||
| "metrics": [ | ||
| { | ||
| "name": "capacity", | ||
| "time-granularity": 0, | ||
| "data-percentile": 50, | ||
| "latency": 0 | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| "footprints": [ | ||
| { | ||
| "footprint-type": "countrycode", | ||
| "footprint-value": [ | ||
| "us" | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
traffic_ops/app/db/migrations/2022011112591400_added_cdni_capacity_table.down.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with this | ||
| * work for additional information regarding copyright ownership. The ASF | ||
| * licenses this file to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| * License for the specific language governing permissions and limitations under | ||
| * the License. | ||
| */ | ||
|
|
||
| DROP TABLE IF EXISTS cdni_total_limits; | ||
| DROP TABLE IF EXISTS cdni_host_limits; | ||
| DROP TABLE IF EXISTS cdni_telemetry_metrics; | ||
| DROP TABLE IF EXISTS cdni_telemetry; | ||
| DROP TABLE IF EXISTS cdni_footprints; | ||
| DROP TABLE IF EXISTS cdni_capabilities; |
82 changes: 82 additions & 0 deletions
82
traffic_ops/app/db/migrations/2022011112591400_added_cdni_capacity_table.up.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with this | ||
| * work for additional information regarding copyright ownership. The ASF | ||
| * licenses this file to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| * License for the specific language governing permissions and limitations under | ||
| * the License. | ||
| */ | ||
|
|
||
| CREATE TABLE IF NOT EXISTS cdni_capabilities ( | ||
| id bigserial NOT NULL, | ||
| type text NOT NULL, | ||
| ucdn text NOT NULL, | ||
| last_updated timestamp with time zone DEFAULT now() NOT NULL, | ||
| CONSTRAINT pk_cdni_capabilities PRIMARY KEY (id) | ||
| ); | ||
|
|
||
| CREATE TABLE IF NOT EXISTS cdni_footprints ( | ||
| id bigserial NOT NULL, | ||
| footprint_type text NOT NULL, | ||
| footprint_value text[] NOT NULL, | ||
| ucdn text NOT NULL, | ||
| capability_id bigint NOT NULL, | ||
| last_updated timestamp with time zone DEFAULT now() NOT NULL, | ||
| CONSTRAINT pk_cdni_footprints PRIMARY KEY (id), | ||
| CONSTRAINT fk_cdni_footprint_capabilities FOREIGN KEY (capability_id) REFERENCES cdni_capabilities(id) ON UPDATE CASCADE ON DELETE CASCADE | ||
| ); | ||
|
|
||
| CREATE TABLE IF NOT EXISTS cdni_telemetry ( | ||
| id text NOT NULL, | ||
| type text NOT NULL, | ||
| capability_id bigint NOT NULL, | ||
| last_updated timestamp with time zone DEFAULT now() NOT NULL, | ||
| CONSTRAINT pk_cdni_telemetry PRIMARY KEY (id), | ||
| CONSTRAINT fk_cdni_telemetry_capabilities FOREIGN KEY (capability_id) REFERENCES cdni_capabilities(id) ON UPDATE CASCADE ON DELETE CASCADE | ||
| ); | ||
|
|
||
| CREATE TABLE IF NOT EXISTS cdni_telemetry_metrics ( | ||
| name text NOT NULL, | ||
| time_granularity bigint NOT NULL, | ||
| data_percentile bigint NOT NULL, | ||
| latency int NOT NULL, | ||
| telemetry_id text NOT NULL, | ||
| last_updated timestamp with time zone DEFAULT now() NOT NULL, | ||
| CONSTRAINT pk_cdni_telemetry_metrics PRIMARY KEY (name), | ||
| CONSTRAINT fk_cdni_telemetry_metrics_telemetry FOREIGN KEY (telemetry_id) REFERENCES cdni_telemetry(id) ON UPDATE CASCADE ON DELETE CASCADE | ||
| ); | ||
|
|
||
| CREATE TABLE IF NOT EXISTS cdni_total_limits ( | ||
| limit_type text NOT NULL, | ||
| maximum_hard bigint NOT NULL, | ||
| maximum_soft bigint NOT NULL, | ||
| telemetry_id text NOT NULL, | ||
| telemetry_metric text NOT NULL, | ||
| capability_id bigint NOT NULL, | ||
| last_updated timestamp with time zone DEFAULT now() NOT NULL, | ||
| CONSTRAINT pk_cdni_total_limits PRIMARY KEY (capability_id, telemetry_id), | ||
| CONSTRAINT fk_cdni_total_limits_telemetry FOREIGN KEY (telemetry_id) REFERENCES cdni_telemetry(id) ON UPDATE CASCADE ON DELETE CASCADE, | ||
| CONSTRAINT fk_cdni_total_limits_capabilities FOREIGN KEY (capability_id) REFERENCES cdni_capabilities(id) ON UPDATE CASCADE ON DELETE CASCADE | ||
| ); | ||
|
|
||
| CREATE TABLE IF NOT EXISTS cdni_host_limits ( | ||
| limit_type text NOT NULL, | ||
| maximum_hard bigint NOT NULL, | ||
| maximum_soft bigint NOT NULL, | ||
| telemetry_id text NOT NULL, | ||
| telemetry_metric text NOT NULL, | ||
| capability_id bigint NOT NULL, | ||
| host text NOT NULL, | ||
| last_updated timestamp with time zone DEFAULT now() NOT NULL, | ||
| CONSTRAINT pk_cdni_host_limits PRIMARY KEY (capability_id, telemetry_id, host), | ||
| CONSTRAINT fk_cdni_host_limits_telemetry FOREIGN KEY (telemetry_id) REFERENCES cdni_telemetry(id) ON UPDATE CASCADE ON DELETE CASCADE, | ||
| CONSTRAINT fk_cdni_total_limits_capabilities FOREIGN KEY (capability_id) REFERENCES cdni_capabilities(id) ON UPDATE CASCADE ON DELETE CASCADE | ||
| ); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.