Private Networks¶
-
OneAndOne::PrivateNetwork()
The
PrivateNetwork
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 private networks.
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
- page (
-
create
(name: nil, description: nil, network_address: nil, subnet_mask: nil)¶ Create a private network.
Parameters: - name (
str
) – private network name. - description (
str
) – private network description. - network_address (
str
) – Private network address. (valid IP) - subnet_mask (
str
) – Subnet mask (valid subnet for the given IP).
Return type: JSON
- name (
-
get
(private_network_id: @id)¶ Returns a private network’s current specs.
Parameters: - private_network_id (
str
) – the unique identifier for the private network.
Return type: JSON
- private_network_id (
-
modify
(private_network_id: @id, name: nil, description: nil, network_address: nil, subnet_mask: nil)¶ Modify a private network.
Parameters: - name (
str
) – private network name. - description (
str
) – private network description. - network_address (
str
) – Private network address. (valid IP) - subnet_mask (
str
) – Subnet mask (valid subnet for the given IP).
Return type: JSON
- name (
-
delete
(private_network_id: @id)¶ Delete a private network.
Parameters: - private_network_id (
str
) – the unique identifier for the private network.
Return type: JSON
- private_network_id (
-
servers
(private_network_id: @id)¶ Lists a private network’s servers.
Parameters: - private_network_id (
str
) – the unique identifier for the private network.
Return type: JSON
- private_network_id (
-
server
(private_network_id: @id, server_id: nil)¶ Returns information about a private network’s server.
Parameters: - private_network_id (
str
) – the unique identifier for the private network. - server_id (
str
) – the unique identifier for the server.
Return type: JSON
- private_network_id (
-
remove_server
(private_network_id: @id, server_id: nil)¶ Remove a server from a private network.
Parameters: - private_network_id (
str
) – the unique identifier for the private network. - server_id (
str
) – the unique identifier for the server.
Return type: JSON
- private_network_id (
-
add_servers
(private_network_id: @id, servers: nil)¶ Add servers to a private network.
Parameters: - private_network_id (
str
) – the unique identifier for the private network. - servers (
array
) – an array of server ID strings.
Return type: JSON
- private_network_id (
-
wait_for
()¶ Polls the private network until an “ACTIVE” state is returned. Use this when chaining actions.
Return type: nil
-