Search in sources :

Example 26 with ServiceDocument

use of com.vmware.xenon.common.ServiceDocument in project photon-model by vmware.

the class SubnetRangeService method getDocumentTemplate.

@Override
public ServiceDocument getDocumentTemplate() {
    ServiceDocument td = super.getDocumentTemplate();
    ServiceUtils.setRetentionLimit(td);
    // enable metadata indexing
    td.documentDescription.documentIndexingOptions = EnumSet.of(DocumentIndexingOption.INDEX_METADATA);
    SubnetRangeState template = (SubnetRangeState) td;
    template.id = UUID.randomUUID().toString();
    template.name = "subnet-range";
    return template;
}
Also used : ServiceDocument(com.vmware.xenon.common.ServiceDocument)

Example 27 with ServiceDocument

use of com.vmware.xenon.common.ServiceDocument in project photon-model by vmware.

the class DeploymentService method getDocumentTemplate.

@Override
public ServiceDocument getDocumentTemplate() {
    ServiceDocument td = super.getDocumentTemplate();
    // enable metadata indexing
    td.documentDescription.documentIndexingOptions = EnumSet.of(DocumentIndexingOption.INDEX_METADATA);
    ServiceUtils.setRetentionLimit(td);
    return td;
}
Also used : ServiceDocument(com.vmware.xenon.common.ServiceDocument)

Example 28 with ServiceDocument

use of com.vmware.xenon.common.ServiceDocument in project photon-model by vmware.

the class EndpointService 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 29 with ServiceDocument

use of com.vmware.xenon.common.ServiceDocument in project photon-model by vmware.

the class IPAddressService method getDocumentTemplate.

@Override
public ServiceDocument getDocumentTemplate() {
    ServiceDocument td = super.getDocumentTemplate();
    ServiceUtils.setRetentionLimit(td);
    IPAddressState template = (IPAddressState) td;
    template.id = UUID.randomUUID().toString();
    template.name = "ip-address";
    return template;
}
Also used : ServiceDocument(com.vmware.xenon.common.ServiceDocument)

Example 30 with ServiceDocument

use of com.vmware.xenon.common.ServiceDocument in project photon-model by vmware.

the class LoadBalancerDescriptionService method getDocumentTemplate.

@Override
public ServiceDocument getDocumentTemplate() {
    ServiceDocument td = super.getDocumentTemplate();
    // enable metadata indexing
    td.documentDescription.documentIndexingOptions = EnumSet.of(DocumentIndexingOption.INDEX_METADATA);
    ServiceUtils.setRetentionLimit(td);
    LoadBalancerDescription template = (LoadBalancerDescription) td;
    template.id = UUID.randomUUID().toString();
    template.name = "load-balancer";
    template.endpointLink = UriUtils.buildUriPath(EndpointService.FACTORY_LINK, "my-endpoint");
    template.networkName = "lb-net";
    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)

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