Zum Hauptinhalt springen

Update an SFTP user

PATCH/v2/sftp-users/{sftpUserId}
API-Version
v2
Request-Methode
PATCH
Operation-ID
sftp-user-update-sftp-user

Request​

  • sftpUserIdstringrequired

    ID of the SFTPUser to be updated.

Responses​

Kein Response-Inhalt angegeben.

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-X PATCH \
-d '{"accessLevel":"read","active":true,"description":"string","directories":["string"],"expiresAt":"1985-10-26T01:21:00.000Z","password":"string","publicKeys":[{"comment":"string","key":"string"}]}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/sftp-users/string
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.sshsftpUser.sftpUserUpdateSftpUser({
"sftpUserId": "string",
"data": {
"accessLevel": "read",
"active": true,
"description": "string",
"directories": [
"string"
],
"expiresAt": "1985-10-26T01:21:00.000Z",
"password": "string",
"publicKeys": [
{
"comment": "string",
"key": "string"
}
]
}
});

assertStatus(response, 204);

use \Mittwald\ApiClient\Generated\V2\Clients\SSHSFTPUser\SftpUserUpdateSftpUser\SftpUserUpdateSftpUserRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\SSHSFTPUser\SftpUserUpdateSftpUser\SftpUserUpdateSftpUserRequestBody;

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

// TODO: Please consult the properties and constructor signature of
// SftpUserUpdateSftpUserRequestBody to learn how to construct a valid instance
$body = new SftpUserUpdateSftpUserRequestBody(/* TODO: ... */);

$request = (new SftpUserUpdateSftpUserRequest(
sftpUserId: "string",
body: $body
));
$response = $client->sshsftpUser()->sftpUserUpdateSftpUser($request);

var_dump($response->getBody();

Auf dieser Seite