Search in sources :

Example 36 with ServiceDocument

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

the class SnapshotService method getDocumentTemplate.

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

Example 37 with ServiceDocument

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

the class GCPTestUtil method deleteDocument.

/**
 * Delete the document by specified docuemnt link.
 * @param host The test host service.
 * @param documentToDelete The document link of the document to be deleted.
 * @throws Throwable The exception during deleting document.
 */
public static void deleteDocument(VerificationHost host, String documentToDelete) throws Throwable {
    host.testStart(1);
    host.send(Operation.createDelete(UriUtils.buildUri(host, documentToDelete)).setBody(new ServiceDocument()).setCompletion(host.getCompletion()));
    host.testWait();
}
Also used : ServiceDocument(com.vmware.xenon.common.ServiceDocument)

Example 38 with ServiceDocument

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

the class TestAWSSetupUtils method deleteDocument.

/**
 * Method for deleting a document with the said identifier.
 *
 * @param host
 *            The verification host
 * @param documentToDelete
 *            The identifier of the document to be deleted.
 * @throws Throwable
 */
public static void deleteDocument(VerificationHost host, String documentToDelete) throws Throwable {
    host.testStart(1);
    host.send(Operation.createDelete(UriUtils.buildUri(host, documentToDelete)).setBody(new ServiceDocument()).setCompletion(host.getCompletion()));
    host.testWait();
}
Also used : ServiceDocument(com.vmware.xenon.common.ServiceDocument)

Example 39 with ServiceDocument

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

the class PhotonModelAdaptersRegistryService method getDocumentTemplate.

@Override
public ServiceDocument getDocumentTemplate() {
    ServiceDocument template = super.getDocumentTemplate();
    ServiceUtils.setRetentionLimit(template);
    return template;
}
Also used : ServiceDocument(com.vmware.xenon.common.ServiceDocument)

Example 40 with ServiceDocument

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

the class ScheduledTaskService method getDocumentTemplate.

@Override
public ServiceDocument getDocumentTemplate() {
    ServiceDocument td = super.getDocumentTemplate();
    ServiceUtils.setRetentionLimit(td);
    ScheduledTaskState template = (ScheduledTaskState) td;
    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