Megosztás a következőn keresztül:


Delete Job

 

The Delete Job operation deletes an existing job, purging the related data from the system. Only jobs in the Creating or Completed states can be deleted.

Request

The Delete Job request may be constructed as follows. HTTPS is required. Replace <subscription-id> with your subscription ID, <storage-account-name> with the name of your storage account, and <jobname> with the name of your import job or export job:

Method

Request URI

DELETE

https://management.core.windows.net/subscription-id/services/importexport/storageaccounts/storage-account-name/jobs/jobname[?$format=format]

URI Parameters

The following additional parameters may be specified on the request URI.

Parameter

Description

format

Optional. Can be used to override the Accept header. See the Accept header for additional information.

The following is an example of the $format query parameter:

$format=application/json;odata=minimalmetadata

Request Headers

The following table describes optional request headers.

Request Header

Description

Accept

Optional. If specified, it must be application/json (which specifies the JSON Light format). Other values will result in response code 406 (Not Acceptable).

One of the following parameters can also be included:

odata=minimalmetadata

odata=nometatadata

odata=fullmetadata

The default parameter is odata=minimalmetadata.

The following is an example header:

Accept: application/json;odata=minimalmetadata

Accept-Language

Optional. Currently only the values en and en-us are supported.

x-ms-date

Optional. If specified, the value should specify the date and time when the request is sent, in RFC 1123 format.

x-ms-version

Required. Specifies the service management version to use for this request. The value of this header must be set to 2014-05-01 or 2014-11-01.

If-Modified-Since

Optional. A DateTime value. Specify this header to perform the operation only if the resource has been modified since the specified time.

If-Unmodified-Since

Optional. A DateTime value. Specify this header to perform the operation only if the resource has not been modified since the specified date/time.

If-Match

Optional. An ETag value. Specify this header to perform the operation only if the resource's ETag matches the value specified.

If-None-Match

Optional. An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified.

Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist.

X-HTTP-Method

Optional. If this header is specified, its value must be PATCH and the request HTTP verb must be GET. The request will be processed as if it were a PATCH request.

Request Body

None.

Response

The response includes an HTTP status code and a set of response headers.

Status Code

A successful operation returns status code 204 (No Content).

Response Headers

The response for this operation includes the following headers.

Response Header

Description

Content-Encoding

Only applicable for error responses. The value of this header will always be identity.

Content-Length

Only applicable for error responses. If the response body is chunked, this header is not included.

Content-Type

Only applicable for error responses. The value of this header will always be application/json.

Date

A UTC date/time value generated by the service that indicates the time at which the response was initiated.

x-ms-request-id

A value that uniquely identifies a request made against the Import/Export service.

x-ms-version

Indicates the version of the Import/Export service used to execute the request.

Response Body

None if the request succeeds.

If the request fails, the response body will contain the following error message:

{
  "odata.error": {
    "code": "http-code",
    "message": {
        "lang": "en-US",
        "value": "detailed-error-message"
    },
    "azure.values": [
      { "ExtendedCode": "extended-error-code" },
      { "ExtendedInformation": "extended-information" }
    ]
  }
}

The following table describes the elements of the error response.

Element

Type

Description

http-code

String

The standard HTTP status code returned when the request fails.

detailed-error-message

String

A human-readable description of the error.

Extended-code

String

A predefined error code, if applicable.

Extended-information

String

Additional information provided to diagnose the error.

Sample Request and Response

The following shows a sample request and response for the Delete Job operation.

Request

DELETE https://management.core.windows.net/afb1a4eb-bc88-4ce1-b1af-dfec80067464/services/importexport/storageaccounts/xttest/jobs/MySampleJob?timeout=3600 HTTP/1.1
x-ms-version: 2014-05-01
x-ms-date: Wed, 30 Apr 2014 00:44:01 GMT
Content-Type: application/json
Accept: application/json
Host: management.core.windows.net

Response

HTTP/1.1 200 OK
Cache-Control: no-cache
Transfer-Encoding: chunked
Content-Encoding: identity
Content-Language: en-us
Server: 1.0.6198.70 (rd_rdfe_stable.140426-2318) Microsoft-HTTPAPI/2.0
x-ms-servedbyregion: ussouth2
x-ms-version: 2014-05-01
x-ms-request-id: 537d025390d9941ebf4330f05a3ff7dc
Date: Wed, 30 Apr 2014 00:44:51 GMT

0

Remarks

You can delete a job only if it is in the Creating or Completed state and the drives have not been shipped. After you delete a job, you will no longer be able to get information about that job. See Retrieving State Information for a Job for information about job states.

You can call Delete Job with conditional headers specified to create the job only when certain conditions are met. When specifying conditional headers, keep in mind the following:

  • If a request specifies both the If-None-Match and If-Modified-Since headers, the request is evaluated based on the criteria specified in If-None-Match.

  • If a request specifies both the If-Match and If-Unmodified-Since headers, the request is evaluated based on the criteria specified in If-Match.

  • With the exception of the two combinations of conditional headers listed above, a request may specify only a single conditional header. Specifying more than one conditional header results in status code 400 (Bad Request).

The following table indicates the response codes returned for an unmet condition for each conditional header:

Conditional header

Response code if condition has not been met

If-Modified-Since

Precondition Failed (412)

If-Unmodified-Since

Precondition Failed (412)

If-Match

Precondition Failed (412)

If-None-Match

Precondition Failed (412)

See Also

Azure Import/Export Service Operations