1. 一括編集リソース

一括編集ジョブ リソース

システムにある各一括編集ジョブは、一括編集ジョブ リソースで表現されます。 このリソースを使用して、ジョブの状態の取得やジョブのキャンセルなどができます。

GETHEADPUT の各メソッドを使用できます。

GET /api/massedits/id

ジョブの状態を収めた一括編集ジョブ オブジェクトが返されます。

要求の例:

GET http://hostname/api/massedits/1493
Host: hostname
Accept: application/json

応答の例:

HTTP/1.1 200 OK
Content-Length: content length
Content-Type: application/json; charset=utf-8
ETag: "hash string"

{
    "state_description":"Pending",
    "state":"Pending",
    "condition":"Pending",
    "started_on":"...",
    "completed_on":null,
    "target_count":215,
    "targets_completed":100,
    "self":{
        "href":"http://hostname/api/massedits/1493",
        "title":"This mass edit job."
    },
    "targets":{
        "href":"http/hostname/api/massedits/1493/targets",
        "title":"The collection of targets for this Mass Edit Job."
    }
}

PUT /api/entities/id

一括編集ジョブをキャンセルできます。 Pending 状態のジョブのみをキャンセルできます。そのようなジョブをキャンセルするには、そのリソースを Cancelled 状態にして配置します。要求本文で一括編集ジョブを指定する必要があります。 すべてのプロパティは無視され、state プロパティのみが、Cancelled に設定されているかどうかが確認されます。 つづいて、サーバーは 204 No Content で応答し、ジョブが正常に更新されたことを通知します。 それ以外の場合、サーバーは 403 Forbidden で応答し、要求を拒否します。

要求の例:

PUT http://hostname/api/entities/1493
Host: hostname
Content-Type: application/json

{
    "state_description":"In progress",
    "state":"Cancelled",
    "condition":"Pending",
    "started_on":"...",
    "completed_on":null,
    "target_count":215,
    "targets_completed":100,
    "self":{
        "href":"http://hostname/api/massedits/1493",
        "title":"This mass edit job."
    },
    "targets":{
        "href":"http/hostname/api/massedits/1493/targets",
        "title":"The collection of targets for this Mass Edit Job."
    }
}

応答の例:

HTTP/1.1 204 No Content
この記事を改善するための提案がある場合は、 お知らせください!