Share via


Read (GET) ConnectionFields

Read using the HTTP GET operation.

Code Examples

Request

Method Request URI HTTP Version

GET

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

HTTP/1.1

Request URI Parameters

URI Parameter Description

GUID

Required. The unique identifier value (ConnectionFieldID) for a ConnectionField entity.

Request URI Example

Example URI

GET https://sma-server:9090/00000000-0000-0000-0000-000000000000/ConnectionFields(guid'76ae8c53-e693-4fee-aa03-0408a165aa6e') 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://sma-server:9090/00000000-0000-0000-0000-000000000000/ConnectionFields(guid'76ae8c53-e693-4fee-aa03-0408a165aa6e')</id>
  <category term="Orchestrator.ResourceModel.ConnectionField" scheme="https://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
  <link rel="edit" title="ConnectionField" href="ConnectionFields(guid'76ae8c53-e693-4fee-aa03-0408a165aa6e')" />
  <link rel="https://schemas.microsoft.com/ado/2007/08/dataservices/related/ConnectionType" type="application/atom+xml;type=entry" title="ConnectionType" href="ConnectionFields(guid'76ae8c53-e693-4fee-aa03-0408a165aa6e')/ConnectionType" />
  <title />
  <updated>2014-04-06T21:52:19Z</updated>
  <author>
    <name />
  </author>
  <content type="application/xml">
    <m:properties>
      <d:TenantID m:type="Edm.Guid">00000000-0000-0000-0000-000000000000</d:TenantID>
      <d:ConnectionFieldID m:type="Edm.Guid">76ae8c53-e693-4fee-aa03-0408a165aa6e</d:ConnectionFieldID>
      <d:ConnectionTypeID m:type="Edm.Guid">3a7aaf55-8094-4302-a97c-eb783fa6f49e</d:ConnectionTypeID>
      <d:Name>ComputerName</d:Name>
      <d:Type>System.String</d:Type>
      <d:IsEncrypted m:type="Edm.Boolean">false</d:IsEncrypted>
      <d:IsOptional m:type="Edm.Boolean">false</d:IsOptional>
      <d:CreationTime m:type="Edm.DateTime">2014-02-07T18:31:10.497</d:CreationTime>
      <d:LastModifiedTime m:type="Edm.DateTime">2014-02-07T18:31:10.497</d:LastModifiedTime>
    </m:properties>
  </content>
</entry>

Code Examples

The following example searches for a specific ConnectionField, identified by the ConnectionFieldID (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 ConnectionField instance to search for.
                var connectionFieldID = new Guid("76ae8c53-e693-4fee-aa03-0408a165aa6e");

                // Query for the specific activity instance identified by ActivityID.
                var  connectionField = SMAService.ConnectionFields.Where(r => r.ConnectionFieldID == connectionFieldID).FirstOrDefault();

                // Output select properties of the instance to the console.
                Console.WriteLine("Found ConnectionField ID  : {0}", connectionField.ConnectionFieldID);
                Console.WriteLine("Found ConnectionField Name: {0}", connectionField.Name);
                Console.WriteLine("Found ConnectionTypeID:     {0}", connectionField.ConnectionTypeID);                
                Console.WriteLine("Found ConnectionType:       {0}", connectionField.ConnectionType);
                Console.WriteLine("Found Type:                 {0}", connectionField.Type);
                Console.ReadKey();
            }
            catch (Exception ex)
            {
                throw new ApplicationException("An error occurred during execution.", ex);
            }
        }                 
    }
}

See Also

Concepts

ConnectionField
ConnectionFields