R/dlm_operations.R

Defines functions dlm_update_lifecycle_policy dlm_untag_resource dlm_tag_resource dlm_list_tags_for_resource dlm_get_lifecycle_policy dlm_get_lifecycle_policies dlm_delete_lifecycle_policy dlm_create_lifecycle_policy

Documented in dlm_create_lifecycle_policy dlm_delete_lifecycle_policy dlm_get_lifecycle_policies dlm_get_lifecycle_policy dlm_list_tags_for_resource dlm_tag_resource dlm_untag_resource dlm_update_lifecycle_policy

# This file is generated by make.paws. Please do not edit here.
#' @importFrom paws.common get_config new_operation new_request send_request
#' @include dlm_service.R
NULL

#' Creates a policy to manage the lifecycle of the specified AWS resources
#'
#' @description
#' Creates a policy to manage the lifecycle of the specified AWS resources.
#' You can create up to 100 lifecycle policies.
#'
#' @usage
#' dlm_create_lifecycle_policy(ExecutionRoleArn, Description, State,
#'   PolicyDetails, Tags)
#'
#' @param ExecutionRoleArn [required] The Amazon Resource Name (ARN) of the IAM role used to run the
#' operations specified by the lifecycle policy.
#' @param Description [required] A description of the lifecycle policy. The characters ^\[0-9A-Za-z
#' _-\]+$ are supported.
#' @param State [required] The desired activation state of the lifecycle policy after creation.
#' @param PolicyDetails [required] The configuration details of the lifecycle policy.
#' @param Tags The tags to apply to the lifecycle policy during creation.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   PolicyId = "string"
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$create_lifecycle_policy(
#'   ExecutionRoleArn = "string",
#'   Description = "string",
#'   State = "ENABLED"|"DISABLED",
#'   PolicyDetails = list(
#'     PolicyType = "EBS_SNAPSHOT_MANAGEMENT"|"IMAGE_MANAGEMENT"|"EVENT_BASED_POLICY",
#'     ResourceTypes = list(
#'       "VOLUME"|"INSTANCE"
#'     ),
#'     TargetTags = list(
#'       list(
#'         Key = "string",
#'         Value = "string"
#'       )
#'     ),
#'     Schedules = list(
#'       list(
#'         Name = "string",
#'         CopyTags = TRUE|FALSE,
#'         TagsToAdd = list(
#'           list(
#'             Key = "string",
#'             Value = "string"
#'           )
#'         ),
#'         VariableTags = list(
#'           list(
#'             Key = "string",
#'             Value = "string"
#'           )
#'         ),
#'         CreateRule = list(
#'           Interval = 123,
#'           IntervalUnit = "HOURS",
#'           Times = list(
#'             "string"
#'           ),
#'           CronExpression = "string"
#'         ),
#'         RetainRule = list(
#'           Count = 123,
#'           Interval = 123,
#'           IntervalUnit = "DAYS"|"WEEKS"|"MONTHS"|"YEARS"
#'         ),
#'         FastRestoreRule = list(
#'           Count = 123,
#'           Interval = 123,
#'           IntervalUnit = "DAYS"|"WEEKS"|"MONTHS"|"YEARS",
#'           AvailabilityZones = list(
#'             "string"
#'           )
#'         ),
#'         CrossRegionCopyRules = list(
#'           list(
#'             TargetRegion = "string",
#'             Encrypted = TRUE|FALSE,
#'             CmkArn = "string",
#'             CopyTags = TRUE|FALSE,
#'             RetainRule = list(
#'               Interval = 123,
#'               IntervalUnit = "DAYS"|"WEEKS"|"MONTHS"|"YEARS"
#'             )
#'           )
#'         ),
#'         ShareRules = list(
#'           list(
#'             TargetAccounts = list(
#'               "string"
#'             ),
#'             UnshareInterval = 123,
#'             UnshareIntervalUnit = "DAYS"|"WEEKS"|"MONTHS"|"YEARS"
#'           )
#'         )
#'       )
#'     ),
#'     Parameters = list(
#'       ExcludeBootVolume = TRUE|FALSE,
#'       NoReboot = TRUE|FALSE
#'     ),
#'     EventSource = list(
#'       Type = "MANAGED_CWE",
#'       Parameters = list(
#'         EventType = "shareSnapshot",
#'         SnapshotOwner = list(
#'           "string"
#'         ),
#'         DescriptionRegex = "string"
#'       )
#'     ),
#'     Actions = list(
#'       list(
#'         Name = "string",
#'         CrossRegionCopy = list(
#'           list(
#'             Target = "string",
#'             EncryptionConfiguration = list(
#'               Encrypted = TRUE|FALSE,
#'               CmkArn = "string"
#'             ),
#'             RetainRule = list(
#'               Interval = 123,
#'               IntervalUnit = "DAYS"|"WEEKS"|"MONTHS"|"YEARS"
#'             )
#'           )
#'         )
#'       )
#'     )
#'   ),
#'   Tags = list(
#'     "string"
#'   )
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname dlm_create_lifecycle_policy
dlm_create_lifecycle_policy <- function(ExecutionRoleArn, Description, State, PolicyDetails, Tags = NULL) {
  op <- new_operation(
    name = "CreateLifecyclePolicy",
    http_method = "POST",
    http_path = "/policies",
    paginator = list()
  )
  input <- .dlm$create_lifecycle_policy_input(ExecutionRoleArn = ExecutionRoleArn, Description = Description, State = State, PolicyDetails = PolicyDetails, Tags = Tags)
  output <- .dlm$create_lifecycle_policy_output()
  config <- get_config()
  svc <- .dlm$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.dlm$operations$create_lifecycle_policy <- dlm_create_lifecycle_policy

#' Deletes the specified lifecycle policy and halts the automated
#' operations that the policy specified
#'
#' @description
#' Deletes the specified lifecycle policy and halts the automated
#' operations that the policy specified.
#'
#' @usage
#' dlm_delete_lifecycle_policy(PolicyId)
#'
#' @param PolicyId &#91;required&#93; The identifier of the lifecycle policy.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$delete_lifecycle_policy(
#'   PolicyId = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname dlm_delete_lifecycle_policy
dlm_delete_lifecycle_policy <- function(PolicyId) {
  op <- new_operation(
    name = "DeleteLifecyclePolicy",
    http_method = "DELETE",
    http_path = "/policies/{policyId}/",
    paginator = list()
  )
  input <- .dlm$delete_lifecycle_policy_input(PolicyId = PolicyId)
  output <- .dlm$delete_lifecycle_policy_output()
  config <- get_config()
  svc <- .dlm$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.dlm$operations$delete_lifecycle_policy <- dlm_delete_lifecycle_policy

#' Gets summary information about all or the specified data lifecycle
#' policies
#'
#' @description
#' Gets summary information about all or the specified data lifecycle
#' policies.
#' 
#' To get complete information about a policy, use
#' [`get_lifecycle_policy`][dlm_get_lifecycle_policy].
#'
#' @usage
#' dlm_get_lifecycle_policies(PolicyIds, State, ResourceTypes, TargetTags,
#'   TagsToAdd)
#'
#' @param PolicyIds The identifiers of the data lifecycle policies.
#' @param State The activation state.
#' @param ResourceTypes The resource type.
#' @param TargetTags The target tag for a policy.
#' 
#' Tags are strings in the format `key=value`.
#' @param TagsToAdd The tags to add to objects created by the policy.
#' 
#' Tags are strings in the format `key=value`.
#' 
#' These user-defined tags are added in addition to the AWS-added lifecycle
#' tags.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   Policies = list(
#'     list(
#'       PolicyId = "string",
#'       Description = "string",
#'       State = "ENABLED"|"DISABLED"|"ERROR",
#'       Tags = list(
#'         "string"
#'       ),
#'       PolicyType = "EBS_SNAPSHOT_MANAGEMENT"|"IMAGE_MANAGEMENT"|"EVENT_BASED_POLICY"
#'     )
#'   )
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$get_lifecycle_policies(
#'   PolicyIds = list(
#'     "string"
#'   ),
#'   State = "ENABLED"|"DISABLED"|"ERROR",
#'   ResourceTypes = list(
#'     "VOLUME"|"INSTANCE"
#'   ),
#'   TargetTags = list(
#'     "string"
#'   ),
#'   TagsToAdd = list(
#'     "string"
#'   )
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname dlm_get_lifecycle_policies
dlm_get_lifecycle_policies <- function(PolicyIds = NULL, State = NULL, ResourceTypes = NULL, TargetTags = NULL, TagsToAdd = NULL) {
  op <- new_operation(
    name = "GetLifecyclePolicies",
    http_method = "GET",
    http_path = "/policies",
    paginator = list()
  )
  input <- .dlm$get_lifecycle_policies_input(PolicyIds = PolicyIds, State = State, ResourceTypes = ResourceTypes, TargetTags = TargetTags, TagsToAdd = TagsToAdd)
  output <- .dlm$get_lifecycle_policies_output()
  config <- get_config()
  svc <- .dlm$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.dlm$operations$get_lifecycle_policies <- dlm_get_lifecycle_policies

#' Gets detailed information about the specified lifecycle policy
#'
#' @description
#' Gets detailed information about the specified lifecycle policy.
#'
#' @usage
#' dlm_get_lifecycle_policy(PolicyId)
#'
#' @param PolicyId &#91;required&#93; The identifier of the lifecycle policy.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   Policy = list(
#'     PolicyId = "string",
#'     Description = "string",
#'     State = "ENABLED"|"DISABLED"|"ERROR",
#'     StatusMessage = "string",
#'     ExecutionRoleArn = "string",
#'     DateCreated = as.POSIXct(
#'       "2015-01-01"
#'     ),
#'     DateModified = as.POSIXct(
#'       "2015-01-01"
#'     ),
#'     PolicyDetails = list(
#'       PolicyType = "EBS_SNAPSHOT_MANAGEMENT"|"IMAGE_MANAGEMENT"|"EVENT_BASED_POLICY",
#'       ResourceTypes = list(
#'         "VOLUME"|"INSTANCE"
#'       ),
#'       TargetTags = list(
#'         list(
#'           Key = "string",
#'           Value = "string"
#'         )
#'       ),
#'       Schedules = list(
#'         list(
#'           Name = "string",
#'           CopyTags = TRUE|FALSE,
#'           TagsToAdd = list(
#'             list(
#'               Key = "string",
#'               Value = "string"
#'             )
#'           ),
#'           VariableTags = list(
#'             list(
#'               Key = "string",
#'               Value = "string"
#'             )
#'           ),
#'           CreateRule = list(
#'             Interval = 123,
#'             IntervalUnit = "HOURS",
#'             Times = list(
#'               "string"
#'             ),
#'             CronExpression = "string"
#'           ),
#'           RetainRule = list(
#'             Count = 123,
#'             Interval = 123,
#'             IntervalUnit = "DAYS"|"WEEKS"|"MONTHS"|"YEARS"
#'           ),
#'           FastRestoreRule = list(
#'             Count = 123,
#'             Interval = 123,
#'             IntervalUnit = "DAYS"|"WEEKS"|"MONTHS"|"YEARS",
#'             AvailabilityZones = list(
#'               "string"
#'             )
#'           ),
#'           CrossRegionCopyRules = list(
#'             list(
#'               TargetRegion = "string",
#'               Encrypted = TRUE|FALSE,
#'               CmkArn = "string",
#'               CopyTags = TRUE|FALSE,
#'               RetainRule = list(
#'                 Interval = 123,
#'                 IntervalUnit = "DAYS"|"WEEKS"|"MONTHS"|"YEARS"
#'               )
#'             )
#'           ),
#'           ShareRules = list(
#'             list(
#'               TargetAccounts = list(
#'                 "string"
#'               ),
#'               UnshareInterval = 123,
#'               UnshareIntervalUnit = "DAYS"|"WEEKS"|"MONTHS"|"YEARS"
#'             )
#'           )
#'         )
#'       ),
#'       Parameters = list(
#'         ExcludeBootVolume = TRUE|FALSE,
#'         NoReboot = TRUE|FALSE
#'       ),
#'       EventSource = list(
#'         Type = "MANAGED_CWE",
#'         Parameters = list(
#'           EventType = "shareSnapshot",
#'           SnapshotOwner = list(
#'             "string"
#'           ),
#'           DescriptionRegex = "string"
#'         )
#'       ),
#'       Actions = list(
#'         list(
#'           Name = "string",
#'           CrossRegionCopy = list(
#'             list(
#'               Target = "string",
#'               EncryptionConfiguration = list(
#'                 Encrypted = TRUE|FALSE,
#'                 CmkArn = "string"
#'               ),
#'               RetainRule = list(
#'                 Interval = 123,
#'                 IntervalUnit = "DAYS"|"WEEKS"|"MONTHS"|"YEARS"
#'               )
#'             )
#'           )
#'         )
#'       )
#'     ),
#'     Tags = list(
#'       "string"
#'     ),
#'     PolicyArn = "string"
#'   )
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$get_lifecycle_policy(
#'   PolicyId = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname dlm_get_lifecycle_policy
dlm_get_lifecycle_policy <- function(PolicyId) {
  op <- new_operation(
    name = "GetLifecyclePolicy",
    http_method = "GET",
    http_path = "/policies/{policyId}/",
    paginator = list()
  )
  input <- .dlm$get_lifecycle_policy_input(PolicyId = PolicyId)
  output <- .dlm$get_lifecycle_policy_output()
  config <- get_config()
  svc <- .dlm$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.dlm$operations$get_lifecycle_policy <- dlm_get_lifecycle_policy

#' Lists the tags for the specified resource
#'
#' @description
#' Lists the tags for the specified resource.
#'
#' @usage
#' dlm_list_tags_for_resource(ResourceArn)
#'
#' @param ResourceArn &#91;required&#93; The Amazon Resource Name (ARN) of the resource.
#'
#' @return
#' A list with the following syntax:
#' ```
#' list(
#'   Tags = list(
#'     "string"
#'   )
#' )
#' ```
#'
#' @section Request syntax:
#' ```
#' svc$list_tags_for_resource(
#'   ResourceArn = "string"
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname dlm_list_tags_for_resource
dlm_list_tags_for_resource <- function(ResourceArn) {
  op <- new_operation(
    name = "ListTagsForResource",
    http_method = "GET",
    http_path = "/tags/{resourceArn}",
    paginator = list()
  )
  input <- .dlm$list_tags_for_resource_input(ResourceArn = ResourceArn)
  output <- .dlm$list_tags_for_resource_output()
  config <- get_config()
  svc <- .dlm$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.dlm$operations$list_tags_for_resource <- dlm_list_tags_for_resource

#' Adds the specified tags to the specified resource
#'
#' @description
#' Adds the specified tags to the specified resource.
#'
#' @usage
#' dlm_tag_resource(ResourceArn, Tags)
#'
#' @param ResourceArn &#91;required&#93; The Amazon Resource Name (ARN) of the resource.
#' @param Tags &#91;required&#93; One or more tags.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$tag_resource(
#'   ResourceArn = "string",
#'   Tags = list(
#'     "string"
#'   )
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname dlm_tag_resource
dlm_tag_resource <- function(ResourceArn, Tags) {
  op <- new_operation(
    name = "TagResource",
    http_method = "POST",
    http_path = "/tags/{resourceArn}",
    paginator = list()
  )
  input <- .dlm$tag_resource_input(ResourceArn = ResourceArn, Tags = Tags)
  output <- .dlm$tag_resource_output()
  config <- get_config()
  svc <- .dlm$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.dlm$operations$tag_resource <- dlm_tag_resource

#' Removes the specified tags from the specified resource
#'
#' @description
#' Removes the specified tags from the specified resource.
#'
#' @usage
#' dlm_untag_resource(ResourceArn, TagKeys)
#'
#' @param ResourceArn &#91;required&#93; The Amazon Resource Name (ARN) of the resource.
#' @param TagKeys &#91;required&#93; The tag keys.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$untag_resource(
#'   ResourceArn = "string",
#'   TagKeys = list(
#'     "string"
#'   )
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname dlm_untag_resource
dlm_untag_resource <- function(ResourceArn, TagKeys) {
  op <- new_operation(
    name = "UntagResource",
    http_method = "DELETE",
    http_path = "/tags/{resourceArn}",
    paginator = list()
  )
  input <- .dlm$untag_resource_input(ResourceArn = ResourceArn, TagKeys = TagKeys)
  output <- .dlm$untag_resource_output()
  config <- get_config()
  svc <- .dlm$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.dlm$operations$untag_resource <- dlm_untag_resource

#' Updates the specified lifecycle policy
#'
#' @description
#' Updates the specified lifecycle policy.
#'
#' @usage
#' dlm_update_lifecycle_policy(PolicyId, ExecutionRoleArn, State,
#'   Description, PolicyDetails)
#'
#' @param PolicyId &#91;required&#93; The identifier of the lifecycle policy.
#' @param ExecutionRoleArn The Amazon Resource Name (ARN) of the IAM role used to run the
#' operations specified by the lifecycle policy.
#' @param State The desired activation state of the lifecycle policy after creation.
#' @param Description A description of the lifecycle policy.
#' @param PolicyDetails The configuration of the lifecycle policy. You cannot update the policy
#' type or the resource type.
#'
#' @return
#' An empty list.
#'
#' @section Request syntax:
#' ```
#' svc$update_lifecycle_policy(
#'   PolicyId = "string",
#'   ExecutionRoleArn = "string",
#'   State = "ENABLED"|"DISABLED",
#'   Description = "string",
#'   PolicyDetails = list(
#'     PolicyType = "EBS_SNAPSHOT_MANAGEMENT"|"IMAGE_MANAGEMENT"|"EVENT_BASED_POLICY",
#'     ResourceTypes = list(
#'       "VOLUME"|"INSTANCE"
#'     ),
#'     TargetTags = list(
#'       list(
#'         Key = "string",
#'         Value = "string"
#'       )
#'     ),
#'     Schedules = list(
#'       list(
#'         Name = "string",
#'         CopyTags = TRUE|FALSE,
#'         TagsToAdd = list(
#'           list(
#'             Key = "string",
#'             Value = "string"
#'           )
#'         ),
#'         VariableTags = list(
#'           list(
#'             Key = "string",
#'             Value = "string"
#'           )
#'         ),
#'         CreateRule = list(
#'           Interval = 123,
#'           IntervalUnit = "HOURS",
#'           Times = list(
#'             "string"
#'           ),
#'           CronExpression = "string"
#'         ),
#'         RetainRule = list(
#'           Count = 123,
#'           Interval = 123,
#'           IntervalUnit = "DAYS"|"WEEKS"|"MONTHS"|"YEARS"
#'         ),
#'         FastRestoreRule = list(
#'           Count = 123,
#'           Interval = 123,
#'           IntervalUnit = "DAYS"|"WEEKS"|"MONTHS"|"YEARS",
#'           AvailabilityZones = list(
#'             "string"
#'           )
#'         ),
#'         CrossRegionCopyRules = list(
#'           list(
#'             TargetRegion = "string",
#'             Encrypted = TRUE|FALSE,
#'             CmkArn = "string",
#'             CopyTags = TRUE|FALSE,
#'             RetainRule = list(
#'               Interval = 123,
#'               IntervalUnit = "DAYS"|"WEEKS"|"MONTHS"|"YEARS"
#'             )
#'           )
#'         ),
#'         ShareRules = list(
#'           list(
#'             TargetAccounts = list(
#'               "string"
#'             ),
#'             UnshareInterval = 123,
#'             UnshareIntervalUnit = "DAYS"|"WEEKS"|"MONTHS"|"YEARS"
#'           )
#'         )
#'       )
#'     ),
#'     Parameters = list(
#'       ExcludeBootVolume = TRUE|FALSE,
#'       NoReboot = TRUE|FALSE
#'     ),
#'     EventSource = list(
#'       Type = "MANAGED_CWE",
#'       Parameters = list(
#'         EventType = "shareSnapshot",
#'         SnapshotOwner = list(
#'           "string"
#'         ),
#'         DescriptionRegex = "string"
#'       )
#'     ),
#'     Actions = list(
#'       list(
#'         Name = "string",
#'         CrossRegionCopy = list(
#'           list(
#'             Target = "string",
#'             EncryptionConfiguration = list(
#'               Encrypted = TRUE|FALSE,
#'               CmkArn = "string"
#'             ),
#'             RetainRule = list(
#'               Interval = 123,
#'               IntervalUnit = "DAYS"|"WEEKS"|"MONTHS"|"YEARS"
#'             )
#'           )
#'         )
#'       )
#'     )
#'   )
#' )
#' ```
#'
#' @keywords internal
#'
#' @rdname dlm_update_lifecycle_policy
dlm_update_lifecycle_policy <- function(PolicyId, ExecutionRoleArn = NULL, State = NULL, Description = NULL, PolicyDetails = NULL) {
  op <- new_operation(
    name = "UpdateLifecyclePolicy",
    http_method = "PATCH",
    http_path = "/policies/{policyId}",
    paginator = list()
  )
  input <- .dlm$update_lifecycle_policy_input(PolicyId = PolicyId, ExecutionRoleArn = ExecutionRoleArn, State = State, Description = Description, PolicyDetails = PolicyDetails)
  output <- .dlm$update_lifecycle_policy_output()
  config <- get_config()
  svc <- .dlm$service(config)
  request <- new_request(svc, op, input, output)
  response <- send_request(request)
  return(response)
}
.dlm$operations$update_lifecycle_policy <- dlm_update_lifecycle_policy

Try the paws.storage package in your browser

Any scripts or data that you put into this service are public.

paws.storage documentation built on March 7, 2021, 5:07 p.m.