patch method
Updates the configuration of the specified service.
request
- The metadata request object.
Request parameters:
appsId
- Part of name
. Name of the resource to update. Example:
apps/myapp/services/default.
servicesId
- Part of name
. See documentation of appsId
.
migrateTraffic
- Set to true to gradually shift traffic to one or more
versions that you specify. By default, traffic is shifted immediately. For
gradual traffic migration, the target versions must be located within
instances that are configured for both warmup requests
(https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#InboundServiceType)
and automatic scaling
(https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#AutomaticScaling).
You must specify the shardBy
(https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#ShardBy)
field in the Service resource. Gradual traffic migration is not supported
in the App Engine flexible environment. For examples, see Migrating and
Splitting Traffic
(https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).
updateMask
- Required. Standard field mask for the set of fields to be
updated.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Operation.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<Operation> patch(
Service request,
core.String appsId,
core.String servicesId, {
core.bool? migrateTraffic,
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if (migrateTraffic != null) 'migrateTraffic': ['${migrateTraffic}'],
if (updateMask != null) 'updateMask': [updateMask],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/apps/' +
commons.escapeVariable('$appsId') +
'/services/' +
commons.escapeVariable('$servicesId');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}