第9章 チーム管理 API

チーム管理 API により、必要なパーミッションを持つユーザーはプラットフォームの複数の異なるレベルでチームを管理することができます。

9.1. 要件

チームを管理できるようにするには、ユーザーは、ログインし、返された cookie を使用するか、または Studio のユーザープロファイルの API キーの管理セクションにある API キーを使用することにより、特定ドメインに対して認証される必要があります。

さらに、ログインしているユーザーは、以下のパーミッションを持つチームのメンバーである必要があります。

  • Reseller

    • 管理者 (閲覧および編集)

または

  • Customer

    • 管理者 (閲覧および編集)

または

  • Domain

    • 管理者 (閲覧および編集)

9.2. チームの一覧表示

9.2.1. 説明

ユーザーがメンバーであるチームに割り当てられたパーミッションに基づいて、ユーザーが利用できるチームを一覧表示します。

9.2.2. JSON チームの定義

以下の JSON オブジェクトは、チーム管理プラットフォーム API のレスポンスボディーで参照されるチームの JSON 定義です。

{
    //Team Identifier
    "_id": "teamid1234",
    //The Business Objects that the Team has access to at different levels of the
    //Platform.
    "business-objects": {
        "cluster": [
            "<Cluster Name>"
          ],
          "cluster/reseller": [
            "<Reseller Id>"
          ],
          "cluster/reseller/customer": [
            "<Customer Id>"
          ]
    },
    //Array Of Users IDs Assigned to the Team.
    "users": ["userid1234"],
    //Permissiions assigned to the Team at Different Levels of the Platform
    "perms": {
        "cluster/reseller": "read"
        "cluster/reseller/customer": "write"
        "cluster/reseller/customer/domain": "read"
    },
    //Is this Team a Default Team or a User Created Team.
    "defaultTeam": true/false,
    //A User-defined description of a Team.
    "desc": "This is a Team.",
    //The Name of a Team.
    "name": "Team 1",
    //Timestamp of the last time the team was updated.
    "updated": "<1413466521479>",
    //A User-Defined code for the team.
    "code": "Team Code"
}

9.2.3. エンドポイント

  • URI: /api/v2/admin/teams
  • メソッド: GET

9.2.4. リクエストボディー

{}

9.2.5. レスポンスボディー

9.2.5.1. 成功

// Array of JSON Objects Representing A Team
[
    "<JSON Team Definition>",
    "<JSON Team Definition>"
]

9.2.5.2. エラー

{
    "error": {
        "error": "<Error Message>"
    }
}

9.3. ユーザーのチームの一覧表示

9.3.1. 説明

このエンドポイントは、ID userId のユーザーがメンバーであるチームを一覧表示します。

9.3.2. エンドポイント

  • URI: /api/v2/admin/users/<userId>/teams
  • メソッド: GET

9.3.3. リクエストボディー

{}

9.3.4. レスポンスボディー

9.3.4.1. 成功

[
    "<JSON Team Definition>"
]

9.3.4.2. エラー

{
    "error": {
        "error": "<Error Message>"
    }
}

9.4. チーム詳細の表示

9.4.1. 説明

ID teamId のチームについての完全な JSON 定義を表示します。

9.4.2. エンドポイント

  • URI: /api/v2/admin/teams/<teamId>
  • メソッド: GET

9.4.3. リクエストボディー

{}

9.4.4. レスポンスボディー

9.4.4.1. 成功

{
    "<JSON Team Definition>"
}

9.4.4.2. エラー

{
    "error": {
        "error": "<Error Message>"
    }
}

9.5. チームの作成

9.5.1. 説明

新規のユーザー定義チームを作成します。

9.5.2. エンドポイント

  • URI: /api/v2/admin/teams
  • メソッド: POST

9.5.3. リクエストボディー

{
    //A User-Defined name for the Team.
    "name":"User Team",
    //A User-Definied code for the Team.
    "code":"user-team",
    //A User-Definied description of the team.
    "desc":"A Team Created By A User",
    //Permissions Assigned to the Team at differnent levels of the Platform
    "perms":{
        "cluster": [
            "<Cluster Name>"
        ],
        "cluster/reseller": [
            "<Reseller Id>"
        ],
        "cluster/reseller/customer": [
            "<Customer Id>"
        ]
    },
    //User IDs of Users assigned to the Team.
    "users":[],
    //IDs of Business Objects assigned to the Team at different levels of the Platform.
    "business-objects":{
        "cluster/reseller": "read"
    }
}

9.5.4. レスポンスボディー

9.5.4.1. 成功

{
    "<JSON Team Definition>"
}

9.5.4.2. エラー

{
    "error": {
        "error": "<Error Message>"
    }
}

9.6. チームの削除

9.6.1. 説明

ID teamId のチームを削除します。

9.6.2. エンドポイント

  • URI: /api/v2/admin/teams/<teamId>
  • メソッド: DELETE

9.6.3. リクエストボディー

{}

9.6.4. レスポンスボディー

9.6.4.1. 成功

{
    "JSON Team Definition"
}

9.6.4.2. エラー

{
    "error": "<Error Message>"
}

9.7. ユーザーのチームへの追加

9.7.1. 説明

ID userId のユーザーを、ID teamId のチームに追加します。

9.7.2. エンドポイント

  • URI: /api/v2/admin/teams/<teamId>/user/<userId>
  • メソッド: POST

9.7.3. リクエストボディー

{
    "guid": "<userId>"
}

9.7.4. レスポンスボディー

9.7.4.1. 成功

{
    "<JSON Team Definition>"
}

9.7.4.2. エラー

{
    "error": "<Error Message>"
}

9.8. ユーザーをチームから削除

9.8.1. 説明

ID userId のユーザーを、ID teamId のチームから削除します。

9.8.2. エンドポイント

  • URI: /api/v2/admin/teams/<teamId>/user/<userId>
  • メソッド: DELETE

9.8.3. リクエストボディー

{}

9.8.4. レスポンスボディー

9.8.4.1. 成功

{
    "<JSON Team Definition>"
}

9.8.4.2. エラー

{
    "error": "<Error Message>"
}