Class: Telnyx::Resources::Storage::Cloudfs

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/storage/cloudfs.rb,
lib/telnyx/resources/storage/cloudfs/actions.rb,
sig/telnyx/resources/storage/cloudfs.rbs,
sig/telnyx/resources/storage/cloudfs/actions.rbs

Overview

Manage CloudFS filesystems — JuiceFS-compatible filesystems backed by Telnyx Cloud Storage

Defined Under Namespace

Classes: Actions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Cloudfs

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 Cloudfs.

Parameters:



180
181
182
183
# File 'lib/telnyx/resources/storage/cloudfs.rb', line 180

def initialize(client:)
  @client = client
  @actions = Telnyx::Resources::Storage::Cloudfs::Actions.new(client: client)
end

Instance Attribute Details

#actionsTelnyx::Resources::Storage::Cloudfs::Actions (readonly)

Manage CloudFS filesystems — JuiceFS-compatible filesystems backed by Telnyx Cloud Storage



12
13
14
# File 'lib/telnyx/resources/storage/cloudfs.rb', line 12

def actions
  @actions
end

Instance Method Details

#create(name:, region:, idempotency_key:, request_options: {}) ⇒ Telnyx::Models::Storage::CloudfsFilesystemResponseWrapper

Some parameter documentations has been truncated, see Models::Storage::CloudfCreateParams for more details.

Creates a CloudFS filesystem. Provisioning is synchronous — typically a few seconds, up to a few minutes — and the filesystem is returned with status ready, together with its S3 bucket and metadata connection details. This response is the only time the filesystem's meta_token — and the credential-bearing meta_url — are returned; store them securely. If the token is lost, issue a new one with the rotate-meta-token action. Names are unique within your organization: creating with an existing name returns a 422. Requests are idempotent: retrying with the same Idempotency-Key within 24 hours replays the original response instead of creating another filesystem.

Parameters:

  • name (String)

    Body param: Filesystem name, unique within your organization. Names are trimmed

  • region (Symbol, Telnyx::Models::Storage::CloudfCreateParams::Region)

    Body param: Region where the filesystem's storage and metadata are provisioned.

  • idempotency_key (String)

    Header param: Unique key that makes the request idempotent (1-255 characters: le

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/telnyx/resources/storage/cloudfs.rb', line 40

def create(params)
  parsed, options = Telnyx::Storage::CloudfCreateParams.dump_request(params)
  header_params = {idempotency_key: "idempotency-key"}
  @client.request(
    method: :post,
    path: "storage/cloudfs",
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: Telnyx::Storage::CloudfsFilesystemResponseWrapper,
    options: options
  )
end

#delete(id, request_options: {}) ⇒ Telnyx::Models::Storage::CloudfsFilesystemDetailResponseWrapper

Permanently deletes a CloudFS filesystem, removing its S3 bucket and its metadata database. Deletion is synchronous: the response returns the filesystem's final state with status deleted. There is no restore. A filesystem that is still provisioning returns a 409. If the filesystem still contains data, the request may be rejected with a 409 — drain the bucket and retry.

Parameters:

Returns:

See Also:



168
169
170
171
172
173
174
175
# File 'lib/telnyx/resources/storage/cloudfs.rb', line 168

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["storage/cloudfs/%1$s", id],
    model: Telnyx::Storage::CloudfsFilesystemDetailResponseWrapper,
    options: params[:request_options]
  )
end

#list(filter_name: nil, filter_region: nil, filter_status: nil, page_after: nil, page_before: nil, page_limit: nil, sort: nil, request_options: {}) ⇒ Telnyx::Models::Storage::CloudfListResponse

Some parameter documentations has been truncated, see Models::Storage::CloudfListParams for more details.

Lists the CloudFS filesystems for the authenticated user's organization. Results use cursor-based pagination: fetch the next page by passing meta.cursors.after as page[after], or follow the meta.next URL.

Parameters:

  • filter_name (String)

    Return only the filesystem whose name matches exactly.

  • filter_region (String)

    Return only filesystems in this region.

  • filter_status (Symbol, Telnyx::Models::Storage::CloudfListParams::FilterStatus)

    Return only filesystems with this status. Unrecognized values are ignored.

  • page_after (String)

    Opaque cursor from a previous response's meta.cursors.after; returns the page

  • page_before (String)

    Opaque cursor from a previous response's meta.cursors.before; returns the page

  • page_limit (Integer)

    The number of filesystems to return per page. Values above 250 are treated as 25

  • sort (Symbol, Telnyx::Models::Storage::CloudfListParams::Sort)

    Sort order for the results: a field name for ascending, or the field name prefix

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/telnyx/resources/storage/cloudfs.rb', line 133

def list(params = {})
  parsed, options = Telnyx::Storage::CloudfListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "storage/cloudfs",
    query: query.transform_keys(
      filter_name: "filter[name]",
      filter_region: "filter[region]",
      filter_status: "filter[status]",
      page_after: "page[after]",
      page_before: "page[before]",
      page_limit: "page[limit]"
    ),
    model: Telnyx::Models::Storage::CloudfListResponse,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ Telnyx::Models::Storage::CloudfsFilesystemDetailResponseWrapper

Retrieves a CloudFS filesystem by its ID. The returned meta_url omits the credential — the metadata token is only ever returned by create and rotate-meta-token. A filesystem whose last lifecycle action failed includes a customer-safe error message.

Parameters:

Returns:

See Also:



67
68
69
70
71
72
73
74
# File 'lib/telnyx/resources/storage/cloudfs.rb', line 67

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["storage/cloudfs/%1$s", id],
    model: Telnyx::Storage::CloudfsFilesystemDetailResponseWrapper,
    options: params[:request_options]
  )
end

#update(id, name: nil, request_options: {}) ⇒ Telnyx::Models::Storage::CloudfsFilesystemDetailResponseWrapper

Some parameter documentations has been truncated, see Models::Storage::CloudfUpdateParams for more details.

Updates a CloudFS filesystem. Only name can be changed; other fields are immutable and unknown fields are rejected with a 400. Renaming to a name that already exists in your organization returns a 422.

Parameters:

  • id (String)

    CloudFS filesystem ID

  • name (String)

    New filesystem name, unique within your organization. Names are trimmed and lowe

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



94
95
96
97
98
99
100
101
102
103
# File 'lib/telnyx/resources/storage/cloudfs.rb', line 94

def update(id, params = {})
  parsed, options = Telnyx::Storage::CloudfUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["storage/cloudfs/%1$s", id],
    body: parsed,
    model: Telnyx::Storage::CloudfsFilesystemDetailResponseWrapper,
    options: options
  )
end