dataproc-skills

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Usage

使用方法

All scripts can be executed using Node.js. Replace
<param_name>
and
<param_value>
with actual values.
Bash:
node <skill_dir>/scripts/<script_name>.js '{"<param_name>": "<param_value>"}'
PowerShell:
node <skill_dir>/scripts/<script_name>.js '{\"<param_name>\": \"<param_value>\"}'
Note: The scripts automatically load the environment variables from various .env files. Do not ask the user to set vars unless skill executions fails due to env var absence.
所有脚本均可通过Node.js执行。将
<param_name>
<param_value>
替换为实际值。
Bash:
node <skill_dir>/scripts/<script_name>.js '{"<param_name>": "<param_value>"}'
PowerShell:
node <skill_dir>/scripts/<script_name>.js '{\"<param_name>\": \"<param_value>\"}'
注意:脚本会自动从多个.env文件加载环境变量。除非因缺少环境变量导致技能执行失败,否则不要要求用户设置变量。

Scripts

脚本

get_cluster

get_cluster

Gets a Dataproc cluster
获取一个Dataproc集群

Parameters

参数

NameTypeDescriptionRequiredDefault
clusterNamestringThe short name of the cluster, e.g. for "projects/my-project/regions/us-central1/clusters/my-cluster", pass "my-cluster" (the project and region are inherited from the source)No

名称类型描述是否必填默认值
clusterNamestring集群的简称,例如对于"projects/my-project/regions/us-central1/clusters/my-cluster",传入"my-cluster"(项目和区域会从源继承)

get_job

get_job

Gets a Dataproc job
获取一个Dataproc作业

Parameters

参数

NameTypeDescriptionRequiredDefault
jobIdstringThe job ID, e.g. for "projects/my-project/regions/us-central1/jobs/my-job", pass "my-job" (the project and region are inherited from the source)No

名称类型描述是否必填默认值
jobIdstring作业ID,例如对于"projects/my-project/regions/us-central1/jobs/my-job",传入"my-job"(项目和区域会从源继承)

list_clusters

list_clusters

Lists and filters Dataproc clusters
列出并筛选Dataproc集群

Parameters

参数

NameTypeDescriptionRequiredDefault
filterstringA filter constraining the clusters to list. Filters are case-sensitive and have the following syntax: field = value [AND [field = value]] ... where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, UPDATING, STOPPING, or STOPPED. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING, ERROR, STOPPING, and STOPPED states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.No
pageSizeintegerThe maximum number of clusters to return in a single page (default 20)No
20
pageTokenstringA page token, received from a previous
ListClusters
call
No

名称类型描述是否必填默认值
filterstring用于约束要列出的集群的筛选条件。筛选条件区分大小写,语法如下:field = value [AND [field = value]] ... 其中field为status.state、clusterName或labels.[KEY]之一,[KEY]是标签键。value可以为*以匹配所有值。status.state可以是以下值之一:ACTIVE、INACTIVE、CREATING、RUNNING、ERROR、DELETING、UPDATING、STOPPING或STOPPED。ACTIVE包含CREATING、UPDATING和RUNNING状态。INACTIVE包含DELETING、ERROR、STOPPING和STOPPED状态。clusterName是创建集群时提供的名称。仅支持逻辑AND运算符;空格分隔的项视为隐含AND运算符。
pageSizeinteger单页返回的最大集群数量(默认20)
20
pageTokenstring从之前的
ListClusters
调用中获取的分页令牌

list_jobs

list_jobs

Lists and filters Dataproc jobs
列出并筛选Dataproc作业

Parameters

参数

NameTypeDescriptionRequiredDefault
filterstringA filter constraining the jobs to list. Filters are case-sensitive and have the following syntax: field = value [AND [field = value]] ... where field is clusterName, status.state, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: PENDING, RUNNING, CANCEL_PENDING, JOB_STATE_CANCELLED, DONE, ERROR, or ATTEMPT_FAILURE. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator. Filtering by clusterName is recommended to improve query performance.No
jobStateMatcherstringSpecifies if the job state matcher should match ALL jobs, only ACTIVE jobs, or only NON_ACTIVE jobs. Defaults to ALL. Supported values: ALL, ACTIVE, NON_ACTIVE.No
pageSizeintegerThe maximum number of jobs to return in a single page (default 20)No
20
pageTokenstringA page token, received from a previous
ListJobs
call
No

名称类型描述是否必填默认值
filterstring用于约束要列出的作业的筛选条件。筛选条件区分大小写,语法如下:field = value [AND [field = value]] ... 其中field为clusterName、status.state或labels.[KEY]之一,[KEY]是标签键。value可以为*以匹配所有值。status.state可以是以下值之一:PENDING、RUNNING、CANCEL_PENDING、JOB_STATE_CANCELLED、DONE、ERROR或ATTEMPT_FAILURE。仅支持逻辑AND运算符;空格分隔的项视为隐含AND运算符。建议通过clusterName进行筛选以提升查询性能。
jobStateMatcherstring指定作业状态匹配器应匹配所有作业、仅匹配ACTIVE作业还是仅匹配NON_ACTIVE作业。默认为ALL。支持的值:ALL、ACTIVE、NON_ACTIVE。
pageSizeinteger单页返回的最大作业数量(默认20)
20
pageTokenstring从之前的
ListJobs
调用中获取的分页令牌