本文整理匯總了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()
}