アドホック・コマンドの通知のリスト
get
/api/v2/ad_hoc_commands/{id}/notifications/
このリソースに対して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
: この通知が最後に変更されたときのタイムスタンプ。(日時)notification_template
: (id)error
: (文字列)status
: (選択)pending
: 保留中successful
: 成功failed
: 失敗
notifications_sent
: (整数)notification_type
: (選択)email
: 電子メールgrafana
: Grafanairc
: IRCmattermost
: Mattermostpagerduty
: Pagerdutyrocketchat
: Rocket.Chatslack
: Slacktwilio
: Twiliowebhook
: Webフック
recipients
: (文字列)subject
: (文字列)body
: 通知本文(json)
ソート
通知が特定の順序で返されるように指定するには、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
(Ansible Tower 3.1.0で追加)関連フィールド全体を検索します。
?related__search=findme
リクエスト
サポートされているメディア・タイプ
- application/json
パス・パラメータ
問合せパラメータ
- page: integer
ページ区切りが設定された結果セット内のページ番号。
- page_size: integer
ページごとに返す結果の数。
- search: string
検索条件。
レスポンス
サポートされているメディア・タイプ
- application/json
200レスポンス
ネストされたスキーマ: Notification
型:
ソースを表示
object
- body: string
タイトル:
Body
読取り専用:true
通知本文 - created: string
タイトル:
Created
読取り専用:true
- error: string
タイトル:
Error
読取り専用:true
最小長:1
- id: integer
タイトル:
ID
読取り専用:true
- modified: string
タイトル:
Modified
読取り専用:true
- notification_template: integer
タイトル:
Notification template
読取り専用:true
- notification_type(required): string
タイトル:
Notification type
指定できる値:[ "email", "grafana", "irc", "mattermost", "pagerduty", "rocketchat", "slack", "twilio", "webhook" ]
- notifications_sent: integer
タイトル:
Notifications sent
読取り専用:true
- recipients: string
タイトル:
Recipients
読取り専用:true
最小長:1
- related: string
- status: string
タイトル:
Status
読取り専用:true
指定できる値:[ "pending", "successful", "failed" ]
- subject: string
タイトル:
Subject
読取り専用:true
最小長:1
- summary_fields: string
タイトル:
Summary fields
読取り専用:true
- type: string
タイトル:
Type
読取り専用:true
- url: string
タイトル:
Url
読取り専用:true