Class: Infrawrench::SftpNamespace
- Inherits:
-
Object
- Object
- Infrawrench::SftpNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.sftp
Instance Method Summary collapse
-
#delete(body:, org_id: nil, request_options: nil) ⇒ Hash
Delete a file or directory over SFTP.
-
#download(account_id:, paths:, org_id: nil, base_path: nil, ssh_key_id: nil, ssh_host: nil, ssh_username: nil, request_options: nil) ⇒ String
Download one or many files via SFTP (zipped if more than one).
-
#initialize(transport) ⇒ SftpNamespace
constructor
private
A new instance of SftpNamespace.
-
#list(body:, org_id: nil, request_options: nil) ⇒ Array<Hash>
List a directory over SFTP.
-
#mkdir(body:, org_id: nil, request_options: nil) ⇒ Hash
Create a directory over SFTP.
-
#upload(body:, org_id: nil, request_options: nil) ⇒ Hash
Upload a file via SFTP.
Constructor Details
#initialize(transport) ⇒ SftpNamespace
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SftpNamespace.
3388 3389 3390 |
# File 'lib/infrawrench/client.rb', line 3388 def initialize(transport) @transport = transport end |
Instance Method Details
#delete(body:, org_id: nil, request_options: nil) ⇒ Hash
Delete a file or directory over SFTP
Requires permission: storage:write.
POST /api/org/orgId/sftp/delete
Raises on 404: Not found
Raises on 500: Server error
3408 3409 3410 3411 3412 3413 3414 3415 3416 |
# File 'lib/infrawrench/client.rb', line 3408 def delete(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/sftp/delete", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#download(account_id:, paths:, org_id: nil, base_path: nil, ssh_key_id: nil, ssh_host: nil, ssh_username: nil, request_options: nil) ⇒ String
Download one or many files via SFTP (zipped if more than one)
Requires permission: storage:read.
GET /api/org/orgId/v1/sftp/download
Raises on 400: Bad request
Raises on 404: Not found
Raises on 500: Server error
3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 |
# File 'lib/infrawrench/client.rb', line 3441 def download( account_id:, paths:, org_id: nil, base_path: nil, ssh_key_id: nil, ssh_host: nil, ssh_username: nil, request_options: nil ) @transport.request( http_method: "GET", path: "/api/org/{orgId}/v1/sftp/download", path_params: { "orgId" => org_id }, query: { "accountId" => account_id, "paths" => paths, "basePath" => base_path, "sshKeyId" => ssh_key_id, "sshHost" => ssh_host, "sshUsername" => ssh_username }, accept: :binary, request_options: ) end |
#list(body:, org_id: nil, request_options: nil) ⇒ Array<Hash>
List a directory over SFTP
Requires permission: storage:read.
POST /api/org/orgId/sftp/list
Raises on 404: Not found
Raises on 500: Server error
3485 3486 3487 3488 3489 3490 3491 3492 3493 |
# File 'lib/infrawrench/client.rb', line 3485 def list(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/sftp/list", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#mkdir(body:, org_id: nil, request_options: nil) ⇒ Hash
Create a directory over SFTP
Requires permission: storage:write.
POST /api/org/orgId/sftp/mkdir
Raises on 404: Not found
Raises on 500: Server error
3511 3512 3513 3514 3515 3516 3517 3518 3519 |
# File 'lib/infrawrench/client.rb', line 3511 def mkdir(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/sftp/mkdir", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#upload(body:, org_id: nil, request_options: nil) ⇒ Hash
Upload a file via SFTP
Requires permission: storage:write.
POST /api/org/orgId/v1/sftp/upload
Raises on 400: Bad request
Raises on 404: Not found
3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 |
# File 'lib/infrawrench/client.rb', line 3537 def upload(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/v1/sftp/upload", path_params: { "orgId" => org_id }, form: body, form_files: ["file"], request_options: ) end |