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/04/12 14:26:42 UTC

[incubator-trafficcontrol] branch master updated: added swaggerdocs for statuses

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


The following commit(s) were added to refs/heads/master by this push:
     new 5938416  added swaggerdocs for statuses
5938416 is described below

commit 59384165499a2a0c12f1350a3e6ba5dff73ea7ec
Author: Dewayne Richardson <de...@apache.org>
AuthorDate: Tue Apr 10 12:57:15 2018 -0600

    added swaggerdocs for statuses
---
 lib/go-tc/v13/statuses.go                          |  60 +++++++++
 .../traffic_ops_golang/swaggerdocs/v13/statuses.go | 149 +++++++++++++++++++++
 2 files changed, 209 insertions(+)

diff --git a/lib/go-tc/v13/statuses.go b/lib/go-tc/v13/statuses.go
new file mode 100644
index 0000000..8e02595
--- /dev/null
+++ b/lib/go-tc/v13/statuses.go
@@ -0,0 +1,60 @@
+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.
+ */
+
+// A List of Statuses Response that depict the state of a server
+// swagger:response StatusesResponse
+type StatusesResponse struct {
+	// in: body
+	Response []Status `json:"response"`
+}
+
+// A Single Status Response for Update and Create to depict what changed
+// swagger:response StatusResponse
+// in: body
+type StatusResponse struct {
+	// in: body
+	Response Status `json:"response"`
+}
+
+// A Single Statuses Response for Update and Create to depict what changed
+// swagger:model Statuses
+type Status struct {
+
+	// The Statuses to retrieve
+	//
+	// description of the status type
+	//
+	Description string `json:"description" db:"description"`
+
+	// ID of the Status
+	//
+	// required: true
+	ID int `json:"id" db:"id"`
+
+	// The Time / Date this server entry was last updated
+	//
+	LastUpdated tc.TimeNoMod `json:"lastUpdated" db:"last_updated"`
+
+	// enum: ["OFFLINE", "ONLINE", "ADMIN_DOWN", "REPORTED", "CCR_IGNORE", "PRE_PROD"]
+	Name string `json:"name" db:"name"`
+}
diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/v13/statuses.go b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/statuses.go
new file mode 100644
index 0000000..f73db72
--- /dev/null
+++ b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/statuses.go
@@ -0,0 +1,149 @@
+package 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.
+ */
+
+import (
+	"github.com/apache/incubator-trafficcontrol/lib/go-tc/v13"
+)
+
+// Statuses -  StatusesResponse to get the "response" top level key
+// swagger:response Statuses
+// in: body
+type Statuses struct {
+	// Status Response Body
+	// in: body
+	StatusesResponse v13.StatusesResponse `json:"response"`
+}
+
+// Status -  StatusResponse to get the "response" top level key
+// swagger:response Status
+// in: body
+type Status struct {
+	// Status Response Body
+	// in: body
+	StatusResponse v13.StatusResponse
+}
+
+// StatusQueryParams
+//
+// swagger:parameters GetStatuses
+type StatusQueryParams struct {
+
+	// StatusesQueryParams
+
+	// 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"`
+}
+
+// swagger:parameters PostStatus
+type StatusPostParam struct {
+	// Status Request Body
+	//
+	// in: body
+	// required: true
+	Status v13.Status
+}
+
+// swagger:parameters GetStatusById DeleteStatus
+type StatusPathParams struct {
+
+	// Id associated to the Status
+	// in: path
+	ID int `json:"id"`
+}
+
+// PostStatus swagger:route POST /statuses Status PostStatus
+//
+// Create a Status
+//
+// Responses:
+//          200: Alerts
+func PostStatus(entity StatusPostParam) (Status, Alerts) {
+	return Status{}, Alerts{}
+}
+
+// GetStatuses swagger:route GET /statuses Status GetStatuses
+//
+// Retrieve a list of Statuses
+//
+// Responses:
+//          200: Statuses
+//          400: Alerts
+func GetStatuses() (Statuses, Alerts) {
+	return Statuses{}, Alerts{}
+}
+
+// swagger:parameters PutStatus
+type StatusPutParam struct {
+
+	// ID
+	// in: path
+	ID int `json:"id"`
+
+	// Status Request Body
+	//
+	// in: body
+	// required: true
+	Status v13.Status
+}
+
+// PutStatus swagger:route PUT /statuses/{id} Status PutStatus
+//
+// Update a Status
+//
+// Responses:
+//          200: Status
+func PutStatus(entity StatusPutParam) (Status, Alerts) {
+	return Status{}, Alerts{}
+}
+
+// GetStatusById swagger:route GET /statuses/{id} Status GetStatusById
+//
+// Retrieve a specific Status
+//
+// Responses:
+//          200: Statuses
+//          400: Alerts
+func GetStatusById() (Statuses, Alerts) {
+	return Statuses{}, Alerts{}
+}
+
+// DeleteStatus swagger:route DELETE /statuses/{id} Status DeleteStatus
+//
+// Delete a Status
+//
+// Responses:
+//          200: Alerts
+func DeleteStatus(entityId int) Alerts {
+	return Alerts{}
+}

-- 
To stop receiving notification emails like this one, please contact
mitchell852@apache.org.