upgradeEdition method

Future<UpgradeEditionResponse> upgradeEdition(
  1. UpgradeEditionRequest request,
  2. String parent, {
  3. String? $fields,
})

Upgrades the edition for a list of reservations and capacity commitments.

You can only upgrade to a higher edition (from STANDARD to ENTERPRISE or ENTERPRISE_PLUS, from ENTERPRISE to ENTERPRISE_PLUS, or from EDITION_UNSPECIFIED to ENTERPRISE or ENTERPRISE_PLUS). You can't downgrade an edition. The upgrade must not cause an overall flexible slot increase across the original and target editions (for example, by upgrading a reservation without upgrading its corresponding capacity commitment). Otherwise, the method fails with a google.rpc.Code.FAILED_PRECONDITION error. Before the upgrade, the service validates that the resources meet the requirements of the target edition (for example, all reservations within a reservation group must be upgraded together).

request - The metadata request object.

Request parameters:

parent - The parent resource name that identifies the admin project and location, in the format projects/{project}/locations/{location}. For example, projects/myproject/locations/us-west1. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$.

$fields - Selector specifying which fields to include in a partial response.

Completes with a UpgradeEditionResponse.

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<UpgradeEditionResponse> upgradeEdition(
  UpgradeEditionRequest request,
  core.String parent, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    'fields': ?$fields == null ? null : [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$parent') + ':upgradeEdition';

  final response_ = await _requester.request(
    url_,
    'POST',
    body: body_,
    queryParams: queryParams_,
  );
  return UpgradeEditionResponse.fromJson(
    response_ as core.Map<core.String, core.dynamic>,
  );
}