updateLifecyclePolicy method
- required String executionRole,
- required String lifecyclePolicyArn,
- required List<
LifecyclePolicyDetail> policyDetails, - required LifecyclePolicyResourceSelection resourceSelection,
- required LifecyclePolicyResourceType resourceType,
- String? clientToken,
- String? description,
- LifecyclePolicyStatus? status,
Update the specified lifecycle policy.
May throw CallRateLimitExceededException.
May throw ClientException.
May throw ForbiddenException.
May throw IdempotentParameterMismatchException.
May throw InvalidParameterCombinationException.
May throw InvalidRequestException.
May throw ResourceInUseException.
May throw ServiceException.
May throw ServiceUnavailableException.
Parameter executionRole :
The name or Amazon Resource Name (ARN) of the IAM role that Image Builder
uses to update the lifecycle policy.
Parameter lifecyclePolicyArn :
The Amazon Resource Name (ARN) of the lifecycle policy resource.
Parameter policyDetails :
The configuration details for a lifecycle policy resource.
Parameter resourceSelection :
Selection criteria for resources that the lifecycle policy applies to.
Parameter resourceType :
The type of image resource that the lifecycle policy applies to.
Parameter clientToken :
Unique, case-sensitive identifier you provide to ensure idempotency of the
request. For more information, see Ensuring
idempotency in the Amazon EC2 API Reference.
Parameter description :
Optional description for the lifecycle policy.
Parameter status :
Indicates whether the lifecycle policy resource is enabled.
Implementation
Future<UpdateLifecyclePolicyResponse> updateLifecyclePolicy({
required String executionRole,
required String lifecyclePolicyArn,
required List<LifecyclePolicyDetail> policyDetails,
required LifecyclePolicyResourceSelection resourceSelection,
required LifecyclePolicyResourceType resourceType,
String? clientToken,
String? description,
LifecyclePolicyStatus? status,
}) async {
final $payload = <String, dynamic>{
'executionRole': executionRole,
'lifecyclePolicyArn': lifecyclePolicyArn,
'policyDetails': policyDetails,
'resourceSelection': resourceSelection,
'resourceType': resourceType.value,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'description': description,
if (status != null) 'status': status.value,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/UpdateLifecyclePolicy',
exceptionFnMap: _exceptionFns,
);
return UpdateLifecyclePolicyResponse.fromJson(response);
}