/**
* list all completed jobs
*
*/
export async function main(
workspace: string,
order_desc: string | undefined,
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,
success: string | undefined,
job_kinds: string | undefined,
args: string | undefined,
result: string | undefined,
tag: string | undefined,
is_skipped: string | undefined,
is_flow_step: string | undefined,
has_null_parent: string | undefined
) {
const url = new URL(`${BASE_URL}/api/w/${workspace}/jobs/completed/list`);
for (const [k, v] of [
["order_desc", order_desc],
["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],
["success", success],
["job_kinds", job_kinds],
["args", args],
["result", result],
["tag", tag],
["is_skipped", is_skipped],
["is_flow_step", is_flow_step],
["has_null_parent", has_null_parent],
]) {
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 completed jobs
*
*/
export async function main(
workspace: string,
order_desc: string | undefined,
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,
success: string | undefined,
job_kinds: string | undefined,
args: string | undefined,
result: string | undefined,
tag: string | undefined,
is_skipped: string | undefined,
is_flow_step: string | undefined
) {
const url = new URL(`${BASE_URL}/api/w/${workspace}/jobs/completed/list`);
for (const [k, v] of [
["order_desc", order_desc],
["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],
["success", success],
["job_kinds", job_kinds],
["args", args],
["result", result],
["tag", tag],
["is_skipped", is_skipped],
["is_flow_step", is_flow_step],
]) {
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 completed jobs
*
*/
export async function main(
workspace: string,
order_desc: string | undefined,
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,
success: string | undefined,
job_kinds: string | undefined,
args: string | undefined,
result: string | undefined,
tag: string | undefined,
is_skipped: string | undefined,
is_flow_step: string | undefined
) {
const url = new URL(`${BASE_URL}/api/w/${workspace}/jobs/completed/list`);
for (const [k, v] of [
["order_desc", order_desc],
["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],
["success", success],
["job_kinds", job_kinds],
["args", args],
["result", result],
["tag", tag],
["is_skipped", is_skipped],
["is_flow_step", is_flow_step],
]) {
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 completed jobs
*
*/
export async function main(
workspace: string,
order_desc: string | undefined,
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,
success: string | undefined,
job_kinds: string | undefined,
args: string | undefined,
result: string | undefined,
tag: string | undefined,
is_skipped: string | undefined,
is_flow_step: string | undefined,
) {
const url = new URL(`${BASE_URL}/api/w/${workspace}/jobs/completed/list`);
for (const [k, v] of [
["order_desc", order_desc],
["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],
["success", success],
["job_kinds", job_kinds],
["args", args],
["result", result],
["tag", tag],
["is_skipped", is_skipped],
["is_flow_step", is_flow_step],
]) {
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