本文整理汇总了Golang中github.com/grrtrr/clcv2.CLIClient.GetDeploymentCapabilities方法的典型用法代码示例。如果您正苦于以下问题:Golang CLIClient.GetDeploymentCapabilities方法的具体用法?Golang CLIClient.GetDeploymentCapabilities怎么用?Golang CLIClient.GetDeploymentCapabilities使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/grrtrr/clcv2.CLIClient
的用法示例。
在下文中一共展示了CLIClient.GetDeploymentCapabilities方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: showTemplates
// showTemplates prints the templates available in @region
func showTemplates(client *clcv2.CLIClient, region string) {
capa, err := client.GetDeploymentCapabilities(region)
if err != nil {
exit.Fatalf("failed to query deployment capabilities of %s: %s", region, err)
}
table := tablewriter.NewWriter(os.Stdout)
table.SetAutoFormatHeaders(false)
table.SetAlignment(tablewriter.ALIGN_LEFT)
table.SetAutoWrapText(false)
/* Note: not displaying ReservedDrivePaths and DrivePathLength here, I don't understand their use. */
/* Note: not listing Capabilities here, since the table gets too large for a single screen */
table.SetHeader([]string{"Template Name", "Description", "OS", "Storage"})
for _, tpl := range capa.Templates {
table.Append([]string{tpl.Name, tpl.Description, tpl.OsType, fmt.Sprintf("%d GB", tpl.StorageSizeGB)})
}
table.Render()
}