startBulkDeployment method

Future<StartBulkDeploymentResponse> startBulkDeployment({
  1. required String executionRoleArn,
  2. required String inputFileUri,
  3. String? amznClientToken,
  4. Map<String, String>? tags,
})

Deploys multiple groups in one operation. This action starts the bulk deployment of a specified set of group versions. Each group version deployment will be triggered with an adaptive rate that has a fixed upper limit. We recommend that you include an ''X-Amzn-Client-Token'' token in every ''StartBulkDeployment'' request. These requests are idempotent with respect to the token and the request parameters.

May throw BadRequestException.

Parameter executionRoleArn : The ARN of the execution role to associate with the bulk deployment operation. This IAM role must allow the ''greengrass:CreateDeployment'' action for all group versions that are listed in the input file. This IAM role must have access to the S3 bucket containing the input file.

Parameter inputFileUri : The URI of the input file contained in the S3 bucket. The execution role must have ''getObject'' permissions on this bucket to access the input file. The input file is a JSON-serialized, line delimited file with UTF-8 encoding that provides a list of group and version IDs and the deployment type. This file must be less than 100 MB. Currently, AWS IoT Greengrass supports only ''NewDeployment'' deployment types.

Parameter amznClientToken : A client token used to correlate requests and responses.

Parameter tags : Tag(s) to add to the new resource.

Implementation

Future<StartBulkDeploymentResponse> startBulkDeployment({
  required String executionRoleArn,
  required String inputFileUri,
  String? amznClientToken,
  Map<String, String>? tags,
}) async {
  ArgumentError.checkNotNull(executionRoleArn, 'executionRoleArn');
  ArgumentError.checkNotNull(inputFileUri, 'inputFileUri');
  final headers = <String, String>{
    if (amznClientToken != null)
      'X-Amzn-Client-Token': amznClientToken.toString(),
  };
  final $payload = <String, dynamic>{
    'ExecutionRoleArn': executionRoleArn,
    'InputFileUri': inputFileUri,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/greengrass/bulk/deployments',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return StartBulkDeploymentResponse.fromJson(response);
}