You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2022/03/03 19:30:45 UTC

[GitHub] [trafficcontrol] srijeet0406 opened a new pull request #6612: Adding status and lastHmPoll fields to CrStates

srijeet0406 opened a new pull request #6612:
URL: https://github.com/apache/trafficcontrol/pull/6612


   <!--
   Thank you for contributing! Please be sure to read our contribution guidelines: https://github.com/apache/trafficcontrol/blob/master/CONTRIBUTING.md
   If this closes or relates to an existing issue, please reference it using one of the following:
   
   Closes: #6448 
   Related: #ISSUE
   
   If this PR fixes a security vulnerability, DO NOT submit! Instead, contact
   the Apache Traffic Control Security Team at security@trafficcontrol.apache.org and follow the
   guidelines at https://apache.org/security regarding vulnerability disclosure.
   -->
   This PR closes #6448 
   
   <!-- **^ Add meaningful description above** --><hr/>
   
   ## Which Traffic Control components are affected by this PR?
   <!-- Please delete all components from this list that are NOT affected by this PR.
   Feel free to add the name of a tool or script that is affected but not on the list.
   -->
   - Traffic Monitor
   
   ## What is the best way to verify this PR?
   <!-- Please include here ALL the steps necessary to test your PR.
   If your PR has tests (and most should), provide the steps needed to run the tests.
   If not, please provide step-by-step instructions to test the PR manually and explain why your PR does not need tests. -->
   Run TM locally and `GET` the `publish/CrStates` endpoint. Make sure the `status` and `lastHmPoll` fields show up in the output. Also confirm that the status for the caches is in fact what's being reported by the `api/cache-statuses` endpoint.
   
   ## If this is a bugfix, which Traffic Control versions contained the bug?
   <!-- Delete this section if the PR is not a bugfix, or if the bug is only in the master branch.
   Examples:
   - 5.1.2
   - 5.1.3 (RC1)
    -->
   - master
   
   ## PR submission checklist
   - [ ] This PR has tests <!-- If not, please delete this text and explain why this PR does not need tests. -->
   - [ ] This PR has documentation <!-- If not, please delete this text and explain why this PR does not need documentation. -->
   - [x] This PR has a CHANGELOG.md entry <!-- A fix for a bug from an ATC release, an improvement, or a new feature should have a changelog entry. -->
   - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://apache.org/security) for details)
   
   <!--
   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.
   -->
   


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp commented on a change in pull request #6612: Adding status and lastHmPoll fields to CrStates

Posted by GitBox <gi...@apache.org>.
rawlinp commented on a change in pull request #6612:
URL: https://github.com/apache/trafficcontrol/pull/6612#discussion_r824188639



##########
File path: docs/source/development/traffic_monitor/traffic_monitor_api.rst
##########
@@ -343,22 +343,60 @@ TODO
 
 ``/publish/CrStates``
 =====================
-The current state of this CDN per the ref:`health-proto`.
+The current state of this CDN per the :ref:`health-proto`.
 
 ``GET``
 -------
-:Response Type: ?
+:Response Type: Object
+
+.. code-block:: http
+	:caption: Example Request
+
+	GET /publish/CrStates HTTP/1.1
+	Accept: */*
+	Content-Type: application/json
 
 Response Structure
 """"""""""""""""""
+:caches: An object with keys that are the names of monitored :term:`cache servers`
+	:server name: The name of the server being monitored
 
-TODO
+		:isAvailable: Whether or not this cache is available for routing
+		:ipv4Available: Whether or not an IPV4 interface on this cache is available for routing
+		:ipv6Available: Whether or not an IPV6 interface on this cache is available for routing
+		:status: The status of this server, along with any additional reason for it to be marked as such
+		:lastPoll: The last time the health data for this server was polled by a traffic monitor
 
+:deliveryServices: An object with keys as the names of monitored :term:`Delivery Services`
+	:delivery service name: The name of the delivery service being monitored

Review comment:
       I think there needs to be an empty line between indentation levels for this to render properly

##########
File path: docs/source/development/traffic_monitor/traffic_monitor_api.rst
##########
@@ -343,22 +343,60 @@ TODO
 
 ``/publish/CrStates``
 =====================
-The current state of this CDN per the ref:`health-proto`.
+The current state of this CDN per the :ref:`health-proto`.
 
 ``GET``
 -------
-:Response Type: ?
+:Response Type: Object
+
+.. code-block:: http
+	:caption: Example Request
+
+	GET /publish/CrStates HTTP/1.1
+	Accept: */*
+	Content-Type: application/json
 
 Response Structure
 """"""""""""""""""
+:caches: An object with keys that are the names of monitored :term:`cache servers`
+	:server name: The name of the server being monitored

Review comment:
       I think there needs to be an empty line between indentation levels for this to render properly




-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp commented on a change in pull request #6612: Adding status and lastHmPoll fields to CrStates

Posted by GitBox <gi...@apache.org>.
rawlinp commented on a change in pull request #6612:
URL: https://github.com/apache/trafficcontrol/pull/6612#discussion_r819120228



##########
File path: lib/go-tc/crstates.go
##########
@@ -37,10 +38,12 @@ type CRStatesDeliveryService struct {
 
 // IsAvailable contains whether the given cache or delivery service is available. It is designed for JSON serialization, namely in the Traffic Monitor 1.0 API.
 type IsAvailable struct {
-	IsAvailable    bool `json:"isAvailable"`
-	Ipv4Available  bool `json:"ipv4Available"`
-	Ipv6Available  bool `json:"ipv6Available"`
-	DirectlyPolled bool `json:"-"`
+	IsAvailable    bool      `json:"isAvailable"`
+	Ipv4Available  bool      `json:"ipv4Available"`
+	Ipv6Available  bool      `json:"ipv6Available"`
+	DirectlyPolled bool      `json:"-"`
+	Status         string    `json:"status"`
+	LastHmPoll     time.Time `json:"lastHmPoll"`

Review comment:
       Can we just call this `LastPoll`? The `Hm` bit is kind of unnecessary/already understood.

##########
File path: docs/source/development/traffic_monitor/traffic_monitor_api.rst
##########
@@ -343,22 +343,60 @@ TODO
 
 ``/publish/CrStates``
 =====================
-The current state of this CDN per the ref:`health-proto`.
+The current state of this CDN per the :ref:`health-proto`.
 
 ``GET``
 -------
-:Response Type: ?
+:Response Type: Object
+
+.. code-block:: http
+	:caption: Example Request
+
+	GET /publish/CrStates HTTP/1.1
+	Accept: */*
+	Content-Type: application/json
 
 Response Structure
 """"""""""""""""""
+:caches: An object with keys that are the names of monitored :term:`cache servers`
+	:server name: The name of the server being monitored
 
-TODO
+		:isAvailable: Whether or not this cache is available for monitoring
+		:ipv4Available: Whether or not an IPV4 interface on this cache is available for monitoring
+		:ipv6Available: Whether or not an IPV6 interface on this cache is available for monitoring

Review comment:
       "available for ~monitoring~ routing" would make more sense I think

##########
File path: docs/source/development/traffic_monitor/traffic_monitor_api.rst
##########
@@ -343,22 +343,60 @@ TODO
 
 ``/publish/CrStates``
 =====================
-The current state of this CDN per the ref:`health-proto`.
+The current state of this CDN per the :ref:`health-proto`.
 
 ``GET``
 -------
-:Response Type: ?
+:Response Type: Object
+
+.. code-block:: http
+	:caption: Example Request
+
+	GET /publish/CrStates HTTP/1.1
+	Accept: */*
+	Content-Type: application/json
 
 Response Structure
 """"""""""""""""""
+:caches: An object with keys that are the names of monitored :term:`cache servers`
+	:server name: The name of the server being monitored
 
-TODO
+		:isAvailable: Whether or not this cache is available for monitoring
+		:ipv4Available: Whether or not an IPV4 interface on this cache is available for monitoring
+		:ipv6Available: Whether or not an IPV6 interface on this cache is available for monitoring
+		:status: The status of this server, along with any additional reason for it to be marked as such
+		:lastHmPoll: The last time the health data for this server was polled by a traffic monitor
 
+:deliveryServices: An object with keys as the names of monitored :term:`Delivery Services`
+	:delivery service name: The name of the delivery service being monitored
+		:disabledLocations: A list of disabled locations for this delivery service
+		:isAvailable: Whether or not this delivery service is available for monitoring

Review comment:
       "available for ~monitoring~ routing" would make more sense I think




-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp merged pull request #6612: Adding status and lastPoll fields to CrStates

Posted by GitBox <gi...@apache.org>.
rawlinp merged pull request #6612:
URL: https://github.com/apache/trafficcontrol/pull/6612


   


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org