Пример #1
0
//CopyObject calls the OpenStack copy object API using previously obtained
//token.  Note from API doc: "The destination container must exist before
//attempting the copy."
func CopyObject(session *openstack.Session, srcURL, destURL string) (err error) {
	var headers http.Header = http.Header{}
	headers.Add("Destination", destURL)
	resp, err := session.Request("COPY", srcURL, nil, &headers, zeroByte)
	if err != nil {
		return err
	}
	return util.CheckHTTPResponseStatusCode(resp)
}