/AWS1/IF_EFS=>PUTLIFECYCLECONFIGURATION()¶
About PutLifecycleConfiguration¶
Use this action to manage storage for your file system. A
LifecycleConfiguration consists of one or more LifecyclePolicy
objects that define the following:
-
TransitionToIA– When to move files in the file system from primary storage (Standard storage class) into the Infrequent Access (IA) storage. -
TransitionToArchive– When to move files in the file system from their current storage class (either IA or Standard storage) into the Archive storage.File systems cannot transition into Archive storage before transitioning into IA storage. Therefore, TransitionToArchive must either not be set or must be later than TransitionToIA.
The Archive storage class is available only for file systems that use the Elastic throughput mode and the General Purpose performance mode.
-
TransitionToPrimaryStorageClass– Whether to move files in the file system back to primary storage (Standard storage class) after they are accessed in IA or Archive storage.
For more information, see Managing file system storage.
Each Amazon EFS file system supports one lifecycle configuration, which applies to
all files in the file system. If a LifecycleConfiguration object already exists
for the specified file system, a PutLifecycleConfiguration call modifies the
existing configuration. A PutLifecycleConfiguration call with an empty
LifecyclePolicies array in the request body deletes any existing
LifecycleConfiguration. In the request, specify the following:
-
The ID for the file system for which you are enabling, disabling, or modifying lifecycle management.
-
A
LifecyclePoliciesarray ofLifecyclePolicyobjects that define when to move files to IA storage, to Archive storage, and back to primary storage.Amazon EFS requires that each
LifecyclePolicyobject have only have a single transition, so theLifecyclePoliciesarray needs to be structured with separateLifecyclePolicyobjects. See the example requests in the following section for more information.
This operation requires permissions for the elasticfilesystem:PutLifecycleConfiguration operation.
To apply a LifecycleConfiguration object to an encrypted file system, you
need the same Key Management Service permissions as when you created the encrypted file system.
Method Signature¶
METHODS /AWS1/IF_EFS~PUTLIFECYCLECONFIGURATION
IMPORTING
!IV_FILESYSTEMID TYPE /AWS1/EFSFILESYSTEMID OPTIONAL
!IT_LIFECYCLEPOLICIES TYPE /AWS1/CL_EFSLIFECYCLEPOLICY=>TT_LIFECYCLEPOLICIES OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_efslifecycleconfdesc
RAISING
/AWS1/CX_EFSBADREQUEST
/AWS1/CX_EFSFILESYSTEMNOTFOUND
/AWS1/CX_EFSINCORRECTFILESYS00
/AWS1/CX_EFSINTERNALSERVERERR
/AWS1/CX_EFSCLIENTEXC
/AWS1/CX_EFSSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_filesystemid TYPE /AWS1/EFSFILESYSTEMID /AWS1/EFSFILESYSTEMID¶
The ID of the file system for which you are creating the
LifecycleConfigurationobject (String).
it_lifecyclepolicies TYPE /AWS1/CL_EFSLIFECYCLEPOLICY=>TT_LIFECYCLEPOLICIES TT_LIFECYCLEPOLICIES¶
An array of
LifecyclePolicyobjects that define the file system'sLifecycleConfigurationobject. ALifecycleConfigurationobject informs lifecycle management of the following:
TransitionToIA– When to move files in the file system from primary storage (Standard storage class) into the Infrequent Access (IA) storage.
TransitionToArchive– When to move files in the file system from their current storage class (either IA or Standard storage) into the Archive storage.File systems cannot transition into Archive storage before transitioning into IA storage. Therefore,
TransitionToArchive must either not be set or must be later than TransitionToIA.The Archive storage class is available only for file systems that use the Elastic throughput mode and the General Purpose performance mode.
TransitionToPrimaryStorageClass– Whether to move files in the file system back to primary storage (Standard storage class) after they are accessed in IA or Archive storage.When using the
put-lifecycle-configurationCLI command or thePutLifecycleConfigurationAPI action, Amazon EFS requires that eachLifecyclePolicyobject have only a single transition. This means that in a request body,LifecyclePoliciesmust be structured as an array ofLifecyclePolicyobjects, one object for each storage transition. See the example requests in the following section for more information.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_efslifecycleconfdesc /AWS1/CL_EFSLIFECYCLECONFDESC¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->putlifecycleconfiguration(
it_lifecyclepolicies = VALUE /aws1/cl_efslifecyclepolicy=>tt_lifecyclepolicies(
(
new /aws1/cl_efslifecyclepolicy(
iv_transitiontoarchive = |string|
iv_transitiontoia = |string|
iv_transtoprimarystrgclass = |string|
)
)
)
iv_filesystemid = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
LOOP AT lo_result->get_lifecyclepolicies( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_transitiontoiarules = lo_row_1->get_transitiontoia( ).
lv_transitiontoprimarystor = lo_row_1->get_transtoprimarystrgclass( ).
lv_transitiontoarchiverule = lo_row_1->get_transitiontoarchive( ).
ENDIF.
ENDLOOP.
ENDIF.
Creates a new lifecycleconfiguration object for a file system¶
This operation enables lifecycle management on a file system by creating a new LifecycleConfiguration object. A LifecycleConfiguration object defines when files in an Amazon EFS file system are automatically transitioned to the lower-cost EFS Infrequent Access (IA) storage class. A LifecycleConfiguration applies to all files in a file system.
DATA(lo_result) = lo_client->putlifecycleconfiguration(
it_lifecyclepolicies = VALUE /aws1/cl_efslifecyclepolicy=>tt_lifecyclepolicies(
( new /aws1/cl_efslifecyclepolicy( iv_transitiontoia = |AFTER_30_DAYS| ) )
)
iv_filesystemid = |fs-01234567|
).