前のトピック: unlock メソッド(template オブジェクト)

次のトピック: put_acl メソッド(template オブジェクト)


get_acl メソッド(template オブジェクト)
説明

テンプレート ACL またはテンプレート ACL の特定のプリンシパルに関連する部分を取得します。

構文
/api/v1/template/get_acl?template=template&principal=<principal>&vdc=controller-name 
引数
template

テンプレートの名前

プリンシパル

URL エンコードされたプリンシパル

vdc

ターゲットの仮想データ センターの名前

トランザクション タイプ

同期

リクエスト タイプ

GET

例: アプリケーション ACL を取得します

テンプレート VDS_CentOS のアプリケーション ACL を取得します。

GET http://192.168.123.200/api/v1/template/get_acl?template=VDS_CentOS&principal=&vdc=mygrid 
サンプル出力
JSON:
{
   "acl" : {
      "owner" : {
         "id" : "b543eff7-db88-4d79-a11c-4de22d5e6d3b"
      },
      "entries" : {
         "entries[0]" : {
            "id" : "4f865f5b-e63a-410a-9d9a-96427c3ecfc7",
            "full" : 1
         },
         "entries[1]" : {
            "id" : "b543eff7-db88-4d79-a11c-4de22d5e6d3b",
            "full" : 1
         }
      }
   }
}

XML:

<acl>
  <entries>
    <name>entries[0]</name>
    <full>1</full>
    <id>4f865f5b-e63a-410a-9d9a-96427c3ecfc7</id>
  </entries>
  <entries>
    <name>entries[1]</name>
    <configure>1</configure>
    <id>b543eff7-db88-4d79-a11c-4de22d5e6d3b</id>
  </entries>
  <owner>
    <id>b543eff7-db88-4d79-a11c-4de22d5e6d3b</id>
  </owner>
</acl> 

例: プリンシパルの ACL データを表示します

テンプレート VDS_CentOS のプリンシパル local:user:api@3tera.com の ACL データを表示します

GET http://192.168.123.200/api/v1/template/get_acl?template=VDS_CentOS&principal=local%3Auser%3Aapi%403tera.com&vdc=mygrid
サンプル出力
JSON:
{
   "acl" : {
      "entries" : {
         "entries[0]" : {
            "id" : "4f865f5b-e63a-410a-9d9a-96427c3ecfc7",
            "full" : 1
         }
      }
   }

XML:

<acl>
  <entries>
    <name>entries[0]</name>
    <full>1</full>
    <id>4f865f5b-e63a-410a-9d9a-96427c3ecfc7</id>
  </entries>
</acl>

HTTP エラー コード
400

エンティティ vdc mygrid が見つかりません。WS_API アプリケーションに設定されていない VDC 名が指定されました。

400.4

必要な引数(template)がありません

- 引数 app=app がありません

必要な引数(principal)がありません

- 引数 principal=principal がありません

404.1

エンティティが見つかりません - アプリケーション test は存在しません。

- mygrid に存在しないテンプレートが指定されました。

エンティティが見つかりません - アプリケーション ACL の取得に失敗しました - ACL にプリンシパルのローカル ユーザ「test@3tera.com」が含まれていません。

- 無効なプリンシパルが指定されました

注: この API は WS_API_r6-1.0.6-1 以降で使用できます。