Skip to content

Commit

Permalink
ReadTheDocs fix attempt No. 2 (#7773)
Browse files Browse the repository at this point in the history
* Update docs dependencies

* Fix invalid JSON in /asns v5 docs

* Fix improper labeling in API docs

* Fix missing docs for statuses/{{ID}} in APIv5

* Fix manual linebreaks and nonexistent reference label in overview docs

* Trim trailing spaces in Python client

* Fix use of incorrect labels in Python client

* Fix Python client offering an endpoint at a version in which it doesn't exist
  • Loading branch information
ocket8888 committed Sep 7, 2023
1 parent b9839c2 commit a416605
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..
.. _to-api-v4-deliveryservices-required-capabilities:
.. _to-api-v4-deliveryservices_required_capabilities:

******************************************
``deliveryservices_required_capabilities``
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/v5/asns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ Response Structure
"cachegroup": "TRAFFIC_OPS",
"cachegroupId": 2,
"id": 1,
"lastUpdated": 2023-05-25T15:59:33.7096-06:00
"lastUpdated": "2023-05-25T15:59:33.7096-06:00"
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/v5/server_server_capabilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..
.. _to-api-server-server-capabilities:
.. _to-api-server_server_capabilities:

******************************
``server_server_capabilities``
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/v5/service_categories.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..
.. _to-api-service-categories:
.. _to-api-service_categories:

**********************
``service_categories``
Expand Down
138 changes: 138 additions & 0 deletions docs/source/api/v5/statuses_id.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
..
..
.. 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-statuses-id:

*******************
``statuses/{{ID}}``
*******************

``PUT``
=======
Updates a :term:`Status`.

:Auth. Required: Yes
:Roles Required: None
:Permissions Required: STATUS:UPDATE, STATUS:READ
:Response Type: Array

Request Structure
-----------------
:description: The description of the updated :term:`Status`
:name: The name of the updated :term:`Status`

.. code-block:: http
:caption: Request Example
PUT /api/5.0/statuses/3 HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
{ "description": "test", "name": "example" }
Response Structure
------------------
:description: A short description of the status
:id: The integral, unique identifier of this status
:lastUpdated: The date and time at which this status was last modified, in :rfc:3339 format
:name: The name of the status

.. code-block:: http
:caption: Response Example
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie
Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE
Access-Control-Allow-Origin: *
Content-Type: application/json
Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: dHNip9kpTGGS1w39/fWcFehNktgmXZus8XaufnmDpv0PyG/3fK/KfoCO3ZOj9V74/CCffps7doEygWeL/xRtKA==
X-Server-Name: traffic_ops_golang/
Date: Mon, 10 Dec 2018 20:56:59 GMT
Content-Length: 167
{ "alerts": [
{
"text": "status was created.",
"level": "success"
}
],"response": [
{
"description": "test",
"name": "example"
"id": 3,
"lastUpdated": "2018-12-10T19:11:17Z",
}
]}
``DELETE``
==========
Deletes a :term:`Status`.

:Auth. Required: Yes
:Roles Required: "admin" or "operations"
:Permissions Required: STATUS:DELETE, STATUS:READ
:Response Type: Object

Request Structure
-----------------
.. table:: Request Path Parameters

+------+----------+---------------------------------------------------------------------------------------------+
| Name | Required | Description |
+======+==========+=============================================================================================+
| id | yes | The integral, unique identifier of the desired :abbr:`Status`-to-:term:`Server` association |
+------+----------+---------------------------------------------------------------------------------------------+

.. code-block:: http
:caption: Request Example
DELETE /api/5.0/statuses/18 HTTP/1.1
User-Agent: curl/8.1.2
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Cookie: mojolicious=...
Content-Length: 0
Response Structure
------------------
.. code-block:: http
:caption: Response Example
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie
Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE
Access-Control-Allow-Origin: *
Content-Encoding: gzip
Content-Type: application/json
Set-Cookie: mojolicious=...; Path=/; Expires=Thu, 15 Jun 2023 22:37:37 GMT; Max-Age=3600; HttpOnly
Whole-Content-Sha512: T8wtKKwyOKKVwDwoNCNvETllsByDiEe4CrpeS7Zdox+rXMgPb3FBlKmmgu4CpxbWdhpiODKqKn+gsSq5K4yvIQ==
X-Server-Name: traffic_ops_golang/
Date: Thu, 15 Jun 2023 21:41:18 GMT
Content-Length: 62
{
"alerts": [
{
"text": "status was deleted.",
"level": "success"
}
]
}
8 changes: 2 additions & 6 deletions docs/source/overview/profiles_and_parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -610,11 +610,7 @@ The following plugins have support for adding args with following parameter Conf
| cachekey.pparam | cachekey.pparam | ``-o`` | ``@pparam=-o`` |
+------------------------+---------------------+------------------------------+--------------------------------------+

In order to support difficult configurations at MID/LAST, a
:term:`Delivery Service` profile parameter is available with parameters
``LastRawRemapPre`` and ``LastRawRemapPost``, config file ``remap.config``
and Value the raw remap lines. The Value in this parameter will be pre
or post pended to the end of ``remap.config``.
In order to support difficult configurations at MID/LAST, a :term:`Delivery Service` profile parameter is available with parameters ``LastRawRemapPre`` and ``LastRawRemapPost``, config file ``remap.config`` and Value the raw remap lines. The Value in this parameter will be pre or post pended to the end of ``remap.config``.

To provide the most flexibility for managing :term:`Delivery Service` generated ``remap.config`` lines there are options for redefining the internal mustache template used to generate these ``remap.config`` lines.

Expand All @@ -626,7 +622,7 @@ To provide the most flexibility for managing :term:`Delivery Service` generated
.. table:: ``remap.config`` Template Tags

+------------------+-----------------------------------+-------------------------------+
| :ref:`tag-name` | Value_ | Associated plugin/directive |
| Tag Name | Value_ | Associated plugin/directive |
+==================+===================================+===============================+
| Source | Target, or request "from" URL | |
+------------------+-----------------------------------+-------------------------------+
Expand Down
6 changes: 3 additions & 3 deletions docs/source/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
Sphinx>=4.0,<4.1
sphinx_rtd_theme>=0.5
sphinx_autodoc_typehints>=1.11
Sphinx>=5.1,<5.2
sphinx-rtd-theme>=1.3
sphinx_autodoc_typehints>=1.24
Pygments>=2.6
munch>=2.1.1
future>=0.16.0
Expand Down
40 changes: 20 additions & 20 deletions traffic_control/clients/python/trafficops/tosession.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ def get_cdns_domains(self):
:rtype: Tuple[Dict[str, Any], requests.Response]
:raises: Union[LoginError, OperationError]
"""

#
# CDN Notifications
#
Expand All @@ -585,7 +585,7 @@ def create_cdn_notification(self, data=None):
:rtype: Tuple[Dict[str, Any], requests.Response]
:raises: Union[LoginError, OperationError]
"""

@api_request('delete', 'cdn_notifications', ('4.0', '4.1', '5.0'))
def delete_cdn_notification(self, query_params=None):
"""
Expand Down Expand Up @@ -661,7 +661,7 @@ def get_cdn_ssl_keys(self, cdn_name=None):
:rtype: Tuple[Dict[str, Any], requests.Response]
:raises: Union[LoginError, OperationError]
"""

#
# CDN Lock
#
Expand Down Expand Up @@ -819,7 +819,7 @@ def delete_deliveryservice_request(self, query_params=None):
:rtype: Tuple[Dict[str, Any], requests.Response]
:raises: Union[LoginError, OperationError]
"""


#
# Delivery Service Request Comments
Expand All @@ -828,7 +828,7 @@ def delete_deliveryservice_request(self, query_params=None):
def get_deliveryservice_request_comments(self, query_params=None):
"""
Retrieves all delivery service reuest comments.
:ref:`to-api-deliveryservice-request-comments`
:ref:`to-api-deliveryservice_request_comments`
:rtype: Tuple[Union[Dict[str, Any], List[Dict[str, Any]]], requests.Response]
:raises: Union[LoginError, OperationError]
"""
Expand All @@ -837,7 +837,7 @@ def get_deliveryservice_request_comments(self, query_params=None):
def create_deliveryservice_request_comment(self, data=None):
"""
Creates a new delivery service request comment.
:ref:`to-api-deliveryservice-request-comments`
:ref:`to-api-deliveryservice_request_comments`
:param data: The request data structure for the API request
:type data: Dict[str, Any]
:rtype: Tuple[Dict[str, Any], requests.Response]
Expand All @@ -848,7 +848,7 @@ def create_deliveryservice_request_comment(self, data=None):
def update_deliveryservice_request_comment(self, query_params=None, data=None):
"""
Updates an existing Delivery Service Request comment.
:ref:`to-api-deliveryservice-request-comments`
:ref:`to-api-deliveryservice_request_comments`
:param data: The request data structure for the API request
:type data: Dict[str, Any]
:rtype: Tuple[Union[Dict[str, Any], List[Dict[str, Any]]], requests.Response]
Expand All @@ -859,39 +859,39 @@ def update_deliveryservice_request_comment(self, query_params=None, data=None):
def delete_deliveryservice_request_comment(self, query_params=None):
"""
Deletes a Delivery Service Request comment.
:ref:`to-api-deliveryservice-request-comments`
:ref:`to-api-deliveryservice_request_comments`
:rtype: Tuple[Dict[str, Any], requests.Response]
:raises: Union[LoginError, OperationError]
"""

#
# Delivery Service Required capabilities
#
@api_request('get', 'deliveryservices_required_capabilities', ('3.0', '4.0', '4.1', '5.0'))
@api_request('get', 'deliveryservices_required_capabilities', ('3.0', '4.0', '4.1'))
def get_deliveryservices_required_capabilities(self, query_params=None):
"""
Retrieves all delivery service required capabilities.
:ref:`to-api-deliveryservice-required-capabilities`
:ref:`to-api-v4-deliveryservices_required_capabilities`
:rtype: Tuple[Union[Dict[str, Any], List[Dict[str, Any]]], requests.Response]
:raises: Union[LoginError, OperationError]
"""

@api_request('post', 'deliveryservices_required_capabilities', ('3.0', '4.0', '4.1', '5.0'))
@api_request('post', 'deliveryservices_required_capabilities', ('3.0', '4.0', '4.1'))
def create_deliveryservices_required_capabilities(self, data=None):
"""
Creates a new delivery service required capability.
:ref:`to-api-deliveryservice-required-capabilities`
:ref:`to-api-v4-deliveryservices_required_capabilities`
:param data: The request data structure for the API request
:type data: Dict[str, Any]
:rtype: Tuple[Dict[str, Any], requests.Response]
:raises: Union[LoginError, OperationError]
"""

@api_request('delete', 'deliveryservices_required_capabilities', ('3.0', '4.0', '4.1', '5.0'))
@api_request('delete', 'deliveryservices_required_capabilities', ('3.0', '4.0', '4.1'))
def delete_deliveryservices_required_capabilities(self, query_params=None):
"""
Deletes a Delivery Service Required capability.
:ref:`to-api-deliveryservice-required-capabilities`
:ref:`to-api-v4-deliveryservices_required_capabilities`
:rtype: Tuple[Dict[str, Any], requests.Response]
:raises: Union[LoginError, OperationError]
"""
Expand Down Expand Up @@ -922,7 +922,7 @@ def get_delivery_service_capacity(self, delivery_service_id=None):
:rtype: Tuple[Union[Dict[str, Any], List[Dict[str, Any]]], requests.Response]
:raises: Union[LoginError, OperationError]
"""

@api_request('get', 'deliveryservices/{delivery_service_id:d}/routing', ('3.0', '4.0', '4.1', '5.0'))
def get_delivery_service_routing(self, delivery_service_id=None):
"""
Expand Down Expand Up @@ -1555,7 +1555,7 @@ def delete_parameter(self, parameter_id=None):
:rtype: Tuple[Dict[str, Any], requests.Response]
:raises: Union[LoginError, OperationError]
"""

#
# Server_capabilities
#
Expand Down Expand Up @@ -2061,7 +2061,7 @@ def get_server_update_status(self, server_name=None):
:rtype: Tuple[Dict[str, Any], requests.Response]
:raises: Union[LoginError, OperationError]
"""

#
# Service categories
#
Expand All @@ -2084,7 +2084,7 @@ def create_service_category(self, data=None):
:rtype: Tuple[Union[Dict[str, Any], List[Dict[str, Any]]], requests.Response]
:raises: Union[LoginError, OperationError]
"""

@api_request('put', 'service_categories/{service_category_name:s}', ('3.0', '4.0', '4.1', '5.0'))
def update_service_category(self, service_category_name=None, data=None):
"""
Expand Down Expand Up @@ -2181,7 +2181,7 @@ def create_statuses(self, query_params=None):
def delete_status_by_id(self, status_id=None):
"""
Delete a status
:ref:`to-api-status-id`
:ref:`to-api-statuses-id`
:param status_id: The status to delete
:type status_id: int
:rtype: Tuple[Union[Dict[str, Any], List[Dict[str, Any]]], requests.Response]
Expand Down Expand Up @@ -2273,7 +2273,7 @@ def create_tenant(self, data=None):
:rtype: Tuple[Union[Dict[str, Any], List[Dict[str, Any]]], requests.Response]
:raises: Union[LoginError, OperationError]
"""

@api_request('delete', 'tenants/{tenant_id:d}', ('3.0', '4.0', '4.1', '5.0'))
def delete_tenant(self, tenant_id=None):
"""
Expand Down

0 comments on commit a416605

Please sign in to comment.