Skip to content

Commit

Permalink
Implement the backup get-servers command
Browse files Browse the repository at this point in the history
  • Loading branch information
ldmberman committed Apr 6, 2016
1 parent e6c2bf0 commit 6ebaa43
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions init.go
Original file line number Diff line number Diff line change
Expand Up @@ -3376,6 +3376,21 @@ func init() {
},
},
})
registerCommandBase(&backup.GetServers{}, &backup.DataCenterServers{}, commands.CommandExcInfo{
Verb: "GET",
Url: "https://api-va1.backup.ctl.io/clc-backup-api/api/datacenters/{DataCenterName}/servers",
Resource: "backup",
Command: "get-servers",
Help: help.Command{
Brief: []string{"Shows the servers in the given data center"},
Arguments: []help.Argument{
{
"--data-center-name",
[]string{"Required. The name of a data center to query. For example, `UC1 - US West (Santa Clara)`"},
},
},
},
})
}

func registerCommandBase(inputModel interface{}, outputModel interface{}, info commands.CommandExcInfo) {
Expand Down
6 changes: 6 additions & 0 deletions models/backup/datacenters.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ package backup
type DataCenters []string

type OSTypes []string

type GetServers struct {
DataCenterName string `valid:"required" URIParam:"yes"`
}

type DataCenterServers []string

0 comments on commit 6ebaa43

Please sign in to comment.