Close httplib2 connections.
create(body=None, requestId=None, runtimeId=None, x__xgafv=None)
Creates a Colab runtime assignment. When runtime creation is refused with a [`FAILED_PRECONDITION` (code: 9)](https://github.com/googleapis/googleapis/blob/437254f595a380cd9323111700ce0fcf9d6d2c21/google/rpc/code.proto#L128) error, a more specific error reason will be returned in the details of the Operation error wrapped in google.rpc.ErrorInfo. A requests-per-minute-per-project and a requests-per-minute-per-user quota are enforced on this API. To see the exact limit your project is subject to, after you enable the Colab API, view it in your project's [Quotas & System Limits](https://console.cloud.google.com/apis/api/colaboratory.googleapis.com/quotas) page. Note that there is no usage reporting on the per-user limit and it is not overridable at the individual user level.
delete(name, allowMissing=None, x__xgafv=None)
Deletes a Colab runtime assignment. **Best Practices:** - Avoid deleting runtimes unless necessary. Reuse runtimes for efficiency. - Open a new Jupyter session on an existing runtime for state isolation.
Gets a Colab runtime assigned to the requesting user.
Lists Colab runtimes assigned to the requesting user.
close()
Close httplib2 connections.
create(body=None, requestId=None, runtimeId=None, x__xgafv=None)
Creates a Colab runtime assignment. When runtime creation is refused with a [`FAILED_PRECONDITION` (code: 9)](https://github.com/googleapis/googleapis/blob/437254f595a380cd9323111700ce0fcf9d6d2c21/google/rpc/code.proto#L128) error, a more specific error reason will be returned in the details of the Operation error wrapped in google.rpc.ErrorInfo. A requests-per-minute-per-project and a requests-per-minute-per-user quota are enforced on this API. To see the exact limit your project is subject to, after you enable the Colab API, view it in your project's [Quotas & System Limits](https://console.cloud.google.com/apis/api/colaboratory.googleapis.com/quotas) page. Note that there is no usage reporting on the per-user limit and it is not overridable at the individual user level.
Args:
body: object, The request body.
The object takes the form of:
{ # A Colab managed runtime. This is essentially a Jupyter server that runs on Google infrastructure. Clients should use the connection_info provided to connect to the runtime, and leverage the standard Jupyter [REST API](https://jupyter-server.readthedocs.io/en/stable/developers/rest-api.html) and/or [client library](https://jupyter-client.readthedocs.io/en/stable/api/jupyter_client.html) to interact with the runtime.
"connectionInfo": { # Connection info used to authenticate to the runtime. # Output only. The connection info used to authenticate to the runtime.
"expireTime": "A String", # Required. Output only. The expiration time of the runtime proxy token.
"token": "A String", # Required. Output only. The runtime proxy token. This is a short-lived credential used to authenticate to the runtime. Clients should set this token as the value of the `X-Colab-Runtime-Proxy-Token` HTTP header when connecting to the runtime, and call the GetRuntime API to refresh this token when approaching `expire_time`.
"url": "A String", # Required. Output only. The authenticated URL that can be used to connect to the runtime.
},
"name": "A String", # Identifier. The name of the runtime in the format `runtimes/{runtime_id}`, where `runtime_id` is either the value supplied via CreateRuntimeRequest.runtime_id or, if none was supplied, a random ID generated by the backend.
"runtimeSpec": { # Key fields that uniquely identify a runtime spec. # Required. The specification of the runtime. When calling `CreateRuntime`, this field should be set to an eligible runtime spec obtained from the ListRuntimeSpecsResponse.
"accelerator": "A String", # Required. Runtime accelerator model name (e.g., "T4", "L4", "A100"). For CPU runtime specs, this field will be "NONE".
"shape": "A String", # Required. Runtime shape.
"variant": "A String", # Required. Runtime variant.
},
"version": "A String", # Optional. The version of the runtime image. See [Colab Runtime Version FAQ](https://research.google.com/colaboratory/runtime-version-faq.html) for supported runtime versions. If omitted (empty), the latest runtime image is used.
}
requestId: string, Optional. A unique identifier for this request. This request is only idempotent if a `request_id` is provided. See [AIP-155](https://google.aip.dev/155) for more details. If provided, the request ID must be in UUID4 format per https://linter.aip.dev/155/request-id-format.
runtimeId: string, Optional. A unique identifier for the runtime. If not supplied, a random ID will be generated. If a runtime with the given ID owned by the requesting user already exists, a completed Operation with an [`ALREADY_EXISTS` (code: 6)](https://github.com/googleapis/googleapis/blob/437254f595a380cd9323111700ce0fcf9d6d2c21/google/rpc/code.proto#L84) error will be returned. See [AIP-133](https://google.aip.dev/133#user-specified-ids) for more details. The ID must conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034), specifically: - 1 to 63 characters - Lower-case letters, digits, and hyphens - Start with a letter - End with a letter or digit
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # This resource represents a long-running operation that is the result of a network API call.
"done": True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
"error": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
"code": 42, # The status code, which should be an enum value of google.rpc.Code.
"details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
{
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
],
"message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
},
"metadata": { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
"name": "A String", # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
"response": { # The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
"a_key": "", # Properties of the object. Contains field @type with type URL.
},
}
delete(name, allowMissing=None, x__xgafv=None)
Deletes a Colab runtime assignment. **Best Practices:** - Avoid deleting runtimes unless necessary. Reuse runtimes for efficiency. - Open a new Jupyter session on an existing runtime for state isolation.
Args:
name: string, Required. The name of the runtime to unassign. Format: `runtimes/{runtime_id}`. (required)
allowMissing: boolean, Optional. If set to `true`, and the runtime is not found, the request will succeed but no action will be taken on the server.
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
}
get(name, x__xgafv=None)
Gets a Colab runtime assigned to the requesting user.
Args:
name: string, Required. The name of the runtime to retrieve. Format: `runtimes/{runtime_id}`. (required)
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # A Colab managed runtime. This is essentially a Jupyter server that runs on Google infrastructure. Clients should use the connection_info provided to connect to the runtime, and leverage the standard Jupyter [REST API](https://jupyter-server.readthedocs.io/en/stable/developers/rest-api.html) and/or [client library](https://jupyter-client.readthedocs.io/en/stable/api/jupyter_client.html) to interact with the runtime.
"connectionInfo": { # Connection info used to authenticate to the runtime. # Output only. The connection info used to authenticate to the runtime.
"expireTime": "A String", # Required. Output only. The expiration time of the runtime proxy token.
"token": "A String", # Required. Output only. The runtime proxy token. This is a short-lived credential used to authenticate to the runtime. Clients should set this token as the value of the `X-Colab-Runtime-Proxy-Token` HTTP header when connecting to the runtime, and call the GetRuntime API to refresh this token when approaching `expire_time`.
"url": "A String", # Required. Output only. The authenticated URL that can be used to connect to the runtime.
},
"name": "A String", # Identifier. The name of the runtime in the format `runtimes/{runtime_id}`, where `runtime_id` is either the value supplied via CreateRuntimeRequest.runtime_id or, if none was supplied, a random ID generated by the backend.
"runtimeSpec": { # Key fields that uniquely identify a runtime spec. # Required. The specification of the runtime. When calling `CreateRuntime`, this field should be set to an eligible runtime spec obtained from the ListRuntimeSpecsResponse.
"accelerator": "A String", # Required. Runtime accelerator model name (e.g., "T4", "L4", "A100"). For CPU runtime specs, this field will be "NONE".
"shape": "A String", # Required. Runtime shape.
"variant": "A String", # Required. Runtime variant.
},
"version": "A String", # Optional. The version of the runtime image. See [Colab Runtime Version FAQ](https://research.google.com/colaboratory/runtime-version-faq.html) for supported runtime versions. If omitted (empty), the latest runtime image is used.
}
list(x__xgafv=None)
Lists Colab runtimes assigned to the requesting user.
Args:
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response message for `ListRuntimes`.
"runtimes": [ # The list of runtimes assigned to the requesting user.
{ # A Colab managed runtime. This is essentially a Jupyter server that runs on Google infrastructure. Clients should use the connection_info provided to connect to the runtime, and leverage the standard Jupyter [REST API](https://jupyter-server.readthedocs.io/en/stable/developers/rest-api.html) and/or [client library](https://jupyter-client.readthedocs.io/en/stable/api/jupyter_client.html) to interact with the runtime.
"connectionInfo": { # Connection info used to authenticate to the runtime. # Output only. The connection info used to authenticate to the runtime.
"expireTime": "A String", # Required. Output only. The expiration time of the runtime proxy token.
"token": "A String", # Required. Output only. The runtime proxy token. This is a short-lived credential used to authenticate to the runtime. Clients should set this token as the value of the `X-Colab-Runtime-Proxy-Token` HTTP header when connecting to the runtime, and call the GetRuntime API to refresh this token when approaching `expire_time`.
"url": "A String", # Required. Output only. The authenticated URL that can be used to connect to the runtime.
},
"name": "A String", # Identifier. The name of the runtime in the format `runtimes/{runtime_id}`, where `runtime_id` is either the value supplied via CreateRuntimeRequest.runtime_id or, if none was supplied, a random ID generated by the backend.
"runtimeSpec": { # Key fields that uniquely identify a runtime spec. # Required. The specification of the runtime. When calling `CreateRuntime`, this field should be set to an eligible runtime spec obtained from the ListRuntimeSpecsResponse.
"accelerator": "A String", # Required. Runtime accelerator model name (e.g., "T4", "L4", "A100"). For CPU runtime specs, this field will be "NONE".
"shape": "A String", # Required. Runtime shape.
"variant": "A String", # Required. Runtime variant.
},
"version": "A String", # Optional. The version of the runtime image. See [Colab Runtime Version FAQ](https://research.google.com/colaboratory/runtime-version-faq.html) for supported runtime versions. If omitted (empty), the latest runtime image is used.
},
],
}