diff --git a/init.go b/init.go index 8a4f39e..66b81ff 100644 --- a/init.go +++ b/init.go @@ -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) { diff --git a/models/backup/datacenters.go b/models/backup/datacenters.go index af4d827..cd7db58 100644 --- a/models/backup/datacenters.go +++ b/models/backup/datacenters.go @@ -3,3 +3,9 @@ package backup type DataCenters []string type OSTypes []string + +type GetServers struct { + DataCenterName string `valid:"required" URIParam:"yes"` +} + +type DataCenterServers []string