use of com.amazonaws.services.ec2.model.ResourceType in project SimianArmy by Netflix.
the class TestEBSSnapshotJanitorCrawler method testSnapshotsWithResourceType.
@Test
public void testSnapshotsWithResourceType() {
Date startTime = new Date();
List<Snapshot> snapshotList = createSnapshotList(startTime);
EBSSnapshotJanitorCrawler crawler = new EBSSnapshotJanitorCrawler(createMockAWSClient(snapshotList));
for (AWSResourceType resourceType : AWSResourceType.values()) {
List<Resource> resources = crawler.resources(resourceType);
if (resourceType == AWSResourceType.EBS_SNAPSHOT) {
verifySnapshotList(resources, snapshotList, startTime);
} else {
Assert.assertTrue(resources.isEmpty());
}
}
}
use of com.amazonaws.services.ec2.model.ResourceType in project SimianArmy by Netflix.
the class TestEBSVolumeJanitorCrawler method testVolumesWithResourceType.
@Test
public void testVolumesWithResourceType() {
Date createTime = new Date();
List<Volume> volumeList = createVolumeList(createTime);
EBSVolumeJanitorCrawler crawler = new EBSVolumeJanitorCrawler(createMockAWSClient(volumeList));
for (AWSResourceType resourceType : AWSResourceType.values()) {
List<Resource> resources = crawler.resources(resourceType);
if (resourceType == AWSResourceType.EBS_VOLUME) {
verifyVolumeList(resources, volumeList, createTime);
} else {
Assert.assertTrue(resources.isEmpty());
}
}
}
use of com.amazonaws.services.ec2.model.ResourceType in project photon-model by vmware.
the class AWSComputeStateCreationAdapterService method createInternalTypeTags.
private void createInternalTypeTags(AWSComputeStateCreationContext context, AWSComputeStateCreationStage next) {
// Go over the list of internal tags to be created. Find whatever already does not have an
// associated tag state and create an operation for its creation.
List<Operation> joinOperations = new ArrayList<>();
for (String resourceType : internalTagList) {
TagState typeTag = newTagState(TAG_KEY_TYPE, resourceType, false, context.request.tenantLinks);
Operation op = Operation.createPost(this, TagService.FACTORY_LINK).setBody(typeTag);
joinOperations.add(op);
}
OperationJoin.create(joinOperations).setCompletion((ops, exs) -> {
if (exs != null) {
exs.values().forEach(ex -> logWarning(() -> String.format("Error creating internal tag%s", ex.getMessage())));
context.creationStage = next;
handleComputeStateCreateOrUpdate(context);
return;
}
for (String internalTagValue : internalTagList) {
TagState tagState = newTagState(TAG_KEY_TYPE, internalTagValue, false, context.request.tenantLinks);
context.internalTagLinksMap.put(tagState.value, new HashSet<>(Arrays.asList(tagState.documentSelfLink)));
}
context.creationStage = next;
handleComputeStateCreateOrUpdate(context);
}).sendWith(this);
}
use of com.amazonaws.services.ec2.model.ResourceType in project photon-model by vmware.
the class AWSNetworkStateEnumerationAdapterService method createInternalTypeTags.
/**
* Method to create the internal tags for subnets and VPCs.
*/
private void createInternalTypeTags(AWSNetworkStateCreationContext context, AWSNetworkStateCreationStage next) {
// Go over the list of internal tags to be created. Find whatever already does not have an
// associated tag state and create an operation for its creation.
List<Operation> joinOperations = new ArrayList<>();
for (String resourceType : internalTagList) {
TagState typeTag = newTagState(TAG_KEY_TYPE, resourceType, false, context.request.tenantLinks);
Operation op = Operation.createPost(this, TagService.FACTORY_LINK).setBody(typeTag);
joinOperations.add(op);
}
OperationJoin.create(joinOperations).setCompletion((ops, exs) -> {
if (exs != null) {
exs.values().forEach(ex -> logWarning(() -> String.format("Error creating internal tag : %s", ex.getMessage())));
context.networkCreationStage = next;
handleNetworkStateChanges(context);
return;
}
for (String internalTagValue : internalTagList) {
TagState tagState = newTagState(TAG_KEY_TYPE, internalTagValue, false, context.request.tenantLinks);
if (internalTagValue.equalsIgnoreCase(AWSResourceType.ec2_vpc.toString())) {
context.networkInternalTagsMap.put(PhotonModelConstants.TAG_KEY_TYPE, tagState.value);
context.networkInternalTagLinksSet.add(tagState.documentSelfLink);
} else {
context.subnetInternalTagsMap.put(PhotonModelConstants.TAG_KEY_TYPE, tagState.value);
context.subnetInternalTagLinksSet.add(tagState.documentSelfLink);
}
}
context.networkCreationStage = next;
handleNetworkStateChanges(context);
}).sendWith(this);
}
use of com.amazonaws.services.ec2.model.ResourceType in project pathling by aehrc.
the class FhirServer method buildAggregateProviders.
@Nonnull
private List<IResourceProvider> buildAggregateProviders() {
final List<IResourceProvider> providers = new ArrayList<>();
// Instantiate an aggregate provider for every resource type in FHIR.
for (final ResourceType resourceType : ResourceType.values()) {
final IResourceProvider aggregateProvider = resourceProviderFactory.createAggregateResourceProvider(resourceType);
providers.add(aggregateProvider);
}
return providers;
}
Aggregations