本文整理汇总了Java中com.amazonaws.services.ec2.model.UnmonitorInstancesResult类的典型用法代码示例。如果您正苦于以下问题:Java UnmonitorInstancesResult类的具体用法?Java UnmonitorInstancesResult怎么用?Java UnmonitorInstancesResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UnmonitorInstancesResult类属于com.amazonaws.services.ec2.model包,在下文中一共展示了UnmonitorInstancesResult类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unmonitorInstances
import com.amazonaws.services.ec2.model.UnmonitorInstancesResult; //导入依赖的package包/类
private void unmonitorInstances(AmazonEC2Client ec2Client, Exchange exchange) {
Collection instanceIds;
UnmonitorInstancesRequest request = new UnmonitorInstancesRequest();
if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(EC2Constants.INSTANCES_IDS))) {
instanceIds = exchange.getIn().getHeader(EC2Constants.INSTANCES_IDS, Collection.class);
request.withInstanceIds(instanceIds);
} else {
throw new IllegalArgumentException("Instances Ids must be specified");
}
UnmonitorInstancesResult result;
try {
result = ec2Client.unmonitorInstances(request);
} catch (AmazonServiceException ase) {
LOG.trace("Unmonitor Instances command returned the error code {}", ase.getErrorCode());
throw ase;
}
LOG.trace("Stop Monitoring instances with Ids [{}] ", Arrays.toString(instanceIds.toArray()));
Message message = getMessageForResponse(exchange);
message.setBody(result);
}
示例2: unmonitorInstances
import com.amazonaws.services.ec2.model.UnmonitorInstancesResult; //导入依赖的package包/类
@Override
public UnmonitorInstancesResult unmonitorInstances(UnmonitorInstancesRequest unmonitorInstancesRequest) {
UnmonitorInstancesResult result = new UnmonitorInstancesResult();
if (!unmonitorInstancesRequest.getInstanceIds().isEmpty()) {
Collection<InstanceMonitoring> coll = new ArrayList();
Iterator it = unmonitorInstancesRequest.getInstanceIds().iterator();
while (it.hasNext()) {
String id = (String) it.next();
InstanceMonitoring mon = new InstanceMonitoring();
mon.setInstanceId(id);
Monitoring monitoring = new Monitoring();
monitoring.setState(MonitoringState.Disabled);
mon.setMonitoring(monitoring);
coll.add(mon);
}
result.setInstanceMonitorings(coll);
}
return result;
}
示例3: unmonitor
import com.amazonaws.services.ec2.model.UnmonitorInstancesResult; //导入依赖的package包/类
@Override
public UnmonitorInstancesResult unmonitor(UnmonitorInstancesRequest request,
ResultCapture<UnmonitorInstancesResult> extractor) {
ActionResult result = resource.performAction("Unmonitor", request,
extractor);
if (result == null) return null;
return (UnmonitorInstancesResult) result.getData();
}
示例4: unmonitorInstances
import com.amazonaws.services.ec2.model.UnmonitorInstancesResult; //导入依赖的package包/类
@Override
public UnmonitorInstancesResult unmonitorInstances(UnmonitorInstancesRequest unmonitorInstancesRequest) throws AmazonServiceException, AmazonClientException {
throw new UnsupportedOperationException("Not supported in mock");
}
示例5: unmonitor
import com.amazonaws.services.ec2.model.UnmonitorInstancesResult; //导入依赖的package包/类
/**
* Performs the <code>Unmonitor</code> action.
*
* <p>
* The following request parameters will be populated from the data of this
* <code>Instance</code> resource, and any conflicting parameter value set
* in the request will be overridden:
* <ul>
* <li>
* <b><code>InstanceIds.0</code></b>
* - mapped from the <code>Id</code> identifier.
* </li>
* </ul>
*
* <p>
*
* @return The response of the low-level client operation associated with
* this resource action.
* @see UnmonitorInstancesRequest
*/
UnmonitorInstancesResult unmonitor(UnmonitorInstancesRequest request);