You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/data/markdown/docs/02 javascript api/09 k6-net-grpc.md
+33-21Lines changed: 33 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,30 +13,42 @@ The k6 gRPC API is currently considered in beta and is subject to change. Future
13
13
14
14
| Class/Method | Description |
15
15
|--------------|-------------|
16
-
|[Client](/javascript-api/k6-net-grpc/client)| gRPC client used for making RPC calls to a gRPC Server |
16
+
|[Client](/javascript-api/k6-net-grpc/client)| gRPC client used for making RPC calls to a gRPC Server.|
17
17
|[Client.load(importPaths, ...protoFiles)](/javascript-api/k6-net-grpc/client/client-load-importpaths----protofiles)| Loads and parses the given protocol buffer definitions to be made available for RPC requests. |
18
18
|[Client.connect(address [,params])](/javascript-api/k6-net-grpc/client/client-connect-address-params)| Connects to a given gRPC service. |
19
19
|[Client.invoke(url, request [,params])](/javascript-api/k6-net-grpc/client/client-invoke-url-request-params)| Makes an unary RPC for the given service/method and returns a [Response](/javascript-api/k6-net-grpc/response). |
20
-
|[Client.close()]()| Close the connection to the gRPC service. |
20
+
|[Client.close()](/javascript-api/k6-net-grpc/client/client-close)| Close the connection to the gRPC service. |
21
21
|[Params](/javascript-api/k6-net-grpc/params)| RPC Request specific options. |
22
22
|[Response](/javascript-api/k6-net-grpc/response)| Returned by RPC requests. |
23
+
|[Constants](/javascript-api/k6-net-grpc/constants)| Define constants to distinguish between [gRPC Response](/javascript-api/k6-net-grpc/response) statuses. |
23
24
24
-
| Constant | Description |
25
-
|----------|-------------|
26
-
|`StatusOK`| OK is returned on success. |
27
-
|`StatusCanceled`| Canceled indicates the operation was canceled (typically by the caller). |
28
-
|`StatusUnknown`| Unknown error. |
29
-
|`StatusInvalidArgument`| InvalidArgument indicates the client specified an invalid argument. |
30
-
|`StatusDeadlineExceeded`| DeadlineExceeded means operation expired before completion. |
31
-
|`StatusNotFound`| NotFound means some requested entity (e.g., file or directory) was not found. |
32
-
|`StatusAlreadyExists`| AlreadyExists means an attempt to create an entity failed because one already exists. |
33
-
|`StatusPermissionDenied`| PermissionDenied indicates the caller does not have permission to execute the specified operation. |
34
-
|`StatusResourceExhausted`| ResourceExhausted indicates some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. |
35
-
|`StatusFailedPrecondition`| FailedPrecondition indicates operation was rejected because the system is not in a state required for the operation's execution. |
36
-
|`StatusAborted`| Aborted indicates the operation was aborted, typically due to a concurrency issue like sequencer check failures, transaction aborts, etc. |
37
-
|`StatusOutOfRange`| OutOfRange means operation was attempted past the valid range. E.g., seeking or reading past end of file. |
38
-
|`StatusUnimplemented`| Unimplemented indicates operation is not implemented or not supported/enabled in this service. |
39
-
|`StatusInternal`| Internal errors. Means some invariants expected by the underlying system have been broken. |
40
-
|`StatusUnavailable`| Unavailable indicates the service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff. Note that it is not always safe to retry non-idempotent operations. |
41
-
|`StatusDataLoss`| DataLoss indicates unrecoverable data loss or corruption. |
42
-
|`StatusUnauthenticated`| Unauthenticated indicates the request does not have valid authentication credentials for the operation. |
Copy file name to clipboardExpand all lines: src/data/markdown/docs/02 javascript api/09 k6-net-grpc/10-Client.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ title: Client
11
11
|[Client.load(importPaths, ...protoFiles)](/javascript-api/k6-net-grpc/client/client-load-importpaths----protofiles)| Loads and parses the given protocol buffer definitions to be made available for RPC requests. |
12
12
|[Client.connect(address [,params])](/javascript-api/k6-net-grpc/client/client-connect-address-params)| Opens a connection to the given gRPC server. |
13
13
|[Client.invoke(url, request [,params])](/javascript-api/k6-net-grpc/client/client-invoke-url-request-params)| Makes an unary RPC for the given service/method and returns a [Response](/javascript-api/k6-net-grpc/response). |
14
+
|[Client.close()](/javascript-api/k6-net-grpc/client/client-close)| Close the connection to the gRPC service. |
Copy file name to clipboardExpand all lines: src/data/markdown/docs/02 javascript api/09 k6-net-grpc/20 Client/20-Client-connect-connect-address-params.md
Opens a connection to a gRPC server; will block until a connection is made or a connection error is thrown. Cannot be called during the [`init` phase](/using-k6/test-life-cycle).
6
6
7
-
See [Client.close()]() to close the connection.
7
+
See [Client.close()](/javascript-api/k6-net-grpc/client/client-close) to close the connection.
Copy file name to clipboardExpand all lines: src/data/markdown/docs/02 javascript api/09 k6-net-grpc/30-Response.md
+30-1Lines changed: 30 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,37 @@ title: "Response"
4
4
5
5
| Name | Type | Description |
6
6
|------|------|-------------|
7
-
|`Response.status`| number | The response gRPC status code. Use the gRPC status constants to check equality. |
7
+
|`Response.status`| number | The response gRPC status code. Use the gRPC [status constants](/javascript-api/k6-net-grpc/constants) to check equality. |
8
8
|`Response.message`| object | The successful protobuf message, serialized to JSON. Will be `null` if `status !== grpc.StatusOK`. |
9
9
|`Response.headers`| object | Key-value pairs representing all the metadata headers returned by the gRPC server. |
10
10
|`Response.trailers`| object | Key-value pairs representing all the metadata trailers returned by the gRPC server. |
11
11
|`Response.error`| object | If `status !== grpc.StatusOK` then the error protobuf message, serialized to JSON; otherwise `null`. |
Define constants to distinguish between [gRPC Response](/javascript-api/k6-net-grpc/response) statuses.
6
+
7
+
| Constant | Description |
8
+
|----------|-------------|
9
+
|`StatusOK`| OK is returned on success. |
10
+
|`StatusCanceled`| Canceled indicates the operation was canceled (typically by the caller). |
11
+
|`StatusUnknown`| Unknown error. |
12
+
|`StatusInvalidArgument`| InvalidArgument indicates the client specified an invalid argument. |
13
+
|`StatusDeadlineExceeded`| DeadlineExceeded means operation expired before completion. |
14
+
|`StatusNotFound`| NotFound means some requested entity (e.g., file or directory) was not found. |
15
+
|`StatusAlreadyExists`| AlreadyExists means an attempt to create an entity failed because one already exists. |
16
+
|`StatusPermissionDenied`| PermissionDenied indicates the caller does not have permission to execute the specified operation. |
17
+
|`StatusResourceExhausted`| ResourceExhausted indicates some resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space. |
18
+
|`StatusFailedPrecondition`| FailedPrecondition indicates operation was rejected because the system is not in a state required for the operation's execution. |
19
+
|`StatusAborted`| Aborted indicates the operation was aborted, typically due to a concurrency issue like sequencer check failures, transaction aborts, etc. |
20
+
|`StatusOutOfRange`| OutOfRange means operation was attempted past the valid range. E.g., seeking or reading past end of file. |
21
+
|`StatusUnimplemented`| Unimplemented indicates operation is not implemented or not supported/enabled in this service. |
22
+
|`StatusInternal`| Internal errors. Means some invariants expected by the underlying system have been broken. |
23
+
|`StatusUnavailable`| Unavailable indicates the service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff. Note that it is not always safe to retry non-idempotent operations. |
24
+
|`StatusDataLoss`| DataLoss indicates unrecoverable data loss or corruption. |
25
+
|`StatusUnauthenticated`| Unauthenticated indicates the request does not have valid authentication credentials for the operation. |
0 commit comments