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\Baremetalsolution\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Baremetalsolution\BaremetalsolutionEmpty;
|
---|
21 | use Google\Service\Baremetalsolution\ListSSHKeysResponse;
|
---|
22 | use Google\Service\Baremetalsolution\SSHKey;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "sshKeys" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $baremetalsolutionService = new Google\Service\Baremetalsolution(...);
|
---|
29 | * $sshKeys = $baremetalsolutionService->projects_locations_sshKeys;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ProjectsLocationsSshKeys extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Register a public SSH key in the specified project for use with the
|
---|
36 | * interactive serial console feature. (sshKeys.create)
|
---|
37 | *
|
---|
38 | * @param string $parent Required. The parent containing the SSH keys.
|
---|
39 | * @param SSHKey $postBody
|
---|
40 | * @param array $optParams Optional parameters.
|
---|
41 | *
|
---|
42 | * @opt_param string sshKeyId Required. The ID to use for the key, which will
|
---|
43 | * become the final component of the key's resource name. This value must match
|
---|
44 | * the regex: [a-zA-Z0-9@.\-_]{1,64}
|
---|
45 | * @return SSHKey
|
---|
46 | * @throws \Google\Service\Exception
|
---|
47 | */
|
---|
48 | public function create($parent, SSHKey $postBody, $optParams = [])
|
---|
49 | {
|
---|
50 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
51 | $params = array_merge($params, $optParams);
|
---|
52 | return $this->call('create', [$params], SSHKey::class);
|
---|
53 | }
|
---|
54 | /**
|
---|
55 | * Deletes a public SSH key registered in the specified project.
|
---|
56 | * (sshKeys.delete)
|
---|
57 | *
|
---|
58 | * @param string $name Required. The name of the SSH key to delete. Currently,
|
---|
59 | * the only valid value for the location is "global".
|
---|
60 | * @param array $optParams Optional parameters.
|
---|
61 | * @return BaremetalsolutionEmpty
|
---|
62 | * @throws \Google\Service\Exception
|
---|
63 | */
|
---|
64 | public function delete($name, $optParams = [])
|
---|
65 | {
|
---|
66 | $params = ['name' => $name];
|
---|
67 | $params = array_merge($params, $optParams);
|
---|
68 | return $this->call('delete', [$params], BaremetalsolutionEmpty::class);
|
---|
69 | }
|
---|
70 | /**
|
---|
71 | * Lists the public SSH keys registered for the specified project. These SSH
|
---|
72 | * keys are used only for the interactive serial console feature.
|
---|
73 | * (sshKeys.listProjectsLocationsSshKeys)
|
---|
74 | *
|
---|
75 | * @param string $parent Required. The parent containing the SSH keys.
|
---|
76 | * Currently, the only valid value for the location is "global".
|
---|
77 | * @param array $optParams Optional parameters.
|
---|
78 | *
|
---|
79 | * @opt_param int pageSize The maximum number of items to return.
|
---|
80 | * @opt_param string pageToken The next_page_token value returned from a
|
---|
81 | * previous List request, if any.
|
---|
82 | * @return ListSSHKeysResponse
|
---|
83 | * @throws \Google\Service\Exception
|
---|
84 | */
|
---|
85 | public function listProjectsLocationsSshKeys($parent, $optParams = [])
|
---|
86 | {
|
---|
87 | $params = ['parent' => $parent];
|
---|
88 | $params = array_merge($params, $optParams);
|
---|
89 | return $this->call('list', [$params], ListSSHKeysResponse::class);
|
---|
90 | }
|
---|
91 | }
|
---|
92 |
|
---|
93 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
94 | class_alias(ProjectsLocationsSshKeys::class, 'Google_Service_Baremetalsolution_Resource_ProjectsLocationsSshKeys');
|
---|