Example usage for com.amazonaws.services.ec2.model Volume setTags

List of usage examples for com.amazonaws.services.ec2.model Volume setTags

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model Volume setTags.

Prototype


public void setTags(java.util.Collection<Tag> tags) 

Source Link

Document

Any tags assigned to the volume.

Usage

From source file:com.pearson.eidetic.driver.threads.EideticSubThreadMethods.java

@Override
public void setResourceTags(AmazonEC2Client ec2Client, Volume vol, Collection<Tag> tags, Integer numRetries,
        Integer maxApiRequestsPerSecond, String uniqueAwsAccountIdentifier) {
    CreateTagsRequest createTagsRequest = new CreateTagsRequest().withResources(vol.getVolumeId())
            .withTags(tags);/*from w  w  w . j a  v  a 2s.  c om*/
    EC2ClientMethods.createTags(ec2Client, createTagsRequest, numRetries, maxApiRequestsPerSecond,
            uniqueAwsAccountIdentifier);
    vol.setTags(tags);
}

From source file:jp.primecloud.auto.aws.typica.converter.VolumeConverter.java

License:Open Source License

@Override
protected Volume convertObject(VolumeInfo from) {
    Volume to = new Volume();

    to.setVolumeId(from.getVolumeId());//from  w w w . ja  v  a  2s .co m

    Integer size = null;
    if (from.getSize() != null && from.getSize().length() != 0) {
        size = Integer.valueOf(from.getSize());
    }
    to.setSize(size);

    to.setSnapshotId(from.getSnapshotId());
    to.setAvailabilityZone(from.getZone());
    to.setState(from.getStatus());
    to.setCreateTime(from.getCreateTime().getTime());
    to.setAttachments(new VolumeAttachmentConverter().convert(from.getAttachmentInfo()));

    // 
    to.setTags(null);

    return to;
}