Share via


Read (GET) JobParameters

Read using the HTTP GET operation.

Code Examples

Request

Method Request URI HTTP Version

GET

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

HTTP/1.1

Request URI Parameters

URI Parameter Description

GUID

Required. The unique identifier value (JobContext) for a JobParameter entity.

Request URI Example

Example URI

GET https://sma-server:9090/00000000-0000-0000-0000-000000000000/JobParameters()?$filter=JobContextID%20eq%20guid'57d071fb-a3d1-499d-b4ef-0d64dfc80723' 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://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/JobParameters</id>
  <title type="text">JobParameters</title>
  <updated>2014-04-06T14:22:03Z</updated>
  <link rel="self" title="JobParameters" href="JobParameters" />
  <entry>
    <id>https://sma-server:9090/00000000-0000-0000-0000-000000000000/JobParameters(JobContextID=guid'57d071fb-a3d1-499d-b4ef-0d64dfc80723',Name='message')</id>
    <category term="Orchestrator.ResourceModel.JobParameter" scheme="https://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <link rel="edit" title="JobParameter" href="JobParameters(JobContextID=guid'57d071fb-a3d1-499d-b4ef-0d64dfc80723',Name='message')" />
    <link rel="https://schemas.microsoft.com/ado/2007/08/dataservices/related/JobContext" type="application/atom+xml;type=entry" title="JobContext" href="JobParameters(JobContextID=guid'57d071fb-a3d1-499d-b4ef-0d64dfc80723',Name='message')/JobContext" />
    <title />
    <updated>2014-04-06T14:22:03Z</updated>
    <author>
      <name />
    </author>
    <content type="application/xml">
      <m:properties>
        <d:JobContextID m:type="Edm.Guid">57d071fb-a3d1-499d-b4ef-0d64dfc80723</d:JobContextID>
        <d:Name>message</d:Name>
        <d:Value>"Test Message"</d:Value>
        <d:Type>System.String</d:Type>
      </m:properties>
    </content>
  </entry>
  <entry>
    <id>https://sma-server:9090/00000000-0000-0000-0000-000000000000/JobParameters(JobContextID=guid'57d071fb-a3d1-499d-b4ef-0d64dfc80723',Name='MicrosoftApplicationManagementStartedBy')</id>
    <category term="Orchestrator.ResourceModel.JobParameter" scheme="https://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <link rel="edit" title="JobParameter" href="JobParameters(JobContextID=guid'57d071fb-a3d1-499d-b4ef-0d64dfc80723',Name='MicrosoftApplicationManagementStartedBy')" />
    <link rel="https://schemas.microsoft.com/ado/2007/08/dataservices/related/JobContext" type="application/atom+xml;type=entry" title="JobContext" href="JobParameters(JobContextID=guid'57d071fb-a3d1-499d-b4ef-0d64dfc80723',Name='MicrosoftApplicationManagementStartedBy')/JobContext" />
    <title />
    <updated>2014-04-06T14:22:03Z</updated>
    <author>
      <name />
    </author>
    <content type="application/xml">
      <m:properties>
        <d:JobContextID m:type="Edm.Guid">57d071fb-a3d1-499d-b4ef-0d64dfc80723</d:JobContextID>
        <d:Name>MicrosoftApplicationManagementStartedBy</d:Name>
        <d:Value>CDMLAB\cdmlabuser</d:Value>
        <d:Type>System.String</d:Type>
      </m:properties>
    </content>
  </entry>
  <entry>
    <id>https://sma-server:9090/00000000-0000-0000-0000-000000000000/JobParameters(JobContextID=guid'57d071fb-a3d1-499d-b4ef-0d64dfc80723',Name='numOfTimes')</id>
    <category term="Orchestrator.ResourceModel.JobParameter" scheme="https://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <link rel="edit" title="JobParameter" href="JobParameters(JobContextID=guid'57d071fb-a3d1-499d-b4ef-0d64dfc80723',Name='numOfTimes')" />
    <link rel="https://schemas.microsoft.com/ado/2007/08/dataservices/related/JobContext" type="application/atom+xml;type=entry" title="JobContext" href="JobParameters(JobContextID=guid'57d071fb-a3d1-499d-b4ef-0d64dfc80723',Name='numOfTimes')/JobContext" />
    <title />
    <updated>2014-04-06T14:22:03Z</updated>
    <author>
      <name />
    </author>
    <content type="application/xml">
      <m:properties>
        <d:JobContextID m:type="Edm.Guid">57d071fb-a3d1-499d-b4ef-0d64dfc80723</d:JobContextID>
        <d:Name>numOfTimes</d:Name>
        <d:Value>1000</d:Value>
        <d:Type>System.Int32</d:Type>
      </m:properties>
    </content>
  </entry>
</feed>

Code Examples

The following example searches for JobParameters associated with a specific Job, identified by the JobContextID (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 job context identifier.
                System.Guid jobContextID = new Guid("57d071fb-a3d1-499d-b4ef-0d64dfc80723");

                // Query for the job parameters associated with the specific job context instance identified by jobContextID.
                var jobParameters = SMAService.JobParameters.Where(r => r.JobContextID == jobContextID);

                // Output select properties of the instances to the console.
                foreach (var jobParameter in jobParameters)
                {
                    Console.WriteLine(" ");
                    Console.WriteLine("Job Context ID      : {0}", jobParameter.JobContextID);
                    Console.WriteLine("Parameter Name      : {0}", jobParameter.Name);
                    Console.WriteLine("Type                : {0}", jobParameter.Type);
                    Console.WriteLine("Value               : {0}", jobParameter.Value);
                };
                Console.ReadKey();
            }
            catch (Exception ex)
            {
                throw new ApplicationException("An error occurred during execution.", ex);
            }
        }
    }
}

See Also

Concepts

Job
JobContext
JobContexts