google-cloud-notebooks 2.4.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +3 -3
- data/README.md +33 -2
- data/lib/google/cloud/notebooks/version.rb +1 -1
- data/lib/google/cloud/notebooks.rb +107 -1
- metadata +13 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12fa26b9b17a95c70ad93b1957924e4bca151639e42fbc0ea0da2714f0004aaf
|
4
|
+
data.tar.gz: 18f26f24817f69b355b44667f397ef80ba94040e316f27a3a5dfd269b8b3c6e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a3f76cf5d2d843a1072c193b6695ffcdcc67e57d67906e019899c2527339037d2cebcf6c4bbc9c6dfc59e65c23ffb2e65141e298351f010c665a0a0216b51be
|
7
|
+
data.tar.gz: 99a1bba2f72854ec0cbcb2d22d1d88487dcece13defeda86dd88e6b1c902c118128a6e01a2496787b1c4829fb3dd306982537c1e3e37380ec049fd75e58498a9
|
data/AUTHENTICATION.md
CHANGED
@@ -56,7 +56,7 @@ To configure a credentials file for an individual client initialization:
|
|
56
56
|
```ruby
|
57
57
|
require "google/cloud/notebooks"
|
58
58
|
|
59
|
-
client = Google::Cloud::Notebooks.
|
59
|
+
client = Google::Cloud::Notebooks.managed_notebook_service do |config|
|
60
60
|
config.credentials = "path/to/credentialfile.json"
|
61
61
|
end
|
62
62
|
```
|
@@ -70,7 +70,7 @@ Google::Cloud::Notebooks.configure do |config|
|
|
70
70
|
config.credentials = "path/to/credentialfile.json"
|
71
71
|
end
|
72
72
|
|
73
|
-
client = Google::Cloud::Notebooks.
|
73
|
+
client = Google::Cloud::Notebooks.managed_notebook_service
|
74
74
|
```
|
75
75
|
|
76
76
|
### Environment Variables
|
@@ -100,7 +100,7 @@ require "google/cloud/notebooks"
|
|
100
100
|
|
101
101
|
ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
|
102
102
|
|
103
|
-
client = Google::Cloud::Notebooks.
|
103
|
+
client = Google::Cloud::Notebooks.managed_notebook_service
|
104
104
|
```
|
105
105
|
|
106
106
|
### Local ADC file
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ constructing client objects. Reference documentation for the client objects
|
|
17
17
|
themselves can be found in the client library documentation for the versioned
|
18
18
|
client gems:
|
19
19
|
[google-cloud-notebooks-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-notebooks-v1/latest),
|
20
|
-
[google-cloud-notebooks-
|
20
|
+
[google-cloud-notebooks-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-notebooks-v2/latest).
|
21
21
|
|
22
22
|
See also the [Product Documentation](https://cloud.google.com/ai-platform-notebooks)
|
23
23
|
for more usage information.
|
@@ -35,9 +35,40 @@ In order to use this library, you first need to go through the following steps:
|
|
35
35
|
1. [Enable the API.](https://console.cloud.google.com/apis/library/notebooks.googleapis.com)
|
36
36
|
1. {file:AUTHENTICATION.md Set up authentication.}
|
37
37
|
|
38
|
+
## Debug Logging
|
39
|
+
|
40
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
41
|
+
your application's integration with the API. When logging is activated, key
|
42
|
+
events such as requests and responses, along with data payloads and metadata
|
43
|
+
such as headers and client configuration, are logged to the standard error
|
44
|
+
stream.
|
45
|
+
|
46
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
47
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
48
|
+
customers, private keys, or other security data that could be compromising if
|
49
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
50
|
+
the principle of least access. Google also recommends that Client Library Debug
|
51
|
+
Logging be enabled only temporarily during active debugging, and not used
|
52
|
+
permanently in production.
|
53
|
+
|
54
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
55
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
56
|
+
list of client library gem names. This will select the default logging behavior,
|
57
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
58
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
59
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
60
|
+
results in logs appearing alongside your application logs in the
|
61
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
62
|
+
|
63
|
+
Debug logging also requires that the versioned clients for this service be
|
64
|
+
sufficiently recent, released after about Dec 10, 2024. If logging is not
|
65
|
+
working, try updating the versioned clients in your bundle or installed gems:
|
66
|
+
[google-cloud-notebooks-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-notebooks-v1/latest),
|
67
|
+
[google-cloud-notebooks-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-notebooks-v2/latest).
|
68
|
+
|
38
69
|
## Supported Ruby Versions
|
39
70
|
|
40
|
-
This library is supported on Ruby
|
71
|
+
This library is supported on Ruby 3.0+.
|
41
72
|
|
42
73
|
Google provides official support for Ruby versions that are actively supported
|
43
74
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
@@ -45,6 +45,76 @@ end
|
|
45
45
|
module Google
|
46
46
|
module Cloud
|
47
47
|
module Notebooks
|
48
|
+
##
|
49
|
+
# Create a new client object for ManagedNotebookService.
|
50
|
+
#
|
51
|
+
# By default, this returns an instance of
|
52
|
+
# [Google::Cloud::Notebooks::V1::ManagedNotebookService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-notebooks-v1/latest/Google-Cloud-Notebooks-V1-ManagedNotebookService-Client)
|
53
|
+
# for a gRPC client for version V1 of the API.
|
54
|
+
# However, you can specify a different API version by passing it in the
|
55
|
+
# `version` parameter. If the ManagedNotebookService service is
|
56
|
+
# supported by that API version, and the corresponding gem is available, the
|
57
|
+
# appropriate versioned client will be returned.
|
58
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
59
|
+
# the `transport` parameter.
|
60
|
+
#
|
61
|
+
# Raises an exception if the currently installed versioned client gem for the
|
62
|
+
# given API version does not support the given transport of the ManagedNotebookService service.
|
63
|
+
# You can determine whether the method will succeed by calling
|
64
|
+
# {Google::Cloud::Notebooks.managed_notebook_service_available?}.
|
65
|
+
#
|
66
|
+
# ## About ManagedNotebookService
|
67
|
+
#
|
68
|
+
# API v1 service for Managed Notebooks.
|
69
|
+
#
|
70
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
71
|
+
# Defaults to `:v1`.
|
72
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
73
|
+
# @return [::Object] A client object for the specified version.
|
74
|
+
#
|
75
|
+
def self.managed_notebook_service version: :v1, transport: :grpc, &block
|
76
|
+
require "google/cloud/notebooks/#{version.to_s.downcase}"
|
77
|
+
|
78
|
+
package_name = Google::Cloud::Notebooks
|
79
|
+
.constants
|
80
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
81
|
+
.first
|
82
|
+
service_module = Google::Cloud::Notebooks.const_get(package_name).const_get(:ManagedNotebookService)
|
83
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
84
|
+
service_module.const_get(:Client).new(&block)
|
85
|
+
end
|
86
|
+
|
87
|
+
##
|
88
|
+
# Determines whether the ManagedNotebookService service is supported by the current client.
|
89
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::Notebooks.managed_notebook_service}.
|
90
|
+
# If false, that method will raise an exception. This could happen if the given
|
91
|
+
# API version does not exist or does not support the ManagedNotebookService service,
|
92
|
+
# or if the versioned client gem needs an update to support the ManagedNotebookService service.
|
93
|
+
#
|
94
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
95
|
+
# Defaults to `:v1`.
|
96
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
97
|
+
# @return [boolean] Whether the service is available.
|
98
|
+
#
|
99
|
+
def self.managed_notebook_service_available? version: :v1, transport: :grpc
|
100
|
+
require "google/cloud/notebooks/#{version.to_s.downcase}"
|
101
|
+
package_name = Google::Cloud::Notebooks
|
102
|
+
.constants
|
103
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
104
|
+
.first
|
105
|
+
return false unless package_name
|
106
|
+
service_module = Google::Cloud::Notebooks.const_get package_name
|
107
|
+
return false unless service_module.const_defined? :ManagedNotebookService
|
108
|
+
service_module = service_module.const_get :ManagedNotebookService
|
109
|
+
if transport == :rest
|
110
|
+
return false unless service_module.const_defined? :Rest
|
111
|
+
service_module = service_module.const_get :Rest
|
112
|
+
end
|
113
|
+
service_module.const_defined? :Client
|
114
|
+
rescue ::LoadError
|
115
|
+
false
|
116
|
+
end
|
117
|
+
|
48
118
|
##
|
49
119
|
# Create a new client object for NotebookService.
|
50
120
|
#
|
@@ -58,9 +128,14 @@ module Google
|
|
58
128
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
59
129
|
# the `transport` parameter.
|
60
130
|
#
|
131
|
+
# Raises an exception if the currently installed versioned client gem for the
|
132
|
+
# given API version does not support the given transport of the NotebookService service.
|
133
|
+
# You can determine whether the method will succeed by calling
|
134
|
+
# {Google::Cloud::Notebooks.notebook_service_available?}.
|
135
|
+
#
|
61
136
|
# ## About NotebookService
|
62
137
|
#
|
63
|
-
# API
|
138
|
+
# API v1 service for Cloud AI Platform Notebooks.
|
64
139
|
#
|
65
140
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
66
141
|
# Defaults to `:v1`.
|
@@ -79,6 +154,37 @@ module Google
|
|
79
154
|
service_module.const_get(:Client).new(&block)
|
80
155
|
end
|
81
156
|
|
157
|
+
##
|
158
|
+
# Determines whether the NotebookService service is supported by the current client.
|
159
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::Notebooks.notebook_service}.
|
160
|
+
# If false, that method will raise an exception. This could happen if the given
|
161
|
+
# API version does not exist or does not support the NotebookService service,
|
162
|
+
# or if the versioned client gem needs an update to support the NotebookService service.
|
163
|
+
#
|
164
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
165
|
+
# Defaults to `:v1`.
|
166
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
167
|
+
# @return [boolean] Whether the service is available.
|
168
|
+
#
|
169
|
+
def self.notebook_service_available? version: :v1, transport: :grpc
|
170
|
+
require "google/cloud/notebooks/#{version.to_s.downcase}"
|
171
|
+
package_name = Google::Cloud::Notebooks
|
172
|
+
.constants
|
173
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
174
|
+
.first
|
175
|
+
return false unless package_name
|
176
|
+
service_module = Google::Cloud::Notebooks.const_get package_name
|
177
|
+
return false unless service_module.const_defined? :NotebookService
|
178
|
+
service_module = service_module.const_get :NotebookService
|
179
|
+
if transport == :rest
|
180
|
+
return false unless service_module.const_defined? :Rest
|
181
|
+
service_module = service_module.const_get :Rest
|
182
|
+
end
|
183
|
+
service_module.const_defined? :Client
|
184
|
+
rescue ::LoadError
|
185
|
+
false
|
186
|
+
end
|
187
|
+
|
82
188
|
##
|
83
189
|
# Configure the google-cloud-notebooks library.
|
84
190
|
#
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-notebooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-02-13 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: google-cloud-core
|
@@ -28,42 +27,30 @@ dependencies:
|
|
28
27
|
name: google-cloud-notebooks-v1
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
|
-
- - "
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0.8'
|
34
|
-
- - "<"
|
30
|
+
- - "~>"
|
35
31
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
32
|
+
version: '1.0'
|
37
33
|
type: :runtime
|
38
34
|
prerelease: false
|
39
35
|
version_requirements: !ruby/object:Gem::Requirement
|
40
36
|
requirements:
|
41
|
-
- - "
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: '0.8'
|
44
|
-
- - "<"
|
37
|
+
- - "~>"
|
45
38
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
39
|
+
version: '1.0'
|
47
40
|
- !ruby/object:Gem::Dependency
|
48
|
-
name: google-cloud-notebooks-
|
41
|
+
name: google-cloud-notebooks-v2
|
49
42
|
requirement: !ruby/object:Gem::Requirement
|
50
43
|
requirements:
|
51
|
-
- - "
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0.9'
|
54
|
-
- - "<"
|
44
|
+
- - "~>"
|
55
45
|
- !ruby/object:Gem::Version
|
56
|
-
version:
|
46
|
+
version: '1.0'
|
57
47
|
type: :runtime
|
58
48
|
prerelease: false
|
59
49
|
version_requirements: !ruby/object:Gem::Requirement
|
60
50
|
requirements:
|
61
|
-
- - "
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
version: '0.9'
|
64
|
-
- - "<"
|
51
|
+
- - "~>"
|
65
52
|
- !ruby/object:Gem::Version
|
66
|
-
version:
|
53
|
+
version: '1.0'
|
67
54
|
description: AI Platform Notebooks makes it easy to manage JupyterLab instances through
|
68
55
|
a protected, publicly available notebook instance URL. A JupyterLab instance is
|
69
56
|
a Deep Learning virtual machine instance with the latest machine learning and data
|
@@ -84,7 +71,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
|
|
84
71
|
licenses:
|
85
72
|
- Apache-2.0
|
86
73
|
metadata: {}
|
87
|
-
post_install_message:
|
88
74
|
rdoc_options: []
|
89
75
|
require_paths:
|
90
76
|
- lib
|
@@ -92,15 +78,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
92
78
|
requirements:
|
93
79
|
- - ">="
|
94
80
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
81
|
+
version: '3.0'
|
96
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
83
|
requirements:
|
98
84
|
- - ">="
|
99
85
|
- !ruby/object:Gem::Version
|
100
86
|
version: '0'
|
101
87
|
requirements: []
|
102
|
-
rubygems_version: 3.
|
103
|
-
signing_key:
|
88
|
+
rubygems_version: 3.6.3
|
104
89
|
specification_version: 4
|
105
90
|
summary: API Client library for the AI Platform Notebooks API
|
106
91
|
test_files: []
|