當前位置: 首頁>>代碼示例>>Java>>正文


Java CreateDeploymentResult類代碼示例

本文整理匯總了Java中com.amazonaws.services.apigateway.model.CreateDeploymentResult的典型用法代碼示例。如果您正苦於以下問題:Java CreateDeploymentResult類的具體用法?Java CreateDeploymentResult怎麽用?Java CreateDeploymentResult使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CreateDeploymentResult類屬於com.amazonaws.services.apigateway.model包,在下文中一共展示了CreateDeploymentResult類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: deploy

import com.amazonaws.services.apigateway.model.CreateDeploymentResult; //導入依賴的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.CreateDeploymentResult; //導入依賴的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.CreateDeploymentResult類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。