Package com.sequenceiq.cloudbreak.domain

Examples of com.sequenceiq.cloudbreak.domain.AwsCredential


        }
    }

    public Map<String, Object> getSetupProperties(Stack stack) {
        AwsTemplate awsTemplate = (AwsTemplate) stack.getTemplate();
        AwsCredential awsCredential = (AwsCredential) stack.getCredential();

        SnsTopic snsTopic = snsTopicRepository.findOneForCredentialInRegion(awsCredential.getId(), awsTemplate.getRegion());
        Map<String, Object> properties = new HashMap<>();
        properties.put(SnsTopicManager.NOTIFICATION_TOPIC_ARN_KEY, snsTopic.getTopicArn());

        return properties;
    }
View Full Code Here


    @Autowired
    private AwsStackUtil awsStackUtil;

    public String getAutoscalingGroupName(Stack stack) {
        AwsTemplate awsTemplate = (AwsTemplate) stack.getTemplate();
        AwsCredential awsCredential = (AwsCredential) stack.getCredential();
        AmazonCloudFormationClient amazonCfClient = awsStackUtil.createCloudFormationClient(awsTemplate.getRegion(), awsCredential);
        return getAutoscalingGroupName(stack, amazonCfClient);
    }
View Full Code Here

        return asGroupResource.getStackResourceDetail().getPhysicalResourceId();
    }

    public List<String> getInstanceIds(Stack stack) {
        AwsTemplate awsTemplate = (AwsTemplate) stack.getTemplate();
        AwsCredential awsCredential = (AwsCredential) stack.getCredential();
        AmazonAutoScalingClient amazonASClient = awsStackUtil.createAutoScalingClient(awsTemplate.getRegion(), awsCredential);
        AmazonCloudFormationClient amazonCFClient = awsStackUtil.createCloudFormationClient(awsTemplate.getRegion(), awsCredential);
        return getInstanceIds(stack, amazonASClient, amazonCFClient);
    }
View Full Code Here

    @Before
    public void setUp() {
        underTest = new StackConverter();
        MockitoAnnotations.initMocks(this);
        stackDescription = createStackDescription();
        awsCredential = new AwsCredential();
        awsCredential.setId(DUMMY_ID);
        awsTemplate = new AwsTemplate();
        awsTemplate.setId(DUMMY_ID);
        stack = createStack();
        stackJson = createStackJson();
View Full Code Here

                azureCredential.setCloudPlatform(platform);
                azureCredential.setPublicInAccount(true);
                azureCredential.setPublicKey(PUBLIC_KEY);
                return azureCredential;
            case AWS:
                AwsCredential awsCredential = new AwsCredential();
                awsCredential.setId(1L);
                awsCredential.setOwner(owner);
                awsCredential.setAccount(account);
                awsCredential.setCloudPlatform(platform);
                awsCredential.setPublicInAccount(true);
                awsCredential.setRoleArn("rolearn");
                awsCredential.setPublicKey(PUBLIC_KEY);
                return awsCredential;
            case GCC:
                GccCredential gccCredential = new GccCredential();
                gccCredential.setId(1L);
                gccCredential.setOwner(owner);
View Full Code Here

    }

    private SnsTopic createSnsTopic() {
        SnsTopic snsTopic = new SnsTopic();
        snsTopic.setConfirmed(true);
        snsTopic.setCredential(new AwsCredential());
        snsTopic.setId(1L);
        snsTopic.setRegion(Regions.DEFAULT_REGION);
        snsTopic.setTopicArn(DUMMY_TOPIC_ARN);
        return snsTopic;
    }
View Full Code Here

        stack.setResources(resources);
        return stack;
    }

    public static AwsCredential createAwsCredential() {
        AwsCredential credential = new AwsCredential();
        credential.setId(DEFAULT_ID);
        credential.setCloudPlatform(CloudPlatform.AWS);
        credential.setDescription(AWS_DESCRIPTION);
        credential.setPublicKey(PUBLIC_KEY);
        return credential;
    }
View Full Code Here

    public void testConvertAwsCredentialJsonToEntity() {
        // GIVEN
        given(awsCredentialInitializer.init(any(AwsCredential.class))).willReturn(awsCredentialWithKeyName);
        doNothing().when(rsaPublicKeyValidator).validate(any(AwsCredential.class));
        // WHEN
        AwsCredential result = underTest.convert(credentialJson);
        // THEN
        assertEquals(result.getRoleArn(),
                credentialJson.getParameters().get(AWSCredentialParam.ROLE_ARN.getName()));
        assertEquals(result.getName(), credentialJson.getName());
        assertEquals(result.getKeyPairName(), "mykeypair");

    }
View Full Code Here

        assertEquals(result.getKeyPairName(), "mykeypair");

    }

    private AwsCredential createAwsCredential() {
        AwsCredential awsCredential = new AwsCredential();
        awsCredential.setId(1L);
        awsCredential.setName(DUMMY_NAME);
        awsCredential.setRoleArn(DUMMY_ROLE_ARN);
        awsCredential.setSnsTopics(new HashSet<SnsTopic>());
        awsCredential.setDescription(DUMMY_DESCRIPTION);
        awsCredential.setTemporaryAwsCredentials(new TemporaryAwsCredentials());
        awsCredential.setCloudPlatform(CloudPlatform.AWS);
        awsCredential.setPublicInAccount(true);
        return awsCredential;
    }
View Full Code Here

                        "ImBAD")
        );
    }

    private Credential azureCredential(String publicKey) {
        Credential credential = new AwsCredential();
        credential.setPublicKey(publicKey);
        return credential;
    }
View Full Code Here

TOP

Related Classes of com.sequenceiq.cloudbreak.domain.AwsCredential

Copyright © 2018 www.massapicom. 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.