Latest post Tue, Apr 14 2015 8:48 AM by rwassall. 19 replies.
Page 1 of 2 (20 items) 1 2 Next >
Sort Posts: Previous Next
  • Fri, Nov 14 2014 9:17 PM

    • rwassall
    • Not Ranked
    • Joined on Fri, Nov 14 2014
    • Posts 11
    • Points 135

    Powershell media export

    Hi,

    Is it conceivable that one could use Powershell to leverage an export of MXF media and XML metadata files from an AVID interplay system via the web services API? 

    As I understand it, the export of media follows the this series of SOAP calls.

    • GetChildren 
    • GetAttributes
    • GetUMIDLocators
    • SendToPlayback 
    • Move

    The plan is to execute a daily export of media and metadata to a location where it can be picked up by our own REST import service and published.

    Any assistance would be appreciated.

  • Mon, Nov 17 2014 8:33 PM In reply to

    • robg
    • Not Ranked
    • Joined on Fri, Nov 4 2005
    • Tewksbury, MA
    • Posts 494
    • Points 5,605
    • Avid Developer Moderator
      Avid Employee

    Re: Powershell media export

    rwassall,

    Yes, you can use Powershell to call SOAP web services.

    There are a couple of good tutorials out there.

    I found that this technique works with Interplay Production Web Services:

      http://iislogs.com/steveschofield/2010/01/17/execute-a-soap-request-from-powershell/

    I got the first call, GetChildern, working (after fixing up the quotation marks formatting). See the code below.

    I also used the WriteXmlToScreen funtion at the bottom of this post to dump the XML response:

      http://stackoverflow.com/questions/6142053/powershell-output-xml-to-screen

    You will have to change the URL, username, and password. Also, this can be turned into a function to pass in the Interplay URI, etc.

    Hope this helps.

    - Rob

    function Execute-SOAPRequest ([Xml]$SOAPRequest, [String] $URL) 

            write-host "Sending SOAP Request To Server: $URL" 

            $soapWebRequest = [System.Net.WebRequest]::Create($URL) 

     

            $soapWebRequest.ContentType = "text/xml;charset=`"utf-8`"" 

            $soapWebRequest.Accept      = "text/xml" 

            $soapWebRequest.Method      = "POST" 

     

            write-host "Initiating Send." 

            $requestStream = $soapWebRequest.GetRequestStream() 

            $SOAPRequest.Save($requestStream) 

            $requestStream.Close() 

     

            write-host "Send Complete, Waiting For Response." 

            $resp = $soapWebRequest.GetResponse() 

            $responseStream = $resp.GetResponseStream() 

            $soapReader = [System.IO.StreamReader]($responseStream) 

            $ReturnXml = [Xml] $soapReader.ReadToEnd() 

            $responseStream.Close() 

     

            write-host "Response Received."

     

            return $ReturnXml 

    }

     

    $url = 'http://your_server/services/Assets'

    $soap = [xml]@'

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://avid.com/interplay/ws/assets/types">

       <soapenv:Header>

          <typ:UserCredentials>

             <typ:Username>username</typ:Username>

             <typ:Password>password</typ:Password>

          </typ:UserCredentials>

       </soapenv:Header>

       <soapenv:Body>

          <typ:GetChildren>

             <typ:InterplayURI>interplay://WGC/Catalogs</typ:InterplayURI>

             <typ:IncludeFolders>false</typ:IncludeFolders>

             <typ:IncludeFiles>true</typ:IncludeFiles>

             <typ:IncludeMOBs>true</typ:IncludeMOBs>

          </typ:GetChildren>

       </soapenv:Body>

    </soapenv:Envelope>

    '@

     

    function WriteXmlToScreen ($xml)

    {

        $StringWriter = New-Object System.IO.StringWriter 

        $XmlWriter = New-Object System.XMl.XmlTextWriter $StringWriter 

        $xmlWriter.Formatting = "indented" 

        $xml.WriteTo($XmlWriter) 

        $XmlWriter.Flush() 

        $StringWriter.Flush() 

        Write-Output $StringWriter.ToString() 

    }

     

    $ret = Execute-SOAPRequest $soap $url 

    WriteXmlToScreen $ret

     

  • Mon, Nov 17 2014 9:35 PM In reply to

    • rwassall
    • Not Ranked
    • Joined on Fri, Nov 14 2014
    • Posts 11
    • Points 135

    Re: Powershell media export

    That's great, thank you. I will give that a try once we get access to the client's system.

    Do you know of a doc referencing envelopes for the other functions?

    Thanks again

     

  • Mon, Nov 17 2014 10:02 PM In reply to

    • robg
    • Not Ranked
    • Joined on Fri, Nov 4 2005
    • Tewksbury, MA
    • Posts 494
    • Points 5,605
    • Avid Developer Moderator
      Avid Employee

    Re: Powershell media export

    You can get this from any installation of Interplay Production Web Services.

     

    http://<server>/docs/Interplay_WS_Reference_Guide.html

     

  • Tue, Jan 13 2015 10:48 AM In reply to

    • rwassall
    • Not Ranked
    • Joined on Fri, Nov 14 2014
    • Posts 11
    • Points 135

    Re: Powershell media export

    Hi, 

    I managed to get a process working to work using powershell, apart from one vital point: I can't get multiple sequences to export to MXF files using a profile configured by the client.

    My process goes like this:

    1)       “GetChildren” (with a lookup performed on output to only discover sequences)

    2)       “CheckReadyForXfer” (followed by a “Move” call to “failed” location if not ready for transfer)

    3)       “GetAttributes” (to use as metadata for Imagen import)

    (we aim to shoehorn a “GetUMIDLocators” to pull annotation/subtitle data at this point)  

    4)       “SubmitJobUsingParameters”

    5)       “GetJobStatus”

    6)       (REST Import to Imagen using information gathered from AVID)

     

    7)       “Move” (appropriately regarding success or failure)

     

    The problem is with step 4 SubmitJobUsingParameters which sends the following soap request for each valid sequence

    ========================================================

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

      xmlns:assets="http://avid.com/interplay/ws/assets/types"

      xmlns:jobs="http://avid.com/interplay/ws/jobs/types">

         <soapenv:Header>

            <assets:UserCredentials>

               <assets:Username>imagen</assets:Username>

               <assets:Password>xxxxxxxx</assets:Password>

            </assets:UserCredentials>

         </soapenv:Header>

         <soapenv:Body>

            <jobs:SubmitJobUsingParameters>

               <jobs:Service>com.avid.dms.longgopexport</jobs:Service>

               <jobs:InterplayURI>$interplayURI</jobs:InterplayURI>

               <jobs:Parameters>

                 <jobs:Parameter Name="High Priority">false</jobs:Parameter>

                 <jobs:Parameter Name="TM_Server">server-name</jobs:Parameter>

                 <jobs:Parameter Name="TM Profile">DAM</jobs:Parameter>

                 <jobs:Parameter Name="Priority">50</jobs:Parameter>

                 <jobs:Parameter Name="Overwrite">true</jobs:Parameter>

               </jobs:Parameters>

            </jobs:SubmitJobUsingParameters>

        </soapenv:Body>

      </soapenv:Envelope> 

    =======================================================

     

    Each call outputs the same file to the FTP server, over and over. I have shown the $interplayURI variable is updated on each call, but always the same file is written. I am told by the client that this process somehow renders Interplay in a bad state. Unfortunately I have no information about the state, just that it impacts their work.

     

    Any ideas?

     

    Are there any other means to output the sequences which might be more effective?

     

    Kind Regards

    Richard

  • Tue, Jan 13 2015 9:10 PM In reply to

    • robg
    • Not Ranked
    • Joined on Fri, Nov 4 2005
    • Tewksbury, MA
    • Posts 494
    • Points 5,605
    • Avid Developer Moderator
      Avid Employee

    Re: Powershell media export

    Richard,

    I don't know if you have done this already, but my suggestion is to try step 4 using a tool like SoapUI to isolate a call to SubmitJobUsingParameters.

    Please let me know if you would like instructions to use SoapUI to call Interplay Production Web Services...

    - Rob

     

  • Tue, Jan 13 2015 10:33 PM In reply to

    • rwassall
    • Not Ranked
    • Joined on Fri, Nov 14 2014
    • Posts 11
    • Points 135

    Re: Powershell media export

    Hi Rob,

    I had exactly the same thought. I used SoapUI, which structured the envolope for me, and I entered an interplayURI manually. Unfortunately I still ended up with the same result where one file would be output.

    Interestingly the file that is output does seem correct from the first call, but subsequent calls only ever output that file, even when supplying the interplayURI.

    Also, every few calls I attempted a connection error would be returned. This happened on other calls as well as the SubmitJobUsingParameters call.

    It's frustrating as the process was so close to working. 

    Thanks
    Richard 

  • Wed, Jan 14 2015 2:56 PM In reply to

    • robg
    • Not Ranked
    • Joined on Fri, Nov 4 2005
    • Tewksbury, MA
    • Posts 494
    • Points 5,605
    • Avid Developer Moderator
      Avid Employee

    Re: Powershell media export

    OK, please let me know the exact versions (i.e. 3.0.5) of the major Avid components at the site:

    • Interplay Production
    • Interplay Production Web Services
    • Interplay Media Services Engine
    • other?
    I'll then check to see if there are any known issues with submitting jobs. - Rob

     

  • Wed, Jan 14 2015 5:13 PM In reply to

    • rwassall
    • Not Ranked
    • Joined on Fri, Nov 14 2014
    • Posts 11
    • Points 135

    Re: Powershell media export

    I have asked for the version/component info and will send over in due course.

    The client informs me that it's the STP encode server that goes wrong when several jobs are sent. Perhaps this is indicative of a wider problem with the AVID deployment, rather than the export script.

    Thanks
    Richard 

  • Wed, Jan 14 2015 10:29 PM In reply to

    • rwassall
    • Not Ranked
    • Joined on Fri, Nov 14 2014
    • Posts 11
    • Points 135

    Re: Powershell media export

    Hi Rob,

    Here are component versions:

     

    Avid Service Framework 1.7.0.29

    Avid Interplay Access 3.1.0.43225

    Avid Interplay Production Services 3.1.0

    Avid Interplay Transcode 3.1.0

    Avid Interplay Transfer Client 3.1.0

    Avid ISIS Client 4.7.3.15400

    Avid Interplay Engine

    Avid Interplay Web Services 3.0.5

    Avid Interplay Media Indexer 3.1.0.20623

    Avid Interplay Delivery Receiver Service 3.1.0

    Avid Interplay STP Encode 3.1.0

    Avid Interplay Transfer Cache 3.1.0

    Avid Interplay Transfer Engine 3.0.7

  • Thu, Jan 15 2015 3:16 PM In reply to

    • robg
    • Not Ranked
    • Joined on Fri, Nov 4 2005
    • Tewksbury, MA
    • Posts 494
    • Points 5,605
    • Avid Developer Moderator
      Avid Employee

    Re: Powershell media export

    rwassall,

    OK. I'll check with our support engineers here.

    I noticed that the version of Avid Interplay Engine is missing in the list above. Please ask the client for that version number.

    Thanks,

    - Rob

     

  • Fri, Jan 16 2015 10:11 PM In reply to

    • rwassall
    • Not Ranked
    • Joined on Fri, Nov 14 2014
    • Posts 11
    • Points 135

    Re: Powershell media export

    The Interplay Engine is 3.1.0

    Cheers

  • Mon, Jan 19 2015 7:10 PM In reply to

    • robg
    • Not Ranked
    • Joined on Fri, Nov 4 2005
    • Tewksbury, MA
    • Posts 494
    • Points 5,605
    • Avid Developer Moderator
      Avid Employee

    Re: Powershell media export

    rwassall,

    I haven't heard back yet from the developers, but I found this thread where the solution was to send the mobid in as a parameter. Like this:

    <jobs:Parameter Name="MobID">060a2b340101010101010f0013-000000-0a181100be0300eb-060e2b347f7f-d080</jobs:Parameter>

    Please give this a try...

    - Rob

     

  • Mon, Jan 19 2015 8:13 PM In reply to

    • robg
    • Not Ranked
    • Joined on Fri, Nov 4 2005
    • Tewksbury, MA
    • Posts 494
    • Points 5,605
    • Avid Developer Moderator
      Avid Employee

    Re: Powershell media export

    rwassall,

    I heard back fromt the developer. He pointed to a section in the IPWS FAQ:

    Q: What are the parameters for starting a Media Services job e.g. LongGOP export?

    A:The easiest way to figure out the required list of parameters is to look up details for the existing instance of a job that had been submitted manually using Media Services and Transfer Status application.

    The full list of parameters can be obtained through the GetProfiles WS request. You'll need to create at least one empty profile for the Media Services Provider you're interested in.

    Please note that required parameters are not highlighted in the WS output response.

    Hope this helps,

    - Rob

     

  • Tue, Apr 7 2015 11:22 AM In reply to

    • rwassall
    • Not Ranked
    • Joined on Fri, Nov 14 2014
    • Posts 11
    • Points 135

    Re: Powershell media export

    Hi Rob,


    We now have the licence sorted out, but are making no progress trying multiple outputs.

     

    In response to your previous points:

     

    1) I tried adding the modID as a separate parameter and received the following:

          Problems creating SAAJ object model

     

    2) I can't perform a GetProfiles as I do not have the exact workgroup ID or service name. I've asked the client for further information.

     

    My problem is that this process works the first file output. If the parameters were not correct, one would assume a failure would result during the first export, not the second. Is this not indicative of a bug? I am not using my script to run these queries, this is executed using SoapUI.


    Thanks
    Richard 

     

Page 1 of 2 (20 items) 1 2 Next >

© Copyright 2011 Avid Technology, Inc.  Terms of Use |  Privacy Policy |  Site Map |  Find a Reseller