Service endpoint:
Image
Api:
Post/v2/images
Request1:
Method:P OST
Url: http://192.168.31.147:9292/v2/images
Headers:
content-type:application/JsonX-auth-token:4e045ef71a994f8d8caeeab683a11419
Body:
{ "name""registry:5000/centos:v1.0", " Container_format " " Docker " , " Disk_format " " Raw " }
REPONSE1:
Headers:
201
Body:
{ "Status":"Queued", "name":"registry:5000/centos:v1.0", "Tags": [], "Container_format":"Docker", "Created_at":"2015-05-22t06:38:10z", "Disk_format":"Raw", "Updated_at":"2015-05-22t06:38:10z", "Visibility":"Private", " Self":"/v2/images/0482eff2-8406-46a7-8bbb-d43e1ca9c14f", "Min_disk":0, "protected":false, "ID":"0482eff2-8406-46a7-8bbb-d43e1ca9c14f", "file":"/v2/images/0482eff2-8406-46a7-8bbb-d43e1ca9c14f/file", "owner":"67f095375f414c3b8fde844a5e08b88e", "Min_ram":0, "Schema":"/v2/schemas/image"}
Request2:
" X-AUTH-TOKEN:94F2B7BF4CEE4F2C9D2BBE1F2CA785A2 " " Content-type:application/octet-stream " --upload-file /home/centos. tar http://192.168.31.147:9292/v2/images/0482eff2-8406-46a7-8bbb-d43e1ca9c14f/file
REPONSE2:
Headers:
http/1.1 continuehttp/1.1204 No contentcontent-type:text /html; charset=utf-8Content0X-openstack-request-id:req-98582037-dca6- 4792-8d4a-: £ º GMT
Personal Impressions: OpenStack website to create the image of the API description is really few ah, and only the first step, is the above mentioned Request1. Request2 is the author of Dickens to find, and a start data source upload with the-D @/home/centos.tar this option, but after repeated testing, this option TM upload file is incomplete, 800M files can only upload 230M, repeatedly find problems can not find , and eventually replaced with the--upload-file option, the upload succeeds, and the instance is started normally based on this image.
In addition, for curl in the--upload-file option how to turn into a normal httpclient request, I have no clue, please help us .
Creating Mirrors with the OpenStack Rest API