This is an automated email from the ASF dual-hosted git repository. mitchell852 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git
commit 63fd5a82b92fc63594b66771e5d14ba442a38578 Author: Dewayne Richardson <dewr...@apache.org> AuthorDate: Fri Mar 23 08:39:10 2018 -0600 moved files into the v13 dir --- .../alerts.go => lib/go-tc/v13/divisions.go | 37 ++- .../traffic_ops_golang/swaggerdocs/swagger.json | 332 --------------------- .../swaggerdocs/{ => v13}/.gitignore | 0 .../swaggerdocs/{ => v13}/README.md | 0 .../swaggerdocs/{ => v13}/alerts.go | 2 +- .../swaggerdocs/{ => v13}/cdns.go | 2 +- .../swaggerdocs/{ => v13}/cors-http-server.py | 0 .../swaggerdocs/v13/divisions.go | 143 +++++++++ .../swaggerdocs/{ => v13}/docs.go | 2 +- .../swaggerdocs/{ => v13}/gen_docs.sh | 0 10 files changed, 176 insertions(+), 342 deletions(-) diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/alerts.go b/lib/go-tc/v13/divisions.go similarity index 59% copy from traffic_ops/traffic_ops_golang/swaggerdocs/alerts.go copy to lib/go-tc/v13/divisions.go index dac0823..572d021 100644 --- a/traffic_ops/traffic_ops_golang/swaggerdocs/alerts.go +++ b/lib/go-tc/v13/divisions.go @@ -1,4 +1,4 @@ -package swaggerdocs +package v13 import tc "github.com/apache/incubator-trafficcontrol/lib/go-tc" @@ -21,11 +21,34 @@ import tc "github.com/apache/incubator-trafficcontrol/lib/go-tc" * under the License. */ -// Alerts - informs the client of server side messages -// swagger:response Alerts -type Alerts struct { - // Alerts Response Body - // +// A List of Divisions Response +// swagger:response DivisionsResponse +type DivisionsResponse struct { + // in: body + Response []Division `json:"response"` +} + +// A Single Division Response for Update and Create to depict what changed +// swagger:response DivisionResponse +// in: body +type DivisionResponse struct { // in: body - Alerts []tc.Alert `json:"alerts"` + Response Division `json:"response"` +} + +// Division ... +type Division struct { + + // Division ID + // + ID int `json:"id" db:"id"` + + // LastUpdated + // + LastUpdated tc.TimeNoMod `json:"lastUpdated" db:"last_updated"` + + // Division Name + // + // required: true + Name string `json:"name" db:"name"` } diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/swagger.json b/traffic_ops/traffic_ops_golang/swaggerdocs/swagger.json deleted file mode 100644 index 0136c96..0000000 --- a/traffic_ops/traffic_ops_golang/swaggerdocs/swagger.json +++ /dev/null @@ -1,332 +0,0 @@ -{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "http", - "https" - ], - "swagger": "2.0", - "info": { - "description": "The following REST APIs are used by the Traffic Portal UI along with several Traffic Control backend component and services.\n\nThis documentation is fully compliant with the Swagger 2.0 specification", - "title": "TrafficOps API", - "contact": { - "name": "Traffic Control Dev List", - "url": "http://traffic-control-cdn.readthedocs.io/en/latest/index.html", - "email": "d...@trafficcontrol.incubator.apache.org" - }, - "license": { - "name": "Apache 2", - "url": "https://github.com/apache/incubator-trafficcontrol/blob/master/LICENSE" - }, - "version": "1.3" - }, - "host": "localhost:8443", - "basePath": "/api/1.3", - "paths": { - "/cdns": { - "get": { - "description": "Retrieve a list of CDNs", - "tags": [ - "CDN" - ], - "operationId": "GetCDNs", - "parameters": [ - { - "type": "string", - "x-go-name": "DNSSecEnabled", - "description": "Enables Domain Name System Security Extensions (DNSSEC) for the CDN", - "name": "dnssecEnabled", - "in": "query" - }, - { - "type": "string", - "x-go-name": "DomainName", - "description": "The domain name for the CDN", - "name": "domainName", - "in": "query" - }, - { - "type": "string", - "x-go-name": "ID", - "description": "Unique identifier for the CDN", - "name": "id", - "in": "query" - }, - { - "type": "string", - "x-go-name": "Name", - "description": "The CDN name for the CDN", - "name": "name", - "in": "query" - }, - { - "type": "string", - "x-go-name": "Orderby", - "name": "orderby", - "in": "query" - } - ], - "responses": { - "200": { - "$ref": "#/responses/CDNs" - }, - "400": { - "$ref": "#/responses/Alerts" - } - } - }, - "post": { - "description": "Create a CDN", - "tags": [ - "CDN" - ], - "operationId": "PostCDN", - "parameters": [ - { - "description": "CDN Request Body", - "name": "CDN", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CDN" - } - } - ], - "responses": { - "200": { - "$ref": "#/responses/Alerts" - } - } - } - }, - "/cdns/{id}": { - "get": { - "description": "Retrieve a specific CDN", - "tags": [ - "CDN" - ], - "operationId": "GetCDNById", - "parameters": [ - { - "type": "integer", - "format": "int64", - "x-go-name": "ID", - "description": "Id associated to the CDN", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "$ref": "#/responses/CDNs" - }, - "400": { - "$ref": "#/responses/Alerts" - } - } - }, - "put": { - "description": "Update a CDN", - "tags": [ - "CDN" - ], - "operationId": "PutCDN", - "parameters": [ - { - "type": "integer", - "format": "int64", - "x-go-name": "ID", - "description": "ID", - "name": "id", - "in": "path", - "required": true - }, - { - "description": "CDN Request Body", - "name": "CDN", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CDN" - } - } - ], - "responses": { - "200": { - "$ref": "#/responses/CDN" - } - } - }, - "delete": { - "description": "Delete a CDN", - "tags": [ - "CDN" - ], - "operationId": "DeleteCDN", - "parameters": [ - { - "type": "integer", - "format": "int64", - "x-go-name": "ID", - "description": "Id associated to the CDN", - "name": "id", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "$ref": "#/responses/Alerts" - } - } - } - } - }, - "definitions": { - "Alert": { - "type": "object", - "properties": { - "level": { - "type": "string", - "x-go-name": "Level" - }, - "text": { - "type": "string", - "x-go-name": "Text" - } - }, - "x-go-package": "github.com/apache/incubator-trafficcontrol/lib/go-tc" - }, - "CDN": { - "type": "object", - "title": "CDN ...", - "required": [ - "dnssecEnabled", - "domainName", - "id", - "name" - ], - "properties": { - "dnssecEnabled": { - "description": "The CDN to retrieve\n\nenables Domain Name Security Extensions on the specified CDN", - "type": "boolean", - "x-go-name": "DNSSECEnabled" - }, - "domainName": { - "description": "DomainName of the CDN", - "type": "string", - "x-go-name": "DomainName" - }, - "id": { - "description": "ID of the CDN", - "type": "integer", - "format": "int64", - "x-go-name": "ID" - }, - "lastUpdated": { - "$ref": "#/definitions/TimeNoMod" - }, - "name": { - "description": "Name of the CDN", - "type": "string", - "x-go-name": "Name" - } - }, - "x-go-package": "github.com/apache/incubator-trafficcontrol/lib/go-tc/v13" - }, - "CDNResponse": { - "description": "A Single CDN Response for Update and Create to depict what changed", - "type": "object", - "properties": { - "response": { - "$ref": "#/definitions/CDN" - } - }, - "x-go-package": "github.com/apache/incubator-trafficcontrol/lib/go-tc/v13" - }, - "CDNsResponse": { - "description": "A List of CDNs Response", - "type": "object", - "properties": { - "response": { - "description": "in: body", - "type": "array", - "items": { - "$ref": "#/definitions/CDN" - }, - "x-go-name": "Response" - } - }, - "x-go-package": "github.com/apache/incubator-trafficcontrol/lib/go-tc/v13" - }, - "Time": { - "description": "Time wraps standard time.Time to allow indication of invalid times", - "type": "object", - "properties": { - "Valid": { - "type": "boolean" - } - }, - "x-go-package": "github.com/apache/incubator-trafficcontrol/lib/go-tc" - }, - "TimeNoMod": { - "description": "TimeNoMod supported JSON marshalling, but suppresses JSON unmarshalling", - "$ref": "#/definitions/Time" - } - }, - "responses": { - "Alerts": { - "description": "Alerts - informs the client of server side messages", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Alert" - } - } - }, - "CDN": { - "description": "CDN - CDNResponse to get the \"response\" top level key", - "schema": { - "$ref": "#/definitions/CDNResponse" - } - }, - "CDNResponse": { - "description": "A Single CDN Response for Update and Create to depict what changed", - "schema": { - "$ref": "#/definitions/CDN" - } - }, - "CDNs": { - "description": "CDNs - CDNsResponse to get the \"response\" top level key", - "schema": { - "$ref": "#/definitions/CDNsResponse" - } - }, - "CDNsResponse": { - "description": "A List of CDNs Response", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/CDN" - } - } - } - }, - "securityDefinitions": { - "Cookie": { - "type": "apiKey", - "name": "cookie", - "in": "header" - } - }, - "security": [ - { - "Cookie": [] - } - ] -} \ No newline at end of file diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/.gitignore b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/.gitignore similarity index 100% rename from traffic_ops/traffic_ops_golang/swaggerdocs/.gitignore rename to traffic_ops/traffic_ops_golang/swaggerdocs/v13/.gitignore diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/README.md b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/README.md similarity index 100% rename from traffic_ops/traffic_ops_golang/swaggerdocs/README.md rename to traffic_ops/traffic_ops_golang/swaggerdocs/v13/README.md diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/alerts.go b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/alerts.go similarity index 98% rename from traffic_ops/traffic_ops_golang/swaggerdocs/alerts.go rename to traffic_ops/traffic_ops_golang/swaggerdocs/v13/alerts.go index dac0823..cc1edfb 100644 --- a/traffic_ops/traffic_ops_golang/swaggerdocs/alerts.go +++ b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/alerts.go @@ -1,4 +1,4 @@ -package swaggerdocs +package v13 import tc "github.com/apache/incubator-trafficcontrol/lib/go-tc" diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/cdns.go b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/cdns.go similarity index 99% rename from traffic_ops/traffic_ops_golang/swaggerdocs/cdns.go rename to traffic_ops/traffic_ops_golang/swaggerdocs/v13/cdns.go index 85a7124..77968ef 100644 --- a/traffic_ops/traffic_ops_golang/swaggerdocs/cdns.go +++ b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/cdns.go @@ -1,4 +1,4 @@ -package swaggerdocs +package v13 /* * Licensed to the Apache Software Foundation (ASF) under one diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/cors-http-server.py b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/cors-http-server.py similarity index 100% rename from traffic_ops/traffic_ops_golang/swaggerdocs/cors-http-server.py rename to traffic_ops/traffic_ops_golang/swaggerdocs/v13/cors-http-server.py diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/v13/divisions.go b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/divisions.go new file mode 100644 index 0000000..23e9e8f --- /dev/null +++ b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/divisions.go @@ -0,0 +1,143 @@ +package v13 + +import v13 "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. + */ + +// Divisions - DivisionsResponse to get the "response" top level key +// swagger:response Divisions +// in: body +type Divisions struct { + // Division Response Body + // in: body + DivisionsResponse v13.DivisionsResponse `json:"response"` +} + +// Division - DivisionResponse to get the "response" top level key +// swagger:response Division +// in: body +type Division struct { + // Division Response Body + // in: body + DivisionResponse v13.DivisionResponse +} + +// DivisionQueryParams +// +// swagger:parameters GetDivisions +type DivisionQueryParams struct { + + // DivisionsQueryParams + + // Name for this Division + // + Name string `json:"name"` + + // Unique identifier for the Division + // + ID string `json:"id"` + + // + // + Orderby string `json:"orderby"` +} + +// swagger:parameters PostDivision +type DivisionPostParam struct { + // Division Request Body + // + // in: body + // required: true + Division v13.Division +} + +// swagger:parameters GetDivisionById DeleteDivision +type DivisionPathParams struct { + + // Id associated to the Division + // in: path + ID int `json:"id"` +} + +// PostDivision swagger:route POST /divisions Division PostDivision +// +// Create a Division +// +// Responses: +// 200: Alerts +func PostDivision(entity DivisionPostParam) (Division, Alerts) { + return Division{}, Alerts{} +} + +// GetDivisions swagger:route GET /divisions Division GetDivisions +// +// Retrieve a list of Divisions +// +// Responses: +// 200: Divisions +// 400: Alerts +func GetDivisions() (Divisions, Alerts) { + return Divisions{}, Alerts{} +} + +// swagger:parameters PutDivision +type DivisionPutParam struct { + + // ID + // in: path + ID int `json:"id"` + + // Division Request Body + // + // in: body + // required: true + Division v13.Division +} + +// PutDivision swagger:route PUT /divisions/{id} Division PutDivision +// +// Update a Division +// +// Responses: +// 200: Division +func PutDivision(entity DivisionPutParam) (Division, Alerts) { + return Division{}, Alerts{} +} + +// GetDivisionById swagger:route GET /divisions/{id} Division GetDivisionById +// +// Retrieve a specific Division +// +// Responses: +// 200: Divisions +// 400: Alerts +func GetDivisionById() (Divisions, Alerts) { + return Divisions{}, Alerts{} +} + +// DeleteDivision swagger:route DELETE /divisions/{id} Division DeleteDivision +// +// Delete a Division +// +// Responses: +// 200: Alerts +func DeleteDivision(entityId int) Alerts { + return Alerts{} +} diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/docs.go b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/docs.go similarity index 98% rename from traffic_ops/traffic_ops_golang/swaggerdocs/docs.go rename to traffic_ops/traffic_ops_golang/swaggerdocs/v13/docs.go index e9b4261..ee55e9c 100644 --- a/traffic_ops/traffic_ops_golang/swaggerdocs/docs.go +++ b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/docs.go @@ -30,7 +30,7 @@ swagger:meta */ -package swaggerdocs +package v13 /* * Licensed to the Apache Software Foundation (ASF) under one diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/gen_docs.sh b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/gen_docs.sh similarity index 100% rename from traffic_ops/traffic_ops_golang/swaggerdocs/gen_docs.sh rename to traffic_ops/traffic_ops_golang/swaggerdocs/v13/gen_docs.sh -- To stop receiving notification emails like this one, please contact mitchell...@apache.org.