createJob method

Future<CreateJobResult> createJob({
  1. String? addressId,
  2. String? clusterId,
  3. String? description,
  4. DeviceConfiguration? deviceConfiguration,
  5. String? forwardingAddressId,
  6. JobType? jobType,
  7. String? kmsKeyARN,
  8. Notification? notification,
  9. JobResource? resources,
  10. String? roleARN,
  11. ShippingOption? shippingOption,
  12. SnowballCapacity? snowballCapacityPreference,
  13. SnowballType? snowballType,
  14. TaxDocuments? taxDocuments,
})

Creates a job to import or export data between Amazon S3 and your on-premises data center. Your AWS account must have the right trust policies and permissions in place to create a job for a Snow device. If you're creating a job for a node in a cluster, you only need to provide the clusterId value; the other job attributes are inherited from the cluster.

May throw InvalidResourceException. May throw KMSRequestFailedException. May throw InvalidInputCombinationException. May throw ClusterLimitExceededException. May throw Ec2RequestFailedException.

Parameter addressId : The ID for the address that you want the Snow device shipped to.

Parameter clusterId : The ID of a cluster. If you're creating a job for a node in a cluster, you need to provide only this clusterId value. The other job attributes are inherited from the cluster.

Parameter description : Defines an optional description of this specific job, for example Important Photos 2016-08-11.

Parameter deviceConfiguration : Defines the device configuration for an AWS Snowcone job.

Parameter forwardingAddressId : The forwarding address ID for a job. This field is not supported in most regions.

Parameter jobType : Defines the type of job that you're creating.

Parameter kmsKeyARN : The KmsKeyARN that you want to associate with this job. KmsKeyARNs are created using the CreateKey AWS Key Management Service (KMS) API action.

Parameter notification : Defines the Amazon Simple Notification Service (Amazon SNS) notification settings for this job.

Parameter resources : Defines the Amazon S3 buckets associated with this job.

With IMPORT jobs, you specify the bucket or buckets that your transferred data will be imported into.

With EXPORT jobs, you specify the bucket or buckets that your transferred data will be exported from. Optionally, you can also specify a KeyRange value. If you choose to export a range, you define the length of the range by providing either an inclusive BeginMarker value, an inclusive EndMarker value, or both. Ranges are UTF-8 binary sorted.

Parameter roleARN : The RoleARN that you want to associate with this job. RoleArns are created using the CreateRole AWS Identity and Access Management (IAM) API action.

Parameter shippingOption : The shipping speed for this job. This speed doesn't dictate how soon you'll get the Snow device, rather it represents how quickly the Snow device moves to its destination while in transit. Regional shipping speeds are as follows:

  • In Australia, you have access to express shipping. Typically, Snow devices shipped express are delivered in about a day.
  • In the European Union (EU), you have access to express shipping. Typically, Snow devices shipped express are delivered in about a day. In addition, most countries in the EU have access to standard shipping, which typically takes less than a week, one way.
  • In India, Snow devices are delivered in one to seven days.
  • In the US, you have access to one-day shipping and two-day shipping.

Parameter snowballCapacityPreference : If your job is being created in one of the US regions, you have the option of specifying what size Snow device you'd like for this job. In all other regions, Snowballs come with 80 TB in storage capacity.

Parameter snowballType : The type of AWS Snow Family device to use for this job. The type of AWS Snow device to use for this job. Currently, the only supported device type for cluster jobs is EDGE.

For more information, see Snowball Edge Device Options in the Snowball Edge Developer Guide.

Parameter taxDocuments : The tax documents required in your AWS Region.

Implementation

Future<CreateJobResult> createJob({
  String? addressId,
  String? clusterId,
  String? description,
  DeviceConfiguration? deviceConfiguration,
  String? forwardingAddressId,
  JobType? jobType,
  String? kmsKeyARN,
  Notification? notification,
  JobResource? resources,
  String? roleARN,
  ShippingOption? shippingOption,
  SnowballCapacity? snowballCapacityPreference,
  SnowballType? snowballType,
  TaxDocuments? taxDocuments,
}) async {
  _s.validateStringLength(
    'addressId',
    addressId,
    40,
    40,
  );
  _s.validateStringLength(
    'clusterId',
    clusterId,
    39,
    39,
  );
  _s.validateStringLength(
    'description',
    description,
    1,
    1152921504606846976,
  );
  _s.validateStringLength(
    'forwardingAddressId',
    forwardingAddressId,
    40,
    40,
  );
  _s.validateStringLength(
    'kmsKeyARN',
    kmsKeyARN,
    0,
    255,
  );
  _s.validateStringLength(
    'roleARN',
    roleARN,
    0,
    255,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSIESnowballJobManagementService.CreateJob'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (addressId != null) 'AddressId': addressId,
      if (clusterId != null) 'ClusterId': clusterId,
      if (description != null) 'Description': description,
      if (deviceConfiguration != null)
        'DeviceConfiguration': deviceConfiguration,
      if (forwardingAddressId != null)
        'ForwardingAddressId': forwardingAddressId,
      if (jobType != null) 'JobType': jobType.toValue(),
      if (kmsKeyARN != null) 'KmsKeyARN': kmsKeyARN,
      if (notification != null) 'Notification': notification,
      if (resources != null) 'Resources': resources,
      if (roleARN != null) 'RoleARN': roleARN,
      if (shippingOption != null) 'ShippingOption': shippingOption.toValue(),
      if (snowballCapacityPreference != null)
        'SnowballCapacityPreference': snowballCapacityPreference.toValue(),
      if (snowballType != null) 'SnowballType': snowballType.toValue(),
      if (taxDocuments != null) 'TaxDocuments': taxDocuments,
    },
  );

  return CreateJobResult.fromJson(jsonResponse.body);
}