Azure / azure-sdk-for-php

Microsoft Azure SDK for PHP
http://azure.microsoft.com/en-us/develop/php/
Apache License 2.0
415 stars 273 forks source link

Add queryParams to MediaServices\MediaServicesRestProxy::getJobList #990

Open smileexx opened 6 years ago

smileexx commented 6 years ago

queryParams gives you a possibility to make search request of Jobs with filters like $skip/$top/$filter. It's useful when you have more then 1000 jobs.

Short example:

function viewJobs( int $offset = 0, int $limit = 1000, string $filter = '' ) {
        $params = [];
        if( $offset ) {
            $params[ '$skip' ] = $offset;
        }
        if( $limit ) {
            $params[ '$top' ] = $limit;
        } else {
            $params[ '$top' ] = 1000;
        }
        if( $filter ) {
            $params[ '$filter' ] = $filter;
        }
        $listIterator = $this->restProxy->getJobList( $params );
}

viewJobs( 1000, 0, "(false or (cast(State,'Edm.Int32') eq 0) or (cast(State,'Edm.Int32') eq 2) )" );

More about Jobs in official Docs