KDDIクラウドプラットフォームサービス ナレッジサイト

  • HOME
  • 提供API一覧
  • getUploadParamsForTemplate

getUploadParamsForTemplate

処理概要

テンプレートのローカルアップロード用URL取得
ローカルアップロード用URLに対してアップロードを実施

注意事項

APIの実行だけではアップロードは完了しません。取得したURLに対してファイルのアップロードを実施してください。

リクエスト

・リクエストパラメータ

Parameter Description Required
name the name of the template true
displaytext the display text of the template. This is usually used for display purposes. true
fomat the format for the template. Possible value includes OVA. true
hypervisor the target hypervisor for the template. Possible value includes VMware. true
ostypeid the ID of the OS Type that best represents the OS of this template. true
zoneid the ID of the zone the volume/template is to be hosted on true
details[0].rootDiskController the type of root disk controller false
details[0].nicAdapter the type of network adaptor false
details[0].keyboard the language type of keyboard false

・リクエストサンプル

$ ./kick-api.sh command=getUploadParamsForTemplate displaytext=SampleTemplate format=OVA osTypeId=817b06c0-7aae-11e4-b5b5-c45444131635 hypervisor=VMware name=SampleTemplate zoneid=c71ac6b8-498e-43e6-89ad-46944a67bce0 details[0].rootDiskController=osdefault details[0].nicAdapter=Vmxnet3 details[0].keyboard=jp

レスポンス

・レスポンスボディ

Response Name Description
id the template ID
postURL the timestamp after which the signature expires
metadata encrypted data to be sent in the POST request.
expires POST url to upload the file to
sigature signature to be sent in the POST request.

・レスポンスサンプル

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 –:–:– –:–:– –:–:–     0*   Trying 106.162.187.83…
<?xml version=”1.0″ encoding=”UTF-8″?>
<postuploadtemplateresponse cloud-stack-version=”4.11.3.0″>
  <getuploadparams>
    <id>eee7738a-7bf3-412c-8207-2a429b8920ba</id>
    <postURL>https://27-86-2-66.con.cloud-platform.kddi.ne.jp/upload/eee7738a-7bf3-412c-8207-2a429b8920ba</postURL>
   <metadata>lnibZkDaKgwyiq56MuM/eiBAwbJ2qgL9nhmsYkXSwF+5GduKMcxOxlZyTsm8GWp1UjavSlZ
+hePZxwgvFNzDuXFtaD/C8VBjLqZMkjokwBadeaP0i7Pwi8V0GxjGVYqsixdWvvIV85kvrdF9CiP2pl2a
BoCV9zsEsNcrG3bHyxBqw0pOWaDL7cB8VpWqg1pk/r15lxRkQ0iF5Og7JgrZoi/AwQXyNZZglALWln
QwbRPEtVF+HSA9XlnVU3sEiAgWs9DxX9WnrEFbJXAynGgRB0JfMlGnBTDZYOJ4vZouSvkchthhC7
FkJGP2MoGbGLGLeTTNW7BWyKTHp1ndp2YEgcCZes2tIdF2F3oCQs0Sby8BBbTG41LSWO593
AALyIcG2P6/aclOcrnF0Tpinq1tQiwklIwAnsrsyWXr3Orirarj7S4+cHj+8ow3SlcP4RKHbnKWxKShKu
VFIzYjDQ9quMhiGEiO7gzTpzSMVjYQNxgCmM0QuEFoSR7mOwS6AhRjHM9AlFxh02yHiOJnIy3t
WINdTn4bcDwrZFu7DrNtJDQG4GEhTQVYPkaFcEqgtluBKWTZ2Hhu1GHa/i8HC88wnpKv3wW1
CHULJ3KdeP3f9CiUqCngJepW2A==</metadata>
    <expires>2021-06-11T05:12:59.254Z</expires>
    <signature>4kZIr2JVWWnTfIPYbs3DwTpIfbU=</signature>
  </getuploadparams>
</postuploadtemplateresponse>

テンプレートアップロード

・リクエスト

Type POST
Header X-metadata: encrypted data returned from getUploadParams API call
Header X-signature: signature returned from getUploadParams API call
Header X-expires: xpires returned from getUploadParams API cal
Request file: the location of the template to be posted as multipart/form-data

・curl実行サンプル

$ curl -X POST “https://27-86-2-66.con.cloud-platform.kddi.ne.jp/upload/eee7738a-7bf3-412c-8207- 
2a429b8920ba” -H “X-signature:4kZIr2JVWWnTfIPYbs3DwTpIfbU=” -H “X
-metadata:lnibZkDaKgwyiq56MuM/eiBAwbJ2qgL9nhmsYkXSwF+5GduKMcxOxlZyTsm8GWp1UjavSlZ
+hePZxwgvFNzDuXFtaD/C8VBjLqZMkjokwBadeaP0i7Pwi8V0GxjGVYqsixdWvvIV85kvrdF9CiP2pl2aBo
CV9zsEsNcrG3bHyxBqw0pOWaDL7cB8VpWqg1pk/r15lxRkQ0iF5Og7JgrZoi/AwQXyNZZglALWlnQwb
RPEtVF+HSA9XlnVU3sEiAgWs9DxX9WnrEFbJXAynGgRB0JfMlGnBTDZYOJ4vZouSvkchthhC7FkJGP2
MoGbGLGLeTTNW7BWyKTHp1ndp2YEgcCZes2tIdF2F3oCQs0Sby8BBbTG41LSWO593AALyIcG2P6/
aclOcrnF0Tpinq1tQiwklIwAnsrsyWXr3Orirarj7S4+cHj+8ow3SlcP4RKHbnKWxKShKuVFIzYjDQ9qu
MhiGEiO7gzTpzSMVjYQNxgCmM0QuEFoSR7mOwS6AhRjHM9AlFxh02yHiOJnIy3tWINdTn4bcDwrZFu7
DrNtJDQG4GEhTQVYPkaFcEqgtluBKWTZ2Hhu1GHa/i8HC88wnpKv3wW1CHULJ3KdeP3f9CiUq
CngJepW2A==” -H “X-expires:2021-06-11T05:12:59.254Z”
-F “file=@b42f005a-0dcc-42ba-82e3-8a57e2bb1512.ova” -v
upload successful.

提供API一覧

2024/09/15 2024/09/15