1 | <?php
|
---|
2 | /*
|
---|
3 | * Copyright 2014 Google Inc.
|
---|
4 | *
|
---|
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
---|
6 | * use this file except in compliance with the License. You may obtain a copy of
|
---|
7 | * the License at
|
---|
8 | *
|
---|
9 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
10 | *
|
---|
11 | * Unless required by applicable law or agreed to in writing, software
|
---|
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
---|
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
---|
14 | * License for the specific language governing permissions and limitations under
|
---|
15 | * the License.
|
---|
16 | */
|
---|
17 |
|
---|
18 | namespace Google\Service\Aiplatform\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1AssignNotebookRuntimeRequest;
|
---|
21 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1ListNotebookRuntimesResponse;
|
---|
22 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1NotebookRuntime;
|
---|
23 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1StartNotebookRuntimeRequest;
|
---|
24 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1StopNotebookRuntimeRequest;
|
---|
25 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1UpgradeNotebookRuntimeRequest;
|
---|
26 | use Google\Service\Aiplatform\GoogleLongrunningOperation;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "notebookRuntimes" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $aiplatformService = new Google\Service\Aiplatform(...);
|
---|
33 | * $notebookRuntimes = $aiplatformService->projects_locations_notebookRuntimes;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class ProjectsLocationsNotebookRuntimes extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Assigns a NotebookRuntime to a user for a particular Notebook file. This
|
---|
40 | * method will either returns an existing assignment or generates a new one.
|
---|
41 | * (notebookRuntimes.assign)
|
---|
42 | *
|
---|
43 | * @param string $parent Required. The resource name of the Location to get the
|
---|
44 | * NotebookRuntime assignment. Format: `projects/{project}/locations/{location}`
|
---|
45 | * @param GoogleCloudAiplatformV1AssignNotebookRuntimeRequest $postBody
|
---|
46 | * @param array $optParams Optional parameters.
|
---|
47 | * @return GoogleLongrunningOperation
|
---|
48 | * @throws \Google\Service\Exception
|
---|
49 | */
|
---|
50 | public function assign($parent, GoogleCloudAiplatformV1AssignNotebookRuntimeRequest $postBody, $optParams = [])
|
---|
51 | {
|
---|
52 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
53 | $params = array_merge($params, $optParams);
|
---|
54 | return $this->call('assign', [$params], GoogleLongrunningOperation::class);
|
---|
55 | }
|
---|
56 | /**
|
---|
57 | * Deletes a NotebookRuntime. (notebookRuntimes.delete)
|
---|
58 | *
|
---|
59 | * @param string $name Required. The name of the NotebookRuntime resource to be
|
---|
60 | * deleted. Instead of checking whether the name is in valid NotebookRuntime
|
---|
61 | * resource name format, directly throw NotFound exception if there is no such
|
---|
62 | * NotebookRuntime in spanner.
|
---|
63 | * @param array $optParams Optional parameters.
|
---|
64 | * @return GoogleLongrunningOperation
|
---|
65 | * @throws \Google\Service\Exception
|
---|
66 | */
|
---|
67 | public function delete($name, $optParams = [])
|
---|
68 | {
|
---|
69 | $params = ['name' => $name];
|
---|
70 | $params = array_merge($params, $optParams);
|
---|
71 | return $this->call('delete', [$params], GoogleLongrunningOperation::class);
|
---|
72 | }
|
---|
73 | /**
|
---|
74 | * Gets a NotebookRuntime. (notebookRuntimes.get)
|
---|
75 | *
|
---|
76 | * @param string $name Required. The name of the NotebookRuntime resource.
|
---|
77 | * Instead of checking whether the name is in valid NotebookRuntime resource
|
---|
78 | * name format, directly throw NotFound exception if there is no such
|
---|
79 | * NotebookRuntime in spanner.
|
---|
80 | * @param array $optParams Optional parameters.
|
---|
81 | * @return GoogleCloudAiplatformV1NotebookRuntime
|
---|
82 | * @throws \Google\Service\Exception
|
---|
83 | */
|
---|
84 | public function get($name, $optParams = [])
|
---|
85 | {
|
---|
86 | $params = ['name' => $name];
|
---|
87 | $params = array_merge($params, $optParams);
|
---|
88 | return $this->call('get', [$params], GoogleCloudAiplatformV1NotebookRuntime::class);
|
---|
89 | }
|
---|
90 | /**
|
---|
91 | * Lists NotebookRuntimes in a Location.
|
---|
92 | * (notebookRuntimes.listProjectsLocationsNotebookRuntimes)
|
---|
93 | *
|
---|
94 | * @param string $parent Required. The resource name of the Location from which
|
---|
95 | * to list the NotebookRuntimes. Format:
|
---|
96 | * `projects/{project}/locations/{location}`
|
---|
97 | * @param array $optParams Optional parameters.
|
---|
98 | *
|
---|
99 | * @opt_param string filter Optional. An expression for filtering the results of
|
---|
100 | * the request. For field names both snake_case and camelCase are supported. *
|
---|
101 | * `notebookRuntime` supports = and !=. `notebookRuntime` represents the
|
---|
102 | * NotebookRuntime ID, i.e. the last segment of the NotebookRuntime's resource
|
---|
103 | * name. * `displayName` supports = and != and regex. *
|
---|
104 | * `notebookRuntimeTemplate` supports = and !=. `notebookRuntimeTemplate`
|
---|
105 | * represents the NotebookRuntimeTemplate ID, i.e. the last segment of the
|
---|
106 | * NotebookRuntimeTemplate's resource name. * `healthState` supports = and !=.
|
---|
107 | * healthState enum: [HEALTHY, UNHEALTHY, HEALTH_STATE_UNSPECIFIED]. *
|
---|
108 | * `runtimeState` supports = and !=. runtimeState enum:
|
---|
109 | * [RUNTIME_STATE_UNSPECIFIED, RUNNING, BEING_STARTED, BEING_STOPPED, STOPPED,
|
---|
110 | * BEING_UPGRADED, ERROR, INVALID]. * `runtimeUser` supports = and !=. * API
|
---|
111 | * version is UI only: `uiState` supports = and !=. uiState enum:
|
---|
112 | * [UI_RESOURCE_STATE_UNSPECIFIED, UI_RESOURCE_STATE_BEING_CREATED,
|
---|
113 | * UI_RESOURCE_STATE_ACTIVE, UI_RESOURCE_STATE_BEING_DELETED,
|
---|
114 | * UI_RESOURCE_STATE_CREATION_FAILED]. * `notebookRuntimeType` supports = and
|
---|
115 | * !=. notebookRuntimeType enum: [USER_DEFINED, ONE_CLICK]. Some examples: *
|
---|
116 | * `notebookRuntime="notebookRuntime123"` * `displayName="myDisplayName"` and
|
---|
117 | * `displayName=~"myDisplayNameRegex"` *
|
---|
118 | * `notebookRuntimeTemplate="notebookRuntimeTemplate321"` *
|
---|
119 | * `healthState=HEALTHY` * `runtimeState=RUNNING` *
|
---|
120 | * `runtimeUser="test@google.com"` * `uiState=UI_RESOURCE_STATE_BEING_DELETED` *
|
---|
121 | * `notebookRuntimeType=USER_DEFINED`
|
---|
122 | * @opt_param string orderBy Optional. A comma-separated list of fields to order
|
---|
123 | * by, sorted in ascending order. Use "desc" after a field name for descending.
|
---|
124 | * Supported fields: * `display_name` * `create_time` * `update_time` Example:
|
---|
125 | * `display_name, create_time desc`.
|
---|
126 | * @opt_param int pageSize Optional. The standard list page size.
|
---|
127 | * @opt_param string pageToken Optional. The standard list page token. Typically
|
---|
128 | * obtained via ListNotebookRuntimesResponse.next_page_token of the previous
|
---|
129 | * NotebookService.ListNotebookRuntimes call.
|
---|
130 | * @opt_param string readMask Optional. Mask specifying which fields to read.
|
---|
131 | * @return GoogleCloudAiplatformV1ListNotebookRuntimesResponse
|
---|
132 | * @throws \Google\Service\Exception
|
---|
133 | */
|
---|
134 | public function listProjectsLocationsNotebookRuntimes($parent, $optParams = [])
|
---|
135 | {
|
---|
136 | $params = ['parent' => $parent];
|
---|
137 | $params = array_merge($params, $optParams);
|
---|
138 | return $this->call('list', [$params], GoogleCloudAiplatformV1ListNotebookRuntimesResponse::class);
|
---|
139 | }
|
---|
140 | /**
|
---|
141 | * Starts a NotebookRuntime. (notebookRuntimes.start)
|
---|
142 | *
|
---|
143 | * @param string $name Required. The name of the NotebookRuntime resource to be
|
---|
144 | * started. Instead of checking whether the name is in valid NotebookRuntime
|
---|
145 | * resource name format, directly throw NotFound exception if there is no such
|
---|
146 | * NotebookRuntime in spanner.
|
---|
147 | * @param GoogleCloudAiplatformV1StartNotebookRuntimeRequest $postBody
|
---|
148 | * @param array $optParams Optional parameters.
|
---|
149 | * @return GoogleLongrunningOperation
|
---|
150 | * @throws \Google\Service\Exception
|
---|
151 | */
|
---|
152 | public function start($name, GoogleCloudAiplatformV1StartNotebookRuntimeRequest $postBody, $optParams = [])
|
---|
153 | {
|
---|
154 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
155 | $params = array_merge($params, $optParams);
|
---|
156 | return $this->call('start', [$params], GoogleLongrunningOperation::class);
|
---|
157 | }
|
---|
158 | /**
|
---|
159 | * Stops a NotebookRuntime. (notebookRuntimes.stop)
|
---|
160 | *
|
---|
161 | * @param string $name Required. The name of the NotebookRuntime resource to be
|
---|
162 | * stopped. Instead of checking whether the name is in valid NotebookRuntime
|
---|
163 | * resource name format, directly throw NotFound exception if there is no such
|
---|
164 | * NotebookRuntime in spanner.
|
---|
165 | * @param GoogleCloudAiplatformV1StopNotebookRuntimeRequest $postBody
|
---|
166 | * @param array $optParams Optional parameters.
|
---|
167 | * @return GoogleLongrunningOperation
|
---|
168 | * @throws \Google\Service\Exception
|
---|
169 | */
|
---|
170 | public function stop($name, GoogleCloudAiplatformV1StopNotebookRuntimeRequest $postBody, $optParams = [])
|
---|
171 | {
|
---|
172 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
173 | $params = array_merge($params, $optParams);
|
---|
174 | return $this->call('stop', [$params], GoogleLongrunningOperation::class);
|
---|
175 | }
|
---|
176 | /**
|
---|
177 | * Upgrades a NotebookRuntime. (notebookRuntimes.upgrade)
|
---|
178 | *
|
---|
179 | * @param string $name Required. The name of the NotebookRuntime resource to be
|
---|
180 | * upgrade. Instead of checking whether the name is in valid NotebookRuntime
|
---|
181 | * resource name format, directly throw NotFound exception if there is no such
|
---|
182 | * NotebookRuntime in spanner.
|
---|
183 | * @param GoogleCloudAiplatformV1UpgradeNotebookRuntimeRequest $postBody
|
---|
184 | * @param array $optParams Optional parameters.
|
---|
185 | * @return GoogleLongrunningOperation
|
---|
186 | * @throws \Google\Service\Exception
|
---|
187 | */
|
---|
188 | public function upgrade($name, GoogleCloudAiplatformV1UpgradeNotebookRuntimeRequest $postBody, $optParams = [])
|
---|
189 | {
|
---|
190 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
191 | $params = array_merge($params, $optParams);
|
---|
192 | return $this->call('upgrade', [$params], GoogleLongrunningOperation::class);
|
---|
193 | }
|
---|
194 | }
|
---|
195 |
|
---|
196 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
197 | class_alias(ProjectsLocationsNotebookRuntimes::class, 'Google_Service_Aiplatform_Resource_ProjectsLocationsNotebookRuntimes');
|
---|