Zum Hauptinhalt springen

Get your stored ssh-keys

GET/v2/users/self/ssh-keys
API-Version
v2
Request-Methode
GET
Operation-ID
user-list-ssh-keys

Request​

Responses​

Response-Header
  • X-Pagination-Limitinteger

    The limit used to select the resources for the response

  • X-Pagination-Skipinteger

    The number of skipped items

  • X-Pagination-Pagenumber

    The calculate page of the list response. Refer to parameters to learn more.

  • X-Pagination-TotalCountinteger

    The total amount of items available in the remote ressource. Use this value in combination with the limit to calculate the available pages.

Format
application/json
Beschreibung

The list of stored ssh-keys.

  • sshKeysArray von object
    • Array[
      • *object
        • algorithmstringrequired
        • commentstringrequired
        • createdAtstring (date-time)required
        • expiresAtstring (date-time)
        • fingerprintstring (hexdump)required
        • keystringrequired
        • sshKeyIdstring (uuid)required
      ]
Content-Type: application/json

{
"sshKeys": [
{
"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": {
"sshKeys": {
"items": {
"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"
},
"type": "array"
}
},
"type": "object"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/users/self/ssh-keys?limit=50&page=1
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.listSshKeys({
"queryParameters": {
"limit": 50,
"page": 1
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\User\ListSshKeys\ListSshKeysRequest;

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

$request = (new ListSshKeysRequest())
->withLimit(50)
->withPage(1);
$response = $client->user()->listSshKeys($request);

var_dump($response->getBody();

Auf dieser Seite