本文整理汇总了Java中com.amazonaws.services.ec2.model.InstanceType.M1Large方法的典型用法代码示例。如果您正苦于以下问题:Java InstanceType.M1Large方法的具体用法?Java InstanceType.M1Large怎么用?Java InstanceType.M1Large使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.amazonaws.services.ec2.model.InstanceType
的用法示例。
在下文中一共展示了InstanceType.M1Large方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testConfigRoundtrip
import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
public void testConfigRoundtrip() throws Exception {
String ami = "ami1";
String description = "foo ami";
EC2Tag tag1 = new EC2Tag( "name1", "value1" );
EC2Tag tag2 = new EC2Tag( "name2", "value2" );
List<EC2Tag> tags = new ArrayList<EC2Tag>();
tags.add( tag1 );
tags.add( tag2 );
SlaveTemplate orig = new SlaveTemplate(ami, EC2AbstractSlave.TEST_ZONE, null, "default", "foo", InstanceType.M1Large, "ttt", Node.Mode.NORMAL, description, "bar", "bbb", "aaa", "10", "fff", null, "-Xmx1g", false, "subnet 456", tags, null, false, null, "", true, false, "", false, "");
List<SlaveTemplate> templates = new ArrayList<SlaveTemplate>();
templates.add(orig);
AmazonEC2Cloud ac = new AmazonEC2Cloud("us-east-1", false, "abc", "def", "us-east-1", "ghi", "3", templates);
hudson.clouds.add(ac);
submit(createWebClient().goTo("configure").getFormByName("config"));
SlaveTemplate received = ((EC2Cloud)hudson.clouds.iterator().next()).getTemplate(description);
assertEqualBeans(orig, received, "ami,zone,description,remoteFS,type,jvmopts,stopOnTerminate,securityGroups,subnetId,usePrivateDnsName,useEphemeralDevices,useDedicatedTenancy");
}
示例2: testConfigRoundtripWithPrivateDns
import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
public void testConfigRoundtripWithPrivateDns() throws Exception {
String ami = "ami1";
String description = "foo ami";
EC2Tag tag1 = new EC2Tag( "name1", "value1" );
EC2Tag tag2 = new EC2Tag( "name2", "value2" );
List<EC2Tag> tags = new ArrayList<EC2Tag>();
tags.add( tag1 );
tags.add( tag2 );
SlaveTemplate orig = new SlaveTemplate(ami, EC2AbstractSlave.TEST_ZONE, null, "default", "foo", InstanceType.M1Large, "ttt", Node.Mode.NORMAL, description, "bar", "bbb", "aaa", "10", "fff", null, "-Xmx1g", false, "subnet 456", tags, null, true, null, "", false, false, "", false, "");
List<SlaveTemplate> templates = new ArrayList<SlaveTemplate>();
templates.add(orig);
AmazonEC2Cloud ac = new AmazonEC2Cloud("us-east-1", false, "abc", "def", "us-east-1", "ghi", "3", templates);
hudson.clouds.add(ac);
submit(createWebClient().goTo("configure").getFormByName("config"));
SlaveTemplate received = ((EC2Cloud)hudson.clouds.iterator().next()).getTemplate(description);
assertEqualBeans(orig, received, "ami,zone,description,remoteFS,type,jvmopts,stopOnTerminate,securityGroups,subnetId,tags,usePrivateDnsName");
}
示例3: testConfigWithSpotBidPrice
import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
/**
* Tests to make sure the slave created has been configured properly.
* Also tests to make sure the spot max bid price has been set properly.
* @throws Exception - Exception that can be thrown by the Jenkins test harness
*/
public void testConfigWithSpotBidPrice() throws Exception {
String ami = "ami1";
String description = "foo ami";
EC2Tag tag1 = new EC2Tag( "name1", "value1" );
EC2Tag tag2 = new EC2Tag( "name2", "value2" );
List<EC2Tag> tags = new ArrayList<EC2Tag>();
tags.add( tag1 );
tags.add( tag2 );
SpotConfiguration spotConfig = new SpotConfiguration(".05", SpotInstanceType.OneTime.toString());
SlaveTemplate orig = new SlaveTemplate(ami, EC2AbstractSlave.TEST_ZONE, spotConfig, "default", "foo", InstanceType.M1Large, "ttt", Node.Mode.NORMAL, "foo ami", "bar", "bbb", "aaa", "10", "fff", null, "-Xmx1g", false, "subnet 456", tags, null, true, null, "", false, false, "", false, "");
List<SlaveTemplate> templates = new ArrayList<SlaveTemplate>();
templates.add(orig);
AmazonEC2Cloud ac = new AmazonEC2Cloud("us-east-1", false, "abc", "def", "us-east-1", "ghi", "3", templates);
hudson.clouds.add(ac);
submit(createWebClient().goTo("configure").getFormByName("config"));
SlaveTemplate received = ((EC2Cloud)hudson.clouds.iterator().next()).getTemplate(description);
assertEqualBeans(orig, received, "ami,zone,spotConfig,description,remoteFS,type,jvmopts,stopOnTerminate,securityGroups,subnetId,tags,usePrivateDnsName");
}
示例4: testConfigRoundtripIamRole
import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
/**
* Test to make sure the IAM Role is set properly.
*
* @throws Exception
*/
public void testConfigRoundtripIamRole() throws Exception {
String ami = "ami1";
String description = "foo ami";
EC2Tag tag1 = new EC2Tag( "name1", "value1" );
EC2Tag tag2 = new EC2Tag( "name2", "value2" );
List<EC2Tag> tags = new ArrayList<EC2Tag>();
tags.add( tag1 );
tags.add( tag2 );
SlaveTemplate orig = new SlaveTemplate(ami, EC2AbstractSlave.TEST_ZONE, null, "default", "foo", InstanceType.M1Large, "ttt", Node.Mode.NORMAL, description, "bar", "bbb", "aaa", "10", "fff", null, "-Xmx1g", false, "subnet 456", tags, null, false, null, "iamInstanceProfile", false, false, "", false, "");
List<SlaveTemplate> templates = new ArrayList<SlaveTemplate>();
templates.add(orig);
AmazonEC2Cloud ac = new AmazonEC2Cloud("us-east-1", false, "abc", "def", "us-east-1", "ghi", "3", templates);
hudson.clouds.add(ac);
submit(createWebClient().goTo("configure").getFormByName("config"));
SlaveTemplate received = ((EC2Cloud)hudson.clouds.iterator().next()).getTemplate(description);
assertEqualBeans(orig, received, "ami,zone,description,remoteFS,type,jvmopts,stopOnTerminate,securityGroups,subnetId,usePrivateDnsName,iamInstanceProfile");
}
示例5: testWindowsConfigRoundTrip
import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
public void testWindowsConfigRoundTrip() throws Exception {
String ami = "ami1";
String description = "foo ami";
EC2Tag tag1 = new EC2Tag( "name1", "value1" );
EC2Tag tag2 = new EC2Tag( "name2", "value2" );
List<EC2Tag> tags = new ArrayList<EC2Tag>();
tags.add( tag1 );
tags.add( tag2 );
SlaveTemplate orig = new SlaveTemplate(ami, EC2AbstractSlave.TEST_ZONE, null, "default", "foo", InstanceType.M1Large, "ttt", Node.Mode.NORMAL, description, "bar", "bbb", "aaa", "10", "rrr", new WindowsData("password", false, ""), "-Xmx1g", false, "subnet 456", tags, null, false, null, "", true, false, "", false, "");
List<SlaveTemplate> templates = new ArrayList<SlaveTemplate>();
templates.add(orig);
AmazonEC2Cloud ac = new AmazonEC2Cloud("us-east-1", false, "abc", "def", "us-east-1", "ghi", "3", templates);
hudson.clouds.add(ac);
submit(createWebClient().goTo("configure").getFormByName("config"));
SlaveTemplate received = ((EC2Cloud)hudson.clouds.iterator().next()).getTemplate(description);
assertEqualBeans(orig, received, "amiType");
}
示例6: testUnixConfigRoundTrip
import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
public void testUnixConfigRoundTrip() throws Exception {
String ami = "ami1";
String description = "foo ami";
EC2Tag tag1 = new EC2Tag( "name1", "value1" );
EC2Tag tag2 = new EC2Tag( "name2", "value2" );
List<EC2Tag> tags = new ArrayList<EC2Tag>();
tags.add( tag1 );
tags.add( tag2 );
SlaveTemplate orig = new SlaveTemplate(ami, EC2AbstractSlave.TEST_ZONE, null, "default", "foo", InstanceType.M1Large, "ttt", Node.Mode.NORMAL, description, "bar", "bbb", "aaa", "10", "rrr", new UnixData("sudo", "22"), "-Xmx1g", false, "subnet 456", tags, null, false, null, "", true, false, "", false, "");
List<SlaveTemplate> templates = new ArrayList<SlaveTemplate>();
templates.add(orig);
AmazonEC2Cloud ac = new AmazonEC2Cloud("us-east-1", false, "abc", "def", "us-east-1", "ghi", "3", templates);
hudson.clouds.add(ac);
submit(createWebClient().goTo("configure").getFormByName("config"));
SlaveTemplate received = ((EC2Cloud)hudson.clouds.iterator().next()).getTemplate(description);
assertEqualBeans(orig, received, "amiType");
}
示例7: testUpdateRemoteTags
import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
@Test
public void testUpdateRemoteTags() throws Exception {
AmazonEC2 ec2 = new AmazonEC2Client() {
@Override
public void createTags(com.amazonaws.services.ec2.model.CreateTagsRequest createTagsRequest) {
}
};
String ami = "ami1";
String description = "foo ami";
EC2Tag tag1 = new EC2Tag("name1", "value1");
EC2Tag tag2 = new EC2Tag("name2", "value2");
List<EC2Tag> tags = new ArrayList<EC2Tag>();
tags.add(tag1);
tags.add(tag2);
String instanceId = "123";
SlaveTemplate orig = new SlaveTemplate(ami, EC2AbstractSlave.TEST_ZONE, null, "default", "foo", InstanceType.M1Large, "ttt", Node.Mode.NORMAL, description, "bar", "bbb", "aaa", "10", "fff", null, "-Xmx1g", false, "subnet 456", tags, null, false, null, "", true, false, "", false, "") {
@Override
protected Object readResolve() {
return null;
}
};
ArrayList<Tag> awsTags = new ArrayList<Tag>();
awsTags.add(new Tag(EC2Tag.TAG_NAME_JENKINS_SLAVE_TYPE, "value1"));
awsTags.add(new Tag(EC2Tag.TAG_NAME_JENKINS_SLAVE_TYPE, "value2"));
final Object params[] = {ec2, awsTags, "InvalidInstanceRequestID.NotFound", instanceId};
Whitebox.invokeMethod(orig, "updateRemoteTags", params);
assertEquals(0, handler.getRecords().size());
}
示例8: setUpCloud
import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
private void setUpCloud(String label, Node.Mode mode) throws Exception{
EC2Tag tag1 = new EC2Tag( "name1", "value1" );
EC2Tag tag2 = new EC2Tag( "name2", "value2" );
List<EC2Tag> tags = new ArrayList<EC2Tag>();
tags.add( tag1 );
tags.add( tag2 );
SlaveTemplate template = new SlaveTemplate("ami", "foo", null, "default", "zone", InstanceType.M1Large, label, mode,"foo ami", "bar", "bbb", "aaa", "10", "fff", null, "-Xmx1g", true, "subnet 456", tags, null, false, null, "", false, false, null, false, "");
List<SlaveTemplate> templates = new ArrayList<SlaveTemplate>();
templates.add(template);
ac = new AmazonEC2Cloud("us-east-1", false, "abc", "def", "us-east-1", "ghi", "3", templates);
}
示例9: testUpdateRemoteTagsInstanceNotFound
import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
@Test
public void testUpdateRemoteTagsInstanceNotFound() throws Exception {
AmazonEC2 ec2 = new AmazonEC2Client() {
@Override
public void createTags(com.amazonaws.services.ec2.model.CreateTagsRequest createTagsRequest) {
AmazonServiceException e = new AmazonServiceException("Instance not found - InvalidInstanceRequestID.NotFound");
e.setErrorCode("InvalidInstanceRequestID.NotFound");
throw e;
}
};
String ami = "ami1";
String description = "foo ami";
EC2Tag tag1 = new EC2Tag("name1", "value1");
EC2Tag tag2 = new EC2Tag("name2", "value2");
List<EC2Tag> tags = new ArrayList<EC2Tag>();
tags.add(tag1);
tags.add(tag2);
String instanceId = "123";
SlaveTemplate orig = new SlaveTemplate(ami, EC2AbstractSlave.TEST_ZONE, null, "default", "foo", InstanceType.M1Large, "ttt", Node.Mode.NORMAL, description, "bar", "bbb", "aaa", "10", "fff", null, "-Xmx1g", false, "subnet 456", tags, null, false, null, "", true, false, "", false, "") {
@Override
protected Object readResolve() {
return null;
}
};
ArrayList<Tag> awsTags = new ArrayList<Tag>();
awsTags.add(new Tag(EC2Tag.TAG_NAME_JENKINS_SLAVE_TYPE, "value1"));
awsTags.add(new Tag(EC2Tag.TAG_NAME_JENKINS_SLAVE_TYPE, "value2"));
final Object params[] = {ec2, awsTags, "InvalidSpotInstanceRequestID.NotFound", instanceId};
Whitebox.invokeMethod(orig, "updateRemoteTags", params);
assertEquals(5, handler.getRecords().size());
Iterator<LogRecord> logs = handler.getRecords().iterator();
while (logs.hasNext()) {
String log = logs.next().getMessage();
assertTrue(log.contains("Instance not found - InvalidInstanceRequestID.NotFound"));
}
}
示例10: testNullTimeoutShouldReturnMaxInt
import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
public void testNullTimeoutShouldReturnMaxInt(){
SlaveTemplate st = new SlaveTemplate("", EC2AbstractSlave.TEST_ZONE, null, "default", "foo", InstanceType.M1Large, "ttt", Node.Mode.NORMAL, "", "bar", "bbb", "aaa", "10", "fff", null, "-Xmx1g", false, "subnet 456", null, null, false, null, "iamInstanceProfile", false, false, null, false, "");
assertEquals(Integer.MAX_VALUE, st.getLaunchTimeout());
}
示例11: test0TimeoutShouldReturnMaxInt
import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
public void test0TimeoutShouldReturnMaxInt(){
SlaveTemplate st = new SlaveTemplate("", EC2AbstractSlave.TEST_ZONE, null, "default", "foo", InstanceType.M1Large, "ttt", Node.Mode.NORMAL, "", "bar", "bbb", "aaa", "10", "fff", null, "-Xmx1g", false, "subnet 456", null, null, false, null, "iamInstanceProfile", false, false, "0", false, "");
assertEquals(Integer.MAX_VALUE, st.getLaunchTimeout());
}
示例12: testNegativeTimeoutShouldReturnMaxInt
import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
public void testNegativeTimeoutShouldReturnMaxInt(){
SlaveTemplate st = new SlaveTemplate("", EC2AbstractSlave.TEST_ZONE, null, "default", "foo", InstanceType.M1Large, "ttt", Node.Mode.NORMAL, "", "bar", "bbb", "aaa", "10", "fff", null, "-Xmx1g", false, "subnet 456", null, null, false, null, "iamInstanceProfile", false, false, "-1", false, "");
assertEquals(Integer.MAX_VALUE, st.getLaunchTimeout());
}
示例13: testNonNumericTimeoutShouldReturnMaxInt
import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
public void testNonNumericTimeoutShouldReturnMaxInt(){
SlaveTemplate st = new SlaveTemplate("", EC2AbstractSlave.TEST_ZONE, null, "default", "foo", InstanceType.M1Large, "ttt", Node.Mode.NORMAL, "", "bar", "bbb", "aaa", "10", "fff", null, "-Xmx1g", false, "subnet 456", null, null, false, null, "iamInstanceProfile", false, false, "NotANumber", false, "");
assertEquals(Integer.MAX_VALUE, st.getLaunchTimeout());
}
示例14: testAssociatePublicIpSetting
import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
public void testAssociatePublicIpSetting(){
SlaveTemplate st = new SlaveTemplate("", EC2AbstractSlave.TEST_ZONE, null, "default", "foo", InstanceType.M1Large, "ttt", Node.Mode.NORMAL, "", "bar", "bbb", "aaa", "10", "fff", null, "-Xmx1g", false, "subnet 456", null, null, false, null, "iamInstanceProfile", false, false, null, true, "");
assertEquals(true, st.getAssociatePublicIp());
}
示例15: testBackwardCompatibleUnixData
import com.amazonaws.services.ec2.model.InstanceType; //导入方法依赖的package包/类
public void testBackwardCompatibleUnixData(){
SlaveTemplate st = new SlaveTemplate("", EC2AbstractSlave.TEST_ZONE, null, "default", "foo", "22", InstanceType.M1Large, "ttt", Node.Mode.NORMAL, "", "bar", "bbb", "aaa", "10", "rrr", "sudo", "-Xmx1g", false, "subnet 456", null, null, false, null, "iamInstanceProfile", false, "NotANumber");
assertFalse(st.isWindowsSlave());
assertEquals(22, st.getSshPort());
assertEquals("sudo", st.getRootCommandPrefix());
}