File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
src/main/java/org/gitlab4j/api Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1010
1111/**
1212 * See:
13- * https://docs.gitlab.com/ee/api/keys.html#get-user-by-fingerprint-of-ssh-key
13+ * <a href=" https://docs.gitlab.com/ee/api/keys.html">GitLab Key API Documentaion</a>
1414 */
1515public class KeysApi extends AbstractApi {
1616 public KeysApi (GitLabApi gitLabApi ) {
@@ -28,4 +28,18 @@ public Key getUserBySSHKeyFingerprint(String fingerprint) throws GitLabApiExcept
2828 Response response = get (Response .Status .OK , queryParams , "keys" );
2929 return response .readEntity (Key .class );
3030 }
31+
32+ /**
33+ * Get a single key by id.
34+ *
35+ * <pre><code>GitLab Endpoint: GET /keys/:id</code></pre>
36+ *
37+ * @param keyId the IID of the key to get
38+ * @return a Key instance
39+ * @throws GitLabApiException if any exception occurs
40+ */
41+ public Key getKey (String keyId ) throws GitLabApiException {
42+ Response response = get (Response .Status .OK , null , "keys" , keyId );
43+ return response .readEntity (Key .class );
44+ }
3145}
You can’t perform that action at this time.
0 commit comments