예제 #1
0
func stackList(client *gophercloud.ServiceClient) ([]map[string]interface{}, error) {
	pager := osStacks.List(client, nil)
	pages, err := pager.AllPages()
	if err != nil {
		return nil, err
	}
	info, err := osStacks.ExtractStacks(pages)
	if err != nil {
		return nil, err
	}
	result := make([]map[string]interface{}, len(info))
	for j, stack := range info {
		result[j] = structs.Map(&stack)
		result[j]["CreationTime"] = stack.CreationTime
		result[j]["UpdatedTime"] = stack.UpdatedTime
	}
	return result, nil
}
예제 #2
0
// List accepts an os.ListOpts struct and lists stacks based on the options provided.
func List(c *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager {
	return os.List(c, opts)
}