Partager via


Read (GET) AdminConfigurations

Read using the HTTP GET operation.

Code Examples

Request

Method Request URI HTTP Version

GET

HTTPS://<HOST>:<PORT>/00000000-0000-0000-0000-000000000000/AdminConfigurations('<NAME>')

HTTP/1.1

Request URI Parameters

URI Parameter Description

NAME

Required. The unique identifier value (Name) for an AdminConfiguration entity.

Request URI Example

Example URI

GET https://sma-server:9090/00000000-0000-0000-0000-000000000000/AdminConfigurations('DrainTimeInSeconds') 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://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/AdminConfigurations('DrainTimeInSeconds')</id>
  <category term="Orchestrator.ResourceModel.AdminConfiguration" scheme="https://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
  <link rel="edit" title="AdminConfiguration" href="AdminConfigurations('DrainTimeInSeconds')" />
  <title />
  <updated>2014-03-31T15:07:49Z</updated>
  <author>
    <name />
  </author>
  <content type="application/xml">
    <m:properties>
      <d:Name>DrainTimeInSeconds</d:Name>
      <d:Value>900</d:Value>
      <d:LastModifiedTime m:type="Edm.DateTime">2014-02-07T18:30:29.31</d:LastModifiedTime>
    </m:properties>
  </content>
</entry>

Code Examples

The following example searches for a specific AdminConfiguration, identified by the Name (a unique string 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 AdminConfiguration instance to search for.
                string AdminConfigurationName = "DrainTimeInSeconds";

                // Query for the specific AdminConfiguration instance identified by Name (the key value is Name).
                var AdminConfiguration = SMAService.AdminConfigurations.Where(r => r.Name == AdminConfigurationName).FirstOrDefault();

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

See Also

Concepts

AdminConfiguration
AdminConfigurations