/**
* list all jobs
*
*/
export async function main(
workspace: string,
created_by: string | undefined,
parent_job: string | undefined,
script_path_exact: string | undefined,
script_path_start: string | undefined,
schedule_path: string | undefined,
script_hash: string | undefined,
started_before: string | undefined,
started_after: string | undefined,
created_or_started_before: string | undefined,
running: string | undefined,
scheduled_for_before_now: string | undefined,
created_or_started_after: string | undefined,
job_kinds: string | undefined,
args: string | undefined,
tag: string | undefined,
result: string | undefined,
is_skipped: string | undefined,
is_flow_step: string | undefined,
has_null_parent: string | undefined,
success: string | undefined,
all_workspaces: string | undefined
) {
const url = new URL(`${BASE_URL}/api/w/${workspace}/jobs/list`);
for (const [k, v] of [
["created_by", created_by],
["parent_job", parent_job],
["script_path_exact", script_path_exact],
["script_path_start", script_path_start],
["schedule_path", schedule_path],
["script_hash", script_hash],
["started_before", started_before],
["started_after", started_after],
["created_or_started_before", created_or_started_before],
["running", running],
["scheduled_for_before_now", scheduled_for_before_now],
["created_or_started_after", created_or_started_after],
["job_kinds", job_kinds],
["args", args],
["tag", tag],
["result", result],
["is_skipped", is_skipped],
["is_flow_step", is_flow_step],
["has_null_parent", has_null_parent],
["success", success],
["all_workspaces", all_workspaces],
]) {
if (v !== undefined && v !== "") {
url.searchParams.append(k, v);
}
}
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + WM_TOKEN,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 274 days ago
/**
* list all jobs
*
*/
export async function main(
workspace: string,
created_by: string | undefined,
parent_job: string | undefined,
script_path_exact: string | undefined,
script_path_start: string | undefined,
schedule_path: string | undefined,
script_hash: string | undefined,
started_before: string | undefined,
started_after: string | undefined,
created_or_started_before: string | undefined,
running: string | undefined,
created_or_started_after: string | undefined,
job_kinds: string | undefined,
args: string | undefined,
tag: string | undefined,
result: string | undefined,
is_skipped: string | undefined,
is_flow_step: string | undefined,
success: string | undefined
) {
const url = new URL(`${BASE_URL}/api/w/${workspace}/jobs/list`);
for (const [k, v] of [
["created_by", created_by],
["parent_job", parent_job],
["script_path_exact", script_path_exact],
["script_path_start", script_path_start],
["schedule_path", schedule_path],
["script_hash", script_hash],
["started_before", started_before],
["started_after", started_after],
["created_or_started_before", created_or_started_before],
["running", running],
["created_or_started_after", created_or_started_after],
["job_kinds", job_kinds],
["args", args],
["tag", tag],
["result", result],
["is_skipped", is_skipped],
["is_flow_step", is_flow_step],
["success", success],
]) {
if (v !== undefined && v !== "") {
url.searchParams.append(k, v);
}
}
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + WM_TOKEN,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 408 days ago
/**
* list all jobs
*
*/
export async function main(
workspace: string,
created_by: string | undefined,
parent_job: string | undefined,
script_path_exact: string | undefined,
script_path_start: string | undefined,
schedule_path: string | undefined,
script_hash: string | undefined,
started_before: string | undefined,
started_after: string | undefined,
created_or_started_before: string | undefined,
running: string | undefined,
created_or_started_after: string | undefined,
job_kinds: string | undefined,
args: string | undefined,
tag: string | undefined,
result: string | undefined,
is_skipped: string | undefined,
is_flow_step: string | undefined,
success: string | undefined
) {
const url = new URL(`${BASE_URL}/api/w/${workspace}/jobs/list`);
for (const [k, v] of [
["created_by", created_by],
["parent_job", parent_job],
["script_path_exact", script_path_exact],
["script_path_start", script_path_start],
["schedule_path", schedule_path],
["script_hash", script_hash],
["started_before", started_before],
["started_after", started_after],
["created_or_started_before", created_or_started_before],
["running", running],
["created_or_started_after", created_or_started_after],
["job_kinds", job_kinds],
["args", args],
["tag", tag],
["result", result],
["is_skipped", is_skipped],
["is_flow_step", is_flow_step],
["success", success],
]) {
if (v !== undefined) {
url.searchParams.append(k, v);
}
}
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + WM_TOKEN,
},
body: undefined,
});
return await response.json();
}
Submitted by rubenfiszel 410 days ago
/**
* list all jobs
*
*/
export async function main(
workspace: string,
created_by: string | undefined,
parent_job: string | undefined,
script_path_exact: string | undefined,
script_path_start: string | undefined,
schedule_path: string | undefined,
script_hash: string | undefined,
started_before: string | undefined,
started_after: string | undefined,
created_or_started_before: string | undefined,
running: string | undefined,
created_or_started_after: string | undefined,
job_kinds: string | undefined,
args: string | undefined,
tag: string | undefined,
result: string | undefined,
is_skipped: string | undefined,
is_flow_step: string | undefined,
success: string | undefined,
) {
const url = new URL(`${BASE_URL}/api/w/${workspace}/jobs/list`);
for (const [k, v] of [
["created_by", created_by],
["parent_job", parent_job],
["script_path_exact", script_path_exact],
["script_path_start", script_path_start],
["schedule_path", schedule_path],
["script_hash", script_hash],
["started_before", started_before],
["started_after", started_after],
["created_or_started_before", created_or_started_before],
["running", running],
["created_or_started_after", created_or_started_after],
["job_kinds", job_kinds],
["args", args],
["tag", tag],
["result", result],
["is_skipped", is_skipped],
["is_flow_step", is_flow_step],
["success", success],
]) {
if (v !== undefined) {
url.searchParams.append(k, v);
}
}
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + WM_TOKEN,
},
body: undefined,
});
return await response.json();
}
Submitted by admin 410 days ago