3334353637383940414243
DomainList response = new DomainList(); response.domains = Lists.newArrayList(); for (DomainData data : identityService.listDomains(user)) { Domain domain = toModel(data); response.domains.add(domain); } return response; }
5455565758596061626364
response.domain = toModel(data); return response; } private Domain toModel(DomainData data) { Domain model = new Domain(); model.id = "" + data.getId(); model.name = data.getName(); model.description = data.getDescription();
163164165166167168169170171172
model.domain = toModel(domain); return model; } private Domain toModel(DomainData domain) { Domain model = new Domain(); model.id = Long.toString(domain.getId()); model.name = domain.getName(); return model; }
2829303132333435363738
SecretService secretsService; @GET @Path("{id}") public Secret findSecret(@PathParam("id") long id) throws CloudException { Auth auth = getAuth(); Project project = getProject(); SecretService.Secret secret = secretsService.find(auth, project, id); notFoundIfNull(secret);
4041424344454647484950
} @GET @Path("{id}/{key}") public Response getSecret(@PathParam("id") long id, @PathParam("key") String key) throws CloudException { Auth auth = getAuth(); Project project = getProject(); SecretService.Secret secret = secretsService.find(auth, project, id); notFoundIfNull(secret);
5556575859606162636465
return Response.ok(data).build(); } @GET public SecretList listSecrets() throws CloudException { Auth auth = getAuth(); Project project = getProject(); SecretList ret = new SecretList(); ret.secrets = Lists.newArrayList();
2425262728293031323334
super("dns-zone-list"); } @Override protected List<DnsZoneData> run0() throws Exception { Auth auth = getAuth(); Project project = auth.getProject(); List<DnsZone> zones = dns.listZones(project); return DnsZone.toData(zones); }
262728293031323334353637
super("dns-zone-delete"); } @Override protected DnsZoneData run0() throws Exception { Auth auth = getAuth(); Project project = auth.getProject(); DnsZone found = dns.findZoneByName(project, zone); if (found == null) { throw new IllegalArgumentException("Zone not found: " + zone); }
353637383940414243444546
super("dns-record-create"); } @Override protected DnsRecordsetData run0() throws Exception { Auth auth = getAuth(); Project project = auth.getProject(); DnsZone zone = dns.findMaximalZone(project, fqdn); if (zone == null) { throw new IllegalArgumentException("Cannot find matching zone"); }
2627282930313233343536
@Inject SecretService secretService; @Override protected Message run0() throws Exception { Auth auth = getAuth(); Project project = auth.getProject(); secretService.deleteKey(auth, project, id); return null; }