Zum Hauptinhalt springen

Get a specific stored ssh-key

GET/v2/users/self/ssh-keys/{sshKeyId}
API-Version
v2
Request-Methode
GET
Operation-ID
user-get-ssh-key

Request​

  • sshKeyIdstring (uuid)required

Responses​

Format
application/json
Beschreibung

The requested ssh-key.

  • sshKeyobjectrequired
    • algorithmstringrequired
    • commentstringrequired
    • createdAtstring (date-time)required
    • expiresAtstring (date-time)
    • fingerprintstring (hexdump)required
    • keystringrequired
    • sshKeyIdstring (uuid)required
Content-Type: application/json

{
"sshKey": {
"algorithm": "ssh-rsa",
"comment": "a.lovelace@example.com",
"createdAt": "1985-10-26T01:21:00.000Z",
"expiresAt": "1985-10-26T01:21:00.000Z",
"fingerprint": "a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1",
"key": "string",
"sshKeyId": "f0f86186-0a5a-45b2-aa33-502777496347"
}
}
{
"properties": {
"sshKey": {
"properties": {
"algorithm": {
"example": "ssh-rsa",
"type": "string"
},
"comment": {
"example": "a.lovelace@example.com",
"type": "string"
},
"createdAt": {
"format": "date-time",
"type": "string"
},
"expiresAt": {
"format": "date-time",
"type": "string"
},
"fingerprint": {
"example": "a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1",
"format": "hexdump",
"type": "string"
},
"key": {
"type": "string"
},
"sshKeyId": {
"format": "uuid",
"type": "string"
}
},
"required": [
"sshKeyId",
"algorithm",
"key",
"comment",
"fingerprint",
"createdAt"
],
"type": "object"
}
},
"required": [
"sshKey"
],
"type": "object"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/users/self/ssh-keys/f0f86186-0a5a-45b2-aa33-502777496347
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.user.getSshKey({
"sshKeyId": "f0f86186-0a5a-45b2-aa33-502777496347"
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\User\GetSshKey\GetSshKeyRequest;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

$request = (new GetSshKeyRequest(
sshKeyId: "f0f86186-0a5a-45b2-aa33-502777496347"
));
$response = $client->user()->getSshKey($request);

var_dump($response->getBody();

Auf dieser Seite