Search in sources :

Example 1 with ServiceDocument

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;
}
Also used : ServiceDocument(com.vmware.xenon.common.ServiceDocument)

Example 2 with ServiceDocument

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;
}
Also used : ArrayList(java.util.ArrayList) ServiceDocument(com.vmware.xenon.common.ServiceDocument) ComputeType(com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription.ComputeType)

Example 3 with ServiceDocument

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;
}
Also used : HealthCheckConfiguration(com.vmware.photon.controller.model.resources.LoadBalancerDescriptionService.LoadBalancerDescription.HealthCheckConfiguration) RouteConfiguration(com.vmware.photon.controller.model.resources.LoadBalancerDescriptionService.LoadBalancerDescription.RouteConfiguration) ServiceDocument(com.vmware.xenon.common.ServiceDocument)

Example 4 with ServiceDocument

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;
}
Also used : ServiceDocument(com.vmware.xenon.common.ServiceDocument)

Example 5 with ServiceDocument

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;
}
Also used : ServiceDocument(com.vmware.xenon.common.ServiceDocument)

Aggregations

ServiceDocument (com.vmware.xenon.common.ServiceDocument)47 Operation (com.vmware.xenon.common.Operation)11 URI (java.net.URI)6 ComputeDescription (com.vmware.photon.controller.model.resources.ComputeDescriptionService.ComputeDescription)5 ComputeService (com.vmware.photon.controller.model.resources.ComputeService)5 EndpointState (com.vmware.photon.controller.model.resources.EndpointService.EndpointState)5 EndpointAllocationTaskState (com.vmware.photon.controller.model.tasks.EndpointAllocationTaskService.EndpointAllocationTaskState)5 PhotonModelUriUtils.createInventoryUri (com.vmware.photon.controller.model.util.PhotonModelUriUtils.createInventoryUri)5 CompletionHandler (com.vmware.xenon.common.Operation.CompletionHandler)5 UriUtils (com.vmware.xenon.common.UriUtils)5 List (java.util.List)5 UriPaths (com.vmware.photon.controller.model.UriPaths)4 ServiceTypeCluster (com.vmware.photon.controller.model.util.ClusterUtil.ServiceTypeCluster)4 TaskState (com.vmware.xenon.common.TaskState)4 TaskStage (com.vmware.xenon.common.TaskState.TaskStage)4 Utils (com.vmware.xenon.common.Utils)4 TaskService (com.vmware.xenon.services.common.TaskService)4 TimeUnit (java.util.concurrent.TimeUnit)4 ComputeDescriptionService (com.vmware.photon.controller.model.resources.ComputeDescriptionService)3 ComputeState (com.vmware.photon.controller.model.resources.ComputeService.ComputeState)3