Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
db94d73
Moved API overview to the Index page
ocket8888 Oct 3, 2018
8c3e92e
Consistent formatting, acurate build system listing, footnotes and he…
ocket8888 Oct 4, 2018
2600ff7
Formatting consistency; added helpful links; grammar fixes
ocket8888 Oct 4, 2018
6242f84
syntax highlighting
ocket8888 Oct 4, 2018
294bbe4
Moved route listing into main API page - replaces ToC
ocket8888 Oct 8, 2018
1afb471
Fixed footnote reference issue
ocket8888 Oct 8, 2018
e82ab24
Added libpq dependency listing, added admonition warning that TO test…
ocket8888 Oct 8, 2018
e024c1e
Added TO Golang documentation page (stub atm)
ocket8888 Oct 9, 2018
aac4774
Steps now numbered
ocket8888 Oct 9, 2018
4be57b4
Began migrating endpoints to single-documentation form
ocket8888 Oct 15, 2018
4231177
Moved cache statistics endpoints to new file structure
ocket8888 Oct 15, 2018
c89c4cb
Moved cachegroups into the new file structure
ocket8888 Oct 15, 2018
ec5f381
Finished moving cachegroups endpoints out of the old file structure
ocket8888 Oct 16, 2018
932bc8d
Moved cachegroup_fallbacks endpoint ouf of old file structure
ocket8888 Oct 16, 2018
62e7be6
Finished moving cachegroupparameters endpoint to new file structure
ocket8888 Oct 16, 2018
bbbbdae
Moved capabilities out of old file structure
ocket8888 Oct 16, 2018
af23c1e
Added note about API response differences between v1.1 and v1.2
ocket8888 Oct 17, 2018
a42d471
WIP - Moving cdns/* endpoints to new file structure
ocket8888 Oct 18, 2018
276fbca
WIP - pulled deliveryservices endpoint out of cdns endpoint
ocket8888 Oct 18, 2018
d9ec0f6
Finished moving cdns logic out of old file structure
ocket8888 Oct 22, 2018
26f5d13
Moved logs endpoints out of old file structure
ocket8888 Oct 24, 2018
ca35ec5
Pulled configuration file endpoints out of old file structure
ocket8888 Oct 25, 2018
13f949a
Added implementation note for logs/newcount
ocket8888 Oct 25, 2018
c24e5a3
Pulled coordinates out of old file structure
ocket8888 Oct 25, 2018
5105cee
started working on deliveryservice stuff
ocket8888 Oct 25, 2018
3a362eb
Moved api/1.x/cdns/{{name}}/dnsseckeys/ksk/generate out of old file s…
ocket8888 Oct 30, 2018
0e2dd48
Fixed incorrect documentation from Rob's PR
ocket8888 Oct 30, 2018
20ba5a0
Fixed more dnsseckeys stuff, more ds work
ocket8888 Oct 31, 2018
e21c47f
more DS stuff
ocket8888 Oct 31, 2018
672b6e0
more work on stuff
ocket8888 Nov 1, 2018
b24e40c
Adding some HTTP responses
ocket8888 Nov 1, 2018
5e300e5
More HTTP examples
ocket8888 Nov 1, 2018
1e8ba83
Removed '/api/1.x/' common prefix
ocket8888 Nov 6, 2018
6d88b72
Fixed label duplication
ocket8888 Nov 7, 2018
5a852ce
Fixed missing syntax name in code block
ocket8888 Nov 7, 2018
00767f2
Title formatting fixed for compliance
ocket8888 Nov 7, 2018
016a574
Line breaks shouldn't occur in URLs, so we're back to monospace for A…
ocket8888 Nov 7, 2018
374f0c8
another HTTP example"
ocket8888 Nov 7, 2018
4252d66
More HTTP examples
ocket8888 Nov 7, 2018
f08c61c
Pulled out more deliveryservice stuff and added more http examples
ocket8888 Nov 8, 2018
4424ae2
Pulled more things out of the Delivery Service files
ocket8888 Nov 13, 2018
a38b954
Pulled out more of Delivery Services
ocket8888 Nov 14, 2018
cc26125
More HTTP examples
ocket8888 Nov 14, 2018
bc18df7
A LOT more HTTP examples
ocket8888 Nov 14, 2018
d47d731
Pulled more stuff out of Delivery Services, added forward-compatible …
ocket8888 Nov 15, 2018
caf2589
fixed the "Traffic Ops API" page heading being monospaced
ocket8888 Nov 15, 2018
a9d6dd9
Finally finished converting examples for previously-extracted, testab…
ocket8888 Nov 15, 2018
1576bc6
A couple of missed HTTP examples, pulled more stuff out of deliveryse…
ocket8888 Nov 15, 2018
de385d9
Started working on deliveryservices POST
ocket8888 Nov 15, 2018
36915b1
Finished the request format spec for Deliveryservices POST
ocket8888 Nov 16, 2018
9ef3a7b
Pulled out 'safe' DS endpoint
ocket8888 Nov 19, 2018
89fa028
Finished pulling the v1.1 Delivery Services page into the new layout …
ocket8888 Nov 20, 2018
f1138a4
Added version change notes to deliveryservice representation endpoint…
ocket8888 Nov 20, 2018
2521ede
Finished pulling things out of v1.2/deliveryservice (deliveryservices…
ocket8888 Nov 20, 2018
a990350
Added documentation for 1.4 DNSSEC key refresh endpoint
ocket8888 Nov 27, 2018
757fa96
Began pulling out deliveryservices.*regexes, removed now-broken refer…
ocket8888 Nov 28, 2018
65cf75e
Finished ds regexes endpoints
ocket8888 Nov 29, 2018
de895f7
Moved deliveryservice_stats to new structure - also removed entries f…
ocket8888 Nov 29, 2018
dc87532
Moved ds regex endpoint to appropriate filename
ocket8888 Nov 29, 2018
3a18422
Moved divisions endpoints into new file structure
ocket8888 Nov 29, 2018
b9e0b05
Fixed bad route name, non-http example, missing request example
ocket8888 Nov 30, 2018
936a7ec
Removed reference to now non-existent v12/divisions document
ocket8888 Nov 30, 2018
2a690f6
Started working with federations - CIAB cannot handle atm
ocket8888 Nov 30, 2018
9b8c044
Moved hwinfo endpoint into new file structure
ocket8888 Nov 30, 2018
5221382
started working on the iso endpoints
ocket8888 Nov 30, 2018
b91fcf1
Moved traffic_monitor/stats into new structure
ocket8888 Dec 3, 2018
20183f8
Moved isos endpoint into the new structure
ocket8888 Dec 3, 2018
a6478e1
started working on federations and jobs
ocket8888 Dec 3, 2018
6946933
Fixed a broken foot ref, temporarily disabled ref to unknown source
ocket8888 Dec 4, 2018
aa00e41
Fixed typo in page label and code block argument
ocket8888 Dec 4, 2018
b4452c1
Changed from HTTP to JSON syntax highlighting - will change back once…
ocket8888 Dec 4, 2018
ae5b09b
Fixed typo in code-block optional directive
ocket8888 Dec 4, 2018
0d4cee9
Fixed now-broken references to API-version-specific hwinfo endpoints
ocket8888 Dec 4, 2018
0b93639
Removed reference to old structure 'influxdb' page
ocket8888 Dec 4, 2018
8c41a7a
pulled v12/federation.rst into new structure (not done with federatio…
ocket8888 Dec 4, 2018
3de16a9
Moved v12/federation_deliveryservice.rst into new structure
ocket8888 Dec 4, 2018
60e5f5e
moved v12/federation_federationresolver.rst into new structure
ocket8888 Dec 4, 2018
2cfb0b8
Moved v12/federation_resolver.rst into new structure
ocket8888 Dec 4, 2018
790d30a
Moved v12/federation_user into new structure
ocket8888 Dec 4, 2018
6b61bd1
All federation endpoints now have full HTTP examples
ocket8888 Dec 5, 2018
f684257
Moved jobs endpoints to new structure
ocket8888 Dec 5, 2018
c2a3599
Pulled v11/parameter.rst and v12/parameter.rst apart into constituent…
ocket8888 Dec 5, 2018
d01fca2
Moved phys_locations endpoints into new structure
ocket8888 Dec 6, 2018
84b5121
Added missing query params, added deprecation notice to GET divisions…
ocket8888 Dec 6, 2018
5f33c80
fixed formatting error
ocket8888 Dec 6, 2018
1e03aa8
Made minor improvements to deprecation formatting notice
ocket8888 Dec 6, 2018
e9ec960
Added missing query parameter and added a deprecation notice
ocket8888 Dec 6, 2018
28ff6b8
Fixed copy/paste typo
ocket8888 Dec 6, 2018
1a72605
Moved region endpoints into new structure
ocket8888 Dec 6, 2018
bb226d2
Fixed a spelling error
ocket8888 Dec 7, 2018
76bd7d1
Pulled v11/profile.rst and v12/profile.rst into new structure
ocket8888 Dec 7, 2018
b3b1cfa
Pulled v12/profile_parameter into new structure
ocket8888 Dec 10, 2018
a84ce54
Moved v1x/role.rst into the new structure
ocket8888 Dec 10, 2018
3cd8d3c
Moved servers endpoints into new structure
ocket8888 Dec 10, 2018
327039b
Various syntax error fixes
ocket8888 Dec 10, 2018
fdb168a
Moved staticdnsentries endpoint into new structure
ocket8888 Dec 10, 2018
a60fb15
Moved statuses endpoints into new structure
ocket8888 Dec 10, 2018
e1193e9
Pulled steering endpoints into new structure
ocket8888 Dec 11, 2018
7d0f031
Moved last 1.3 endpoint (origins) into new structure
ocket8888 Dec 11, 2018
2e2be1e
moved system info endpoint into new file structure
ocket8888 Dec 11, 2018
9d72f67
Moved tenants endpoints into new structure
ocket8888 Dec 11, 2018
a377ebe
WIP - pulling to_extensions into new structure
ocket8888 Dec 11, 2018
b34b3ea
Pulled Traffic Ops extensions endpoints into new structure
ocket8888 Dec 12, 2018
2b30bb5
Moved snapshot endpoints into new structure
ocket8888 Dec 12, 2018
58b96da
Moved types endpoints into new structure
ocket8888 Dec 12, 2018
5006afa
Pulled users endpoints into new structure
ocket8888 Dec 13, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 182 additions & 0 deletions docs/source/api/api_capabilities.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
..
..
.. 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-api_capability:

********************
``api_capabilities``
********************
Deals with the capabilities that may be associated with API endpoints and methods. These capabilities are assigned to "roles", of which a user may have one or more. Capabilities support "wildcarding" or "globbing" using asterisks to group multiple routes into a single capability

``GET``
=======
Get all API-capability mappings.

:Auth. Required: Yes
:Roles Required: None
:Response Type: Array

Request Structure
-----------------
.. table:: Request Query Parameters

+----------------+----------+--------+------------------------------------+
| Name | Required | Type | Description |
+================+==========+========+====================================+
| capability | no | string | Capability name |
+----------------+----------+--------+------------------------------------+

.. code-block:: http
:caption: Request Example

GET /api/1.1/api_capabilities?capability=types-write HTTP/1.1
Host: trafficops.infra.ciab.test
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...

Response Structure
------------------
:capability: Capability name
:httpMethod: An HTTP request method, practically one of:

- ``GET``
- ``POST``
- ``PUT``
- ``PATCH``
- ``DELETE``

:httpRoute: The request route for which this capability applies - relative to the Traffic Ops server's URL
:id: An integer which uniquely identifies this capability
:lastUpdated: The time at which this capability was last updated, in ISO format

.. 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
Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE
Access-Control-Allow-Origin: *
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json
Date: Thu, 01 Nov 2018 14:45:24 GMT
Server: Mojolicious (Perl)
Set-Cookie: mojolicious=...; expires=Thu, 01 Nov 2018 18:45:24 GMT; path=/; HttpOnly
Vary: Accept-Encoding
Whole-Content-Sha512: wptErtIop/AfTTQ+1MZdA2YpPXEOuLFfrPQvvaHqO/uX5fRruOVYW+7p8JTrtH1xg1WN+x6FnjQnSHuWwcpyJg==
Content-Length: 393

{ "response": [
{
"httpMethod": "POST",
"lastUpdated": "2018-11-01 14:10:22.794114+00",
"httpRoute": "types",
"id": 261,
"capability": "types-write"
},
{
"httpMethod": "PUT",
"lastUpdated": "2018-11-01 14:10:22.795917+00",
"httpRoute": "types/*",
"id": 262,
"capability": "types-write"
},
{
"httpMethod": "DELETE",
"lastUpdated": "2018-11-01 14:10:22.799748+00",
"httpRoute": "types/*",
"id": 263,
"capability": "types-write"
}
]}

``POST``
========
Create an API-capability mapping.

:Auth. Required: Yes
:Roles Required: "admin" or "operations"
:Response Type: Object

Request Structure
-----------------
:capability: Capability name
:httpMethod: An HTTP request method, one of: 'GET', 'POST', 'PUT', 'PATCH', 'DELETE'
:httpRoute: The API endpoint for which to create capabilities

.. code-block:: http
:caption: Request Example

POST /api/1.1/api_capabilities HTTP/1.1
Host: ipcdn-cache-51.cdnlab.comcast.net:6443
User-Agent: curl/7.47.0
Accept: */*
Cookie: mojolicious=...
Content-Length: 94
Content-Type: application/x-www-form-urlencoded

{
"capability": "types-write",
"httpRoute": "/api/1.1/api_capabilities",
"httpMethod": "PATCH"
}

Response Structure
------------------
:capability: Capability name
:httpMethod: An HTTP request method, practically one of:

- ``GET``
- ``POST``
- ``PUT``
- ``PATCH``
- ``DELETE``

:httpRoute: The request route for which this capability applies - relative to the Traffic Ops server's URL
:id: An integer which uniquely identifies this capability
:lastUpdated: The time at which this capability was last updated, in ISO format

.. 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
Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE
Access-Control-Allow-Origin: *
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json
Date: Thu, 01 Nov 2018 14:53:58 GMT
Server: Mojolicious (Perl)
Set-Cookie: mojolicious=...; expires=Thu, 01 Nov 2018 18:53:58 GMT; path=/; HttpOnly
Vary: Accept-Encoding
Whole-Content-Sha512: CDz5DUJFoL5DgfnCcvitPmnKJAG5VENhNN6wz2YNqqW1n5HQzSci+NsU5SqfhKnTwnKfSy7PYl9hQhrUKO6KCQ==
Content-Length: 209

{ "alerts": [
{
"level": "success",
"text": "API-Capability mapping was created."
}
],
"response": {
"httpMethod": "PATCH",
"lastUpdated": null,
"httpRoute": "/api/1.1/api_capabilities",
"id": 273,
"capability": "types-write"
}}

Loading