diff --git a/README.md b/README.md index 255e19d4..34447db3 100644 --- a/README.md +++ b/README.md @@ -237,7 +237,9 @@ USAGE * [`mw project update [PROJECT-ID]`](#mw-project-update-project-id) * [`mw server get [SERVER-ID]`](#mw-server-get-server-id) * [`mw server list`](#mw-server-list) +* [`mw sftp-user delete SFTP-USER-ID`](#mw-sftp-user-delete-sftp-user-id) * [`mw sftp-user list`](#mw-sftp-user-list) +* [`mw ssh-user delete SSH-USER-ID`](#mw-ssh-user-delete-ssh-user-id) * [`mw ssh-user list`](#mw-ssh-user-list) * [`mw update [CHANNEL]`](#mw-update-channel) * [`mw user api-token create`](#mw-user-api-token-create) @@ -4184,6 +4186,31 @@ DESCRIPTION List servers for an organization or user. ``` +## `mw sftp-user delete SFTP-USER-ID` + +Delete an SFTP user + +``` +USAGE + $ mw sftp-user delete SFTP-USER-ID [-q] [-f] + +ARGUMENTS + SFTP-USER-ID The ID of the SFTP user to delete + +FLAGS + -f, --force Do not ask for confirmation + -q, --quiet suppress process output and only display a machine-readable summary. + +DESCRIPTION + Delete an SFTP user + +FLAG DESCRIPTIONS + -q, --quiet suppress process output and only display a machine-readable summary. + + This flag controls if you want to see the process output or only a summary. When using mw non-interactively (e.g. in + scripts), you can use this flag to easily get the IDs of created resources for further processing. +``` + ## `mw sftp-user list` List all SFTP users for a project. @@ -4217,6 +4244,31 @@ FLAG DESCRIPTIONS to persistently set a default project for all commands that accept this flag. ``` +## `mw ssh-user delete SSH-USER-ID` + +Delete an SSH user + +``` +USAGE + $ mw ssh-user delete SSH-USER-ID [-q] [-f] + +ARGUMENTS + SSH-USER-ID The ID of the SSH user to delete + +FLAGS + -f, --force Do not ask for confirmation + -q, --quiet suppress process output and only display a machine-readable summary. + +DESCRIPTION + Delete an SSH user + +FLAG DESCRIPTIONS + -q, --quiet suppress process output and only display a machine-readable summary. + + This flag controls if you want to see the process output or only a summary. When using mw non-interactively (e.g. in + scripts), you can use this flag to easily get the IDs of created resources for further processing. +``` + ## `mw ssh-user list` List all SSH users for a project. diff --git a/src/commands/sftp-user/delete.ts b/src/commands/sftp-user/delete.ts new file mode 100644 index 00000000..966cb415 --- /dev/null +++ b/src/commands/sftp-user/delete.ts @@ -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 { + 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 { + const sftpUserId = this.args["sftp-user-id"]; + const response = await this.apiClient.sshsftpUser.sftpUserDeleteSftpUser({ + sftpUserId, + }); + + assertSuccess(response); + } +} diff --git a/src/commands/ssh-user/delete.ts b/src/commands/ssh-user/delete.ts new file mode 100644 index 00000000..ed8a85b9 --- /dev/null +++ b/src/commands/ssh-user/delete.ts @@ -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 { + 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 { + const sshUserId = this.args["ssh-user-id"]; + const response = await this.apiClient.sshsftpUser.sshUserDeleteSshUser({ + sshUserId, + }); + + assertSuccess(response); + } +}