setStackName(stackName); return this;
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStackName() == null) ? 0 : getStackName().hashCode()); hashCode = prime * hashCode + ((getLogicalResourceId() == null) ? 0 : getLogicalResourceId().hashCode()); hashCode = prime * hashCode + ((getPhysicalResourceId() == null) ? 0 : getPhysicalResourceId().hashCode()); return hashCode; }
/** * <p> * The logical name of the resource as specified in the template. * </p> * <p> * Default: There is no default value. * </p> * * @param logicalResourceId * The logical name of the resource as specified in the template.</p> * <p> * Default: There is no default value. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeStackResourcesRequest withLogicalResourceId(String logicalResourceId) { setLogicalResourceId(logicalResourceId); return this; }
public static DescribeStackResourcesResult describeStackResourcesResult(final String stackName, final AmazonCloudFormation cloudFormationClient) { DescribeStackResourcesRequest stackResourceRequest = new DescribeStackResourcesRequest() .withStackName(stackName); return cloudFormationClient.describeStackResources(stackResourceRequest); }
describeStacksRequest.withStackName(stackName); final DescribeStackResourcesRequest stackResourceRequest = new DescribeStackResourcesRequest(); results.put(Outputs.STACK_OUTPUTS_RESULT,stack.getOutputs().toString()); stackResourceRequest.setStackName(stack.getStackName()); results.put(Outputs.STACK_RESOURCES_RESULT,stackBuilder.describeStackResources(stackResourceRequest).getStackResources().toString());
private String autoDetectStackName(String instanceId) { Assert.notNull(instanceId, "No valid instance id defined"); DescribeStackResourcesResult describeStackResourcesResult = this.amazonCloudFormationClient.describeStackResources(new DescribeStackResourcesRequest().withPhysicalResourceId(instanceId)); if (describeStackResourcesResult != null && describeStackResourcesResult.getStackResources() != null && !describeStackResourcesResult.getStackResources().isEmpty()) { return describeStackResourcesResult.getStackResources().get(0).getStackName(); } if (this.amazonEc2Client != null) { DescribeTagsResult describeTagsResult = this.amazonEc2Client.describeTags(new DescribeTagsRequest().withFilters( new Filter("resource-id", Collections.singletonList(instanceId)), new Filter("resource-type", Collections.singletonList("instance")), new Filter("key", Collections.singletonList("aws:cloudformation:stack-name")))); if (describeTagsResult != null && describeTagsResult.getTags() != null && !describeTagsResult.getTags().isEmpty()) { return describeTagsResult.getTags().get(0).getValue(); } } return null; } }
setPhysicalResourceId(physicalResourceId); return this;
public List<StackResource> getStackResources(String stackName) { if (getProject().getGradle().getStartParameter().isOffline() == false) { try { DescribeStackResourcesResult describeStackResourcesResult = getClient().describeStackResources(new DescribeStackResourcesRequest() .withStackName(stackName)); return describeStackResourcesResult.getStackResources(); } catch (AmazonCloudFormationException e) { if ("ValidationError".equals(e.getErrorCode())) { return Collections.emptyList(); } else { throw new GradleException(e.getMessage(), e); } } } logger.info("offline mode: return empty resources"); return Collections.emptyList(); }
private String autoDetectStackName(String instanceId) { Assert.notNull(instanceId, "No valid instance id defined"); DescribeStackResourcesResult describeStackResourcesResult = this.amazonCloudFormationClient.describeStackResources(new DescribeStackResourcesRequest().withPhysicalResourceId(instanceId)); if (describeStackResourcesResult != null && describeStackResourcesResult.getStackResources() != null && !describeStackResourcesResult.getStackResources().isEmpty()) { return describeStackResourcesResult.getStackResources().get(0).getStackName(); } if (this.amazonEc2Client != null) { DescribeTagsResult describeTagsResult = this.amazonEc2Client.describeTags(new DescribeTagsRequest().withFilters( new Filter("resource-id", Collections.singletonList(instanceId)), new Filter("resource-type", Collections.singletonList("instance")), new Filter("key", Collections.singletonList("aws:cloudformation:stack-name")))); if (describeTagsResult != null && describeTagsResult.getTags() != null && !describeTagsResult.getTags().isEmpty()) { return describeTagsResult.getTags().get(0).getValue(); } } return null; } }
setPhysicalResourceId(physicalResourceId); return this;
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeStackResourcesRequest == false) return false; DescribeStackResourcesRequest other = (DescribeStackResourcesRequest) obj; if (other.getStackName() == null ^ this.getStackName() == null) return false; if (other.getStackName() != null && other.getStackName().equals(this.getStackName()) == false) return false; if (other.getLogicalResourceId() == null ^ this.getLogicalResourceId() == null) return false; if (other.getLogicalResourceId() != null && other.getLogicalResourceId().equals(this.getLogicalResourceId()) == false) return false; if (other.getPhysicalResourceId() == null ^ this.getPhysicalResourceId() == null) return false; if (other.getPhysicalResourceId() != null && other.getPhysicalResourceId().equals(this.getPhysicalResourceId()) == false) return false; return true; }
setStackName(stackName); return this;
/** * <p> * The logical name of the resource as specified in the template. * </p> * <p> * Default: There is no default value. * </p> * * @param logicalResourceId * The logical name of the resource as specified in the template.</p> * <p> * Default: There is no default value. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeStackResourcesRequest withLogicalResourceId(String logicalResourceId) { setLogicalResourceId(logicalResourceId); return this; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getStackName() != null) sb.append("StackName: ").append(getStackName()).append(","); if (getLogicalResourceId() != null) sb.append("LogicalResourceId: ").append(getLogicalResourceId()).append(","); if (getPhysicalResourceId() != null) sb.append("PhysicalResourceId: ").append(getPhysicalResourceId()); sb.append("}"); return sb.toString(); }
public Request<DescribeStackResourcesRequest> marshall(DescribeStackResourcesRequest describeStackResourcesRequest) { if (describeStackResourcesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<DescribeStackResourcesRequest> request = new DefaultRequest<DescribeStackResourcesRequest>(describeStackResourcesRequest, "AmazonCloudFormation"); request.addParameter("Action", "DescribeStackResources"); request.addParameter("Version", "2010-05-15"); request.setHttpMethod(HttpMethodName.POST); if (describeStackResourcesRequest.getStackName() != null) { request.addParameter("StackName", StringUtils.fromString(describeStackResourcesRequest.getStackName())); } if (describeStackResourcesRequest.getLogicalResourceId() != null) { request.addParameter("LogicalResourceId", StringUtils.fromString(describeStackResourcesRequest.getLogicalResourceId())); } if (describeStackResourcesRequest.getPhysicalResourceId() != null) { request.addParameter("PhysicalResourceId", StringUtils.fromString(describeStackResourcesRequest.getPhysicalResourceId())); } return request; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStackName() == null) ? 0 : getStackName().hashCode()); hashCode = prime * hashCode + ((getLogicalResourceId() == null) ? 0 : getLogicalResourceId().hashCode()); hashCode = prime * hashCode + ((getPhysicalResourceId() == null) ? 0 : getPhysicalResourceId().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeStackResourcesRequest == false) return false; DescribeStackResourcesRequest other = (DescribeStackResourcesRequest) obj; if (other.getStackName() == null ^ this.getStackName() == null) return false; if (other.getStackName() != null && other.getStackName().equals(this.getStackName()) == false) return false; if (other.getLogicalResourceId() == null ^ this.getLogicalResourceId() == null) return false; if (other.getLogicalResourceId() != null && other.getLogicalResourceId().equals(this.getLogicalResourceId()) == false) return false; if (other.getPhysicalResourceId() == null ^ this.getPhysicalResourceId() == null) return false; if (other.getPhysicalResourceId() != null && other.getPhysicalResourceId().equals(this.getPhysicalResourceId()) == false) return false; return true; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getStackName() != null) sb.append("StackName: ").append(getStackName()).append(","); if (getLogicalResourceId() != null) sb.append("LogicalResourceId: ").append(getLogicalResourceId()).append(","); if (getPhysicalResourceId() != null) sb.append("PhysicalResourceId: ").append(getPhysicalResourceId()); sb.append("}"); return sb.toString(); }
public Request<DescribeStackResourcesRequest> marshall(DescribeStackResourcesRequest describeStackResourcesRequest) { if (describeStackResourcesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<DescribeStackResourcesRequest> request = new DefaultRequest<DescribeStackResourcesRequest>(describeStackResourcesRequest, "AmazonCloudFormation"); request.addParameter("Action", "DescribeStackResources"); request.addParameter("Version", "2010-05-15"); request.setHttpMethod(HttpMethodName.POST); if (describeStackResourcesRequest.getStackName() != null) { request.addParameter("StackName", StringUtils.fromString(describeStackResourcesRequest.getStackName())); } if (describeStackResourcesRequest.getLogicalResourceId() != null) { request.addParameter("LogicalResourceId", StringUtils.fromString(describeStackResourcesRequest.getLogicalResourceId())); } if (describeStackResourcesRequest.getPhysicalResourceId() != null) { request.addParameter("PhysicalResourceId", StringUtils.fromString(describeStackResourcesRequest.getPhysicalResourceId())); } return request; }