組織のリスト
get
/api/v2/organizations/
このリソースに対してGETリクエストを行って、組織のリストを取得します。
結果のデータ構造には次が含まれます。
{
"count": 99,
"next": null,
"previous": null,
"results": [
...
]
}
count
フィールドは、対象となる問合せで見つかった組織の合計数を示します。 next
フィールドとprevious
フィールドには、結果が1ページに収まらない場合に、追加の結果へのリンクが表示されます。 results
リストには、0個以上の組織レコードが含まれます。
結果
それぞれの組織のデータ構造には次のフィールドが含まれます。
id
: この組織のデータベースID。(整数)type
: この組織のデータ型。(選択)url
: この組織のURL。(文字列)related
: 関連リソースのURLを含むデータ構造。(オブジェクト)summary_fields
: 関連リソースの名前/説明を含むデータ構造。 一部のオブジェクトの出力は、パフォーマンス上の理由によって制限される場合があります。(オブジェクト)created
: この組織が作成されたときのタイムスタンプ。(日時)modified
: この組織が最後に変更されたときのタイムスタンプ。(日時)name
: この組織の名前。(文字列)description
: この組織のオプションの説明。(文字列)max_hosts
: この組織が管理できるホストの最大数。(整数)custom_virtualenv
: 使用するカスタムPython virtualenvを含むローカルの絶対ファイル・パス(文字列)default_environment
: この組織によって実行されるジョブのデフォルト実行環境。(id)
ソート
組織が特定の順序で返されるように指定するには、GETリクエストでorder_by
問合せ文字列パラメータを使用します。
?order_by=name
フィールド名の先頭にダッシュ-
を付けると逆の順序でソートされます。
?order_by=-name
フィールド名をカンマ,
で区切ると、複数のソート・フィールドを指定できます。
?order_by=name,some_other_field
ページ区切り
リクエストごとに返される結果の数を変更するには、page_size
問合せ文字列パラメータを使用します。 特定のページの結果を取得するには、page
問合せ文字列パラメータを使用します。
?page_size=100&page=2
結果で返されるprevious
リンクおよびnext
リンクは、これらの問合せ文字列パラメータを自動的に設定します。
検索
モデルのすべての指定テキスト・フィールド内で大/小文字を区別しない検索を実行するには、search
問合せ文字列パラメータを使用します。
?search=findme
( 「Oracle Linux Automation Manaerに追加」)関連フィールド全体を検索します:
?related__search=findme
リクエスト
サポートされているメディア・タイプ
- application/json
問合せパラメータ
- page(オプション): 整数
ページ区切りが設定された結果セット内のページ番号。
- page_size(オプション): 整数
ページごとに返す結果の数。
- search(オプション): 文字列
検索条件。
レスポンス
サポートされているメディア・タイプ
- application/json
200レスポンス
レスポンスの例(application/json)
{
"count":1,
"next":null,
"previous":null,
"results":[
{
"created":"2018-02-01T08:00:00.000000Z",
"custom_virtualenv":null,
"default_environment":null,
"description":"test-org-desc",
"id":2,
"max_hosts":0,
"modified":"2018-02-01T08:00:00.000000Z",
"name":"test-org-1",
"related":{
"access_list":"/api/v2/organizations/2/access_list/",
"activity_stream":"/api/v2/organizations/2/activity_stream/",
"admins":"/api/v2/organizations/2/admins/",
"applications":"/api/v2/organizations/2/applications/",
"credentials":"/api/v2/organizations/2/credentials/",
"execution_environments":"/api/v2/organizations/2/execution_environments/",
"galaxy_credentials":"/api/v2/organizations/2/galaxy_credentials/",
"instance_groups":"/api/v2/organizations/2/instance_groups/",
"inventories":"/api/v2/organizations/2/inventories/",
"job_templates":"/api/v2/organizations/2/job_templates/",
"notification_templates":"/api/v2/organizations/2/notification_templates/",
"notification_templates_approvals":"/api/v2/organizations/2/notification_templates_approvals/",
"notification_templates_error":"/api/v2/organizations/2/notification_templates_error/",
"notification_templates_started":"/api/v2/organizations/2/notification_templates_started/",
"notification_templates_success":"/api/v2/organizations/2/notification_templates_success/",
"object_roles":"/api/v2/organizations/2/object_roles/",
"projects":"/api/v2/organizations/2/projects/",
"teams":"/api/v2/organizations/2/teams/",
"users":"/api/v2/organizations/2/users/",
"workflow_job_templates":"/api/v2/organizations/2/workflow_job_templates/"
},
"summary_fields":{
"object_roles":{
"admin_role":{
"description":"Can manage all aspects of the organization",
"id":16,
"name":"Admin",
"user_only":true
},
"approval_role":{
"description":"Can approve or deny a workflow approval node",
"id":28,
"name":"Approve"
},
"auditor_role":{
"description":"Can view all aspects of the organization",
"id":25,
"name":"Auditor"
},
"credential_admin_role":{
"description":"Can manage all credentials of the organization",
"id":20,
"name":"Credential Admin"
},
"execute_role":{
"description":"May run any executable resources in the organization",
"id":17,
"name":"Execute"
},
"execution_environment_admin_role":{
"description":"Can manage all execution environments of the organization",
"id":24,
"name":"Execution Environment Admin"
},
"inventory_admin_role":{
"description":"Can manage all inventories of the organization",
"id":19,
"name":"Inventory Admin"
},
"job_template_admin_role":{
"description":"Can manage all job templates of the organization",
"id":23,
"name":"Job Template Admin"
},
"member_role":{
"description":"User is a member of the organization",
"id":26,
"name":"Member",
"user_only":true
},
"notification_admin_role":{
"description":"Can manage all notifications of the organization",
"id":22,
"name":"Notification Admin"
},
"project_admin_role":{
"description":"Can manage all projects of the organization",
"id":18,
"name":"Project Admin"
},
"read_role":{
"description":"May view settings for the organization",
"id":27,
"name":"Read"
},
"workflow_admin_role":{
"description":"Can manage all workflows of the organization",
"id":21,
"name":"Workflow Admin"
}
},
"related_field_counts":{
"admins":0,
"inventories":0,
"job_templates":0,
"projects":0,
"teams":0,
"users":1
},
"user_capabilities":{
"delete":false,
"edit":false
}
},
"type":"organization",
"url":"/api/v2/organizations/2/"
}
]
}
401レスポンス
レスポンスの例(application/json)
{
"detail":"Authentication credentials were not provided. To establish a login session, visit /api/login/."
}