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\Appengine\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Appengine\ListServicesResponse;
|
---|
21 | use Google\Service\Appengine\Operation;
|
---|
22 | use Google\Service\Appengine\Service;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "services" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $appengineService = new Google\Service\Appengine(...);
|
---|
29 | * $services = $appengineService->apps_services;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class AppsServices extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Deletes the specified service and all enclosed versions. (services.delete)
|
---|
36 | *
|
---|
37 | * @param string $appsId Part of `name`. Name of the resource requested.
|
---|
38 | * Example: apps/myapp/services/default.
|
---|
39 | * @param string $servicesId Part of `name`. See documentation of `appsId`.
|
---|
40 | * @param array $optParams Optional parameters.
|
---|
41 | * @return Operation
|
---|
42 | * @throws \Google\Service\Exception
|
---|
43 | */
|
---|
44 | public function delete($appsId, $servicesId, $optParams = [])
|
---|
45 | {
|
---|
46 | $params = ['appsId' => $appsId, 'servicesId' => $servicesId];
|
---|
47 | $params = array_merge($params, $optParams);
|
---|
48 | return $this->call('delete', [$params], Operation::class);
|
---|
49 | }
|
---|
50 | /**
|
---|
51 | * Gets the current configuration of the specified service. (services.get)
|
---|
52 | *
|
---|
53 | * @param string $appsId Part of `name`. Name of the resource requested.
|
---|
54 | * Example: apps/myapp/services/default.
|
---|
55 | * @param string $servicesId Part of `name`. See documentation of `appsId`.
|
---|
56 | * @param array $optParams Optional parameters.
|
---|
57 | * @return Service
|
---|
58 | * @throws \Google\Service\Exception
|
---|
59 | */
|
---|
60 | public function get($appsId, $servicesId, $optParams = [])
|
---|
61 | {
|
---|
62 | $params = ['appsId' => $appsId, 'servicesId' => $servicesId];
|
---|
63 | $params = array_merge($params, $optParams);
|
---|
64 | return $this->call('get', [$params], Service::class);
|
---|
65 | }
|
---|
66 | /**
|
---|
67 | * Lists all the services in the application. (services.listAppsServices)
|
---|
68 | *
|
---|
69 | * @param string $appsId Part of `parent`. Name of the parent Application
|
---|
70 | * resource. Example: apps/myapp.
|
---|
71 | * @param array $optParams Optional parameters.
|
---|
72 | *
|
---|
73 | * @opt_param int pageSize Maximum results to return per page.
|
---|
74 | * @opt_param string pageToken Continuation token for fetching the next page of
|
---|
75 | * results.
|
---|
76 | * @return ListServicesResponse
|
---|
77 | * @throws \Google\Service\Exception
|
---|
78 | */
|
---|
79 | public function listAppsServices($appsId, $optParams = [])
|
---|
80 | {
|
---|
81 | $params = ['appsId' => $appsId];
|
---|
82 | $params = array_merge($params, $optParams);
|
---|
83 | return $this->call('list', [$params], ListServicesResponse::class);
|
---|
84 | }
|
---|
85 | /**
|
---|
86 | * Updates the configuration of the specified service. (services.patch)
|
---|
87 | *
|
---|
88 | * @param string $appsId Part of `name`. Name of the resource to update.
|
---|
89 | * Example: apps/myapp/services/default.
|
---|
90 | * @param string $servicesId Part of `name`. See documentation of `appsId`.
|
---|
91 | * @param Service $postBody
|
---|
92 | * @param array $optParams Optional parameters.
|
---|
93 | *
|
---|
94 | * @opt_param bool migrateTraffic Set to true to gradually shift traffic to one
|
---|
95 | * or more versions that you specify. By default, traffic is shifted
|
---|
96 | * immediately. For gradual traffic migration, the target versions must be
|
---|
97 | * located within instances that are configured for both warmup requests
|
---|
98 | * (https://cloud.google.com/appengine/docs/admin-
|
---|
99 | * api/reference/rest/v1/apps.services.versions#InboundServiceType) and
|
---|
100 | * automatic scaling (https://cloud.google.com/appengine/docs/admin-
|
---|
101 | * api/reference/rest/v1/apps.services.versions#AutomaticScaling). You must
|
---|
102 | * specify the shardBy (https://cloud.google.com/appengine/docs/admin-
|
---|
103 | * api/reference/rest/v1/apps.services#ShardBy) field in the Service resource.
|
---|
104 | * Gradual traffic migration is not supported in the App Engine flexible
|
---|
105 | * environment. For examples, see Migrating and Splitting Traffic
|
---|
106 | * (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-
|
---|
107 | * traffic).
|
---|
108 | * @opt_param string updateMask Required. Standard field mask for the set of
|
---|
109 | * fields to be updated.
|
---|
110 | * @return Operation
|
---|
111 | * @throws \Google\Service\Exception
|
---|
112 | */
|
---|
113 | public function patch($appsId, $servicesId, Service $postBody, $optParams = [])
|
---|
114 | {
|
---|
115 | $params = ['appsId' => $appsId, 'servicesId' => $servicesId, 'postBody' => $postBody];
|
---|
116 | $params = array_merge($params, $optParams);
|
---|
117 | return $this->call('patch', [$params], Operation::class);
|
---|
118 | }
|
---|
119 | }
|
---|
120 |
|
---|
121 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
122 | class_alias(AppsServices::class, 'Google_Service_Appengine_Resource_AppsServices');
|
---|