Package io.fathom.cloud.server.model

Examples of io.fathom.cloud.server.model.Project


    public AvailabilityZoneList listDetail() throws CloudException {
        return list(true);
    }

    private AvailabilityZoneList list(boolean details) throws CloudException {
        Project project = getProject();

        warnStub();

        AvailabilityZoneList response = new AvailabilityZoneList();
        response.availabilityZoneInfo = Lists.newArrayList();
View Full Code Here


    AsyncTasks asyncTasks;

    @Override
    public Object go() throws CloudException {
        // UserData user = getUser();
        Project project = getProject();

        List<String> instanceEc2Ids = getList("InstanceId");

        TerminateInstancesResponse response = new TerminateInstancesResponse();
        response.requestId = getRequestId();
View Full Code Here

    @Inject
    DnsService dnsService;

    @GET
    public DomainList listDomains() throws CloudException {
        Project project = getProject();

        DomainList response = new DomainList();
        response.domain_entries = Lists.newArrayList();
        for (DnsService.Zone domain : dnsService.listZones(project)) {
            response.domain_entries.add(toModel(domain));
View Full Code Here

    @PUT
    @Path("{domain}/entries/{name}")
    public WrappedRecord createRecord(@PathParam("domain") String domainName, @PathParam("name") String name,
            WrappedRecord wrappedRequest) throws CloudException {
        Project project = getProject();

        Record request = wrappedRequest.dns_entry;
        if (request == null) {
            throw new IllegalArgumentException();
        }
View Full Code Here

    }

    RecordList listRecordsByIp(String domainName, String ipString) throws CloudException {
        InetAddress ip = InetAddresses.forString(ipString);

        Project project = getProject();

        DnsService.Zone domain = dnsService.findZoneByName(project, domainName);
        notFoundIfNull(domain);

        RecordList response = new RecordList();
View Full Code Here

        return response;
    }

    WrappedRecord findRecordByFqdn(String domainName, String fqdn) throws CloudException {
        Project project = getProject();

        DnsService.Zone domain = dnsService.findZoneByName(project, domainName);
        notFoundIfNull(domain);

        // TODO: Return multiple matches??
View Full Code Here

    }

    @PUT
    @Path("{name}")
    public WrappedDomain createDomain(@PathParam("name") String name, WrappedDomain domain) throws CloudException {
        Project project = getProject();

        Domain request = domain.domain_entry;
        if (request == null) {
            throw new IllegalArgumentException();
        }
View Full Code Here

public class DescribeInstances extends AwsActionHandler {
    @Override
    public Object go() throws CloudException {
        // User user = getUser();

        Project project = getProject();

        // Get instances first; so we shouldn't have any instances that refer to
        // not-yet-create reservations
        List<InstanceData> instances = instanceStateStore.getInstances(getProject().getId()).list();
        List<ReservationData> reservationInfoList = instanceStateStore.getReservations(project).list();
View Full Code Here

    ImageService imageService;

    @Override
    public Object go() throws CloudException {
        // User user = getUser();
        Project project = getProject();

        // ImageId=ami-5168f861
        // MinCount=1
        // MaxCount=1
        // DisableApiTermination=false
        // Monitoring.Enabled=false
        // EbsOptimized=false

        StartInstancesAction action = new StartInstancesAction();

        long imageId = decodeEc2Id(get("ImageId"));

        {
            ReservationData.Builder reservation = ReservationData.newBuilder();

            ImageService.Image image = imageService.findImage(project, imageId);
            if (image == null) {
                throw new IllegalArgumentException();
            }

            reservation.setImageId(image.getId());

            action.reservationTemplate = reservation.build();
        }

        List<SecurityGroupData> securityGroups = getSecurityGroups();

        {
            InstanceData.Builder instance = InstanceData.newBuilder();

            for (SecurityGroupData securityGroup : securityGroups) {
                instance.addSecurityGroupId(securityGroup.getId());
            }
            action.instanceTemplate = instance.build();
        }

        action.maxCount = get("MaxCount", 1);
        action.minCount = get("MinCount", 1);

        // action.user = getUser();
        action.project = project;

        StartInstancesAction.Result result = action.go();

        RunInstancesResponse response = new RunInstancesResponse();
        response.requestId = getRequestId();

        response.reservationId = toEc2ReservationId(result.reservation.getId());
        response.ownerId = toEc2Owner(project.getId());

        response.groups = buildGroupsXml(securityGroups);

        response.instances = Lists.newArrayList();
View Full Code Here

        return response;
    }

    protected SecurityGroup toModel(SecurityGroupData data, boolean includeRules) throws CloudException {
        Project project = getProject();

        return toModel(project, data, includeRules);
    }
View Full Code Here

TOP

Related Classes of io.fathom.cloud.server.model.Project

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.