Example #1
0
File: get.go Project: hdansou/rack
func (command *commandGet) Execute(resource *handler.Resource) {
	containerName := resource.Params.(*paramsGet).container
	objectName := resource.Params.(*paramsGet).object
	objectInfo, err := objects.Get(command.Ctx.ServiceClient, containerName, objectName, nil).Extract()
	if err != nil {
		resource.Err = err
		return
	}
	resource.Result = structs.Map(objectInfo)
	resource.Result.(map[string]interface{})["Name"] = objectName
}
Example #2
0
// Get is a function that retrieves the metadata of an object. To extract just the custom
// metadata, pass the GetResult response to the ExtractMetadata function.
func Get(c *gophercloud.ServiceClient, containerName, objectName string, opts os.GetOptsBuilder) os.GetResult {
	return os.Get(c, containerName, objectName, opts)
}