You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2018/03/27 19:01:45 UTC
[incubator-trafficcontrol] branch master updated (db487d4 ->
f77f92a)
This is an automated email from the ASF dual-hosted git repository.
mitchell852 pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git.
from db487d4 updated the profiles to be -wip until more time to complete
new 31b6710 initial swaggerdocs dir
new 31bc7bf added swagger doc to go-tc struct
new 2643a88 added cors-http-server.py to help with swagger doc building
new d9e828a added .gitignore
new 41a1d98 added swagger files
new fde995f updated the README.md
new 76cb698 added apache header
new aeb6a35 updated to have pointers as nullable
new f7e4fe7 updated the description
new f77f92a added more metatags for producing the summary
The 10 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
lib/go-tc/v13/cdns.go | 79 ++++-
.../traffic_ops_golang/swaggerdocs/.gitignore | 1 +
.../traffic_ops_golang/swaggerdocs/README.md | 54 ++++
.../traffic_ops_golang/swaggerdocs/alerts.go | 21 +-
traffic_ops/traffic_ops_golang/swaggerdocs/cdns.go | 161 ++++++++++
.../swaggerdocs/cors-http-server.py | 33 ++
.../traffic_ops_golang/swaggerdocs/docs.go | 74 ++---
.../traffic_ops_golang/swaggerdocs/gen_docs.sh | 23 ++
.../traffic_ops_golang/swaggerdocs/swagger.json | 332 +++++++++++++++++++++
9 files changed, 716 insertions(+), 62 deletions(-)
create mode 100644 traffic_ops/traffic_ops_golang/swaggerdocs/.gitignore
create mode 100644 traffic_ops/traffic_ops_golang/swaggerdocs/README.md
copy traffic_monitor/datareq/monitorconfig.go => traffic_ops/traffic_ops_golang/swaggerdocs/alerts.go (75%)
create mode 100644 traffic_ops/traffic_ops_golang/swaggerdocs/cdns.go
create mode 100755 traffic_ops/traffic_ops_golang/swaggerdocs/cors-http-server.py
copy lib/go-util/join.go => traffic_ops/traffic_ops_golang/swaggerdocs/docs.go (50%)
create mode 100755 traffic_ops/traffic_ops_golang/swaggerdocs/gen_docs.sh
create mode 100644 traffic_ops/traffic_ops_golang/swaggerdocs/swagger.json
--
To stop receiving notification emails like this one, please contact
mitchell852@apache.org.
[incubator-trafficcontrol] 07/10: added apache header
Posted by mi...@apache.org.
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 76cb698a0a6dfac5036b1ace67025b37baa5eb1d
Author: Dewayne Richardson <de...@apache.org>
AuthorDate: Thu Mar 22 13:51:21 2018 -0600
added apache header
---
traffic_ops/traffic_ops_golang/swaggerdocs/gen_docs.sh | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/gen_docs.sh b/traffic_ops/traffic_ops_golang/swaggerdocs/gen_docs.sh
index 453020a..a7c7154 100755
--- a/traffic_ops/traffic_ops_golang/swaggerdocs/gen_docs.sh
+++ b/traffic_ops/traffic_ops_golang/swaggerdocs/gen_docs.sh
@@ -1,5 +1,22 @@
#!/usr/bin/env bash
+# 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.
+
unset DEBUG
#export DEBUG=true
swagger generate spec -o ./swagger.json
--
To stop receiving notification emails like this one, please contact
mitchell852@apache.org.
[incubator-trafficcontrol] 02/10: added swagger doc to go-tc struct
Posted by mi...@apache.org.
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 31bc7bfa872e48fc605c81ebae1450aa3881e5de
Author: Dewayne Richardson <de...@apache.org>
AuthorDate: Wed Mar 21 08:43:57 2018 -0600
added swagger doc to go-tc struct
---
lib/go-tc/v13/cdns.go | 79 ++++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 68 insertions(+), 11 deletions(-)
diff --git a/lib/go-tc/v13/cdns.go b/lib/go-tc/v13/cdns.go
index e0c1aa8..9fa6ae1 100644
--- a/lib/go-tc/v13/cdns.go
+++ b/lib/go-tc/v13/cdns.go
@@ -1,5 +1,7 @@
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
@@ -18,26 +20,81 @@ package v13
* specific language governing permissions and limitations
* under the License.
*/
-import "github.com/apache/incubator-trafficcontrol/lib/go-tc"
+// A List of CDNs Response
+// swagger:response CDNsResponse
+// in: body
type CDNsResponse struct {
+ // in: body
Response []CDN `json:"response"`
}
+// A Single CDN Response for Update and Create to depict what changed
+// swagger:response CDNResponse
+// in: body
+type CDNResponse struct {
+ // in: body
+ Response CDN `json:"response"`
+}
+
+// CDN ...
type CDN struct {
- DNSSECEnabled bool `json:"dnssecEnabled" db:"dnssec_enabled"`
- DomainName string `json:"domainName" db:"domain_name"`
- ID int `json:"id" db:"id"`
- LastUpdated tc.TimeNoMod `json:"lastUpdated" db:"last_updated"`
- Name string `json:"name" db:"name"`
+
+ // The CDN to retrieve
+ //
+ // enables Domain Name Security Extensions on the specified CDN
+ //
+ // required: true
+ DNSSECEnabled bool `json:"dnssecEnabled" db:"dnssec_enabled"`
+
+ // DomainName of the CDN
+ //
+ // required: true
+ DomainName string `json:"domainName" db:"domain_name"`
+
+ // ID of the CDN
+ //
+ // required: true
+ ID int `json:"id" db:"id"`
+
+ // LastUpdated
+ //
+ LastUpdated tc.TimeNoMod `json:"lastUpdated" db:"last_updated"`
+
+ // Name of the CDN
+ //
+ // required: true
+ Name string `json:"name" db:"name"`
}
+// CDNNullable ...
type CDNNullable struct {
- DNSSECEnabled *bool `json:"dnssecEnabled" db:"dnssec_enabled"`
- DomainName *string `json:"domainName" db:"domain_name"`
- ID *int `json:"id" db:"id"`
- LastUpdated *tc.TimeNoMod `json:"lastUpdated" db:"last_updated"`
- Name *string `json:"name" db:"name"`
+
+ // The CDN to retrieve
+ //
+ // enables Domain Name Security Extensions on the specified CDN
+ //
+ // required: true
+ DNSSECEnabled bool `json:"dnssecEnabled" db:"dnssec_enabled"`
+
+ // DomainName of the CDN
+ //
+ // required: true
+ DomainName string `json:"domainName" db:"domain_name"`
+
+ // ID of the CDN
+ //
+ // required: true
+ ID int `json:"id" db:"id"`
+
+ // LastUpdated
+ //
+ LastUpdated tc.TimeNoMod `json:"lastUpdated" db:"last_updated"`
+
+ // Name of the CDN
+ //
+ // required: true
+ Name string `json:"name" db:"name"`
}
// CDNSSLKeysResponse ...
--
To stop receiving notification emails like this one, please contact
mitchell852@apache.org.
[incubator-trafficcontrol] 05/10: added swagger files
Posted by mi...@apache.org.
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 41a1d98ca24b17444354031b9a46048951108185
Author: Dewayne Richardson <de...@apache.org>
AuthorDate: Thu Mar 22 08:22:23 2018 -0600
added swagger files
---
.../traffic_ops_golang/swaggerdocs/README.md | 8 ++
.../traffic_ops_golang/swaggerdocs/alerts.go | 31 +++++
traffic_ops/traffic_ops_golang/swaggerdocs/cdns.go | 151 +++++++++++++++++++++
traffic_ops/traffic_ops_golang/swaggerdocs/docs.go | 52 +++++++
.../traffic_ops_golang/swaggerdocs/gen_docs.sh | 6 +
5 files changed, 248 insertions(+)
diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/README.md b/traffic_ops/traffic_ops_golang/swaggerdocs/README.md
new file mode 100644
index 0000000..78a4edb
--- /dev/null
+++ b/traffic_ops/traffic_ops_golang/swaggerdocs/README.md
@@ -0,0 +1,8 @@
+
+Generates Swagger 2.0 the Traffic Ops API documentation using [go-swagger](https://github.com/go-swagger/go-swagger) meta tags
+
+
+## Setup
+
+See the install documentation for go-swagger
+
diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/alerts.go b/traffic_ops/traffic_ops_golang/swaggerdocs/alerts.go
new file mode 100644
index 0000000..dac0823
--- /dev/null
+++ b/traffic_ops/traffic_ops_golang/swaggerdocs/alerts.go
@@ -0,0 +1,31 @@
+package swaggerdocs
+
+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.
+ */
+
+// Alerts - informs the client of server side messages
+// swagger:response Alerts
+type Alerts struct {
+ // Alerts Response Body
+ //
+ // in: body
+ Alerts []tc.Alert `json:"alerts"`
+}
diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/cdns.go b/traffic_ops/traffic_ops_golang/swaggerdocs/cdns.go
new file mode 100644
index 0000000..ea89b4c
--- /dev/null
+++ b/traffic_ops/traffic_ops_golang/swaggerdocs/cdns.go
@@ -0,0 +1,151 @@
+package swaggerdocs
+
+/*
+ * 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.
+ */
+
+import v13 "github.com/apache/incubator-trafficcontrol/lib/go-tc/v13"
+
+// CDNs - CDNsResponse to get the "response" top level key
+// swagger:response CDNs
+// in: body
+type CDNs struct {
+ // CDN Response Body
+ // in: body
+ CDNsResponse v13.CDNsResponse `json:"response"`
+}
+
+// CDN - CDNResponse to get the "response" top level key
+// swagger:response CDN
+// in: body
+type CDN struct {
+ // CDN Response Body
+ // in: body
+ CDNResponse v13.CDNResponse
+}
+
+// CDNQueryParams
+//
+// swagger:parameters GetCDNs
+type CDNQueryParams struct {
+
+ // CDNsQueryParams
+
+ // 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 for the CDN
+ //
+ Name string `json:"name"`
+
+ //
+ //
+ Orderby string `json:"orderby"`
+}
+
+// swagger:parameters PostCDN
+type CDNPostParam struct {
+ // CDN Request Body
+ //
+ // in: body
+ // required: true
+ CDN v13.CDN
+}
+
+// swagger:parameters GetCDNById DeleteCDN
+type CDNPathParams struct {
+
+ // Id associated to the CDN
+ // in: path
+ ID int `json:"id"`
+}
+
+// PostCDN swagger:route POST /cdns CDN PostCDN
+//
+// Create a CDN
+//
+// Responses:
+// 200: Alerts
+func PostCDN(entity CDNPostParam) (CDN, Alerts) {
+ return CDN{}, Alerts{}
+}
+
+// GetCDNs swagger:route GET /cdns CDN GetCDNs
+//
+// Retrieve a list of CDNs
+//
+// Responses:
+// 200: CDNs
+// 400: Alerts
+func GetCDNs() (CDNs, Alerts) {
+ return CDNs{}, Alerts{}
+}
+
+// swagger:parameters PutCDN
+type CDNPutParam struct {
+
+ // ID
+ // in: path
+ ID int `json:"id"`
+
+ // CDN Request Body
+ //
+ // in: body
+ // required: true
+ CDN v13.CDN
+}
+
+// PutCDN swagger:route PUT /cdns/{id} CDN PutCDN
+//
+// Update a CDN
+//
+// Responses:
+// 200: CDN
+func PutCDN(entity CDNPutParam) (CDN, Alerts) {
+ return CDN{}, Alerts{}
+}
+
+// GetCDNById swagger:route GET /cdns/{id} CDN GetCDNById
+//
+// Retrieve a specific CDN
+//
+// Responses:
+// 200: CDNs
+// 400: Alerts
+func GetCDNById() (CDNs, Alerts) {
+ return CDNs{}, Alerts{}
+}
+
+// DeleteCDN swagger:route DELETE /cdns/{id} CDN DeleteCDN
+//
+// Delete a CDN
+//
+// Responses:
+// 200: Alerts
+func DeleteCDN(entityId int) Alerts {
+ return Alerts{}
+}
diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/docs.go b/traffic_ops/traffic_ops_golang/swaggerdocs/docs.go
new file mode 100644
index 0000000..4045455
--- /dev/null
+++ b/traffic_ops/traffic_ops_golang/swaggerdocs/docs.go
@@ -0,0 +1,52 @@
+/*
+ Package docs TrafficOps 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: localhost:8443
+ BasePath: /api/1.3
+ Version: 1.3
+ License: Apache 2 https://github.com/apache/incubator-trafficcontrol/blob/master/LICENSE
+ Contact: Traffic Control Dev List<de...@trafficcontrol.incubator.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
+*/
+package swaggerdocs
+
+/*
+ * 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.
+ */
diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/gen_docs.sh b/traffic_ops/traffic_ops_golang/swaggerdocs/gen_docs.sh
new file mode 100755
index 0000000..453020a
--- /dev/null
+++ b/traffic_ops/traffic_ops_golang/swaggerdocs/gen_docs.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+unset DEBUG
+#export DEBUG=true
+swagger generate spec -o ./swagger.json
+echo "successfully generated the swagger.json file"
--
To stop receiving notification emails like this one, please contact
mitchell852@apache.org.
[incubator-trafficcontrol] 03/10: added cors-http-server.py to help
with swagger doc building
Posted by mi...@apache.org.
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 2643a88350bef158c1167fd5f7123b3991d711f8
Author: Dewayne Richardson <de...@apache.org>
AuthorDate: Thu Mar 22 07:58:12 2018 -0600
added cors-http-server.py to help with swagger doc building
---
.../swaggerdocs/cors-http-server.py | 33 ++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/cors-http-server.py b/traffic_ops/traffic_ops_golang/swaggerdocs/cors-http-server.py
new file mode 100755
index 0000000..3c1687f
--- /dev/null
+++ b/traffic_ops/traffic_ops_golang/swaggerdocs/cors-http-server.py
@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+
+
+ # 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.
+
+from SimpleHTTPServer import SimpleHTTPRequestHandler
+import BaseHTTPServer
+
+#
+# Simple HTTP server that serves up port 8000 with the CORS header enabled
+#
+class CORSRequestHandler (SimpleHTTPRequestHandler):
+ def end_headers (self):
+ self.send_header('Access-Control-Allow-Origin', '*')
+ SimpleHTTPRequestHandler.end_headers(self)
+
+if __name__ == '__main__':
+ BaseHTTPServer.test(CORSRequestHandler, BaseHTTPServer.HTTPServer)
--
To stop receiving notification emails like this one, please contact
mitchell852@apache.org.
[incubator-trafficcontrol] 04/10: added .gitignore
Posted by mi...@apache.org.
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 d9e828a3a5f167fa6959b4c0c37dfbd56ad01072
Author: Dewayne Richardson <de...@apache.org>
AuthorDate: Thu Mar 22 08:01:19 2018 -0600
added .gitignore
---
traffic_ops/traffic_ops_golang/swaggerdocs/.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/.gitignore b/traffic_ops/traffic_ops_golang/swaggerdocs/.gitignore
new file mode 100644
index 0000000..168aa94
--- /dev/null
+++ b/traffic_ops/traffic_ops_golang/swaggerdocs/.gitignore
@@ -0,0 +1 @@
+swagger.json
--
To stop receiving notification emails like this one, please contact
mitchell852@apache.org.
[incubator-trafficcontrol] 09/10: updated the description
Posted by mi...@apache.org.
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 f7e4fe7af3ddad093f089141f920424a2e74b84a
Author: Dewayne Richardson <de...@apache.org>
AuthorDate: Fri Mar 23 14:21:29 2018 -0600
updated the description
---
traffic_ops/traffic_ops_golang/swaggerdocs/docs.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/docs.go b/traffic_ops/traffic_ops_golang/swaggerdocs/docs.go
index 4045455..e9b4261 100644
--- a/traffic_ops/traffic_ops_golang/swaggerdocs/docs.go
+++ b/traffic_ops/traffic_ops_golang/swaggerdocs/docs.go
@@ -1,5 +1,5 @@
/*
- Package docs TrafficOps API
+ Package docs Traffic Ops API v1.3
The following REST APIs are used by the Traffic Portal UI along with several Traffic Control backend component and services.
--
To stop receiving notification emails like this one, please contact
mitchell852@apache.org.
[incubator-trafficcontrol] 10/10: added more metatags for producing
the summary
Posted by mi...@apache.org.
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 f77f92a45e6802fb559f5f23ed680b5f69e057d7
Author: Dewayne Richardson <de...@apache.org>
AuthorDate: Fri Mar 23 14:32:55 2018 -0600
added more metatags for producing the summary
---
traffic_ops/traffic_ops_golang/swaggerdocs/cdns.go | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/cdns.go b/traffic_ops/traffic_ops_golang/swaggerdocs/cdns.go
index ea89b4c..85a7124 100644
--- a/traffic_ops/traffic_ops_golang/swaggerdocs/cdns.go
+++ b/traffic_ops/traffic_ops_golang/swaggerdocs/cdns.go
@@ -88,6 +88,8 @@ type CDNPathParams struct {
//
// Create a CDN
//
+// A CDN is a collection of Delivery Services
+//
// Responses:
// 200: Alerts
func PostCDN(entity CDNPostParam) (CDN, Alerts) {
@@ -98,6 +100,8 @@ func PostCDN(entity CDNPostParam) (CDN, Alerts) {
//
// Retrieve a list of CDNs
//
+// List of CDNs
+//
// Responses:
// 200: CDNs
// 400: Alerts
@@ -121,6 +125,8 @@ type CDNPutParam struct {
// PutCDN swagger:route PUT /cdns/{id} CDN PutCDN
//
+// Update a CDN by Id
+//
// Update a CDN
//
// Responses:
@@ -131,6 +137,8 @@ func PutCDN(entity CDNPutParam) (CDN, Alerts) {
// GetCDNById swagger:route GET /cdns/{id} CDN GetCDNById
//
+// Retrieve a specific CDN by Id
+//
// Retrieve a specific CDN
//
// Responses:
@@ -142,6 +150,8 @@ func GetCDNById() (CDNs, Alerts) {
// DeleteCDN swagger:route DELETE /cdns/{id} CDN DeleteCDN
//
+// Delete a CDN by Id
+//
// Delete a CDN
//
// Responses:
--
To stop receiving notification emails like this one, please contact
mitchell852@apache.org.
[incubator-trafficcontrol] 01/10: initial swaggerdocs dir
Posted by mi...@apache.org.
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 31b67103fafafa084b7a586d0021d85b58cc4f3d
Author: Dewayne Richardson <de...@apache.org>
AuthorDate: Fri Mar 16 11:40:29 2018 -0600
initial swaggerdocs dir
---
.../traffic_ops_golang/swaggerdocs/swagger.json | 332 +++++++++++++++++++++
1 file changed, 332 insertions(+)
diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/swagger.json b/traffic_ops/traffic_ops_golang/swaggerdocs/swagger.json
new file mode 100644
index 0000000..0136c96
--- /dev/null
+++ b/traffic_ops/traffic_ops_golang/swaggerdocs/swagger.json
@@ -0,0 +1,332 @@
+{
+ "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": "dev@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
--
To stop receiving notification emails like this one, please contact
mitchell852@apache.org.
[incubator-trafficcontrol] 08/10: updated to have pointers as
nullable
Posted by mi...@apache.org.
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 aeb6a358f5b758d1a1a77ac2607c21b58066baa1
Author: Dewayne Richardson <de...@apache.org>
AuthorDate: Fri Mar 23 10:10:35 2018 -0600
updated to have pointers as nullable
---
lib/go-tc/v13/cdns.go | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/go-tc/v13/cdns.go b/lib/go-tc/v13/cdns.go
index 9fa6ae1..3037af9 100644
--- a/lib/go-tc/v13/cdns.go
+++ b/lib/go-tc/v13/cdns.go
@@ -75,26 +75,26 @@ type CDNNullable struct {
// enables Domain Name Security Extensions on the specified CDN
//
// required: true
- DNSSECEnabled bool `json:"dnssecEnabled" db:"dnssec_enabled"`
+ DNSSECEnabled *bool `json:"dnssecEnabled" db:"dnssec_enabled"`
// DomainName of the CDN
//
// required: true
- DomainName string `json:"domainName" db:"domain_name"`
+ DomainName *string `json:"domainName" db:"domain_name"`
// ID of the CDN
//
// required: true
- ID int `json:"id" db:"id"`
+ ID *int `json:"id" db:"id"`
// LastUpdated
//
- LastUpdated tc.TimeNoMod `json:"lastUpdated" db:"last_updated"`
+ LastUpdated *tc.TimeNoMod `json:"lastUpdated" db:"last_updated"`
// Name of the CDN
//
// required: true
- Name string `json:"name" db:"name"`
+ Name *string `json:"name" db:"name"`
}
// CDNSSLKeysResponse ...
--
To stop receiving notification emails like this one, please contact
mitchell852@apache.org.
[incubator-trafficcontrol] 06/10: updated the README.md
Posted by mi...@apache.org.
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 fde995f7ae3b0479d850258aea46a61a7d6bf010
Author: Dewayne Richardson <de...@apache.org>
AuthorDate: Thu Mar 22 09:15:07 2018 -0600
updated the README.md
---
.../traffic_ops_golang/swaggerdocs/README.md | 52 ++++++++++++++++++++--
1 file changed, 49 insertions(+), 3 deletions(-)
diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/README.md b/traffic_ops/traffic_ops_golang/swaggerdocs/README.md
index 78a4edb..19fff3d 100644
--- a/traffic_ops/traffic_ops_golang/swaggerdocs/README.md
+++ b/traffic_ops/traffic_ops_golang/swaggerdocs/README.md
@@ -1,8 +1,54 @@
+<!--
+ 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
-Generates Swagger 2.0 the Traffic Ops API documentation using [go-swagger](https://github.com/go-swagger/go-swagger) meta tags
+ 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.
+-->
-## Setup
+#### `./swaggerdocs`
+This directory contains the Go structs that glue together the Swagger 2.0 metadata that will generate the Traffic Ops API documentation using [go-swagger](https://github.com/go-swagger/go-swagger) meta tags. The Traffic Ops API documentation is maintained by modifying the Go files in this directory that point to the **incubator-trafficcontrol/lib/go-tc/*.go** structs that render the Traffic Ops Go Proxy API's.
-See the install documentation for go-swagger
+
+### Setup
+
+See the install documentation for [https://github.com/go-swagger/go-swagger](go-swagger)
+
+
+### Generate your Documentation
+
+The **gen_docs.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_docs.sh** script will be the **swagger.json** spec file.
+
+### Verifying your Documentation
+
+Once the **swagger.json** spec file has been generated it needs to to be served over http so that you can validate it using the Swagger Editor.
+
+See the following steps:
+
+* Execute the **cors-http-server.py** (this will start a server on **http://localhost:8000**
+ so that you can point to it using the [https://editor.swagger.io](Swagger Editor).
+
+ `$ ./cors-http-server.py`
+
+* Navigate to [https://editor.swagger.io](Swagger Editor)
+
+* Use File->Import URL then plugin **http://localhost:8000**
+ * At this point the Swagger Editor will convert the **swagger.json** to yaml format and show the resulting documentation rendered as html.
+
+ OR
+
+* Install the [https://swagger.io/swagger-ui/](Swagger UI) yourself and run locally.
+
+
--
To stop receiving notification emails like this one, please contact
mitchell852@apache.org.