Share via


Read (GET) Modules

Read using the HTTP GET operation.

Code Examples

Request

Method Request URI HTTP Version

GET

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

HTTP/1.1

Request URI Parameters

URI Parameter Description

GUID

Required. The unique identifier value (ModuleID) for a Module entity.

Request URI Example

Example URI

GET https://sma-server:9090/00000000-0000-0000-0000-000000000000/Modules(guid'38d642be-ffa9-4660-9f9b-1b6f708f9d32') 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"?>
<entry xml:base="https://sma-server: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://waplabvm4:9090/00000000-0000-0000-0000-000000000000/Modules(guid'38d642be-ffa9-4660-9f9b-1b6f708f9d32')</id>
  <category term="Orchestrator.ResourceModel.Module" scheme="https://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
  <link rel="edit" title="Module" href="Modules(guid'38d642be-ffa9-4660-9f9b-1b6f708f9d32')" />
  <link rel="https://schemas.microsoft.com/ado/2007/08/dataservices/related/Activities" type="application/atom+xml;type=feed" title="Activities" href="Modules(guid'38d642be-ffa9-4660-9f9b-1b6f708f9d32')/Activities" />
  <title />
  <updated>2014-04-06T15:37:25Z</updated>
  <author>
    <name />
  </author>
  <link rel="edit-media" title="Module" href="Modules(guid'38d642be-ffa9-4660-9f9b-1b6f708f9d32')/$value" />
  <content type="application/octet-stream" src="Modules(guid'38d642be-ffa9-4660-9f9b-1b6f708f9d32')/$value" />
  <m:properties>
    <d:ModuleID m:type="Edm.Guid">38d642be-ffa9-4660-9f9b-1b6f708f9d32</d:ModuleID>
    <d:ModuleName>MgmtSvcSqlServer</d:ModuleName>
    <d:TenantID m:type="Edm.Guid">00000000-0000-0000-0000-000000000000</d:TenantID>
    <d:Version m:type="Edm.Int32">1</d:Version>
    <d:CreationTime m:type="Edm.DateTime">2014-02-07T18:39:48.877</d:CreationTime>
    <d:LastModifiedTime m:type="Edm.DateTime">2014-02-07T18:39:48.923</d:LastModifiedTime>
  </m:properties>
</entry>

Code Examples

The following example searches for a specific Module, identified by the ModuleID (a unique guid value).

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 module instance to search for.
                var moduleID = new Guid("38d642be-ffa9-4660-9f9b-1b6f708f9d32");

                // Query for the specific module instance identified by ModuleID.
                var module = SMAService.Modules.Where(r => r.ModuleID == moduleID).FirstOrDefault();

                // Output select properties of the instance to the console.
                Console.WriteLine("Found Module ID  : {0}", module.ModuleID);
                Console.WriteLine("Found Module Name: {0}", module.ModuleName);
                Console.ReadKey();
            }
            catch (Exception ex)
            {
                throw new ApplicationException("An error occurred during execution.", ex);
            }
        }                 
    }
}

See Also

Concepts

Module
Modules