EN
Det här innehållet finns inte tillgängligt på ditt språk men här finns den engelska versionen,
0 av 4 bedömde detta vara till hjälp - Bedöm det här ämnet

List Subscription Operations

Updated: June 7, 2012

The List Subscription Operations operation returns a list of create, update, and delete operations that were performed on a subscription during the specified timeframe.

Request

The List Subscription Operations request may be specified as follows. Replace the following parameters with your own:

  • <subscription-id> with your subscription ID

  • <start-of-timeframe> with the start of the timeframe

  • <end-of-timeframe> with the end of the timeframe

  • <object-id> (optional) with the desired object from your subscription

  • <Succeeded|Failed|InProgress> (optional) with the status of the subscription operation you want

  • <opaque-continuation-token> (optional) with your continuation token from a previous request that returned too many results for one response

noteNote
Having trouble viewing this topic in the Windows Azure library? Try viewing it in the MSDN library.

 

Method Request URI HTTP Version

GET

https://management.core.windows.net/<subscription-id>/operations?StartTime=<start-of-timeframe>&EndTime=<end-of-timeframe>&ObjectIdFilter=<object-url>&OperationResultFilter=<Succeeded|Failed|InProgress>&ContinuationToken=<opaque-continuation-token>

HTTP/1.1

URI Parameters

 

URI Parameter Description

StartTime=<start-of-timeframe>

Required. The start of the timeframe to begin listing subscription operations in UTC format. This parameter and the <end-of-timeframe> parameter indicate the timeframe to retrieve subscription operations. This parameter cannot indicate a start date of more than 90 days in the past.

If you specify a time for this parameter, you must include the literal string “T” before the time, which indicates the start of the time element. Also, you must include the literal string “Z” after the time element, which indicates that the time is in UTC format. For example, a start time of March 1st, 2011 at 4:30PM would be expressed as follows: StartTime=2011-03-01T16:30:00Z

You can use the following time formats:

  • StartTime=[4DigitYear]-[2DigitMonth]-[2DigitDay]

    Example: StartTime=2011-03-01



  • StartTime=[4DigitYear]-[2DigitMonth]-[2DigitDay]T[2DigitHour]:[2DigitMinute]:2DigitSecond]Z

    Example: StartTime=2011-03-01T16:30:00Z



  • StartTime=[4DigitYear]-[2DigitMonth]-[2DigitDay]T[2DigitMinute]:[2DigitSecond]:[7DigitsOfPrecision]Z

    Example: StartTime=2011-03-01T16:30:00:0005000Z



EndTime=<end-of-timeframe>

Required. The end of the timeframe to begin listing subscription operations in UTC format. This parameter and the <start-of-timeframe> parameter indicate the timeframe to retrieve subscription operations.

If you specify a time for this parameter, you must include the literal string “T” before the time, which indicates the start of the time element. Also, you must include the literal string “Z” after the time element, which indicates that the time is in UTC format. For example, an end time of March 7st, 2011 at 4:30PM would be expressed as follows: EndTime=2011-03-07T16:30:00Z

You can use the following time formats:

  • EndTime=[4DigitYear]-[2DigitMonth]-[2DigitDay]

    Example: EndTime=2011-03-07



  • EndTime=[4DigitYear]-[2DigitMonth]-[2DigitDay]T[2DigitHour]:[2DigitMinute]:2DigitSecond]Z

    Example: EndTime=2011-03-07T16:30:00Z



  • EndTime=[4DigitYear]-[2DigitMonth]-[2DigitDay]T[2DigitMinute]:[2DigitSecond].[7DigitsOfPrecision]Z

    Example: EndTime=2011-03-07T16:30:00.0005000Z



ObjectIdFilter=<object-url>

Optional. Returns subscription operations only for the specified object type and object ID. This parameter must be set equal to the URL value for performing an HTTP GET on the object. If no object is specified, a filter is not applied. Applicable object types and examples are included below. Replace sample values such as <subscription-id> with your own values.

 

Object Type

Object URL for Filter

Subscription

ObjectIdFilter=/<subscription-id>

Hosted Service

ObjectIdFilter=/<subscription-id>/services/hostedservices/<hosted-service-name>

Storage Service

ObjectIdFilter=/<subscription-id>/services/storageservices/<storage-service-name>

Affinity Group

ObjectIdFilter=/<subscription-id>/affinitygroups/<affinity-group-name>

Deployment

ObjectIdFilter=/<subscription-id>/services/hostedservices/<hosted-service-name>/deployments/<deployment-name>

Role Instance

ObjectIdFilter=/<subscription-id>/services/hostedservices/<hosted-service-name>/deployments/<deployment-name>/roleinstances/<role-instance-name>

Machine Image

ObjectIdFilter=/<subscription-id>/machineimages/<machine-image-name>

OperationResultFilter=<Succeeded|Failed|InProgress>

Optional. Returns subscription operations only for the specified result status, either Succeeded, Failed, or InProgress. This filter can be combined with the ObjectIdFilter to select subscription operations for an object with a specific result status. If no result status is specified, a filter is not applied. For example, the following request URI snippet returns all successful operations for a storage service:

ObjectIdFilter=/<subscription-id>/services/storageservices/<storage-service-name>&OperationResultFilter=Succeeded

ContinuationToken=<opaque-continuation-token>

Optional. When there are too many operations to list, such as when the requested timeframe is very large, the response includes an incomplete list and a token that can be used to return the rest of the list. Subsequent requests must include this parameter to continue listing operations from where the last response left off. If no token is specified, a filter is not applied and the response will begin at the specified StartTime.

Request Headers

The following table describes required and optional request headers.

 

Request Header Description

x-ms-version

Required. Specifies the version of the operation to use for this request. This header should be set to 2011-02-25 or later. The current version of this API is 2012-03-01. For more information about versioning headers, see Service Management Versioning.

Request Body

None.

Response

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

Status Code

A successful operation returns status code 200 (OK).

For information about status codes, see Service Management Status and Error Codes.

Response Headers

The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

 

Response Header Description

x-ms-request-id

A value that uniquely identifies a request made against the management service.

Response Body

The format for the 2011-06-01 version of the response body is as follows. The following sample response applies to an operation that was initiated by the Windows Azure Management Portal and has a string parameter value.

<?xml version="1.0" encoding="utf-8"?>
<SubscriptionOperationCollection xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <SubscriptionOperations>
    <SubscriptionOperation>
      <OperationId>subscription-operation-id</OperationId>
      <OperationObjectId>subscription-operation-object-id</OperationObjectId>
      <OperationName>subscription-operation-name</OperationName>
      <OperationParameters xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Samples.WindowsAzure.ServiceManagement">
        <OperationParameter>
          <a:Name>operation-parameter-name</a:Name>
          <a:Value>operation-parameter-value</a:Value>
        </OperationParameter>
      </OperationParameters>
      <OperationCaller>
        <UsedServiceManagementApi>false</UsedServiceManagementApi>
        <UserEmailAddress>user-email-address</UserEmailAddress>
      </OperationCaller>
      <OperationStatus>operation-status</OperationStatus>
      <OperationStartedTime>operation-start-time</OperationStartedTime>
      <OperationCompletedTime>operation-completed-time</OperationCompletedTime>
    </SubscriptionOperation>
    …
  </SubscriptionOperations>
  <ContinuationToken>continuation-token-value</ContinuationToken>
</SubscriptionOperationCollection>

The format for the 2011-06-01 version of the response body is as follows. The following sample response applies to an operation that was initiated by the Service Management API and has XML as the parameter value.

<?xml version="1.0" encoding="utf-8"?>
<SubscriptionOperationCollection xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <SubscriptionOperations>
    <SubscriptionOperation>
      <OperationId>subscription-operation-id</OperationId>
      <OperationObjectId>subscription-object-id</OperationObjectId>
      <OperationName>subscription-operation-name</OperationName>
      <OperationParameters xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Samples.WindowsAzure.ServiceManagement">
        <OperationParameter>
          <a:Name>operation-parameter-name</a:Name>
          <a:Value><?xml version="1.0" encoding="utf-16"?>
            <z:anyType xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d1p1="http://schemas.microsoft.com/windowsazure" i:type="d1p1:<type-body>" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/">
              …xml body…
            </z:anyType>
          </a:Value>
        </OperationParameter>
      </OperationParameters>
      <OperationCaller>
        <UsedServiceManagementApi>true</UsedServiceManagementApi>
        <SubscriptionCertificateThumbprint>subscription-certificate-thumbprint</SubscriptionCertificateThumbprint>
        <ClientIP>client-ip-address</ClientIP>
      </OperationCaller>
      <OperationStatus>operation-status</OperationStatus>
      <OperationStartedTime>operation-start-time</OperationStartedTime>
      <OperationCompletedTime>operation-completed-time</OperationCompletedTime>
    </SubscriptionOperation>
    …
  </SubscriptionOperations>
<ContinuationToken>continuation-token-value</ContinuationToken>
</SubscriptionOperationCollection>

noteNote
The sample response bodies show the format of the latest version. If you are using an older version of the Service Management API, verify whether a specific element is available in the response by consulting the element description table.

The following table describes the key elements in the response body:

 

Element name Description

Subscription Operations

The list of operations that have been performed on the subscription during the specified timeframe.

Continuation Token

The string that can be used to return the rest of the list. Subsequent requests must include this parameter to continue listing operations from where the last response left off. This element exists only if the complete list of subscription operations was not returned.

Subscription Operation

A single operation that has been performed on the subscription during the specified timeframe.

Operation ID

The globally unique identifier (GUID) of the operation.

Operation Object ID

The target object for the operation. This value is equal to the URL for performing an HTTP GET on the object, and corresponds to the same values for the ObjectIdFilter in the request.

Operation Name

The name of the performed operation. Possible values are:

  • ActivateDomainName

  • AddCertificates

  • AddSubscriptionCertificate

  • ChangeDeploymentConfiguration

  • ChangeDeploymentConfigurationBySlot

  • CommitImageUpload

  • CreateAffinityGroup

  • CreateDeployment

  • CreateDeploymentBySlot

  • CreateHostedService

  • CreateStorageService

  • DeleteAffinityGroup

  • DeleteCertificate

  • DeleteDeployment

  • DeleteHostedService

  • DeleteImage

  • DeleteStorageService

  • PrepareImageUpload

  • RebootDeploymentRoleInstance

  • RebootDeploymentRoleInstanceBySlot

  • ReimageDeploymentRoleInstance

  • ReimageDeploymentRoleInstanceBySlot

  • RegenerateStorageServiceKeys

  • RegisterDomainName

  • RemoveSubscriptionCertificate

  • RollbackDeploymentUpdateOrUpgrade

  • SetImageProperties

  • SetParentImage

  • SwapDeployment

  • UnregisterDomainName

  • UpdateAffinityGroup

  • UpdateDeploymentStatus

  • UpdateDeploymentStatusBySlot

  • UpdateHostedService

  • UpdateStorageService

  • UpdateStorageService

  • UpgradeDeployment

  • UpgradeDeploymentBySlot

  • WalkUpgradeDomain

  • WalkUpgradeDomainBySlot

Operation Parameters

The collection of parameters for the performed operation.

Operation Parameter

A single parameter for the performed operation.

Name

The name of the parameter.

Value

The value of the parameter. The value can be represented as a string or an XML document, depending on the subscription operation that was performed.

OperationCaller

A collection of attributes that identifies the source of the operation.

UsedServiceManagementApi

Indicates whether the operation was initiated by using the Service Management API. False if it was initiated by another source, such as the Management Portal.

UserEmailAddress

The email associated with the Windows Live ID of the user who initiated the operation from the Management Portal. This element is returned only if UsedServiceManagementApi is false.

ClientIP

The IP address of the client computer that initiated the operation. This element is returned only if UsedServiceManagementApi is true.

SubscriptionCertificateThumbprint

The thumbprint of the subscription certificate used to initiate the operation.

Operation Status

An object that contains information on the current status of the operation. The object returned has the following XML format:

<OperationStatus> <ID>339c6c13-1f81-412f-9bc6-00e9c5876695</ID> <Status>Succeeded</Status> <HttpStatusCode>200</HttpStatusCode> </OperationStatus>

Possible values of the Status element, which holds the operation status, are:

  • Succeeded

  • Failed

  • InProgress

OperationStartedTime

The time that the operation started to execute. The format of the time is:

[4DigitYear]-[2DigitMonth]-[2DigitDay]T[2DigitHour]:[2DigitMinute]:2DigitSecond]Z

Example: 2011-05-11T16:15:26Z

noteNote
The OperationStartedTime element is only available using version 2011-06-01 or higher.

OperationCompletedTime

The time that the operation finished executing. This element is not present if the operation is still in progress. The format of the time is:

[4DigitYear]-[2DigitMonth]-[2DigitDay]T[2DigitHour]:[2DigitMinute]:2DigitSecond]Z

Example: 2011-05-11T16:15:32Z

noteNote
The OperationCompletedTime element is only available using version 2011-06-01 or higher.

Authorization

Any management certificate associated with the subscription specified by <subscription-id> can be used to authenticate this operation. For additional details, see Authenticating Service Management Requests.

Remarks

None.

Var detta till hjälp?
(1500 tecken kvar)
© 2013 Microsoft. Med ensamrätt.
facebook page visit twitter rss feed newsletter