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.
4016 4017 4018 |
# File 'lib/infrawrench/client.rb', line 4016 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
4036 4037 4038 4039 4040 4041 4042 4043 4044 |
# File 'lib/infrawrench/client.rb', line 4036 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
4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 |
# File 'lib/infrawrench/client.rb', line 4069 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
4113 4114 4115 4116 4117 4118 4119 4120 4121 |
# File 'lib/infrawrench/client.rb', line 4113 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
4139 4140 4141 4142 4143 4144 4145 4146 4147 |
# File 'lib/infrawrench/client.rb', line 4139 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
4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 |
# File 'lib/infrawrench/client.rb', line 4165 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 |