共用方式為


Get-AzHDInsightJob

從叢集取得作業清單,並以反向時間順序列出作業,或擷取特定作業。

語法

Get-AzHDInsightJob
   [-ClusterName] <String>
   [-HttpCredential] <PSCredential>
   [[-JobId] <String>]
   [-NumOfJobs <Int32>]
   [-ResourceGroupName <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

Get-AzHDInsightJob Cmdlet 會以反向時間順序取得指定 Azure HDInsight 叢集的最近作業,且清單頂端的最新作業。 藉由提供 JobId 參數來取得特定作業。

範例

範例 1:取得指定 Azure HDInsight 叢集的最新作業

# 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

此命令會取得名為 your-hadoop-001 之叢集的所有最近作業。

參數

-ClusterName

指定叢集的名稱。

類型:String
Position:0
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-DefaultProfile

用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶

類型:IAzureContextContainer
別名:AzContext, AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-HttpCredential

指定叢集的叢集登入 (HTTP) 認證。

類型:PSCredential
別名:ClusterCredential
Position:1
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-JobId

指定要取得之作業的作業標識碼。

類型:String
Position:2
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-NumOfJobs

指定要擷取的作業數目。

類型:Int32
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ResourceGroupName

指定資源群組的名稱。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

None

輸出

AzureHDInsightJob