injectCredentials method

Future<Operation> injectCredentials(
  1. InjectCredentialsRequest request,
  2. String project,
  3. String region,
  4. String cluster, {
  5. String? $fields,
})

Inject encrypted credentials into all of the VMs in a cluster.The target cluster must be a personal auth cluster assigned to the user who is issuing the RPC.

request - The metadata request object.

Request parameters:

project - Required. The ID of the Google Cloud Platform project the cluster belongs to, of the form projects/. Value must have pattern ^projects/\[^/\]+$.

region - Required. The region containing the cluster, of the form regions/. Value must have pattern ^regions/\[^/\]+$.

cluster - Required. The cluster, in the form clusters/. Value must have pattern ^clusters/\[^/\]+$.

$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> injectCredentials(
  InjectCredentialsRequest request,
  core.String project,
  core.String region,
  core.String cluster, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' +
      core.Uri.encodeFull('$project') +
      '/' +
      core.Uri.encodeFull('$region') +
      '/' +
      core.Uri.encodeFull('$cluster') +
      ':injectCredentials';

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