This is an automated email from the ASF dual-hosted git repository.

dangogh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 638818bcad69cb878599ef573937faef7f8a6c7f
Author: Dewayne Richardson <dewr...@apache.org>
AuthorDate: Thu Apr 5 09:22:19 2018 -0600

    added swagger documentation for profiles
    
    tweaked the cdns comment
---
 lib/go-tc/v13/profiles.go                          |  40 ++++-
 .../traffic_ops_golang/swaggerdocs/v13/cdns.go     |   2 +-
 .../traffic_ops_golang/swaggerdocs/v13/profiles.go | 161 +++++++++++++++++++++
 3 files changed, 196 insertions(+), 7 deletions(-)

diff --git a/lib/go-tc/v13/profiles.go b/lib/go-tc/v13/profiles.go
index 22003bf..19899b4 100644
--- a/lib/go-tc/v13/profiles.go
+++ b/lib/go-tc/v13/profiles.go
@@ -26,6 +26,14 @@ type ProfilesResponse struct {
        Response []Profile `json:"response"`
 }
 
+// A Single Profile Response for Update and Create to depict what changed
+// swagger:response ProfileResponse
+// in: body
+type ProfileResponse struct {
+       // in: body
+       Response Profile `json:"response"`
+}
+
 // Profile ...
 type Profile struct {
        ID int `json:"id" db:"id"`
@@ -44,16 +52,36 @@ type Profile struct {
 
 // ProfileNullable ...
 type ProfileNullable struct {
+
+       // Unique identifier for the Profile
+       //
        ID *int `json:"id" db:"id"`
 
        // LastUpdated
        //
        LastUpdated *tc.TimeNoMod `json:"lastUpdated" db:"last_updated"`
 
-       Name            *string `json:"name" db:"name"`
-       Description     *string `json:"description" db:"description"`
-       CDNName         *string `json:"cdnName" db:"cdn_name"`
-       CDNID           *int    `json:"cdn" db:"cdn"`
-       RoutingDisabled *bool   `json:"routingDisabled" db:"routing_disabled"`
-       Type            *string `json:"type" db:"type"`
+       // The Profile name
+       //
+       Name *string `json:"name" db:"name"`
+
+       // The Profile Description
+       //
+       Description *string `json:"description" db:"description"`
+
+       // The CDN name associated with the Profile
+       //
+       CDNName *string `json:"cdnName" db:"cdn_name"`
+
+       // The CDN id associated with the Profile
+       //
+       CDNID *int `json:"cdn" db:"cdn"`
+
+       // Enables
+       //
+       RoutingDisabled *bool `json:"routingDisabled" db:"routing_disabled"`
+
+       // The Type name associated with the Profile
+       //
+       Type *string `json:"type" db:"type"`
 }
diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/v13/cdns.go 
b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/cdns.go
index 77968ef..ee7bcf1 100644
--- a/traffic_ops/traffic_ops_golang/swaggerdocs/v13/cdns.go
+++ b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/cdns.go
@@ -58,7 +58,7 @@ type CDNQueryParams struct {
        //
        ID string `json:"id"`
 
-       // The CDN name for the CDN
+       // The CDN name
        //
        Name string `json:"name"`
 
diff --git a/traffic_ops/traffic_ops_golang/swaggerdocs/v13/profiles.go 
b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/profiles.go
new file mode 100644
index 0000000..18d7063
--- /dev/null
+++ b/traffic_ops/traffic_ops_golang/swaggerdocs/v13/profiles.go
@@ -0,0 +1,161 @@
+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 v13 "github.com/apache/incubator-trafficcontrol/lib/go-tc/v13"
+
+// Profiles -  ProfilesResponse to get the "response" top level key
+// swagger:response Profiles
+// in: body
+type Profiles struct {
+       // Profile Response Body
+       // in: body
+       ProfilesResponse v13.ProfilesResponse `json:"response"`
+}
+
+// Profile -  ProfileResponse to get the "response" top level key
+// swagger:response Profile
+// in: body
+type Profile struct {
+       // Profile Response Body
+       // in: body
+       ProfileResponse v13.ProfileResponse
+}
+
+// ProfileQueryParams
+//
+// swagger:parameters GetProfiles
+type ProfileQueryParams struct {
+
+       // ProfilesQueryParams
+
+       // Enables Domain Name System Security Extensions (DNSSEC) for the 
Profile
+       //
+       DNSSecEnabled string `json:"dnssecEnabled"`
+
+       // The domain name for the Profile
+       //
+       DomainName string `json:"domainName"`
+
+       // Unique identifier for the Profile
+       //
+       ID string `json:"id"`
+
+       // The Profile name for the Profile
+       //
+       Name string `json:"name"`
+
+       //
+       //
+       Orderby string `json:"orderby"`
+}
+
+// swagger:parameters PostProfile
+type ProfilePostParam struct {
+       // Profile Request Body
+       //
+       // in: body
+       // required: true
+       Profile v13.Profile
+}
+
+// swagger:parameters GetProfileById DeleteProfile
+type ProfilePathParams struct {
+
+       // Id associated to the Profile
+       // in: path
+       ID int `json:"id"`
+}
+
+// PostProfile swagger:route POST /cdns Profile PostProfile
+//
+// Create a Profile
+//
+// A Profile is a collection of Delivery Services
+//
+// Responses:
+//          200: Alerts
+func PostProfile(entity ProfilePostParam) (Profile, Alerts) {
+       return Profile{}, Alerts{}
+}
+
+// GetProfiles swagger:route GET /cdns Profile GetProfiles
+//
+// Retrieve a list of Profiles
+//
+// List of Profiles
+//
+// Responses:
+//          200: Profiles
+//          400: Alerts
+func GetProfiles() (Profiles, Alerts) {
+       return Profiles{}, Alerts{}
+}
+
+// swagger:parameters PutProfile
+type ProfilePutParam struct {
+
+       // ID
+       // in: path
+       ID int `json:"id"`
+
+       // Profile Request Body
+       //
+       // in: body
+       // required: true
+       Profile v13.Profile
+}
+
+// PutProfile swagger:route PUT /cdns/{id} Profile PutProfile
+//
+// Update a Profile by Id
+//
+// Update a Profile
+//
+// Responses:
+//          200: Profile
+func PutProfile(entity ProfilePutParam) (Profile, Alerts) {
+       return Profile{}, Alerts{}
+}
+
+// GetProfileById swagger:route GET /cdns/{id} Profile GetProfileById
+//
+// Retrieve a specific Profile by Id
+//
+// Retrieve a specific Profile
+//
+// Responses:
+//          200: Profiles
+//          400: Alerts
+func GetProfileById() (Profiles, Alerts) {
+       return Profiles{}, Alerts{}
+}
+
+// DeleteProfile swagger:route DELETE /cdns/{id} Profile DeleteProfile
+//
+// Delete a Profile by Id
+//
+// Delete a Profile
+//
+// Responses:
+//          200: Alerts
+func DeleteProfile(entityId int) Alerts {
+       return Alerts{}
+}

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

Reply via email to