Get-AzHDInsightJob
Gets the list of jobs from a cluster and lists them in reverse chronological order, or retrieves a specific job.
Syntax
Default (Default)
Get-AzHDInsightJob
[-ClusterName] <String>
[-HttpCredential] <PSCredential>
[[-JobId] <String>]
[-NumOfJobs <Int32>]
[-ResourceGroupName <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Get-AzHDInsightJob cmdlet gets recent jobs for a specified Azure HDInsight cluster in reverse chronological order, with the most recent job at the top of the list.
Get a specific job by providing the JobId parameter.
Examples
Example 1: Get recent jobs for a specified Azure HDInsight cluster
# Cluster info
$clusterName = "your-hadoop-001"
$clusterCreds = Get-Credential
# Hive job details
$statusFolder = "tempStatusFolder/"
$query = "SHOW TABLES"
New-AzHDInsightHiveJobDefinition -StatusFolder $statusFolder `
-Query $query `
| Start-AzHDInsightJob -ClusterName $clusterName `
-ClusterCredential $clusterCreds `
| Get-AzHDInsightJob -ClusterName $clusterName `
-ClusterCredential $clusterCreds
This command gets all recent jobs for the cluster named your-hadoop-001.
Parameters
-ClusterName
Specifies the name of the cluster.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: 0
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-HttpCredential
Specifies the cluster login (HTTP) credentials for the cluster.
Parameter properties
Type: PSCredential
Default value: None
Supports wildcards: False
DontShow: False
Aliases: ClusterCredential
Parameter sets
(All)
Position: 1
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-JobId
Specifies the job ID of the job to get.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: 2
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-NumOfJobs
Specifies the number of jobs to retrieve.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceGroupName
Specifies the name of the resource group.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
None
Outputs