mitchell852 closed pull request #2050: Created swaggerdocs for the /asns API URL: https://github.com/apache/incubator-trafficcontrol/pull/2050
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/lib/go-tc/v13/asns.go b/lib/go-tc/v13/asns.go new file mode 100644 index 000000000..12debea72 --- /dev/null +++ b/lib/go-tc/v13/asns.go @@ -0,0 +1,90 @@ +package v13 + +import tc "github.com/apache/incubator-trafficcontrol/lib/go-tc" + +/* + * 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. + */ + +// Autonomous System Numbers +// +// A List of ASNs Response +// swagger:response ASNsResponse +// in: body +type ASNsResponse struct { + // in: body + Response []ASN `json:"response"` +} + +// A Single ASN Response for Update and Create to depict what changed +// swagger:response ASNResponse +// in: body +type ASNResponse struct { + // in: body + Response ASN `json:"response"` +} + +type ASN struct { + // The ASN to retrieve + // + // Autonomous System Numbers per APNIC for identifying a service provider + // required: true + ASN int `json:"asn" db:"asn"` + + // Related cachegroup name + // + Cachegroup string `json:"cachegroup" db:"cachegroup"` + + // Related cachegroup id + // + CachegroupID int `json:"cachegroupId" db:"cachegroup_id"` + + // ID of the ASN + // + // required: true + ID int `json:"id" db:"id"` + + // LastUpdated + // + LastUpdated string `json:"lastUpdated" db:"last_updated"` +} + +type ASNNullable struct { + // The ASN to retrieve + // + // Autonomous System Numbers per APNIC for identifying a service provider + // required: true + ASN *int `json:"asn" db:"asn"` + + // Related cachegroup name + // + Cachegroup *string `json:"cachegroup" db:"cachegroup"` + + // Related cachegroup id + // + CachegroupID *int `json:"cachegroupId" db:"cachegroup_id"` + + // ID of the ASN + // + // required: true + ID *int `json:"id" db:"id"` + + // LastUpdated + // + LastUpdated *tc.TimeNoMod `json:"lastUpdated" db:"last_updated"` +} diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/v13/asns.go b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/asns.go new file mode 100644 index 000000000..f2a771784 --- /dev/null +++ b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/asns.go @@ -0,0 +1,161 @@ +package v13 + +import "github.com/apache/incubator-trafficcontrol/lib/go-tc/v13" + +/* + * 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. + */ + +// ASNs - ASNsResponse to get the "response" top level key +// swagger:response ASNs +// in: body +type ASNs struct { + // ASN Response Body + // in: body + ASNsResponse v13.ASNsResponse `json:"response"` +} + +// ASN - ASNResponse to get the "response" top level key +// swagger:response ASN +// in: body +type ASN struct { + // ASN Response Body + // in: body + ASNResponse v13.ASNResponse +} + +// ASNQueryParams +// +// swagger:parameters GetASNs +type ASNQueryParams struct { + + // ASNsQueryParams + + // 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"` +} + +// swagger:parameters PostASN +type ASNPostParam struct { + // ASN Request Body + // + // in: body + // required: true + ASN v13.ASN +} + +// swagger:parameters GetASNById DeleteASN +type ASNPathParams struct { + + // Id associated to the ASN + // in: path + ID int `json:"id"` +} + +// PostASN swagger:route POST /asns ASN PostASN +// +// Create a ASN +// +// An Autonomous System Number +// +// Responses: +// 200: Alerts +func PostASN(entity ASNPostParam) (ASN, Alerts) { + return ASN{}, Alerts{} +} + +// GetASNs swagger:route GET /asns ASN GetASNs +// +// Retrieve a list of ASNs +// +// A list of ASNs +// +// Responses: +// 200: ASNs +// 400: Alerts +func GetASNs() (ASNs, Alerts) { + return ASNs{}, Alerts{} +} + +// swagger:parameters PutASN +type ASNPutParam struct { + + // ID + // in: path + ID int `json:"id"` + + // ASN Request Body + // + // in: body + // required: true + ASN v13.ASN +} + +// PutASN swagger:route PUT /asns/{id} ASN PutASN +// +// Update an ASN by Id +// +// Update an ASN +// +// Responses: +// 200: ASN +func PutASN(entity ASNPutParam) (ASN, Alerts) { + return ASN{}, Alerts{} +} + +// GetASNById swagger:route GET /asns/{id} ASN GetASNById +// +// Retrieve a specific ASN by Id +// +// Retrieve an ASN +// +// Responses: +// 200: ASNs +// 400: Alerts +func GetASNById() (ASNs, Alerts) { + return ASNs{}, Alerts{} +} + +// DeleteASN swagger:route DELETE /asns/{id} ASN DeleteASN +// +// Delete an ASN by Id +// +// Delete an ASN +// +// Responses: +// 200: Alerts +func DeleteASN(entityId int) Alerts { + return Alerts{} +} ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
