REST Resource: processes
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tài nguyên: Quy trình
Hình ảnh minh hoạ một quá trình thực thi quy trình tập lệnh bắt đầu qua trình chỉnh sửa tập lệnh, điều kiện kích hoạt, ứng dụng hoặc API Apps Script. Tài nguyên này khác với tài nguyên Operation
(chỉ biểu thị các lượt thực thi được bắt đầu thông qua API Apps Script).
Biểu diễn dưới dạng JSON |
{
"projectName": string,
"functionName": string,
"processType": enum (ProcessType ),
"processStatus": enum (ProcessStatus ),
"userAccessLevel": enum (UserAccessLevel ),
"startTime": string,
"duration": string
} |
Trường |
projectName |
string
Tên của tập lệnh đang được thực thi.
|
functionName |
string
Tên của hàm đã bắt đầu thực thi.
|
processType |
enum (ProcessType )
Loại thực thi.
|
processStatus |
enum (ProcessStatus )
Trạng thái thực thi.
|
userAccessLevel |
enum (UserAccessLevel )
Cấp truy cập của người dùng thực thi vào tập lệnh.
|
startTime |
string (Timestamp format)
Thời gian bắt đầu quá trình thực thi. Dấu thời gian theo múi giờ "Zulu" RFC3339 (giờ UTC) với độ phân giải nano giây và lên đến 9 chữ số phân số. Ví dụ: "2014-10-02T15:01:23Z" và "2014-10-02T15:01:23.045123456Z" .
|
duration |
string (Duration format)
Thời lượng thực thi đã thực thi. Thời lượng tính bằng giây với tối đa 9 chữ số phân số, kết thúc bằng "s ". Ví dụ: "3.5s" .
|
ProcessType
Loại quy trình xác định cách bắt đầu quy trình.
Enum |
PROCESS_TYPE_UNSPECIFIED |
Loại không xác định. |
ADD_ON |
Quá trình này bắt đầu từ một điểm truy cập vào tiện ích bổ sung. |
EXECUTION_API |
Quá trình này bắt đầu bằng API Apps Script. |
TIME_DRIVEN |
Quá trình này được bắt đầu từ điều kiện kích hoạt dựa trên thời gian. |
TRIGGER |
Quá trình này được bắt đầu từ một điều kiện kích hoạt dựa trên sự kiện. |
WEBAPP |
Quá trình này bắt đầu từ một điểm truy cập của ứng dụng web. |
EDITOR |
Quá trình này bắt đầu bằng IDE của Apps Script. |
SIMPLE_TRIGGER |
Quá trình này được bắt đầu từ một điều kiện kích hoạt đơn giản của G Suite. |
BATCH_TASK |
Quá trình này bắt đầu dưới dạng một tác vụ trong một tác vụ hàng loạt. |
ProcessStatus
Trạng thái của quá trình.
Enum |
PROCESS_STATUS_UNSPECIFIED |
Trạng thái không xác định. |
RUNNING |
Quy trình này hiện đang chạy. |
PAUSED |
Quá trình này đã tạm dừng. |
COMPLETED |
Quá trình này đã hoàn tất. |
CANCELED |
Quá trình này đã bị huỷ. |
FAILED |
Quá trình này không thành công. |
TIMED_OUT |
Đã hết thời gian chờ cho quá trình này. |
UNKNOWN |
Trạng thái quy trình không xác định. |
DELAYED |
Quá trình này bị trì hoãn vì đang chờ hạn mức. |
UserAccessLevel
Các cấp truy cập của người dùng.
Enum |
USER_ACCESS_LEVEL_UNSPECIFIED |
Cấp truy cập của người dùng chưa được chỉ định |
NONE |
Người dùng không có quyền truy cập. |
READ |
Người dùng có quyền truy cập chỉ đọc. |
WRITE |
Người dùng có quyền ghi. |
OWNER |
Người dùng là chủ sở hữu. |
Phương thức |
|
Liệt kê thông tin về các quy trình do người dùng thực hiện hoặc thay mặt cho người dùng, chẳng hạn như loại quy trình và trạng thái hiện tại. |
|
Liệt kê thông tin về các quy trình đã thực thi của một tập lệnh, chẳng hạn như loại quy trình và trạng thái hiện tại. |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eProcess\u003c/code\u003e resource represents a single script execution initiated from various sources like the script editor, triggers, applications, or the Apps Script API.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eProcess\u003c/code\u003e details include project and function names, execution type, status, user access level, start time, and duration.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eProcessType\u003c/code\u003e identifies how the process was started (e.g., add-on, API, trigger, web app).\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eProcessStatus\u003c/code\u003e indicates the current state of the execution (e.g., running, paused, completed, failed).\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can programmatically list processes using methods like \u003ccode\u003elist\u003c/code\u003e and \u003ccode\u003elistScriptProcesses\u003c/code\u003e to gain insights into executions.\u003c/p\u003e\n"]]],[],null,["# REST Resource: processes\n\n- [Resource: Process](#Process)\n - [JSON representation](#Process.SCHEMA_REPRESENTATION)\n- [ProcessType](#ProcessType)\n- [ProcessStatus](#ProcessStatus)\n- [UserAccessLevel](#UserAccessLevel)\n- [Methods](#METHODS_SUMMARY)\n\nResource: Process\n-----------------\n\nRepresentation of a single script process execution that was started from the script editor, a trigger, an application, or using the Apps Script API. This is distinct from the [`Operation`](/apps-script/api/reference/rest/v1/scripts/run#body.Operation) resource, which only represents executions started via the Apps Script API.\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"projectName\": string, \"functionName\": string, \"processType\": enum (/apps-script/api/reference/rest/v1/processes#ProcessType), \"processStatus\": enum (/apps-script/api/reference/rest/v1/processes#ProcessStatus), \"userAccessLevel\": enum (/apps-script/api/reference/rest/v1/processes#UserAccessLevel), \"startTime\": string, \"duration\": string } ``` |\n\n| Fields ||\n|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `projectName` | `string` Name of the script being executed. |\n| `functionName` | `string` Name of the function the started the execution. |\n| `processType` | `enum (`[ProcessType](/apps-script/api/reference/rest/v1/processes#ProcessType)`)` The executions type. |\n| `processStatus` | `enum (`[ProcessStatus](/apps-script/api/reference/rest/v1/processes#ProcessStatus)`)` The executions status. |\n| `userAccessLevel` | `enum (`[UserAccessLevel](/apps-script/api/reference/rest/v1/processes#UserAccessLevel)`)` The executing users access level to the script. |\n| `startTime` | `string (`[Timestamp](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp)` format)` Time the execution started. A timestamp in RFC3339 UTC \"Zulu\" format, with nanosecond resolution and up to nine fractional digits. Examples: `\"2014-10-02T15:01:23Z\"` and `\"2014-10-02T15:01:23.045123456Z\"`. |\n| `duration` | `string (`[Duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration)` format)` Duration the execution spent executing. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `\"3.5s\"`. |\n\nProcessType\n-----------\n\nThe type of process, which defines how the process was started.\n\n| Enums ||\n|----------------------------|--------------------------------------------------------|\n| `PROCESS_TYPE_UNSPECIFIED` | Unspecified type. |\n| `ADD_ON` | The process was started from an add-on entry point. |\n| `EXECUTION_API` | The process was started using the Apps Script API. |\n| `TIME_DRIVEN` | The process was started from a time-based trigger. |\n| `TRIGGER` | The process was started from an event-based trigger. |\n| `WEBAPP` | The process was started from a web app entry point. |\n| `EDITOR` | The process was started using the Apps Script IDE. |\n| `SIMPLE_TRIGGER` | The process was started from a G Suite simple trigger. |\n| `MENU` | The process was started from a G Suite menu item. |\n| `BATCH_TASK` | The process was started as a task in a batch job. |\n\nProcessStatus\n-------------\n\nThe process status.\n\n| Enums ||\n|------------------------------|--------------------------------------------|\n| `PROCESS_STATUS_UNSPECIFIED` | Unspecified status. |\n| `RUNNING` | The process is currently running. |\n| `PAUSED` | The process has paused. |\n| `COMPLETED` | The process has completed. |\n| `CANCELED` | The process was cancelled. |\n| `FAILED` | The process failed. |\n| `TIMED_OUT` | The process timed out. |\n| `UNKNOWN` | Process status unknown. |\n| `DELAYED` | The process is delayed, waiting for quota. |\n\nUserAccessLevel\n---------------\n\nThe various user access levels.\n\n| Enums ||\n|---------------------------------|--------------------------------|\n| `USER_ACCESS_LEVEL_UNSPECIFIED` | User access level unspecified |\n| `NONE` | The user has no access. |\n| `READ` | The user has read-only access. |\n| `WRITE` | The user has write access. |\n| `OWNER` | The user is an owner. |\n\n| Methods ------- ||\n|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|\n| ### [list](/apps-script/api/reference/rest/v1/processes/list) | List information about processes made by or on behalf of a user, such as process type and current status. |\n| ### [listScriptProcesses](/apps-script/api/reference/rest/v1/processes/listScriptProcesses) | List information about a script's executed processes, such as process type and current status. |"]]