Share via


Read (GET) RunbookVersions

Read using the HTTP GET operation.

Code Examples

Request

Method Request URI HTTP Version

GET

HTTPS://<HOST>:<PORT>/00000000-0000-0000-0000-000000000000/RunbookVersions(guid'<GUID>')

HTTP/1.1

Request URI Parameters

URI Parameter Description

GUID

Required. The unique identifier value (RunbookID) for a Runbook entity.

Request URI Example

Example URI

GET https://sma-server:9090/00000000-0000-0000-0000-000000000000/RunbookVersions()?$filter=RunbookID%20eq%20guid'0feaf232-fee1-465e-a570-c613b77f48f4' HTTP/1.1

Request Headers

For more information about the common request headers used by this operation, see Standard Service Management Automation POST/GET/PUT/DELETE Headers.

Request Body

The GET operation has no request body.

Response

Response Codes

Response Code Description

HTTP/1.1 200 OK

Successful HTTP request.

Response Headers

For more information about the common response headers used by this operation, see Standard Service Management Automation POST/GET/PUT/DELETE Headers.

Response Body

<?xml version="1.0" encoding="utf-8"?><feed xml:base="https://waplabvm4:9090/00000000-0000-0000-0000-000000000000/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="https://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="https://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
  <id>https://sma-server:9090/00000000-0000-0000-0000-000000000000/RunbookVersions</id>
  <title type="text">RunbookVersions</title>
  <updated>2014-04-02T22:35:40Z</updated>
  <link rel="self" title="RunbookVersions" href="RunbookVersions" />
  <entry>
    <id>https://sma-server:9090/00000000-0000-0000-0000-000000000000/RunbookVersions(guid'8d88e23f-7ac9-4bbe-b14a-cd5a7cbd70a6')</id>
    <category term="Orchestrator.ResourceModel.RunbookVersion" scheme="https://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <link rel="edit" title="RunbookVersion" href="RunbookVersions(guid'8d88e23f-7ac9-4bbe-b14a-cd5a7cbd70a6')" />
    <link rel="https://schemas.microsoft.com/ado/2007/08/dataservices/related/JobContexts" type="application/atom+xml;type=feed" title="JobContexts" href="RunbookVersions(guid'8d88e23f-7ac9-4bbe-b14a-cd5a7cbd70a6')/JobContexts" />
    <link rel="https://schemas.microsoft.com/ado/2007/08/dataservices/related/Runbook" type="application/atom+xml;type=entry" title="Runbook" href="RunbookVersions(guid'8d88e23f-7ac9-4bbe-b14a-cd5a7cbd70a6')/Runbook" />
    <link rel="https://schemas.microsoft.com/ado/2007/08/dataservices/related/RunbookParameters" type="application/atom+xml;type=feed" title="RunbookParameters" href="RunbookVersions(guid'8d88e23f-7ac9-4bbe-b14a-cd5a7cbd70a6')/RunbookParameters" />
    <title />
    <updated>2014-04-02T22:35:40Z</updated>
    <author>
      <name />
    </author>
    <link rel="edit-media" title="RunbookVersion" href="RunbookVersions(guid'8d88e23f-7ac9-4bbe-b14a-cd5a7cbd70a6')/$value" m:etag="&quot;635273946469770000&quot;" />
    <content type="application/octet-stream" src="RunbookVersions(guid'8d88e23f-7ac9-4bbe-b14a-cd5a7cbd70a6')/$value" />
    <m:properties>
      <d:TenantID m:type="Edm.Guid">00000000-0000-0000-0000-000000000000</d:TenantID>
      <d:RunbookVersionID m:type="Edm.Guid">8d88e23f-7ac9-4bbe-b14a-cd5a7cbd70a6</d:RunbookVersionID>
      <d:RunbookID m:type="Edm.Guid">0feaf232-fee1-465e-a570-c613b77f48f4</d:RunbookID>
      <d:VersionNumber m:type="Edm.Int32">1</d:VersionNumber>
      <d:IsDraft m:type="Edm.Boolean">true</d:IsDraft>
      <d:CreationTime m:type="Edm.DateTime">2014-02-07T18:30:46.977</d:CreationTime>
      <d:LastModifiedTime m:type="Edm.DateTime">2014-02-07T18:30:46.977</d:LastModifiedTime>
    </m:properties>
  </entry>
  <entry>
    <id>https://sma-server:9090/00000000-0000-0000-0000-000000000000/RunbookVersions(guid'161fc600-aa16-4f49-910d-b5fd47a23c5c')</id>
    <category term="Orchestrator.ResourceModel.RunbookVersion" scheme="https://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <link rel="edit" title="RunbookVersion" href="RunbookVersions(guid'161fc600-aa16-4f49-910d-b5fd47a23c5c')" />
    <link rel="https://schemas.microsoft.com/ado/2007/08/dataservices/related/JobContexts" type="application/atom+xml;type=feed" title="JobContexts" href="RunbookVersions(guid'161fc600-aa16-4f49-910d-b5fd47a23c5c')/JobContexts" />
    <link rel="https://schemas.microsoft.com/ado/2007/08/dataservices/related/Runbook" type="application/atom+xml;type=entry" title="Runbook" href="RunbookVersions(guid'161fc600-aa16-4f49-910d-b5fd47a23c5c')/Runbook" />
    <link rel="https://schemas.microsoft.com/ado/2007/08/dataservices/related/RunbookParameters" type="application/atom+xml;type=feed" title="RunbookParameters" href="RunbookVersions(guid'161fc600-aa16-4f49-910d-b5fd47a23c5c')/RunbookParameters" />
    <title />
    <updated>2014-04-02T22:35:40Z</updated>
    <author>
      <name />
    </author>
    <link rel="edit-media" title="RunbookVersion" href="RunbookVersions(guid'161fc600-aa16-4f49-910d-b5fd47a23c5c')/$value" m:etag="&quot;635273946499400000&quot;" />
    <content type="application/octet-stream" src="RunbookVersions(guid'161fc600-aa16-4f49-910d-b5fd47a23c5c')/$value" />
    <m:properties>
      <d:TenantID m:type="Edm.Guid">00000000-0000-0000-0000-000000000000</d:TenantID>
      <d:RunbookVersionID m:type="Edm.Guid">161fc600-aa16-4f49-910d-b5fd47a23c5c</d:RunbookVersionID>
      <d:RunbookID m:type="Edm.Guid">0feaf232-fee1-465e-a570-c613b77f48f4</d:RunbookID>
      <d:VersionNumber m:type="Edm.Int32">2</d:VersionNumber>
      <d:IsDraft m:type="Edm.Boolean">false</d:IsDraft>
      <d:CreationTime m:type="Edm.DateTime">2014-02-07T18:30:49.94</d:CreationTime>
      <d:LastModifiedTime m:type="Edm.DateTime">2014-02-07T18:30:49.94</d:LastModifiedTime>
    </m:properties>
  </entry>
</feed>

Code Examples

The following example searches for the RunbookVersion(s) associated with a specific Runbook.

namespace CodeSample.Microsoft.SystemCenter.SMA
{
    public class SMASamples
    {
        public static void Main()
        { 
            // Replace this with the name of your SMA web service endpoint.
            string serviceEndPoint = "https://sma-server:9090/00000000-0000-0000-0000-000000000000";                      

            // Setup the connection to SMA
            OrchestratorApi SMAService = new OrchestratorApi(new Uri(serviceEndPoint));

            // Set credentials to the default or to a specific user.
            //((DataServiceContext)SMAService).Credentials = CredentialCache.DefaultCredentials;
            ((DataServiceContext)SMAService).Credentials = new NetworkCredential("user", "pwd", "domain");

            try
            {
                // Identify a specific runbook instance (to search for the associated runbook versions).
                var runbookID = new Guid("0feaf232-fee1-465e-a570-c613b77f48f4");

                // Query for the specific runbook version instance(s) identified by RunbookID.
                var runbookVersions = SMAService.RunbookVersions.Where(r => r.RunbookID == runbookID);

                foreach(var runbookVersion in runbookVersions)
                {
                    // Output select properties of the instance to the console.
                    Console.WriteLine("Found Runbook ID              : {0}", runbookVersion.RunbookID);
                    Console.WriteLine("Found Runbook Version ID      : {0}", runbookVersion.RunbookVersionID);
                    Console.WriteLine("Found Runbook Version Number  : {0}", runbookVersion.VersionNumber);
                    Console.WriteLine("Found Runbook Parameters      : {0}", runbookVersion.RunbookParameters);
                    Console.WriteLine("Found Runbook Draft State     : {0}", runbookVersion.IsDraft);
                }
                Console.ReadKey();
            }
            catch (Exception ex)
            {
                throw new ApplicationException("An error occurred during execution.", ex);
            }
        }                 
    }
}

See Also

Concepts

RunbookVersion
RunbookVersions