describe_job_flows ( $opt )

DescribeJobFlows returns a list of job flows that match all of the supplied parameters. The parameters can include a list of job flow IDs, job flow states, and restrictions on job flow creation date and time.

Regardless of supplied parameters, only job flows created within the last two months are returned.

If no parameters are supplied, then job flows matching either of the following criteria are returned:

  • Job flows created and completed in the last two weeks
  • Job flows created within the last two months that are in one of the following states: RUNNING, WAITING, SHUTTING_DOWN, STARTING

Amazon Elastic MapReduce can return a maximum of 512 job flow descriptions.

Access

public

Parameters

Parameter

Type

Required

Description

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • CreatedAfter - string - Optional - Return only job flows created after this date and time. May be passed as a number of seconds since UNIX Epoch, or any string compatible with strtotime().
  • CreatedBefore - string - Optional - Return only job flows created before this date and time. May be passed as a number of seconds since UNIX Epoch, or any string compatible with strtotime().
  • JobFlowIds - string|array - Optional - Return only job flows whose job flow ID is contained in this list. Pass a string for a single value, or an indexed array for multiple values.
  • JobFlowStates - string|array - Optional - Return only job flows whose state is contained in this list. Pass a string for a single value, or an indexed array for multiple values.
  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Describe all job flows.

$emr = new AmazonEMR();

$response = $emr->describe_job_flows();

// Success?
var_dump($response->isOK());
Result:
bool(true)

Describe job flows from a specific date range.

$emr = new AmazonEMR();

$response = $emr->describe_job_flows(array(
	'CreatedAfter' => 'last month',
	'CreatedBefore' => 'yesterday',
));

// Success?
var_dump($response->isOK());
Result:
bool(true)

Describe job flows from a specific date range.

$emr = new AmazonEMR();

$response = $emr->describe_job_flows(array(
	'CreatedAfter' => '1 January 2010, 12:00am',
	'CreatedBefore' => '28 February 2010, 5:42pm',
));

// Success?
var_dump($response->isOK());
Result:
bool(true)

Describe all job flows with a given state.

$emr = new AmazonEMR();

$response = $emr->describe_job_flows(array(
	'JobFlowStates' => array('RUNNING', 'WAITING')
));

// Success?
var_dump($response->isOK());
Result:
bool(true)

Related Methods

Source

Method defined in services/emr.class.php | Toggle source view (36 lines) | View on GitHub

public function describe_job_flows($opt = null)
{
    if (!$opt) $opt = array();
            
    // Optional DateTime
    if (isset($opt['CreatedAfter']))
    {
        $opt['CreatedAfter'] = $this->util->convert_date_to_iso8601($opt['CreatedAfter']);
    }
    
    // Optional DateTime
    if (isset($opt['CreatedBefore']))
    {
        $opt['CreatedBefore'] = $this->util->convert_date_to_iso8601($opt['CreatedBefore']);
    }

    // Optional list (non-map)
    if (isset($opt['JobFlowIds']))
    {
        $opt = array_merge($opt, CFComplexType::map(array(
            'JobFlowIds' => (is_array($opt['JobFlowIds']) ? $opt['JobFlowIds'] : array($opt['JobFlowIds']))
        ), 'member'));
        unset($opt['JobFlowIds']);
    }
    
    // Optional list (non-map)
    if (isset($opt['JobFlowStates']))
    {
        $opt = array_merge($opt, CFComplexType::map(array(
            'JobFlowStates' => (is_array($opt['JobFlowStates']) ? $opt['JobFlowStates'] : array($opt['JobFlowStates']))
        ), 'member'));
        unset($opt['JobFlowStates']);
    }

    return $this->authenticate('DescribeJobFlows', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback