저장소 계정 나열

 

List Storage Accounts 작업은 지정 된 구독에서 사용할 수 있는 저장소 계정을 나열 합니다.

요청

List Storage Accounts 요청을 다음과 같이 지정할 수 있습니다. 대체 <subscription-id> 와 프로그램 구독 id입니다.

방법 요청 URI
GET https://management.core.windows.net/<subscription-id>/services/storageservices

관리 서비스에 대한 요청이 안전한지 확인해야 합니다. 추가 세부 정보를 참조 하십시오. 서비스 관리 요청 인증.

URI 매개 변수

없음.

요청 헤더

다음 표에서는 요청 헤더에 대해 설명합니다.

요청 헤더 설명
x-ms-version 필수 사항입니다. 이 요청에 사용할 작업의 버전을 지정합니다. 이 헤더 설정 해야 2009-10-01 이상. 버전 관리 헤더에 대 한 자세한 내용은 참조 서비스 관리 버전 관리.

요청 본문

없음.

응답

응답에는 HTTP 상태 코드, 응답 헤더 집합 및 응답 본문이 포함되어 있습니다.

상태 코드

작업에 성공하면 상태 코드 200(정상)이 반환됩니다.

상태 코드에 대 한 정보를 참조 하십시오. 서비스 관리 상태 및 오류 코드.

응답 헤더

이 작업의 응답에는 다음과 같은 헤더가 포함됩니다. 응답에는 추가 표준 HTTP 헤더가 포함될 수도 있습니다. 모든 표준 헤더를 준수 하는 HTTP/1.1 프로토콜 사양.

응답 헤더 설명
x-ms-request-id 관리 서비스에 대해 수행된 요청을 고유하게 식별하는 값입니다.

응답 본문

응답 본문의 형식은 다음과 같습니다.

  
<?xml version="1.0" encoding="utf-8"?> <StorageServices xmlns=”https://schemas.microsoft.com/windowsazure”> <StorageService> <Url>storage-service-address</Url> <ServiceName>storage-service-name</ServiceName> <StorageServiceProperties> <Description>description</Description> <AffinityGroup>affinity-group</AffinityGroup> <Location>location-of-storage-account</Location> <Label>base64-encoded-label</Label> <Status>status</Status> <Endpoints> <Endpoint>storage-service-blob-endpoint</Endpoint> <Endpoint>storage-service-queue-endpoint</Endpoint> <Endpoint>storage-service-table-endpoint</Endpoint> <Endpoint>storage-service-file-endpoint</Endpoint> </Endpoints> <GeoReplicationEnabled>geo-replication-indicator</GeoReplicationEnabled> <GeoPrimaryRegion>primary-region</GeoPrimaryRegion> <StatusOfPrimary>primary-status</StatusOfPrimary> <LastGeoFailoverTime>DateTime</LastGeoFailoverTime> <GeoSecondaryRegion>secondary-region</GeoSecondaryRegion> <StatusOfSecondary>secondary-status</StatusOfSecondary> <CreationTime>time-of-creation</CreationTime> <CustomDomains> <CustomDomain> <Name>name-of-custom-domain</Name> </CustomDomain> </CustomDomains> <SecondaryReadEnabled>secondary-read-indicator</SecondaryReadEnabled> <SecondaryEndpoints> <Endpoint>storage-secondary-service-blob-endpoint</Endpoint> <Endpoint>storage-secondary-service-queue-endpoint</Endpoint> <Endpoint>storage-secondary-service-table-endpoint</Endpoint> </SecondaryEndpoints> <AccountType>type-of-storage-account</AccountType> </StorageServiceProperties> <ExtendedProperties> <ExtendedProperty> <Name>property-name</Name> <Value>property-value</Value> </ExtendedProperty> </ExtendedProperties> </StorageService> </StorageServices>  
  

다음 표에서는 응답 본문의 요소에 대해 설명합니다.

요소 이름 설명
Url 저장소 URI를 지정합니다.
ServiceName 저장소 계정의 이름을 지정합니다. 이 이름은 DNS 접두사 이름이며 저장소 계정의 Blob, 큐 및 테이블에 액세스하는 데 사용할 수 있습니다.

예: 서비스 이름이 MyStorageAccount 를 호출 하 여 blob 컨테이너에 액세스할 수 있습니다: http://MyStorageAccount.blob.core.windows.net/mycontainer/
StorageServiceProperties 저장소 계정의 속성을 지정합니다.
ExtendedProperties 저장소 계정에 추가된 확장된 속성의 이름 및 값을 지정합니다.

StorageServiceProperties

저장소 계정의 속성을 지정합니다.

요소 이름 설명
설명 선택 사항입니다. 저장소 계정에 대한 설명입니다. 설명의 길이는 최대 1024자입니다.

 Description 요소는 버전 2012-03-01을 사용 하 여 사용할 수 있는 이상 에서만.
AffinityGroup 필요한 경우 Location 지정 하지 않았습니다. 이 구독에 연결된 기존 선호도 그룹의 이름입니다. 이 이름은 GUID 이며에서 반환 된 응답 본문의 name 요소를 검사 하 여 검색할 수는 선호도 그룹 나열 작업 합니다.

 AffinityGroup 요소는 버전 2012-03-01을 사용 하 여 사용할 수 있는 이상 에서만.
위치 필요한 경우 AffinityGroup 지정 하지 않았습니다. 저장소 계정이 만들어질 위치입니다.

 Location 요소는 버전 2012-03-01을 사용 하 여 사용할 수 있는 이상 에서만.
Label 필수 사항입니다. Base-64로 인코딩된 호스팅 서비스의 이름입니다. 이름의 길이는 최대 100자입니다. 저장소 계정을 식별하는 데 추적용으로 사용할 수 있는 이름입니다.

 Label 요소는 버전 2012-03-01을 사용 하 여 사용할 수 있는 이상 에서만.
상태 저장소 계정의 상태입니다. 가능한 값은 다음과 같습니다.

- Creating
- Created
- Deleting
- Deleted
- Changing
- ResolvingDns

 Status 요소는 버전 2012-03-01을 사용 하 여 사용할 수 있는 이상 에서만.
끝점 Blob, 테이블, 큐 및 파일 끝점입니다.

참고 1: 파일 끝점은 미리 보기 모드로 제공되고 미리 보기 지원 구독에 대해서만 반환됩니다.

참고 2: Standard_ZRS 계정 유형에 대해서는 Blob 끝점만 반환됩니다. 또한 ZRS는 페이지 Blob이 아닌 블록 Blob만 지원하므로 IaaS VM과 호환되지 않습니다.

참고 3: Premium_LRS 계정 유형에 대해서는 Blob 끝점만 반환됩니다.
GeoReplicationEnabled 저장소 계정의 데이터를 둘 이상의 지리적 위치로 복제하여 심각한 서비스 중단 시 복원 기능을 사용할지 여부를 나타냅니다. 값은 true 이 지역에서 복제 사용 하도록 설정 하 고 그렇지않으면 false.

 GeoReplicationEnabled 요소는 버전 2012-03-01을 사용 하 여 사용할 수 있는 이상 에서만 및는 2014-06-01 버전은 AccountType 요소로 대체 이후인 경우.
GeoPrimaryRegion 현재 저장소 계정이 있는 주 지역을 나타냅니다.

 GeoPrimaryRegion 요소는 버전 2012-03-01을 사용 하 여 사용할 수 있는 이상 에서만.
StatusOfPrimary 주 저장소 지역을 사용할 수 있는지 여부를 나타냅니다.

가능한 값은 다음과 같습니다.

- Available
- Unavailable

 StatusOfPrimary 요소는 버전 2013-11-01을 사용 하 여 사용할 수 있는 이상 에서만.
LastGeoFailoverTime 보조 지역으로 장애 조치(Failover)된 최근 인스턴스를 나타내는 타임스탬프입니다. 장애 조치(Failover)가 여러 번 수행된 경우 최신 장애 조치(Failover) 날짜 및 시간이 유지됩니다.

반환 된 타임 스탬프의 형식은: [4DigitYear]-[2DigitMonth]-[2DigitDay] T [2DigitMinute]: [2DigitSecond]: [7DigitsOfPrecision] Z

예: < LastGeoFailoverTime > 2010-01-18T13:15:30.0000000Z < / LastGeoFailoverTime >

장애 조치(Failover) 인스턴스가 없는 경우 LastGeoFailoverTime이 반환되지 않습니다.

 LastGeoFailoverTime 요소는 버전 2012-03-01을 사용 하 여 사용할 수 있는 이상 에서만.
GeoSecondaryRegion 저장소 계정이 복제되고 있는 지역을 나타냅니다.

이 계정에 대해 지리적 복제가 "해제"인 경우에는 GeoSecondaryRegion 요소는 반환되지 않습니다.

 GeoSecondaryRegion 요소는 버전 2012-03-01을 사용 하 여 사용할 수 있는 이상 에서만.
StatusOfSecondary 보조 저장소 지역을 사용할 수 있는지 여부를 나타냅니다.

 StatusOfSecondary 요소는 버전 2013-11-01을 사용 하 여 사용할 수 있는 이상 에서만.

가능한 값은 다음과 같습니다.

- Available
- Unavailable
CreationTime 저장소 계정을 만든 시간을 지정합니다.
CustomDomains 저장소 계정과 연결된 사용자 지정 도메인을 지정합니다.

 CustomDomains 요소는 버전 2013-06-01을 사용 하 여 사용할 수 있는 이상 에서만.
SecondaryReadEnabled 저장소 계정에 대해 보조 읽기가 설정되어 있음을 나타냅니다.

가능한 값은 다음과 같습니다.

- true
- false

 SecondaryReadEnabled 요소는 버전 2013-11-01을 사용 하 여 사용할 수 있는 이상 에서만 및는 2014-06-01 버전은 AccountType 요소로 대체 이후인 경우.
SecondaryEndpoints 저장소 계정의 보조 끝점을 지정합니다.

 SecondaryEndpoints 요소는 버전 2013-11-01을 사용 하 여 사용할 수 있는 이상 에서만.
AccountType 계정이 로컬 중복 저장소, 지역 중복 저장소, 영역 중복 저장소 또는 읽기 권한의 지역 중복 저장소를 지원하는지 여부를 지정합니다.

가능한 값은 다음과 같습니다.

- Standard_LRS
- Standard_ZRS
- Standard_GRS
- Standard_RAGRS
- Premium_LRS

 AccountType 요소는 사용할 버전 2014-06-01 이상 에서만 및 SecondaryReadEnabled 및 GeoReplicationEnabled 요소를 대체 합니다.

 Premium_LRS 요소는만 이상의 버전 2014-10-01을 사용 하 여 사용할 수 있습니다.

끝점

저장소 계정의 끝점을 지정합니다.

요소 이름 설명
끝점 다음과 같은 형식의 blob 서비스 끝점을 포함합니다. https://<storage-service-name>.blob.core.windows.net

 Endpoint 요소는 버전 2012-03-01을 사용 하 여 사용할 수 있는 이상 에서만. Http 끝점은 버전 2014-04-01 이전에서만 반환됩니다.
끝점 다음과 같은 형식의 큐 서비스 끝점을 포함합니다. https://<storage-service-name>.queue.core.windows.net

 Endpoint 요소는 버전 2012-03-01을 사용 하 여 사용할 수 있는 이상 에서만. Http 끝점은 버전 2014-04-01 이전에서만 반환됩니다.
끝점 다음과 같은 형식의 테이블 서비스 끝점을 포함합니다. https://<storage-service-name>.table.core.windows.net

 Endpoint 요소는 버전 2012-03-01을 사용 하 여 사용할 수 있는 이상 에서만. Http 끝점은 버전 2014-04-01 이전에서만 반환됩니다.
끝점 다음과 같은 형식의 파일 서비스 끝점을 포함 합니다. https://<storage-service-name>.file.core.windows.net

 Endpoint 요소는 버전 2012-03-01을 사용 하 여 사용할 수 있는 이상 에서만. Http 끝점은 버전 2014-04-01 이전에서만 반환됩니다.

CustomDomains

저장소 계정과 연결된 사용자 지정 도메인을 지정합니다.

요소 이름 설명
CustomDomain 저장소 계정과 연결된 사용자 지정 도메인에 대한 정보를 지정합니다.
Name 사용자 지정 도메인의 이름을 지정합니다.

SecondaryEndpoints

저장소 계정의 보조 끝점을 지정합니다.

요소 이름 설명
끝점 다음과 같은 형식의 blob 보조 서비스 끝점을 포함합니다. https://<storage-secondary-service-name>.blob.core.windows.net

Http 끝점은 버전 2014-04-01 이전에서만 반환됩니다.
끝점 다음과 같은 형식의 큐 서비스 끝점을 포함합니다. https://<storage-secondary-service-name>.queue.core.windows.net

Http 끝점은 버전 2014-04-01 이전에서만 반환됩니다.
끝점 다음과 같은 형식의 테이블 서비스 끝점을 포함합니다. https://<storage-secondary-service-name>.table.core.windows.net

Http 끝점은 버전 2014-04-01 이전에서만 반환됩니다.

ExtendedProperties

저장소 계정에 추가된 확장된 속성의 이름 및 값을 지정합니다.

요소 이름 설명
Name 선택 사항입니다. 확장 저장소 계정 속성의 이름을 나타냅니다. 각 확장 속성에는 정의된 이름과 값이 모두 있어야 합니다. 확장 속성 이름/값 쌍은 50개까지 지정할 수 있습니다.

Name 요소의 최대 길이는 64자이고, 영숫자와 밑줄만 포함할 수 있으며, 문자로 시작해야 합니다. Name에 다른 문자를 사용하거나, Name을 문자로 시작하지 않거나, 동일한 저장소 계정에서 소유하고 있는 다른 확장 속성의 이름과 동일한 이름을 입력하면 상태 코드 400(잘못된 요청) 오류가 반환됩니다.

 Name 요소는 버전 2012-03-01을 사용 하 여 사용할 수 있는 이상 에서만.
선택 사항입니다. 확장 저장소 계정 속성의 값을 나타냅니다. 각 확장 속성에는 정의된 이름과 값이 모두 있어야 합니다. 확장 속성 이름/값 쌍은 50개까지 지정할 수 있으며 각 확장 속성 값의 최대 길이는 255자입니다.

 Value 요소는 버전 2012-03-01을 사용 하 여 사용할 수 있는 이상 에서만.

설명

하는 경우는 x-ms-version 이 2012-03-01 이상 및 선호도 그룹의 사용 되지않는 하나에서 만들어진 Anywhere US, Anywhere Europe, Anywhere Asia 지역은 Location 요소가 선호도 그룹이 현재 할당 된 위치를 반환 합니다.

List Storage Accounts 작업와 같은 저장소 계정에 다른 작업에 사용할 Uri를 구하는 데 사용할 수 저장소 계정 속성 가져오기, 저장소 계정 키 가져오기, 저장소 계정 삭제, 및 저장소 계정 업데이트합니다.

예제

다음 예제 프로그램에서는 구독 ID, 연결된 관리 인증서 지문 및 작업 버전 문자열을 사용하고 저장소 계정 목록을 콘솔에 출력합니다. 초기화는 msVersion, subscriptionId, 및 thumbprint 예제 코드를 실행 하려면 사용자 고유의 값을 사용 하 여 변수입니다. 이 예에서는 x-ms-version 2011-10-01입니다.

using System; using System.Collections.Generic; using System.Net; using System.Security.Cryptography.X509Certificates; using System.Xml; using System.Xml.Linq; class Program { static void Main(string[] args) { string msVersion = "2011-10-01"; string subscriptionId = "subscription-id-guid"; string thumbprint = "certificate-thumbprint"; try { // Obtain the certificate with the specified thumbprint X509Certificate2 certificate = GetCertificate(thumbprint); ListStorageAccountsExample(subscriptionId, certificate, msVersion); } catch (Exception ex) { Console.WriteLine("Exception caught in Main:"); Console.WriteLine(ex.Message); } } public static X509Certificate2 GetCertificate(string thumbprint) { List<StoreLocation> locations = new List<StoreLocation> { StoreLocation.CurrentUser, StoreLocation.LocalMachine }; foreach (var location in locations) { X509Store store = new X509Store("My", location); try { store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly); X509Certificate2Collection certificates = store.Certificates.Find( X509FindType.FindByThumbprint, thumbprint, false); if (certificates.Count == 1) { return certificates[0]; } } finally { store.Close(); } } throw new ArgumentException(string.Format( "A certificate with thumbprint '{0}' could not be located.", thumbprint)); } public static void ListStorageAccountsExample( string subscriptionId, X509Certificate2 certificate, string version) { string uriFormat = "https://management.core.windows.net/{0}/services/storageservices"; Uri uri = new Uri(String.Format(uriFormat, subscriptionId)); HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri); request.Method = "GET"; request.Headers.Add("x-ms-version", version); request.ClientCertificates.Add(certificate); request.ContentType = "application/xml"; XDocument responseBody = null; HttpStatusCode statusCode; HttpWebResponse response; try { response = (HttpWebResponse)request.GetResponse(); } catch (WebException ex) { // GetResponse throws a WebException for 400 and 500 status codes response = (HttpWebResponse)ex.Response; } statusCode = response.StatusCode; if (response.ContentLength > 0) { using (XmlReader reader = XmlReader.Create(response.GetResponseStream())) { responseBody = XDocument.Load(reader); } } response.Close(); if (statusCode.Equals(HttpStatusCode.OK)) { XNamespace wa = "https://schemas.microsoft.com/windowsazure"; XElement storageServices = responseBody.Element(wa + "StorageServices"); int storageCount = 0; foreach (XElement storageService in storageServices.Elements(wa + "StorageService")) { string url = storageService.Element(wa + "Url").Value; string serviceName = storageService.Element(wa + "ServiceName").Value; Console.WriteLine( "Location[{0}]{1}  Name: {2}{1}  DisplayName: {3}", storageCount++, Environment.NewLine, url, serviceName); } } else { Console.WriteLine("Call to List Storage Accounts returned an error:"); Console.WriteLine("Status Code: {0} ({1}):{2}{3}", (int)statusCode, statusCode, Environment.NewLine, responseBody.ToString(SaveOptions.OmitDuplicateNamespaces)); } return; } }