-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #212 from mittwald/feature/sshuser-delete
Add "{sftp|ssh}-user delete" commands
- Loading branch information
Showing
3 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { DeleteBaseCommand } from "../../DeleteBaseCommand.js"; | ||
import assertSuccess from "../../lib/assert_success.js"; | ||
import { Args } from "@oclif/core"; | ||
|
||
export default class Delete extends DeleteBaseCommand<typeof Delete> { | ||
static description = "Delete an SFTP user"; | ||
static resourceName = "SFTP user"; | ||
|
||
static flags = { ...DeleteBaseCommand.baseFlags }; | ||
static args = { | ||
"sftp-user-id": Args.string({ | ||
description: "The ID of the SFTP user to delete", | ||
required: true, | ||
}), | ||
}; | ||
|
||
protected async deleteResource(): Promise<void> { | ||
const sftpUserId = this.args["sftp-user-id"]; | ||
const response = await this.apiClient.sshsftpUser.sftpUserDeleteSftpUser({ | ||
sftpUserId, | ||
}); | ||
|
||
assertSuccess(response); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { DeleteBaseCommand } from "../../DeleteBaseCommand.js"; | ||
import assertSuccess from "../../lib/assert_success.js"; | ||
import { Args } from "@oclif/core"; | ||
|
||
export default class Delete extends DeleteBaseCommand<typeof Delete> { | ||
static description = "Delete an SSH user"; | ||
static resourceName = "SSH user"; | ||
|
||
static flags = { ...DeleteBaseCommand.baseFlags }; | ||
static args = { | ||
"ssh-user-id": Args.string({ | ||
description: "The ID of the SSH user to delete", | ||
required: true, | ||
}), | ||
}; | ||
|
||
protected async deleteResource(): Promise<void> { | ||
const sshUserId = this.args["ssh-user-id"]; | ||
const response = await this.apiClient.sshsftpUser.sshUserDeleteSshUser({ | ||
sshUserId, | ||
}); | ||
|
||
assertSuccess(response); | ||
} | ||
} |