Shared Storages

OneAndOne::SharedStorage()

The SharedStorage class allows a user to perform actions against the 1and1 API.

list(page: nil, per_page: nil, sort: nil, q: nil, fields: nil)

Return a list of all shared storages.

Parameters:
  • page (int) – Allows the use of pagination. Indicate which page to start on.
  • per_page (int) – Number of items per page.
  • sort (str) – sort: 'name' retrieves a list of elements sorted alphabetically. sort: 'creation_date' retrieves a list of elements sorted by their creation date in descending order.
  • q (str) – q is for query. Use this parameter to return only the items that match your search query.
  • fields (str) – Returns only the parameters requested. (i.e. fields: ‘id, name, description, hardware.ram’)
Return type:

JSON

create(name: nil, description: nil, size: nil)

Create a shared storage.

Parameters:
  • name (str) – shared storage name.
  • description (str) – shared storage description.
  • size (int) – shared storage size.
Return type:

JSON

get(shared_storage_id: @id)

Returns a shared storage’s current specs.

Parameters:
  • shared_storage_id (str) – the unique identifier for the shared storage.
Return type:

JSON

modify(shared_storage_id: @id, name: nil, description: nil, size: nil)

Modify a shared storage.

Parameters:
  • shared_storage_id (str) – the unique identifier for the shared storage.
  • name (str) – shared storage name.
  • description (str) – shared storage description.
  • size (int) – shared storage size. Must be a multiple of 50.
Return type:

JSON

delete(shared_storage_id: @id)

Delete a shared storage.

Parameters:
  • shared_storage_id (str) – the unique identifier for the shared storage.
Return type:

JSON

add_servers(shared_storage_id: @id, servers: nil)

Add servers to a shared storage.

Parameters:
  • shared_storage_id (str) – the unique identifier for the shared storage.
  • servers (array) – an array of server hashes.
Return type:

JSON

servers(shared_storage_id: @id)

List a shared storage’s servers.

Parameters:
  • shared_storage_id (str) – the unique identifier for the shared storage.
Return type:

JSON

server(shared_storage_id: @id, server_id: nil)

Returns information about a shared storage’s server.

Parameters:
  • shared_storage_id (str) – the unique identifier for the shared storage.
  • server_id (str) – the unique identifier for the server.
Return type:

JSON

remove_server(shared_storage_id: @id, server_id: nil)

Remove a server from a shared storage.

Parameters:
  • shared_storage_id (str) – the unique identifier for the shared storage.
  • server_id (str) – the unique identifier for the server.
Return type:

JSON

access()

Retrieve the credentials for accessing shared storages.

Return type:JSON
change_password(password: nil)

Change the password for accessing shared storages.

Parameters:
  • password (str) – new shared storage password.
Return type:

JSON

wait_for()

Polls the shared storage until an “ACTIVE” state is returned. Use this when chaining actions.

Return type:nil