Examples of AWSResource


Examples of com.netflix.simianarmy.aws.AWSResource

    @Test
    public void testOldSnapshotWithoutAMI() {
        int ageThreshold = 5;
        DateTime now = DateTime.now();
        Resource resource = new AWSResource().withId("snap123").withResourceType(AWSResourceType.EBS_SNAPSHOT)
                .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis()));
        ((AWSResource) resource).setAWSResourceState("completed");
        int retentionDays = 4;
        NoGeneratedAMIRule rule = new NoGeneratedAMIRule(new TestMonkeyCalendar(),
                ageThreshold, retentionDays);
View Full Code Here

Examples of com.netflix.simianarmy.aws.AWSResource

    @Test
    public void testSnapshotWithoutAMINotOld() {
        int ageThreshold = 5;
        DateTime now = DateTime.now();
        Resource resource = new AWSResource().withId("snap123").withResourceType(AWSResourceType.EBS_SNAPSHOT)
                .withLaunchTime(new Date(now.minusDays(ageThreshold - 1).getMillis()));
        ((AWSResource) resource).setAWSResourceState("completed");
        int retentionDays = 4;
        NoGeneratedAMIRule rule = new NoGeneratedAMIRule(new TestMonkeyCalendar(),
                ageThreshold, retentionDays);
View Full Code Here

Examples of com.netflix.simianarmy.aws.AWSResource

    @Test
    public void testWithAMIs() {
        int ageThreshold = 5;
        DateTime now = DateTime.now();
        Resource resource = new AWSResource().withId("snap123").withResourceType(AWSResourceType.EBS_SNAPSHOT)
                .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis()));
        ((AWSResource) resource).setAWSResourceState("completed");
        resource.setAdditionalField(EBSSnapshotJanitorCrawler.SNAPSHOT_FIELD_AMIS, "ami-123");
        int retentionDays = 4;
        NoGeneratedAMIRule rule = new NoGeneratedAMIRule(new TestMonkeyCalendar(),
View Full Code Here

Examples of com.netflix.simianarmy.aws.AWSResource

    }

    @Test
    public void testSnapshotsWithoutLauchTime() {
        int ageThreshold = 5;
        Resource resource = new AWSResource().withId("snap123").withResourceType(AWSResourceType.EBS_SNAPSHOT);
        ((AWSResource) resource).setAWSResourceState("completed");
        int retentionDays = 4;
        NoGeneratedAMIRule rule = new NoGeneratedAMIRule(new TestMonkeyCalendar(),
                ageThreshold, retentionDays);
        Assert.assertTrue(rule.isValid(resource));
View Full Code Here

Examples of com.netflix.simianarmy.aws.AWSResource

    @Test
    public void testResourceWithExpectedTerminationTimeSet() {
        int ageThreshold = 5;
        DateTime now = DateTime.now();
        Resource resource = new AWSResource().withId("snap123").withResourceType(AWSResourceType.EBS_SNAPSHOT)
                .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis()));
        ((AWSResource) resource).setAWSResourceState("completed");
        Date oldTermDate = new Date(now.plusDays(10).getMillis());
        String oldTermReason = "Foo";
        int retentionDays = 4;
View Full Code Here

Examples of com.netflix.simianarmy.aws.AWSResource

        DateTime now = DateTime.now();
        Date expectedTerminationTime = new Date(now.plusDays(10).getMillis());
        Date markTime = new Date(now.getMillis());
        String fieldName = "fieldName123";
        String fieldValue = "fieldValue456";
        Resource resource = new AWSResource().withId(id).withResourceType(resourceType)
                .withDescription(description).withOwnerEmail(ownerEmail).withRegion(region)
                .withState(state).withTerminationReason(terminationReason)
                .withExpectedTerminationTime(expectedTerminationTime)
                .withMarkTime(markTime).withOptOutOfJanitor(false)
                .setAdditionalField(fieldName, fieldValue);
View Full Code Here

Examples of com.netflix.simianarmy.aws.AWSResource

    @Test
    public void testOrphanedInstancesWithOwner() {
        int ageThreshold = 5;
        DateTime now = DateTime.now();
        Resource resource = new AWSResource().withId("i-12345678").withResourceType(AWSResourceType.INSTANCE)
                .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis()))
                .withOwnerEmail("owner@foo.com");
        ((AWSResource) resource).setAWSResourceState("running");
        int retentionDaysWithOwner = 4;
        int retentionDaysWithoutOwner = 8;
View Full Code Here

Examples of com.netflix.simianarmy.aws.AWSResource

    @Test
    public void testOrphanedInstancesWithoutOwner() {
        int ageThreshold = 5;
        DateTime now = DateTime.now();
        Resource resource = new AWSResource().withId("i-12345678").withResourceType(AWSResourceType.INSTANCE)
                .withLaunchTime(new Date(now.minusDays(ageThreshold + 1).getMillis()));
        ((AWSResource) resource).setAWSResourceState("running");
        int retentionDaysWithOwner = 4;
        int retentionDaysWithoutOwner = 8;
        OrphanedInstanceRule rule = new OrphanedInstanceRule(new TestMonkeyCalendar(),
View Full Code Here

Examples of com.netflix.simianarmy.aws.AWSResource

    }

    @Test
    public void testOrphanedInstancesWithoutLaunchTime() {
        int ageThreshold = 5;
        Resource resource = new AWSResource().withId("i-12345678").withResourceType(AWSResourceType.INSTANCE);
        ((AWSResource) resource).setAWSResourceState("running");
        int retentionDaysWithOwner = 4;
        int retentionDaysWithoutOwner = 8;
        OrphanedInstanceRule rule = new OrphanedInstanceRule(new TestMonkeyCalendar(),
                ageThreshold, retentionDaysWithOwner, retentionDaysWithoutOwner);
View Full Code Here

Examples of com.netflix.simianarmy.aws.AWSResource

    @Test
    public void testOrphanedInstancesWithLaunchTimeNotExpires() {
        int ageThreshold = 5;
        DateTime now = DateTime.now();
        Resource resource = new AWSResource().withId("i-12345678").withResourceType(AWSResourceType.INSTANCE)
                .withLaunchTime(new Date(now.minusDays(ageThreshold - 1).getMillis()));
        ((AWSResource) resource).setAWSResourceState("running");
        int retentionDaysWithOwner = 4;
        int retentionDaysWithoutOwner = 8;
        OrphanedInstanceRule rule = new OrphanedInstanceRule(new TestMonkeyCalendar(),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.