[e3d4e0a] | 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\TPU\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\TPU\GetGuestAttributesRequest;
|
---|
| 21 | use Google\Service\TPU\GetGuestAttributesResponse;
|
---|
| 22 | use Google\Service\TPU\ListNodesResponse;
|
---|
| 23 | use Google\Service\TPU\Node;
|
---|
| 24 | use Google\Service\TPU\Operation;
|
---|
| 25 | use Google\Service\TPU\StartNodeRequest;
|
---|
| 26 | use Google\Service\TPU\StopNodeRequest;
|
---|
| 27 |
|
---|
| 28 | /**
|
---|
| 29 | * The "nodes" collection of methods.
|
---|
| 30 | * Typical usage is:
|
---|
| 31 | * <code>
|
---|
| 32 | * $tpuService = new Google\Service\TPU(...);
|
---|
| 33 | * $nodes = $tpuService->projects_locations_nodes;
|
---|
| 34 | * </code>
|
---|
| 35 | */
|
---|
| 36 | class ProjectsLocationsNodes extends \Google\Service\Resource
|
---|
| 37 | {
|
---|
| 38 | /**
|
---|
| 39 | * Creates a node. (nodes.create)
|
---|
| 40 | *
|
---|
| 41 | * @param string $parent Required. The parent resource name.
|
---|
| 42 | * @param Node $postBody
|
---|
| 43 | * @param array $optParams Optional parameters.
|
---|
| 44 | *
|
---|
| 45 | * @opt_param string nodeId The unqualified resource name.
|
---|
| 46 | * @return Operation
|
---|
| 47 | * @throws \Google\Service\Exception
|
---|
| 48 | */
|
---|
| 49 | public function create($parent, Node $postBody, $optParams = [])
|
---|
| 50 | {
|
---|
| 51 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 52 | $params = array_merge($params, $optParams);
|
---|
| 53 | return $this->call('create', [$params], Operation::class);
|
---|
| 54 | }
|
---|
| 55 | /**
|
---|
| 56 | * Deletes a node. (nodes.delete)
|
---|
| 57 | *
|
---|
| 58 | * @param string $name Required. The resource name.
|
---|
| 59 | * @param array $optParams Optional parameters.
|
---|
| 60 | * @return Operation
|
---|
| 61 | * @throws \Google\Service\Exception
|
---|
| 62 | */
|
---|
| 63 | public function delete($name, $optParams = [])
|
---|
| 64 | {
|
---|
| 65 | $params = ['name' => $name];
|
---|
| 66 | $params = array_merge($params, $optParams);
|
---|
| 67 | return $this->call('delete', [$params], Operation::class);
|
---|
| 68 | }
|
---|
| 69 | /**
|
---|
| 70 | * Gets the details of a node. (nodes.get)
|
---|
| 71 | *
|
---|
| 72 | * @param string $name Required. The resource name.
|
---|
| 73 | * @param array $optParams Optional parameters.
|
---|
| 74 | * @return Node
|
---|
| 75 | * @throws \Google\Service\Exception
|
---|
| 76 | */
|
---|
| 77 | public function get($name, $optParams = [])
|
---|
| 78 | {
|
---|
| 79 | $params = ['name' => $name];
|
---|
| 80 | $params = array_merge($params, $optParams);
|
---|
| 81 | return $this->call('get', [$params], Node::class);
|
---|
| 82 | }
|
---|
| 83 | /**
|
---|
| 84 | * Retrieves the guest attributes for the node. (nodes.getGuestAttributes)
|
---|
| 85 | *
|
---|
| 86 | * @param string $name Required. The resource name.
|
---|
| 87 | * @param GetGuestAttributesRequest $postBody
|
---|
| 88 | * @param array $optParams Optional parameters.
|
---|
| 89 | * @return GetGuestAttributesResponse
|
---|
| 90 | * @throws \Google\Service\Exception
|
---|
| 91 | */
|
---|
| 92 | public function getGuestAttributes($name, GetGuestAttributesRequest $postBody, $optParams = [])
|
---|
| 93 | {
|
---|
| 94 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 95 | $params = array_merge($params, $optParams);
|
---|
| 96 | return $this->call('getGuestAttributes', [$params], GetGuestAttributesResponse::class);
|
---|
| 97 | }
|
---|
| 98 | /**
|
---|
| 99 | * Lists nodes. (nodes.listProjectsLocationsNodes)
|
---|
| 100 | *
|
---|
| 101 | * @param string $parent Required. The parent resource name.
|
---|
| 102 | * @param array $optParams Optional parameters.
|
---|
| 103 | *
|
---|
| 104 | * @opt_param int pageSize The maximum number of items to return.
|
---|
| 105 | * @opt_param string pageToken The next_page_token value returned from a
|
---|
| 106 | * previous List request, if any.
|
---|
| 107 | * @return ListNodesResponse
|
---|
| 108 | * @throws \Google\Service\Exception
|
---|
| 109 | */
|
---|
| 110 | public function listProjectsLocationsNodes($parent, $optParams = [])
|
---|
| 111 | {
|
---|
| 112 | $params = ['parent' => $parent];
|
---|
| 113 | $params = array_merge($params, $optParams);
|
---|
| 114 | return $this->call('list', [$params], ListNodesResponse::class);
|
---|
| 115 | }
|
---|
| 116 | /**
|
---|
| 117 | * Updates the configurations of a node. (nodes.patch)
|
---|
| 118 | *
|
---|
| 119 | * @param string $name Output only. Immutable. The name of the TPU.
|
---|
| 120 | * @param Node $postBody
|
---|
| 121 | * @param array $optParams Optional parameters.
|
---|
| 122 | *
|
---|
| 123 | * @opt_param string updateMask Required. Mask of fields from Node to update.
|
---|
| 124 | * Supported fields: [description, tags, labels, metadata,
|
---|
| 125 | * network_config.enable_external_ips].
|
---|
| 126 | * @return Operation
|
---|
| 127 | * @throws \Google\Service\Exception
|
---|
| 128 | */
|
---|
| 129 | public function patch($name, Node $postBody, $optParams = [])
|
---|
| 130 | {
|
---|
| 131 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 132 | $params = array_merge($params, $optParams);
|
---|
| 133 | return $this->call('patch', [$params], Operation::class);
|
---|
| 134 | }
|
---|
| 135 | /**
|
---|
| 136 | * Starts a node. (nodes.start)
|
---|
| 137 | *
|
---|
| 138 | * @param string $name Required. The resource name.
|
---|
| 139 | * @param StartNodeRequest $postBody
|
---|
| 140 | * @param array $optParams Optional parameters.
|
---|
| 141 | * @return Operation
|
---|
| 142 | * @throws \Google\Service\Exception
|
---|
| 143 | */
|
---|
| 144 | public function start($name, StartNodeRequest $postBody, $optParams = [])
|
---|
| 145 | {
|
---|
| 146 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 147 | $params = array_merge($params, $optParams);
|
---|
| 148 | return $this->call('start', [$params], Operation::class);
|
---|
| 149 | }
|
---|
| 150 | /**
|
---|
| 151 | * Stops a node. This operation is only available with single TPU nodes.
|
---|
| 152 | * (nodes.stop)
|
---|
| 153 | *
|
---|
| 154 | * @param string $name Required. The resource name.
|
---|
| 155 | * @param StopNodeRequest $postBody
|
---|
| 156 | * @param array $optParams Optional parameters.
|
---|
| 157 | * @return Operation
|
---|
| 158 | * @throws \Google\Service\Exception
|
---|
| 159 | */
|
---|
| 160 | public function stop($name, StopNodeRequest $postBody, $optParams = [])
|
---|
| 161 | {
|
---|
| 162 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 163 | $params = array_merge($params, $optParams);
|
---|
| 164 | return $this->call('stop', [$params], Operation::class);
|
---|
| 165 | }
|
---|
| 166 | }
|
---|
| 167 |
|
---|
| 168 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 169 | class_alias(ProjectsLocationsNodes::class, 'Google_Service_TPU_Resource_ProjectsLocationsNodes');
|
---|