v13

package
v6.1.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 1 Imported by: 0

README

./swaggerdocs overview

This directory contains the Go structs that glue together the Swagger 2.0 metadata that will generate the Traffic Ops API documentation using the go-swagger meta tags. The Traffic Ops API documentation is maintained by modifying the Go files in this directory and the Go structs that they reference from here trafficcontrol/lib/go-tc/*.go. These combination of these two areas of .go files will produce Swagger documentation for the Traffic Ops Go API's.

Setup

Generating your Swagger Spec File

The gen_swaggerspec.sh script will scan all the Go files in the swaggerdocs directory and extract out all of the swagger meta tags that are embedded as comments. The output of the gen_swaggerspec.sh script will be the swaggerspec/swagger.json spec file.

While the Docker services are running, just re-run gen_swaggerspec.sh and hit refresh on the page to see the Swagger doc updates in real time.

Running the web services

Once your swaggerspec/swagger.json file has been generated you will want to render it to verify it's contents with the HTTP web rendering services.

The docker-compose.yml will start two rendering services, a custom http service for hosting the swaggerspec/swagger.json and the Swagger UI.

To start the Swagger UI services (and build them if not already built) just run:

$ docker-compose up

NOTE: Iterative Workflow Tips:

Blow away only the local images (excluding remote ones) and bring down the container: $ docker-compose down --rmi local

Blow away all the images (including remote ones) and bring down the container: $ docker-compose down --rmi all

Once started navigate your browser to http://localhost:8080

Converting the swaggerspec/swagger.json to .rst

After you generate the swaggerspec/swagger.json from the steps above use the swaggerspec Docker Compose file to convert the swagger.json to .rst so that it can merged in with the existing Traffic Control documentation.

  • $ cd swaggerspec
  • $ docker-compose up - will convert the swagger.json in this directory into v13_api_docs.rst
  • $ cp v13_api_docs.rst ../../../../../docs/source/development/traffic_ops_api
  • $ cd ../../../../../docs
  • $ make - will generate all the Sphinx documentation along with the newly generated TO Swagger API 1.3 docs

NOTE: Iterative Workflow Tips:

Blow away only the local images (excluding remote ones) and bring down the container: $ docker-compose down --rmi local

Blow away all the images (including remote ones) and bring down the container: $ docker-compose down --rmi all

Documentation

Overview

 Package docs Traffic Ops API

 The following REST APIs are used by the Traffic Portal UI along with several Traffic Control backend component and services.

 This documentation is fully compliant with the Swagger 2.0 specification

     Schemes: http, https
	 Host: your-traffic-ops
     BasePath: /api/1.3
     Version: 1.3
     License: Apache 2 https://github.com/apache/trafficcontrol/blob/master/LICENSE
     Contact: Traffic Control Dev List<dev@trafficcontrol.apache.org> http://traffic-control-cdn.readthedocs.io/en/latest/index.html

     Consumes:
     - application/json

     Produces:
     - application/json

     Security:
     - Cookie:

     SecurityDefinitions:
     Cookie:
          type: apiKey
          name: cookie
          in: header

 swagger:meta

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetASNById

func GetASNById() (ASNs, Alerts)

GetASNById swagger:route GET /asns/{id} ASN GetASNById

Retrieve a specific ASN by Id

Retrieve an ASN

Responses:

200: ASNs
400: Alerts

func GetASNs

func GetASNs() (ASNs, Alerts)

GetASNs swagger:route GET /asns ASN GetASNs

Retrieve a list of ASNs

A list of ASNs

Responses:

200: ASNs
400: Alerts

func GetCDNById

func GetCDNById() (CDNs, Alerts)

GetCDNById swagger:route GET /cdns/{id} CDN GetCDNById

Retrieve a specific CDN by Id

Retrieve a specific CDN

Responses:

200: CDNs
400: Alerts

func GetCDNs

func GetCDNs() (CDNs, Alerts)

GetCDNs swagger:route GET /cdns CDN GetCDNs

Retrieve a list of CDNs

List of CDNs

Responses:

200: CDNs
400: Alerts

func GetDivisionById

func GetDivisionById() (Divisions, Alerts)

GetDivisionById swagger:route GET /divisions/{id} Division GetDivisionById

Retrieve a specific Division by Id

Retrieve a single division

Responses:

200: Divisions
400: Alerts

func GetDivisions

func GetDivisions() (Divisions, Alerts)

GetDivisions swagger:route GET /divisions Division GetDivisions

Retrieve a list of Divisions

List of Divisions

Responses:

200: Divisions
400: Alerts

func GetPhysLocationById

func GetPhysLocationById() (PhysLocations, Alerts)

GetPhysLocationById swagger:route GET /phys_locations/{id} PhysLocation GetPhysLocationById

Retrieve a specific PhysLocation by Id

Retrieve a specific PhysLocation

Responses:

200: PhysLocations
400: Alerts

func GetPhysLocations

func GetPhysLocations() (PhysLocations, Alerts)

GetPhysLocations swagger:route GET /phys_locations PhysLocation GetPhysLocations

Retrieve a list of PhysLocations

List of PhysLocations

Responses:

200: PhysLocations
400: Alerts

func GetProfileById

func GetProfileById() (Profiles, Alerts)

GetProfileById swagger:route GET /cdns/{id} Profile GetProfileById

Retrieve a specific Profile by Id

Retrieve a specific Profile

Responses:

200: Profiles
400: Alerts

func GetProfileParameterById

func GetProfileParameterById() (ProfileParameters, Alerts)

GetProfileParameterById swagger:route GET /profileparameters?id={id} ProfileParameter GetProfileParameterById

Retrieve a specific ProfileParameter by Id

Retrieve a single division

Responses:

200: ProfileParameters
400: Alerts

func GetProfileParameters

func GetProfileParameters() (ProfileParameters, Alerts)

GetProfileParameters swagger:route GET /profileparameters ProfileParameter GetProfileParameters

Retrieve a list of ProfileParameters by narrowing down with query parameters

List of ProfileParameters

Responses:

200: ProfileParameters
400: Alerts

func GetProfiles

func GetProfiles() (Profiles, Alerts)

GetProfiles swagger:route GET /cdns Profile GetProfiles

Retrieve a list of Profiles

List of Profiles

Responses:

200: Profiles
400: Alerts

func GetRegionById

func GetRegionById() (Regions, Alerts)

GetRegionById swagger:route GET /regions/{id} Region GetRegionById

Retrieve a specific Region

Responses:

200: Regions
400: Alerts

func GetRegions

func GetRegions() (Regions, Alerts)

GetRegions swagger:route GET /regions Region GetRegions

Retrieve a list of Regions

Responses:

200: Regions
400: Alerts

func GetStatusById

func GetStatusById() (Statuses, Alerts)

GetStatusById swagger:route GET /statuses/{id} Status GetStatusById

Retrieve a specific Status

Responses:

200: Statuses
400: Alerts

func GetStatuses

func GetStatuses() (Statuses, Alerts)

GetStatuses swagger:route GET /statuses Status GetStatuses

Retrieve a list of Statuses

Responses:

200: Statuses
400: Alerts

func PostASN

func PostASN(entity ASNPostParam) (ASN, Alerts)

PostASN swagger:route POST /asns ASN PostASN

Create a ASN

An Autonomous System Number

Responses:

200: Alerts

func PostCDN

func PostCDN(entity CDNPostParam) (CDN, Alerts)

PostCDN swagger:route POST /cdns CDN PostCDN

Create a CDN

A CDN is a collection of Delivery Services

Responses:

200: Alerts

func PostDivision

func PostDivision(entity DivisionPostParam) (Division, Alerts)

PostDivision swagger:route POST /divisions Division PostDivision

Create a Division

A Division is a group of regions

Responses:

200: Alerts

func PostPhysLocation

func PostPhysLocation(entity PhysLocationPostParam) (PhysLocation, Alerts)

PostPhysLocation swagger:route POST /phys_locations PhysLocation PostPhysLocation

Create a PhysLocation

A PhysLocation is a collection of Delivery Services

Responses:

200: Alerts

func PostProfile

func PostProfile(entity ProfilePostParam) (Profile, Alerts)

PostProfile swagger:route POST /cdns Profile PostProfile

Create a Profile

A Profile is a collection of Delivery Services

Responses:

200: Alerts

func PostProfileParameter

func PostProfileParameter(entity ProfileParameterPostParam) (ProfileParameter, Alerts)

PostProfileParameter swagger:route POST /profileparameters ProfileParameter PostProfileParameter

Create a ProfileParameter

A ProfileParameter is a join of the Profile and Parameters

Responses:

200: Alerts

func PostRegion

func PostRegion(entity RegionPostParam) (Region, Alerts)

PostRegion swagger:route POST /regions Region PostRegion

Create a Region

Responses:

200: Alerts

func PostStatus

func PostStatus(entity StatusPostParam) (Status, Alerts)

PostStatus swagger:route POST /statuses Status PostStatus

Create a Status

Responses:

200: Alerts

func PutASN

func PutASN(entity ASNPutParam) (ASN, Alerts)

PutASN swagger:route PUT /asns/{id} ASN PutASN

Update an ASN by Id

Update an ASN

Responses:

200: ASN

func PutCDN

func PutCDN(entity CDNPutParam) (CDN, Alerts)

PutCDN swagger:route PUT /cdns/{id} CDN PutCDN

Update a CDN by Id

Update a CDN

Responses:

200: CDN

func PutDivision

func PutDivision(entity DivisionPutParam) (Division, Alerts)

PutDivision swagger:route PUT /divisions/{id} Division PutDivision

Update a Division by Id

Update a single Division

Responses:

200: Division

func PutPhysLocation

func PutPhysLocation(entity PhysLocationPutParam) (PhysLocation, Alerts)

PutPhysLocation swagger:route PUT /phys_locations/{id} PhysLocation PutPhysLocation

Update a PhysLocation by Id

Update a PhysLocation

Responses:

200: PhysLocation

func PutProfile

func PutProfile(entity ProfilePutParam) (Profile, Alerts)

PutProfile swagger:route PUT /cdns/{id} Profile PutProfile

Update a Profile by Id

Update a Profile

Responses:

200: Profile

func PutRegion

func PutRegion(entity RegionPutParam) (Region, Alerts)

PutRegion swagger:route PUT /regions/{id} Region PutRegion

Update a Region

Responses:

200: Region

func PutStatus

func PutStatus(entity StatusPutParam) (Status, Alerts)

PutStatus swagger:route PUT /statuses/{id} Status PutStatus

Update a Status

Responses:

200: Status

Types

type ASN

type ASN struct {
	// ASN Response Body
	// in: body
	ASNResponse tc.ASNResponse
}

ASN - ASNResponse to get the "response" top level key swagger:response ASN in: body

type ASNPathParams

type ASNPathParams struct {

	// Id associated to the ASN
	// in: path
	ID int `json:"id"`
}

swagger:parameters GetASNById DeleteASN

type ASNPostParam

type ASNPostParam struct {
	// ASN Request Body
	//
	// in: body
	// required: true
	ASN tc.ASN
}

swagger:parameters PostASN

type ASNPutParam

type ASNPutParam struct {

	// ID
	// in: path
	ID int `json:"id"`

	// ASN Request Body
	//
	// in: body
	// required: true
	ASN tc.ASN
}

swagger:parameters PutASN

type ASNQueryParams

type ASNQueryParams struct {

	// Autonomous System Numbers per APNIC for identifying a service provider
	//
	Asn string `json:"asn"`

	// Related cachegroup name
	//
	Cachegroup string `json:"cachegroup"`

	// Related cachegroup id
	//
	CachegroupID string `json:"cachegroupId"`

	// Unique identifier for the CDN
	//
	ID string `json:"id"`

	//
	//
	Orderby string `json:"orderby"`
}

ASNQueryParams

swagger:parameters GetASNs

type ASNs

type ASNs struct {
	// ASN Response Body
	// in: body
	ASNsResponse tc.ASNsResponse `json:"response"`
}

ASNs - ASNsResponse to get the "response" top level key swagger:response ASNs in: body

type Alerts

type Alerts struct {
	// Alerts Response Body
	//
	// in: body
	Alerts []tc.Alert `json:"alerts"`
}

Alerts - informs the client of server side messages swagger:response Alerts

func DeleteASN

func DeleteASN(entityId int) Alerts

DeleteASN swagger:route DELETE /asns/{id} ASN DeleteASN

Delete an ASN by Id

Delete an ASN

Responses:

200: Alerts

func DeleteCDN

func DeleteCDN(entityId int) Alerts

DeleteCDN swagger:route DELETE /cdns/{id} CDN DeleteCDN

Delete a CDN by Id

Delete a CDN

Responses:

200: Alerts

func DeleteDivision

func DeleteDivision(entityId int) Alerts

DeleteDivision swagger:route DELETE /divisions/{id} Division DeleteDivision

Delete a Division by Id

Delete a single Division

Responses:

200: Alerts

func DeletePhysLocation

func DeletePhysLocation(entityId int) Alerts

DeletePhysLocation swagger:route DELETE /phys_locations/{id} PhysLocation DeletePhysLocation

Delete a PhysLocation by Id

Delete a PhysLocation

Responses:

200: Alerts

func DeleteProfile

func DeleteProfile(entityId int) Alerts

DeleteProfile swagger:route DELETE /cdns/{id} Profile DeleteProfile

Delete a Profile by Id

Delete a Profile

Responses:

200: Alerts

func DeleteProfileParameter

func DeleteProfileParameter(entityId int) Alerts

DeleteProfileParameter swagger:route DELETE /profileparameters/{id} ProfileParameter DeleteProfileParameter

Delete a ProfileParameter by Id

Delete a single ProfileParameter

Responses:

200: Alerts

func DeleteRegion

func DeleteRegion(entityId int) Alerts

DeleteRegion swagger:route DELETE /regions/{id} Region DeleteRegion

Delete a Region

Responses:

200: Alerts

func DeleteStatus

func DeleteStatus(entityId int) Alerts

DeleteStatus swagger:route DELETE /statuses/{id} Status DeleteStatus

Delete a Status

Responses:

200: Alerts

type CDN

type CDN struct {
	// CDN Response Body
	// in: body
	CDNResponse tc.CDNResponse
}

CDN - CDNResponse to get the "response" top level key swagger:response CDN in: body

type CDNPathParams

type CDNPathParams struct {

	// Id associated to the CDN
	// in: path
	ID int `json:"id"`
}

swagger:parameters GetCDNById DeleteCDN

type CDNPostParam

type CDNPostParam struct {
	// CDN Request Body
	//
	// in: body
	// required: true
	CDN tc.CDN
}

swagger:parameters PostCDN

type CDNPutParam

type CDNPutParam struct {

	// ID
	// in: path
	ID int `json:"id"`

	// CDN Request Body
	//
	// in: body
	// required: true
	CDN tc.CDN
}

swagger:parameters PutCDN

type CDNQueryParams

type CDNQueryParams struct {

	// Enables Domain Name System Security Extensions (DNSSEC) for the CDN
	//
	DNSSecEnabled string `json:"dnssecEnabled"`

	// The domain name for the CDN
	//
	DomainName string `json:"domainName"`

	// Unique identifier for the CDN
	//
	ID string `json:"id"`

	// The CDN name
	//
	Name string `json:"name"`

	//
	//
	Orderby string `json:"orderby"`
}

CDNQueryParams

swagger:parameters GetCDNs

type CDNs

type CDNs struct {
	// CDN Response Body
	// in: body
	CDNsResponse tc.CDNsResponse `json:"response"`
}

CDNs - CDNsResponse to get the "response" top level key swagger:response CDNs in: body

type Division

type Division struct {
	// Division Response Body
	// in: body
	DivisionResponse tc.DivisionResponse
}

Division - DivisionResponse to get the "response" top level key swagger:response Division in: body

type DivisionPathParams

type DivisionPathParams struct {

	// Id associated to the Division
	// in: path
	ID int `json:"id"`
}

swagger:parameters GetDivisionById DeleteDivision

type DivisionPostParam

type DivisionPostParam struct {
	// Division Request Body
	//
	// in: body
	// required: true
	Division tc.Division
}

swagger:parameters PostDivision

type DivisionPutParam

type DivisionPutParam struct {

	// ID
	// in: path
	ID int `json:"id"`

	// Division Request Body
	//
	// in: body
	// required: true
	Division tc.Division
}

swagger:parameters PutDivision

type DivisionQueryParams

type DivisionQueryParams struct {

	// Name for this Division
	//
	Name string `json:"name"`

	// Unique identifier for the Division
	//
	ID string `json:"id"`

	// The field in the response to sort the response by
	//
	Orderby string `json:"orderby"`
}

DivisionQueryParams

swagger:parameters GetDivisions

type Divisions

type Divisions struct {
	// Division Response Body
	// in: body
	DivisionsResponse tc.DivisionsResponse `json:"response"`
}

Divisions - DivisionsResponse to get the "response" top level key swagger:response Divisions in: body

type PhysLocation

type PhysLocation struct {
	// PhysLocation Response Body
	// in: body
	PhysLocationResponse tc.PhysLocationResponse
}

PhysLocation - PhysLocationResponse to get the "response" top level key swagger:response PhysLocation in: body

type PhysLocationPathParams

type PhysLocationPathParams struct {

	// Id associated to the PhysLocation
	// in: path
	ID int `json:"id"`
}

swagger:parameters GetPhysLocationById DeletePhysLocation

type PhysLocationPostParam

type PhysLocationPostParam struct {
	// PhysLocation Request Body
	//
	// in: body
	// required: true
	PhysLocation tc.PhysLocationNullable
}

swagger:parameters PostPhysLocation

type PhysLocationPutParam

type PhysLocationPutParam struct {

	// ID
	// in: path
	ID int `json:"id"`

	// PhysLocation Request Body
	//
	// in: body
	// required: true
	PhysLocation tc.PhysLocationNullable
}

swagger:parameters PutPhysLocation

type PhysLocationQueryParams

type PhysLocationQueryParams struct {

	// The ID of the region associated with this Physical Location
	//
	RegionID int `json:"regionId"`

	//
	//
	Orderby string `json:"orderby"`
}

PhysLocationQueryParams

swagger:parameters GetPhysLocations

type PhysLocations

type PhysLocations struct {
	// PhysLocation Response Body
	// in: body
	PhysLocationsResponse tc.PhysLocationsResponse `json:"response"`
}

PhysLocations - PhysLocationsResponse to get the "response" top level key swagger:response PhysLocations in: body

type Profile

type Profile struct {
	// Profile Response Body
	// in: body
	ProfileResponse tc.ProfileResponse
}

Profile - ProfileResponse to get the "response" top level key swagger:response Profile in: body

type ProfileParameter

type ProfileParameter struct {
	// ProfileParameter Response Body
	// in: body
	ProfileParameterResponse tc.ProfileParameterResponse
}

ProfileParameter - ProfileParameterResponse to get the "response" top level key swagger:response ProfileParameter in: body

type ProfileParameterPostParam

type ProfileParameterPostParam struct {
	// ProfileParameter Request Body
	//
	// in: body
	// required: true
	ProfileParameter tc.ProfileParameter
}

swagger:parameters PostProfileParameter

type ProfileParameterQueryParams

type ProfileParameterQueryParams struct {

	// Unique identifier for the ProfileParameter
	//
	ProfileID string `json:"profileId"`

	// Unique identifier for the ProfileParameter
	//
	ParameterID string `json:"parameterId"`

	// The field in the response to sort the response by
	//
	Orderby string `json:"orderby"`
}

ProfileParameterQueryParams

swagger:parameters GetProfileParameters

type ProfileParameters

type ProfileParameters struct {
	// ProfileParameter Response Body
	// in: body
	ProfileParametersResponse tc.ProfileParametersResponse `json:"response"`
}

ProfileParameters - ProfileParametersResponse to get the "response" top level key swagger:response ProfileParameters in: body

type ProfilePathParams

type ProfilePathParams struct {

	// Id associated to the Profile
	// in: path
	ID int `json:"id"`
}

swagger:parameters GetProfileById DeleteProfile

type ProfilePostParam

type ProfilePostParam struct {
	// Profile Request Body
	//
	// in: body
	// required: true
	Profile tc.Profile
}

swagger:parameters PostProfile

type ProfilePutParam

type ProfilePutParam struct {

	// ID
	// in: path
	ID int `json:"id"`

	// Profile Request Body
	//
	// in: body
	// required: true
	Profile tc.Profile
}

swagger:parameters PutProfile

type ProfileQueryParams

type ProfileQueryParams struct {

	// Enables Domain Name System Security Extensions (DNSSEC) for the Profile
	//
	DNSSecEnabled string `json:"dnssecEnabled"`

	// The domain name for the Profile
	//
	DomainName string `json:"domainName"`

	// Unique identifier for the Profile
	//
	ID string `json:"id"`

	// The Profile name for the Profile
	//
	Name string `json:"name"`

	//
	//
	Orderby string `json:"orderby"`
}

ProfileQueryParams

swagger:parameters GetProfiles

type Profiles

type Profiles struct {
	// Profile Response Body
	// in: body
	ProfilesResponse tc.ProfilesResponse `json:"response"`
}

Profiles - ProfilesResponse to get the "response" top level key swagger:response Profiles in: body

type Region

type Region struct {
	// Region Response Body
	// in: body
	RegionResponse tc.RegionsResponse
}

Region - RegionResponse to get the "response" top level key swagger:response Region in: body

type RegionPathParams

type RegionPathParams struct {

	// Id associated to the Region
	// in: path
	ID int `json:"id"`
}

swagger:parameters GetRegionById DeleteRegion

type RegionPostParam

type RegionPostParam struct {
	// Region Request Body
	//
	// in: body
	// required: true
	Region tc.Region
}

swagger:parameters PostRegion

type RegionPutParam

type RegionPutParam struct {

	// ID
	// in: path
	ID int `json:"id"`

	// Region Request Body
	//
	// in: body
	// required: true
	Region tc.Region
}

swagger:parameters PutRegion

type RegionQueryParams

type RegionQueryParams struct {

	// Division ID that refers to this Region
	//
	Division string `json:"division"`

	// Division Name that refers to this Region
	//
	DivisionName string `json:"divisionName"`

	// Unique identifier for the Region
	//
	ID string `json:"id"`

	//
	//
	Orderby string `json:"orderby"`
}

RegionQueryParams

swagger:parameters GetRegions

type Regions

type Regions struct {
	// Region Response Body
	// in: body
	RegionsResponse tc.RegionsResponse `json:"response"`
}

Regions - RegionsResponse to get the "response" top level key swagger:response Regions in: body

type Status

type Status struct {
	// Status Response Body
	// in: body
	StatusResponse tc.StatusResponse
}

Status - StatusResponse to get the "response" top level key swagger:response Status in: body

type StatusPathParams

type StatusPathParams struct {

	// Id associated to the Status
	// in: path
	ID int `json:"id"`
}

swagger:parameters GetStatusById DeleteStatus

type StatusPostParam

type StatusPostParam struct {
	// Status Request Body
	//
	// in: body
	// required: true
	Status tc.Status
}

swagger:parameters PostStatus

type StatusPutParam

type StatusPutParam struct {

	// ID
	// in: path
	ID int `json:"id"`

	// Status Request Body
	//
	// in: body
	// required: true
	Status tc.Status
}

swagger:parameters PutStatus

type StatusQueryParams

type StatusQueryParams struct {

	// The name that refers to this Status
	//
	Name string `json:"name"`

	// A short description of the status
	//
	Description string `json:"description"`

	// Unique identifier for the Status
	//
	ID string `json:"id"`

	//
	//
	Orderby string `json:"orderby"`
}

StatusQueryParams

swagger:parameters GetStatuses

type Statuses

type Statuses struct {
	// Status Response Body
	// in: body
	StatusesResponse tc.StatusesResponse `json:"response"`
}

Statuses - StatusesResponse to get the "response" top level key swagger:response Statuses in: body

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL