当前位置: 首页>>代码示例>>Java>>正文


Java InstanceType.M1Large方法代码示例

本文整理汇总了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");
   }
 
开发者ID:hudson3-plugins,项目名称:ec2-plugin,代码行数:23,代码来源:SlaveTemplateTest.java

示例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");
   }
 
开发者ID:hudson3-plugins,项目名称:ec2-plugin,代码行数:23,代码来源:SlaveTemplateTest.java

示例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");
}
 
开发者ID:hudson3-plugins,项目名称:ec2-plugin,代码行数:29,代码来源:SlaveTemplateTest.java

示例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");
}
 
开发者ID:hudson3-plugins,项目名称:ec2-plugin,代码行数:28,代码来源:SlaveTemplateTest.java

示例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");
}
 
开发者ID:hudson3-plugins,项目名称:ec2-plugin,代码行数:23,代码来源:SlaveTemplateTest.java

示例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");
}
 
开发者ID:hudson3-plugins,项目名称:ec2-plugin,代码行数:23,代码来源:SlaveTemplateTest.java

示例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());
}
 
开发者ID:hudson3-plugins,项目名称:ec2-plugin,代码行数:35,代码来源:SlaveTemplateUnitTest.java

示例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);
}
 
开发者ID:hudson3-plugins,项目名称:ec2-plugin,代码行数:14,代码来源:TemplateLabelsTest.java

示例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"));
    }

}
 
开发者ID:hudson3-plugins,项目名称:ec2-plugin,代码行数:45,代码来源:SlaveTemplateUnitTest.java

示例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());
}
 
开发者ID:hudson3-plugins,项目名称:ec2-plugin,代码行数:5,代码来源:SlaveTemplateTest.java

示例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());
}
 
开发者ID:hudson3-plugins,项目名称:ec2-plugin,代码行数:5,代码来源:SlaveTemplateTest.java

示例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());
}
 
开发者ID:hudson3-plugins,项目名称:ec2-plugin,代码行数:5,代码来源:SlaveTemplateTest.java

示例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());
}
 
开发者ID:hudson3-plugins,项目名称:ec2-plugin,代码行数:5,代码来源:SlaveTemplateTest.java

示例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());
}
 
开发者ID:hudson3-plugins,项目名称:ec2-plugin,代码行数:5,代码来源:SlaveTemplateTest.java

示例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());
}
 
开发者ID:hudson3-plugins,项目名称:ec2-plugin,代码行数:7,代码来源:SlaveTemplateTest.java


注:本文中的com.amazonaws.services.ec2.model.InstanceType.M1Large方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。