.fingerprint(expectedFingerprint).build();
.fingerprint(expectedFingerprint).build();
@Test public void testListAndGetSSHKeyPairsWhenResponseIs2xx() { HttpResponse response = HttpResponse.builder() .statusCode(200) .payload(payloadFromResource("/listsshkeypairsresponse.json")) .build(); SSHKeyPairApi client = requestSendsResponse(HttpRequest.builder() .method("GET") .endpoint( URI.create("http://localhost:8080/client/api?response=json&" + "command=listSSHKeyPairs&listAll=true&apiKey=identity&signature=5d2J9u%2BdKpkQsadDbl9i9OcUSLQ%3D")) .addHeader("Accept", "application/json") .build(), response); assertEquals(client.listSSHKeyPairs(), ImmutableSet.of( SshKeyPair.builder().name("jclouds-keypair") .fingerprint("1c:06:74:52:3b:99:1c:95:5c:04:c2:f4:ba:77:6e:7b").build())); client = requestSendsResponse(HttpRequest.builder() .method("GET") .endpoint( URI.create("http://localhost:8080/client/api?response=json&command=listSSHKeyPairs&listAll=true&" + "name=jclouds-keypair&apiKey=identity&signature=hJIVCFOHhdOww3aq19tFHpeD2HI%3D")) .addHeader("Accept", "application/json") .build(), response); assertEquals(client.getSSHKeyPair("jclouds-keypair"), SshKeyPair.builder().name("jclouds-keypair") .fingerprint("1c:06:74:52:3b:99:1c:95:5c:04:c2:f4:ba:77:6e:7b").build()); }
String pem = templateOptions.getLoginPrivateKey(); keyPair = SshKeyPair.builder().name(templateOptions.getKeyPair()) .fingerprint(fingerprintPrivateKey(pem)).privateKey(pem).build(); keyPairCache.asMap().put(keyPair.getName(), keyPair); options.keyPair(keyPair.getName());
.fingerprint("1c:06:74:52:3b:99:1c:95:5c:04:c2:f4:ba:77:6e:7b") .privateKey("-----BEGIN RSA PRIVATE KEY-----\n" + "MIICXgIBAAKBgQDZo/EF4Ew1uEW0raz7vCs28lBwy0UKV2Xr606gaEgxO7h9mSXZ\n" +
.fingerprint("1c:06:74:52:3b:99:1c:95:5c:04:c2:f4:ba:77:6e:7b") .privateKey("-----BEGIN RSA PRIVATE KEY-----\n" + "MIICXgIBAAKBgQDZo/EF4Ew1uEW0raz7vCs28lBwy0UKV2Xr606gaEgxO7h9mSXZ\n" +
@Test public void testListAndGetSSHKeyPairsWhenResponseIs2xx() { HttpResponse response = HttpResponse.builder() .statusCode(200) .payload(payloadFromResource("/listsshkeypairsresponse.json")) .build(); SSHKeyPairClient client = requestSendsResponse(HttpRequest.builder() .method("GET") .endpoint( URI.create("http://localhost:8080/client/api?response=json&" + "command=listSSHKeyPairs&listAll=true&apiKey=identity&signature=5d2J9u%2BdKpkQsadDbl9i9OcUSLQ%3D")) .addHeader("Accept", "application/json") .build(), response); assertEquals(client.listSSHKeyPairs(), ImmutableSet.of( SshKeyPair.builder().name("jclouds-keypair") .fingerprint("1c:06:74:52:3b:99:1c:95:5c:04:c2:f4:ba:77:6e:7b").build())); client = requestSendsResponse(HttpRequest.builder() .method("GET") .endpoint( URI.create("http://localhost:8080/client/api?response=json&command=listSSHKeyPairs&listAll=true&" + "name=jclouds-keypair&apiKey=identity&signature=hJIVCFOHhdOww3aq19tFHpeD2HI%3D")) .addHeader("Accept", "application/json") .build(), response); assertEquals(client.getSSHKeyPair("jclouds-keypair"), SshKeyPair.builder().name("jclouds-keypair") .fingerprint("1c:06:74:52:3b:99:1c:95:5c:04:c2:f4:ba:77:6e:7b").build()); }
public T fromSshKeyPair(SshKeyPair in) { return this .fingerprint(in.getFingerprint()) .name(in.getName()) .privateKey(in.getPrivateKey()); } }
public T fromSshKeyPair(SshKeyPair in) { return this .fingerprint(in.getFingerprint()) .name(in.getName()) .privateKey(in.getPrivateKey()); } }
@Override @SelectJson("sshkeypair") public Set<SshKeyPair> expected() { return ImmutableSet.<SshKeyPair> of(SshKeyPair.builder().name("jclouds-keypair") .fingerprint("1c:06:74:52:3b:99:1c:95:5c:04:c2:f4:ba:77:6e:7b").build()); }
@Override @SelectJson("sshkeypair") public Set<SshKeyPair> expected() { return ImmutableSet.<SshKeyPair> of(SshKeyPair.builder().name("jclouds-keypair") .fingerprint("1c:06:74:52:3b:99:1c:95:5c:04:c2:f4:ba:77:6e:7b").build()); }
public T fromSshKeyPair(SshKeyPair in) { return this .fingerprint(in.getFingerprint()) .name(in.getName()) .privateKey(in.getPrivateKey()); } }