mitchell852 closed pull request #2107: added swaggerdocs for /statuses
URL: https://github.com/apache/incubator-trafficcontrol/pull/2107
 
 
   

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/statuses.go b/lib/go-tc/v13/statuses.go
new file mode 100644
index 000000000..8e02595ba
--- /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 000000000..f73db7218
--- /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{}
+}


 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to