use of com.vmware.xenon.common.ServiceDocument in project photon-model by vmware.
the class SslTrustCertificateService method getDocumentTemplate.
@Override
public ServiceDocument getDocumentTemplate() {
ServiceDocument template = super.getDocumentTemplate();
ServiceUtils.setRetentionLimit(template);
return template;
}
use of com.vmware.xenon.common.ServiceDocument in project photon-model by vmware.
the class ComputeDescriptionService method getDocumentTemplate.
@Override
public ServiceDocument getDocumentTemplate() {
ServiceDocument td = super.getDocumentTemplate();
// enable metadata indexing
td.documentDescription.documentIndexingOptions = EnumSet.of(DocumentIndexingOption.INDEX_METADATA);
ServiceUtils.setRetentionLimit(td);
ComputeDescription template = (ComputeDescription) td;
template.bootAdapterReference = UriUtils.buildUri(this.getHost(), "/bootAdapterReference");
template.powerAdapterReference = UriUtils.buildUri(this.getHost(), "/powerAdapterReference");
template.instanceAdapterReference = UriUtils.buildUri(this.getHost(), "/instanceAdapterReference");
template.diskAdapterReference = UriUtils.buildUri(this.getHost(), "/diskAdapterReference");
template.healthAdapterReference = UriUtils.buildUri(this.getHost(), "/healthAdapterReference");
template.statsAdapterReference = UriUtils.buildUri(this.getHost(), "/statsAdapterReference");
template.statsAdapterReferences = Collections.singleton(UriUtils.buildUri(this.getHost(), "/customStatsAdapterReference"));
template.enumerationAdapterReference = UriUtils.buildUri(this.getHost(), "/enumerationAdapterReference");
template.dataStoreId = null;
ArrayList<String> children = new ArrayList<>();
for (ComputeDescription.ComputeType type : ComputeDescription.ComputeType.values()) {
children.add(type.name());
}
template.supportedChildren = children;
template.environmentName = ComputeDescription.ENVIRONMENT_NAME_ON_PREMISE;
template.cpuCount = 2;
template.gpuCount = 1;
template.totalMemoryBytes = Integer.MAX_VALUE;
template.id = UUID.randomUUID().toString();
template.name = "friendly-name";
template.regionId = "provider-specific-regions";
template.zoneId = "provider-specific-zone";
template.instanceType = "provider-specific-instance-type";
return template;
}
use of com.vmware.xenon.common.ServiceDocument in project photon-model by vmware.
the class LoadBalancerService method getDocumentTemplate.
@Override
public ServiceDocument getDocumentTemplate() {
ServiceDocument td = super.getDocumentTemplate();
// enable metadata indexing
td.documentDescription.documentIndexingOptions = EnumSet.of(DocumentIndexingOption.INDEX_METADATA);
ServiceUtils.setRetentionLimit(td);
LoadBalancerState template = (LoadBalancerState) td;
template.id = UUID.randomUUID().toString();
template.descriptionLink = "lb-description-link";
template.name = "load-balancer";
template.endpointLink = UriUtils.buildUriPath(EndpointService.FACTORY_LINK, "my-endpoint");
template.internetFacing = Boolean.TRUE;
template.address = "my-address";
RouteConfiguration routeConfiguration = new RouteConfiguration();
routeConfiguration.protocol = Protocol.HTTP.name();
routeConfiguration.port = "80";
routeConfiguration.instanceProtocol = Protocol.HTTP.name();
routeConfiguration.instancePort = "80";
routeConfiguration.healthCheckConfiguration = new HealthCheckConfiguration();
routeConfiguration.healthCheckConfiguration.protocol = Protocol.HTTP.name();
routeConfiguration.healthCheckConfiguration.port = "80";
template.routes = Arrays.asList(routeConfiguration);
return template;
}
use of com.vmware.xenon.common.ServiceDocument in project photon-model by vmware.
the class NetworkInterfaceService method getDocumentTemplate.
@Override
public ServiceDocument getDocumentTemplate() {
ServiceDocument template = super.getDocumentTemplate();
// enable metadata indexing
template.documentDescription.documentIndexingOptions = EnumSet.of(DocumentIndexingOption.INDEX_METADATA);
ServiceUtils.setRetentionLimit(template);
return template;
}
use of com.vmware.xenon.common.ServiceDocument in project photon-model by vmware.
the class ResourcePoolService method getDocumentTemplate.
@Override
public ServiceDocument getDocumentTemplate() {
ServiceDocument template = super.getDocumentTemplate();
// enable metadata indexing
template.documentDescription.documentIndexingOptions = EnumSet.of(DocumentIndexingOption.INDEX_METADATA);
ServiceUtils.setRetentionLimit(template);
return template;
}
Aggregations