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


Java CreateDeploymentRequest类代码示例

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


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

示例1: deploy

import com.amazonaws.services.apigateway.model.CreateDeploymentRequest; //导入依赖的package包/类
public void deploy(AwsKeyPair keyPair, String region, final String restApiName, final String stage, Proxy proxy) {
    final AWSCredentialsProvider credentials = new AWSStaticCredentialsProvider(
            new BasicAWSCredentials(keyPair.key, keyPair.secret));

    ClientConfiguration cc = Util.createConfiguration(proxy);

    AmazonApiGateway ag = AmazonApiGatewayClientBuilder.standard().withCredentials(credentials) //
            .withClientConfiguration(cc) //
            .withRegion(region) //
            .build();
    GetRestApisResult apis = ag.getRestApis(new GetRestApisRequest().withLimit(10000));
    Optional<RestApi> api = apis.getItems().stream().filter(item -> item.getName().equals(restApiName)).findFirst();
    RestApi a = api.orElseThrow(() -> new RuntimeException("no rest api found with name='" + restApiName + "'"));
    String restApiId = a.getId();
    log.info("creating deployment of " + restApiId + " to stage " + stage);
    CreateDeploymentResult r = ag
            .createDeployment(new CreateDeploymentRequest().withRestApiId(restApiId).withStageName(stage));
    Map<String, Map<String, MethodSnapshot>> summary = r.getApiSummary();
    log.info("created deployment");
    log.info("summary=" + summary);
}
 
开发者ID:davidmoten,项目名称:aws-maven-plugin,代码行数:22,代码来源:ApiGatewayDeployer.java

示例2: stageApi

import com.amazonaws.services.apigateway.model.CreateDeploymentRequest; //导入依赖的package包/类
private CreateDeploymentResult stageApi(final CreateRestApiResult createApiResult) {
    final CreateDeploymentRequest cdrq = new CreateDeploymentRequest().withRestApiId(createApiResult.getId())
            .withStageName("advance");
    return this.awsApiClient.createDeployment(cdrq);
}
 
开发者ID:aztecrex,项目名称:java-translatebot,代码行数:6,代码来源:OauthHandlerDeployer.java


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