List Storage Accounts
The List Storage Accounts operation returns a list of storage accounts for which one or more import or export jobs have been created for a subscription.
Request
The List Storage Accounts request may be constructed as follows. HTTPS is required. Replace <subscription-id> with your subscription ID:
Method |
Request URI |
---|---|
GET|HEAD |
https://management.core.windows.net/subscription-id/services/importexport/storageaccounts?format=format |
URI Parameters
Parameter |
Description |
---|---|
format |
Optional. Can be used to override the Accept header. See the Accept request header for additional information. The following example demonstrates the use of the $format query parameter: $format=application/json;odata=minimalmetadata |
Request Headers
The following table describes required and 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. |
Content-Length |
Optional. If specified, the value must be 0. |
x-ms-date |
Optional. If specified, the value should specify the date and time when the request is sent, in the 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 2015-11-01. |
Request Body
None.
Response
The response includes an HTTP status code, a set of response headers, and a response body in XML format.
Status Code
A successful operation returns status code 200 (OK).
Response Headers
The response for this operation includes the following headers.
Response Header |
Description |
---|---|
Content-Encoding |
The value of this header will always be identity. |
Content-Length |
The length of the content returned in the response. |
Content-Type |
Specifies the format in which the results are returned. The value of this header will always be application/json. |
Date |
The UTC date and time generated by the service that indicates the time at which the response was initiated, in RFC 1123 formet. |
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
The following response values and table illustrate the format of the response body.
{
"odata.metadata":"https://management.core.windows.net/subid/services/importexport/$metadata#Microsoft.Cis.Services.ImportExport.Public.ImportExportData.StorageAccounts","odata.count":"result-count","value":[
{
"odata.type":"Microsoft.Cis.Services.ImportExport.Public.StorageAccount",
"odata.id":"storage-account-name",
"odata.editLink":"edit-link",
"Name":"storage-account-name"
},
. . .
]
}
Element |
Type |
Description |
---|---|---|
result-count |
Integer |
The number of locations in the response. This value can be zero. The result will be empty if the location is not currently supported by the Windows Azure Import/Export service. |
edit-link |
String |
The URI that addresses the location element. |
storage-account-name |
String |
The name of the storage account, as displayed in the Windows Azure management portal. |
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" }
]
}
}
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 List Storage Accounts operation.
Request
GET https://management.core.windows.net/afb1a4eb-bc88-4ce1-b1af-dfec80067464/services/importexport/StorageAccounts HTTP/1.1
x-ms-version: 2014-05-01
Content-Type: application/json
Accept: application/json
Host: management.core.windows.net
Expect: 100-continue
Connection: Keep-Alive
Response
HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 617
Content-Type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
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
DataServiceVersion: 3.0;
x-ms-version: 2014-05-01
x-ms-request-id: 5444c6918207955c8693b15a26ba30d7
Date: Wed, 30 Apr 2014 00:00:40 GMT
{"odata.metadata":"https:\/\/management.core.windows.net\/afb1a4eb-bc88-4ce1-b1af-dfec80067464\/services\/importexport\/$metadata#Microsoft.Cis.Services.ImportExport.Public.ImportExportData.StorageAccounts","odata.count":"2","value":[{"odata.id":"accountone","odata.editLink":"https:\/\/management.core.windows.net\/afb1a4eb-bc88-4ce1-b1af-dfec80067464\/services\/importexport\/storageaccounts\/accountone","Name":"accountone"},{"odata.id":"accounttwo","odata.editLink":"https:\/\/management.core.windows.net\/afb1a4eb-bc88-4ce1-b1af-dfec80067464\/services\/importexport\/storageaccounts\/accounttwo","Name":"accounttwo"}]}
Remarks
The List Storage Accounts operation returns a list of the storage accounts for which you have created one or more import or export jobs.
The following is an example URL to get all storage accounts for which at least one job has been created in the subscription afb1a4eb-bc88-4ce1-b1af-dfec80067464: