Share via


Importing the JobStreams Metadata File

Due to a known issue, the JobStreams metadata file is not available to add as a Visual Studio service reference using the normal browsing function (pointing to https://<sma-webservice-endpoint>:<port>/00000000-0000-0000-0000-000000000000/JobStreams). As a workaround, create a local copy of the metadata file and specify the local file when adding the Visual Studio service reference.

Adding the JobStreams Service Reference

To add the JobStreams service reference and generate the client library for the JobStreams service:

  1. Save the JobStreams metadata information (below) as an XML file.

  2. In Visual Studio, select Add Service Reference.

  3. In the Address field, specify the previously saved XML file. For example, “c:\metadatafile\JobStreams-$metadata.xml”

  4. Click Go, then OK to add the service reference and generate the client library.

JobStreams Metadata Information($metadata)

<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="1.0" xmlns:edmx="https://schemas.microsoft.com/ado/2007/06/edmx">
  <edmx:DataServices m:DataServiceVersion="3.0" m:MaxDataServiceVersion="3.0" xmlns:m="https://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
    <Schema Namespace="Orchestrator.Streams.ResourceModel" xmlns="https://schemas.microsoft.com/ado/2009/11/edm">
      <EntityType Name="StreamItem">
        <Key>
          <PropertyRef Name="JobId" />
          <PropertyRef Name="TenantId" />
        </Key>
        <Property Name="JobId" Type="Edm.Guid" Nullable="false" />
        <Property Name="NameValues" Type="Collection(Orchestrator.Streams.ResourceModel.NameValue)" Nullable="false" />
        <Property Name="RunbookVersionId" Type="Edm.Guid" Nullable="false" />
        <Property Name="StreamTypeName" Type="Edm.String" />
        <Property Name="TenantId" Type="Edm.Guid" Nullable="false" />
        <Property Name="StreamTime" Type="Edm.DateTime" Nullable="false" />
        <Property Name="StreamText" Type="Edm.String" />
      </EntityType>
      <ComplexType Name="NameValue">
        <Property Name="Name" Type="Edm.String" />
        <Property Name="NameValueInner" Type="Collection(Orchestrator.Streams.ResourceModel.NameValue)" Nullable="false" />
        <Property Name="Value" Type="Edm.String" />
      </ComplexType>
      <ComplexType Name="JobStatusChangeCounter">
        <Property Name="TimeSliceStart" Type="Edm.DateTime" Nullable="false" />
        <Property Name="Status" Type="Edm.String" />
        <Property Name="Count" Type="Edm.Int32" Nullable="false" />
      </ComplexType>
      <ComplexType Name="RunbookSnapshot">
        <Property Name="DraftVersionId" Type="Edm.Guid" />
        <Property Name="JobCount" Type="Edm.Int64" Nullable="false" />
        <Property Name="JobStartTime" Type="Edm.DateTime" />
        <Property Name="LastJobStatus" Type="Edm.String" />
        <Property Name="PublishedVersionId" Type="Edm.Guid" />
        <Property Name="RunbookName" Type="Edm.String" />
        <Property Name="RunbookStatus" Type="Edm.String" />
        <Property Name="RunbookId" Type="Edm.Guid" Nullable="false" />
        <Property Name="TotalRunbooksCount" Type="Edm.Int32" Nullable="false" />
        <Property Name="Tags" Type="Edm.String" />
      </ComplexType>
      <ComplexType Name="QuickGlanceCounter">
        <Property Name="Order" Type="Edm.Int32" Nullable="false" />
        <Property Name="ItemType" Type="Edm.String" />
        <Property Name="Count" Type="Edm.Int32" Nullable="false" />
      </ComplexType>
      <EntityContainer Name="OrchestratorStreamsApi" m:IsDefaultEntityContainer="true">
        <EntitySet Name="Stream" EntityType="Orchestrator.Streams.ResourceModel.StreamItem" />
        <FunctionImport Name="GetStreamItems" ReturnType="Collection(Orchestrator.Streams.ResourceModel.StreamItem)" EntitySet="Stream" m:HttpMethod="GET">
          <Parameter Name="jobId" Type="Edm.String" />
          <Parameter Name="streamType" Type="Edm.String" />
          <Parameter Name="streamsCreatedSinceDateTime" Type="Edm.String" />
        </FunctionImport>
        <FunctionImport Name="GetJobStatusChangeCounters" ReturnType="Collection(Orchestrator.Streams.ResourceModel.JobStatusChangeCounter)" m:HttpMethod="GET">
          <Parameter Name="timeWindowHours" Type="Edm.Int32" Nullable="false" />
          <Parameter Name="timeSlices" Type="Edm.Int32" Nullable="false" />
          <Parameter Name="runbookId" Type="Edm.Guid" />
          <Parameter Name="timeWindowStart" Type="Edm.DateTime" />
        </FunctionImport>
        <FunctionImport Name="GetRunbookJobSnapshots" ReturnType="Collection(Orchestrator.Streams.ResourceModel.RunbookSnapshot)" m:HttpMethod="GET">
          <Parameter Name="jobStatus" Type="Edm.String" />
          <Parameter Name="jobStartBeginTime" Type="Edm.DateTime" Nullable="false" />
          <Parameter Name="jobStartEndTime" Type="Edm.DateTime" Nullable="false" />
          <Parameter Name="sortProperty" Type="Edm.String" />
          <Parameter Name="sortDirection" Type="Edm.String" />
          <Parameter Name="skip" Type="Edm.Int32" Nullable="false" />
          <Parameter Name="take" Type="Edm.Int32" Nullable="false" />
          <Parameter Name="filter" Type="Edm.String" />
        </FunctionImport>
        <FunctionImport Name="GetQuickGlanceCounters" ReturnType="Collection(Orchestrator.Streams.ResourceModel.QuickGlanceCounter)" m:HttpMethod="GET" />
        <FunctionImport Name="CreateDeployment" m:HttpMethod="POST">
          <Parameter Name="runbookWorkers" Type="Edm.String" />
        </FunctionImport>
      </EntityContainer>
    </Schema>
  </edmx:DataServices>
</edmx:Edmx>