Search in sources :

Example 6 with ServiceDocument

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

the class SecurityGroupService method getDocumentTemplate.

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

Example 7 with ServiceDocument

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

the class StorageDescriptionService 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 8 with ServiceDocument

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

the class SubnetService method getDocumentTemplate.

@Override
public ServiceDocument getDocumentTemplate() {
    ServiceDocument td = super.getDocumentTemplate();
    // enable metadata indexing
    td.documentDescription.documentIndexingOptions = EnumSet.of(DocumentIndexingOption.INDEX_METADATA);
    ServiceUtils.setRetentionLimit(td);
    SubnetState template = (SubnetState) td;
    template.id = UUID.randomUUID().toString();
    template.subnetCIDR = "10.1.0.0/16";
    template.name = "sub-network";
    template.networkLink = UriUtils.buildUriPath(NetworkService.FACTORY_LINK, "on-prem-network");
    template.dnsServerAddresses = new ArrayList<>();
    template.dnsServerAddresses.add("10.12.14.12");
    template.gatewayAddress = "10.1.0.1";
    template.supportPublicIpAddress = Boolean.TRUE;
    template.defaultForZone = Boolean.TRUE;
    return template;
}
Also used : ServiceDocument(com.vmware.xenon.common.ServiceDocument)

Example 9 with ServiceDocument

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

the class NetworkInterfaceDescriptionService method getDocumentTemplate.

@Override
public ServiceDocument getDocumentTemplate() {
    ServiceDocument td = super.getDocumentTemplate();
    // enable metadata indexing
    td.documentDescription.documentIndexingOptions = EnumSet.of(DocumentIndexingOption.INDEX_METADATA);
    ServiceUtils.setRetentionLimit(td);
    NetworkInterfaceDescription template = (NetworkInterfaceDescription) td;
    template.id = UUID.randomUUID().toString();
    template.name = "my-nic";
    template.subnetLink = UriUtils.buildUriPath(SubnetService.FACTORY_LINK, "sub-network");
    template.assignment = IpAssignment.STATIC;
    template.address = "10.1.0.12";
    template.securityGroupLinks = Collections.singletonList(UriUtils.buildUriPath(SecurityGroupService.FACTORY_LINK, "security-group-one"));
    template.deviceIndex = 0;
    template.assignPublicIpAddress = Boolean.TRUE;
    return template;
}
Also used : ServiceDocument(com.vmware.xenon.common.ServiceDocument)

Example 10 with ServiceDocument

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

the class NetworkService method getDocumentTemplate.

@Override
public ServiceDocument getDocumentTemplate() {
    ServiceDocument td = super.getDocumentTemplate();
    // enable metadata indexing
    td.documentDescription.documentIndexingOptions = EnumSet.of(DocumentIndexingOption.INDEX_METADATA);
    ServiceUtils.setRetentionLimit(td);
    NetworkState template = (NetworkState) td;
    template.id = UUID.randomUUID().toString();
    template.subnetCIDR = "10.1.0.0/16";
    template.name = "cell-network";
    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