• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Parameter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.amazonaws.services.cloudformation.model.Parameter的典型用法代码示例。如果您正苦于以下问题:Java Parameter类的具体用法?Java Parameter怎么用?Java Parameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Parameter类属于com.amazonaws.services.cloudformation.model包,在下文中一共展示了Parameter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testCentOS

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void testCentOS() throws Exception {
    final String stackName = "showcase-" + this.random8String();
    final String userName = "user-" + this.random8String();
    try {
        final User user = this.createUser(userName);
        try {
            this.createStack(stackName,
                    "showcase.yaml",
                    new Parameter().withParameterKey("VPC").withParameterValue(this.getDefaultVPC().getVpcId()),
                    new Parameter().withParameterKey("Subnet").withParameterValue(this.getDefaultSubnets().get(0).getSubnetId()),
                    new Parameter().withParameterKey("OS").withParameterValue("CentOS")
            );
            final String host = this.getStackOutputValue(stackName, "PublicName");
            this.probeSSH(host, user);
        } finally {
            this.deleteStack(stackName);
        }
    } finally {
        this.deleteUser(userName);
    }
}
 
开发者ID:widdix,项目名称:aws-ec2-ssh,代码行数:23,代码来源:TestShowcase.java


示例2: testRHEL

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void testRHEL() throws Exception {
    final String stackName = "showcase-" + this.random8String();
    final String userName = "user-" + this.random8String();
    try {
        final User user = this.createUser(userName);
        try {
            this.createStack(stackName,
                    "showcase.yaml",
                    new Parameter().withParameterKey("VPC").withParameterValue(this.getDefaultVPC().getVpcId()),
                    new Parameter().withParameterKey("Subnet").withParameterValue(this.getDefaultSubnets().get(0).getSubnetId()),
                    new Parameter().withParameterKey("OS").withParameterValue("RHEL")
            );
            final String host = this.getStackOutputValue(stackName, "PublicName");
            this.probeSSH(host, user);
        } finally {
            this.deleteStack(stackName);
        }
    } finally {
        this.deleteUser(userName);
    }
}
 
开发者ID:widdix,项目名称:aws-ec2-ssh,代码行数:23,代码来源:TestShowcase.java


示例3: testSUSELinuxEnterpriseServer

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void testSUSELinuxEnterpriseServer() throws Exception {
    final String stackName = "showcase-" + this.random8String();
    final String userName = "user-" + this.random8String();
    try {
        final User user = this.createUser(userName);
        try {
            this.createStack(stackName,
                    "showcase.yaml",
                    new Parameter().withParameterKey("VPC").withParameterValue(this.getDefaultVPC().getVpcId()),
                    new Parameter().withParameterKey("Subnet").withParameterValue(this.getDefaultSubnets().get(0).getSubnetId()),
                    new Parameter().withParameterKey("OS").withParameterValue("SUSELinuxEnterpriseServer")
            );
            final String host = this.getStackOutputValue(stackName, "PublicName");
            this.probeSSH(host, user);
        } finally {
            this.deleteStack(stackName);
        }
    } finally {
        this.deleteUser(userName);
    }
}
 
开发者ID:widdix,项目名称:aws-ec2-ssh,代码行数:23,代码来源:TestShowcase.java


示例4: testUbuntu

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void testUbuntu() throws Exception {
    final String stackName = "showcase-" + this.random8String();
    final String userName = "user-" + this.random8String();
    try {
        final User user = this.createUser(userName);
        try {
            this.createStack(stackName,
                    "showcase.yaml",
                    new Parameter().withParameterKey("VPC").withParameterValue(this.getDefaultVPC().getVpcId()),
                    new Parameter().withParameterKey("Subnet").withParameterValue(this.getDefaultSubnets().get(0).getSubnetId()),
                    new Parameter().withParameterKey("OS").withParameterValue("Ubuntu")
            );
            final String host = this.getStackOutputValue(stackName, "PublicName");
            this.probeSSH(host, user);
        } finally {
            this.deleteStack(stackName);
        }
    } finally {
        this.deleteUser(userName);
    }
}
 
开发者ID:widdix,项目名称:aws-ec2-ssh,代码行数:23,代码来源:TestShowcase.java


示例5: testAmazonLinux2

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void testAmazonLinux2() throws Exception {
    final String stackName = "showcase-" + this.random8String();
    final String userName = "user-" + this.random8String();
    try {
        final User user = this.createUser(userName);
        try {
            this.createStack(stackName,
                    "showcase.yaml",
                    new Parameter().withParameterKey("VPC").withParameterValue(this.getDefaultVPC().getVpcId()),
                    new Parameter().withParameterKey("Subnet").withParameterValue(this.getDefaultSubnets().get(0).getSubnetId()),
                    new Parameter().withParameterKey("OS").withParameterValue("AmazonLinux2")
            );
            final String host = this.getStackOutputValue(stackName, "PublicName");
            this.probeSSH(host, user);
        } finally {
            this.deleteStack(stackName);
        }
    } finally {
        this.deleteUser(userName);
    }
}
 
开发者ID:widdix,项目名称:aws-ec2-ssh,代码行数:23,代码来源:TestShowcase.java


示例6: testDefaultAmazonLinux

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void testDefaultAmazonLinux() throws Exception {
    final String stackName = "showcase-" + this.random8String();
    final String userName = "user-" + this.random8String();
    try {
        final User user = this.createUser(userName);
        try {
            this.createStack(stackName,
                    "showcase.yaml",
                    new Parameter().withParameterKey("VPC").withParameterValue(this.getDefaultVPC().getVpcId()),
                    new Parameter().withParameterKey("Subnet").withParameterValue(this.getDefaultSubnets().get(0).getSubnetId())
            );
            final String host = this.getStackOutputValue(stackName, "PublicName");
            this.probeSSH(host, user);
        } finally {
            this.deleteStack(stackName);
        }
    } finally {
        this.deleteUser(userName);
    }
}
 
开发者ID:widdix,项目名称:aws-ec2-ssh,代码行数:22,代码来源:TestShowcase.java


示例7: test

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void test() {
    final String vpcStackName = "vpc-2azs-" + this.random8String();
    final String endpointStackName = "vpc-endpoint-dynamodb-" + this.random8String();
    final String classB = "10";
    try {
        this.createStack(vpcStackName,
                "vpc/vpc-2azs.yaml",
                new Parameter().withParameterKey("ClassB").withParameterValue(classB)
        );
        try {
            this.createStack(endpointStackName,
                    "vpc/vpc-endpoint-dynamodb.yaml",
                    new Parameter().withParameterKey("ParentVPCStack").withParameterValue(vpcStackName)
            );
            // TODO how can we check if this stack works?
        } finally {
            this.deleteStack(endpointStackName);
        }
    } finally {
        this.deleteStack(vpcStackName);
    }
}
 
开发者ID:widdix,项目名称:aws-cf-templates,代码行数:24,代码来源:TestVPCEndpointDynamoDB.java


示例8: test

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void test() {
    final String vpcStackName = "vpc-2azs-" + this.random8String();
    final String natStackName = "vpc-nat-gateway-" + this.random8String();
    final String classB = "10";
    try {
        this.createStack(vpcStackName,
                "vpc/vpc-2azs.yaml",
                new Parameter().withParameterKey("ClassB").withParameterValue(classB)
        );
        try {
            this.createStack(natStackName,
                    "vpc/vpc-nat-gateway.yaml",
                    new Parameter().withParameterKey("ParentVPCStack").withParameterValue(vpcStackName)
            );
            this.testVPCSubnetInternetAccess(vpcStackName, "SubnetAPrivate");
        } finally {
            this.deleteStack(natStackName);
        }
    } finally {
        this.deleteStack(vpcStackName);
    }
}
 
开发者ID:widdix,项目名称:aws-cf-templates,代码行数:24,代码来源:TestVPCNatGateway.java


示例9: test

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void test() {
    final String stackName = "vpc-4azs-" + this.random8String();
    try {
        this.createStack(stackName,
                "vpc/vpc-4azs.yaml",
                new Parameter().withParameterKey("ClassB").withParameterValue("10")
        );
        this.testVPCSubnetInternetAccess(stackName, "SubnetAPublic");
        this.testVPCSubnetInternetAccess(stackName, "SubnetBPublic");
        this.testVPCSubnetInternetAccess(stackName, "SubnetCPublic");
        this.testVPCSubnetInternetAccess(stackName, "SubnetDPublic");
    } finally {
        this.deleteStack(stackName);
    }
}
 
开发者ID:widdix,项目名称:aws-cf-templates,代码行数:17,代码来源:TestVPC4AZs.java


示例10: test

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void test() {
    final String vpcStackName = "vpc-2azs-" + this.random8String();
    final String endpointStackName = "vpc-endpoint-s3-" + this.random8String();
    final String classB = "10";
    try {
        this.createStack(vpcStackName,
                "vpc/vpc-2azs.yaml",
                new Parameter().withParameterKey("ClassB").withParameterValue(classB)
        );
        try {
            this.createStack(endpointStackName,
                    "vpc/vpc-endpoint-s3.yaml",
                    new Parameter().withParameterKey("ParentVPCStack").withParameterValue(vpcStackName)
            );
            // TODO how can we check if this stack works?
        } finally {
            this.deleteStack(endpointStackName);
        }
    } finally {
        this.deleteStack(vpcStackName);
    }
}
 
开发者ID:widdix,项目名称:aws-cf-templates,代码行数:24,代码来源:TestVPCEndpointS3.java


示例11: invoke

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Override
public void invoke(FacadeFactory factory, ProjectAndEnv projectAndEnv, Collection<Parameter> cfnParams,
                   Collection<Parameter> artifacts, String... argument) throws IOException, InterruptedException,
        CfnAssistException, MissingArgumentException {
    AwsFacade facade = factory.createFacade();

    String filename;
    if (argument==null) {
        String home = System.getenv("HOME");
        String keypairName = format("%s_%s", projectAndEnv.getProject(), projectAndEnv.getEnv());
        filename = format("%s/.ssh/%s.pem", home, keypairName);
    } else {
        filename = argument[0];
    }

    KeyPair keyPair = facade.createKeyPair(projectAndEnv, factory.getSavesFile(), filename);
    System.out.println(format("Created key %s with fingerprint %s", keyPair.getKeyName(),
            keyPair.getKeyFingerprint()));
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:20,代码来源:CreateKeyPairAction.java


示例12: createRequiredParameters

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
public Collection<Parameter> createRequiredParameters(ProjectAndEnv projAndEnv,
                                                         Collection<Parameter> userParameters,
                                                         List<TemplateParameter> declaredParameters,
                                                         ProvidesZones providesZones)
		throws InvalidStackParameterException,
		IOException, CannotFindVpcException {
	
	Collection<Parameter> result  = new LinkedList<>();
	result.addAll(userParameters);
	
	checkNoClashWithBuiltInParameters(result);
	for(PopulatesParameters populator : populators) {
		populator.addParameters(result, declaredParameters, projAndEnv, providesZones);
	}
	
	logAllParameters(result, declaredParameters);
	return result;
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:19,代码来源:ParameterFactory.java


示例13: fetchAutopopulateParametersFor

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
private List<Parameter> fetchAutopopulateParametersFor(ProjectAndEnv projectAndEnv, List<TemplateParameter> declaredParameters, Map<String, AvailabilityZone> zones) throws IOException, InvalidStackParameterException, CannotFindVpcException {
	logger.info(String.format("Discover and populate parameters for %s and %s", templateFile.getAbsolutePath(), projectAndEnv));
	List<Parameter> matches = new LinkedList<>();
	for(TemplateParameter templateParam : declaredParameters) {
		String name = templateParam.getParameterKey();
		if (isBuiltInParamater(name))
		{
			continue;
		}
		logger.info("Checking if parameter should be auto-populated from an existing resource, param name is " + name);
		String description = templateParam.getDescription();
		if (shouldPopulateFor(description)) {
			populateParameter(projectAndEnv, matches, name, description, declaredParameters, zones);
		}
	}
	return matches;
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:18,代码来源:AutoDiscoverParams.java


示例14: populateParamForZone

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
private void populateParamForZone(Collection<Parameter> results,
								  List<TemplateParameter> declaredParameters,
								  Map<String, AvailabilityZone> zones, String parameterName,
								  String parameterDescription) {
	logger.info(String.format("Check parameter for zone %s and target %s", parameterName, parameterDescription));
	String target = parameterDescription.replaceFirst(PopulatesParameters.CFN_TAG_ZONE, "").toLowerCase();
	logger.debug("Check for zone " + target);
	if (zones.containsKey(target)) {
		String zoneName = zones.get(target).getZoneName();
		declaredParameters.stream().filter(declaredParameter -> declaredParameter.getParameterKey().equals(parameterName)).
				forEach(declaredParameter -> {
					addParameterTo(results, declaredParameters, parameterName, zoneName);
					logger.info(String.format("Adding zone parameter %s with value %s", parameterName, zoneName));
				});
	} else {
		logger.error("Could not find matching zone for target " + target);
	}
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:19,代码来源:AutoDiscoverParams.java


示例15: addParameterTo

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
protected void addParameterTo(Collection<Parameter> parameters, List<TemplateParameter> declared, String parameterName, String parameterValue) {
	boolean isDeclared = false;
	for(TemplateParameter declaration : declared) {
		isDeclared = (declaration.getParameterKey().equals(parameterName));
		if (isDeclared==true) break;
	}
	if (!isDeclared) {
		logger.info(String.format("Not populating parameter %s as it is not declared in the json file", parameterName));
	} else {
		logger.info(String.format("Setting %s parameter to %s", parameterName, parameterValue));
		Parameter parameter = new Parameter();
		parameter.setParameterKey(parameterName);
		parameter.setParameterValue(parameterValue);
		parameters.add(parameter);
	}
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:17,代码来源:PopulatesParameters.java


示例16: execute

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Override
public void execute(FacadeFactory factory, ProjectAndEnv projectAndEnv,
		Collection<Parameter> cfnParams, Collection<Parameter> artifacts)
		throws IOException, InterruptedException,
		CfnAssistException, CommandLineException, MissingArgumentException {
	String path = target.getAbsolutePath();

	if (!target.isDirectory()) {
		throw new BuildException(
				String.format("Target %s was not a directory, please provide a directory for the diagrams to be saved into", path));
	}
	
	CreateDiagramAction action = new CreateDiagramAction();
	
	action.validate(projectAndEnv, cfnParams, artifacts, path);
	action.invoke(factory, projectAndEnv, cfnParams, artifacts, path);

}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:19,代码来源:DiagramsElement.java


示例17: execute

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Override
public void execute(FacadeFactory factory, ProjectAndEnv projectAndEnv, Collection<Parameter> cfnParams, Collection<Parameter> artifacts) 
		throws IOException, InterruptedException, CfnAssistException,
		CommandLineException, MissingArgumentException {
	String absolutePath = target.getAbsolutePath();
	CommandLineAction actionToInvoke = null;
	if (target.isDirectory()) {
		actionToInvoke = new DirAction();
	} else if (target.isFile()) {
		actionToInvoke = new FileAction();
	} 
	
	if (actionToInvoke==null) {
		throw new BuildException("Unable to action on path, expect file or folder, path was: " + absolutePath);
	} 
	actionToInvoke.validate(projectAndEnv, cfnParams, artifacts, absolutePath);
	actionToInvoke.invoke(factory, projectAndEnv, cfnParams, artifacts, absolutePath);		
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:19,代码来源:TemplatesElement.java


示例18: processArtifact

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
private Parameter processArtifact(Parameter artifact) {
	String fullFilePath = artifact.getParameterValue();
	File item = FileUtils.getFile(fullFilePath);
	
	URL url;
	if (item.isDirectory()) {
		for (File file : item.listFiles()) {
			if (file.isFile()) {
				URL fileUrl = uploadItem(file);
				logger.info(String.format("Uploaded %s at URL %s", file.getAbsolutePath(), fileUrl));
			} else {
				logger.warn("Skipped item " + file.getAbsolutePath());
			}
		}
		url = s3Client.getUrl(bucketName, buildNumber.toString());
	} else {
		url = uploadItem(item);
	}
	logger.info(String.format("Uploaded %s at URL %s", item.getAbsolutePath(), url));
	return new Parameter().withParameterKey(artifact.getParameterKey()).withParameterValue(url.toString());
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:22,代码来源:ArtifactUploader.java


示例19: canDeleteArtifactsFromS3

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
@Test
public void canDeleteArtifactsFromS3() {
	List<Parameter> arts = new LinkedList<>();
	
	// any files would do here
	Parameter artA = new Parameter().withParameterKey("urlA").withParameterValue(FilesForTesting.INSTANCE); 
	arts.add(artA);	
	ArtifactUploader uploader = new ArtifactUploader(s3Client, EnvironmentSetupForTests.BUCKET_NAME, BUILD_NUMBER);
	uploader.uploadArtifacts(arts);	
	
	// check upload actually happened	
	List<S3ObjectSummary> objectSummaries = EnvironmentSetupForTests.getBucketObjects(s3Client);
	assertTrue(EnvironmentSetupForTests.isContainedIn(objectSummaries, KEY_A));
	
	uploader.delete("instance.json");
	objectSummaries = EnvironmentSetupForTests.getBucketObjects(s3Client);
	assertFalse(EnvironmentSetupForTests.isContainedIn(objectSummaries, KEY_A));
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:19,代码来源:TestArtifactUploader.java


示例20: createTemporarySimpleStack

import com.amazonaws.services.cloudformation.model.Parameter; //导入依赖的package包/类
public static StackNameAndId createTemporarySimpleStack(AmazonCloudFormation cfnClient, String vpcId, String arn) throws IOException {
	CreateStackRequest createStackRequest = new CreateStackRequest();
	createStackRequest.setStackName(TEMPORARY_STACK);
	File file = new File(FilesForTesting.SIMPLE_STACK);
	createStackRequest.setTemplateBody(FileUtils.readFileToString(file , Charset.defaultCharset()));
	Collection<Parameter> parameters = new LinkedList<>();
	parameters.add(createParam("env", EnvironmentSetupForTests.ENV));
	parameters.add(createParam("vpc", vpcId));
	if (!arn.isEmpty()) {
		Collection<String> notificationARNs = new LinkedList<>();
		notificationARNs.add(arn);
		logger.debug("Adding arn subscription "+ arn);
		createStackRequest.setNotificationARNs(notificationARNs);
	}
	createStackRequest.setParameters(parameters);
	CreateStackResult result = cfnClient.createStack(createStackRequest);
	return new StackNameAndId(TEMPORARY_STACK, result.getStackId());
}
 
开发者ID:cartwrightian,项目名称:cfnassist,代码行数:19,代码来源:EnvironmentSetupForTests.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EigenvalueDecomposition类代码示例发布时间:2022-05-22
下一篇:
Java ChannelHandlerContext类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap