community.hrobot.storagebox_info module – Query information on one or more storage boxes

Note

This module is part of the community.hrobot collection (version 2.5.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.hrobot.

To use it in a playbook, specify: community.hrobot.storagebox_info.

New in community.hrobot 2.1.0

Synopsis

  • Query information on one or more storage box.

Parameters

Parameter

Comments

full_info

boolean

Whether to provide full information for every storage box.

Setting this to true requires one REST call per storage box, which is slow and reduces your rate limit. Use with care.

When storagebox_id is specified, this option is always treated as having value true.

Note that this option has no effect if hetzner_token is specified.

Choices:

  • false ← (default)

  • true

hetzner_password

string

The password for the Robot web-service user.

If hetzner_password is specified, hetzner_user must also be specified, and hetzner_token must not be specified.

hetzner_token

string

added in community.hrobot 2.5.0

The API token for the Robot web-service user.

One of hetzner_token and hetzner_user must be specified.

hetzner_user

string

The username for the Robot web-service user.

One of hetzner_token and hetzner_user must be specified.

If hetzner_user is specified, hetzner_password must also be specified, and hetzner_token must not be specified.

linked_server_number

integer

Limit result list to storage boxes linked to the server with this number.

Ignored when storagebox_id has been specified, or when hetzner_token has been specified.

rate_limit_retry_timeout

integer

added in community.hrobot 2.1.0

Timeout (in seconds) for waiting when rate limit exceeded errors are returned.

Set to 0 to not retry.

Set to a negative value like -1 to retry forever.

Default: -1

storagebox_id

integer

Limit result list to storage boxes with this ID.

Attributes

Attribute

Support

Description

action_group

Action groups: community.hrobot.api, community.hrobot.robot

Use group/community.hrobot.robot or group/community.hrobot.api in module_defaults to set defaults for this module.

check_mode

Support: full

This action does not modify state.

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: N/A

This action does not modify state.

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

idempotent

Support: full

This action does not modify state.

When run twice in a row outside check mode, with the same arguments, the second invocation indicates no change.

This assumes that the system controlled/queried by the module has not changed in a relevant way.

Examples

---
- name: Query a list of all storage boxes
  community.hrobot.storagebox_info:
    hetzner_user: foo
    hetzner_password: bar
  register: result

- name: Query a specific storage box
  community.hrobot.storagebox_info:
    hetzner_user: foo
    hetzner_password: bar
    storagebox_id: 23
  register: result

- name: Output data on specific storage box
  ansible.builtin.debug:
    msg: "Storage box name: {{ result.storageboxes[0].name }}"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

storageboxes

list / elements=dictionary

List of storage boxes matching the provided options.

Returned: success

access_settings

dictionary

added in community.hrobot 2.5.0

Access settings for the storage box.

Returned: when hetzner_token is specified

reachable_externally

boolean

Whether the storage box is accessible from outside Hetzner’s network.

Returned: success

Sample: false

samba_enabled

boolean

Whether SAMBA is enabled.

Returned: success

Sample: false

ssh_enabled

boolean

Whether SSH is enabled.

Returned: success

Sample: false

webdav_enabled

boolean

Whether WebDAV is enabled.

Returned: success

Sample: false

zfs_enabled

boolean

Whether ZFS is enabled.

Returned: success

Sample: false

cancelled

boolean

Whether the storage box has been cancelled.

The cancellation can still be un-done until storageboxes[].paid_until has been exceeded.

Returned: success and hetzner_user is specified

Sample: false

created

string

added in community.hrobot 2.5.0

Creation timestamp in ISO 8601 format.

Returned: when hetzner_token is specified

Sample: "2016-01-30T23:55:00+00:00"

disk_quota

integer

Total amount of MB available.

Note that this is copied from storageboxes[].storage_box_type.size in case hetzner_token is specified.

Returned: when full_info=true, or hetzner_token is specified

Sample: 10240000

disk_usage

integer

The amount of MB in use.

Note that this is copied from storageboxes[].stats.size in case hetzner_token is specified.

Returned: when full_info=true, or hetzner_token is specified

Sample: 900

disk_usage_data

integer

The amount of MB used by files.

Note that this is copied from storageboxes[].stats.size_data in case hetzner_token is specified.

Returned: when full_info=true, or hetzner_token is specified

Sample: 500

disk_usage_snapshots

integer

The amount of MB used by snapshots.

Note that this is copied from storageboxes[].stats.size_snapshots in case hetzner_token is specified.

Returned: when full_info=true, or hetzner_token is specified

Sample: 400

external_reachability

boolean

Whether the storage box is reachable externally.

Note that this is copied from storageboxes[].access_settings.reachable_externally in case hetzner_token is specified.

Returned: when full_info=true, or hetzner_token is specified

Sample: true

host_system

string

Identifier of the storage box’s host.

Returned: when full_info=true and hetzner_user is specified

Sample: "FSN1-BX355"

id

integer

The storage box’s ID.

Returned: success

Sample: 123456

labels

dictionary

added in community.hrobot 2.5.0

User-defined labels for the storage box.

Returned: when hetzner_token is specified

linked_server

integer

The ID (server number) of the connected server, if available. Is null otherwise.

Returned: success and hetzner_user is specified

Sample: 123456

location

any

The storage box’s location.

This is a string if hetzner_user is specified, and a dictionary if hetzner_token is specified.

Returned: success

Sample: "FSN1"

locked

boolean

Whether the IP is locked.

Returned: success and hetzner_user is specified

Sample: false

login

string

The storage box’s login name.

Note that this is copied from storageboxes[].username in case hetzner_token is specified.

Returned: success

Sample: "u12345"

name

string

The storage box’s name.

Returned: success and hetzner_user is specified

Sample: "Backup Server 1"

paid_until

string

The date until which the storage box has been paid for.

Returned: success and hetzner_user is specified

Sample: "2015-10-23"

product

string

The product name.

Returned: success and hetzner_user is specified

Sample: "BX60"

protection

dictionary

added in community.hrobot 2.5.0

Protection configuration for the storage box.

Returned: when hetzner_token is specified

delete

boolean

Whether deletion of the storage box is disabled.

Returned: success

Sample: false

samba

boolean

Whether SAMBA is active.

Note that this is copied from storageboxes[].access_settings.samba_enabled in case hetzner_token is specified.

Returned: when full_info=true, or hetzner_token is specified

Sample: true

server

string

The storage box’s hostname.

Returned: when full_info=true; or hetzner_token is specified and storageboxes[].status is not initializing

Sample: "u12345.your-storagebox.de"

snapshot_plan

dictionary

added in community.hrobot 2.5.0

The snapshot plan for the storage box.

Will be none (JSON null) if no plan is active.

Returned: when hetzner_token is specified and storageboxes[].status is not initializing

day_of_month

integer

Day of the month the snapshot plan is executed.

Will be none (JSON null) if this restriction is not set (that is, create a snapshot every day unless the day of week is specified).

Returned: success

day_of_week

integer

Day of the week the snapshot plan is executed.

Will be none (JSON null) if this restriction is not set (that is, create a snapshot every day unless the day of month is specified).

Returned: success

hour

integer

Hour the snapshot plan is executed (in UTC).

Will be none (JSON null) if this restriction is not set (that is, create a snapshot every hour).

Returned: success

max_snapshots

integer

Maximum number of automatic snapshots to be kept.

Returned: success

Sample: 10

minute

integer

Minute the snapshot plan is executed (in UTC).

Will be none (JSON null) if this restriction is not set (that is, create a snapshot every minute).

Returned: success

ssh

boolean

Whether SSH is active.

Note that this is copied from storageboxes[].access_settings.ssh_enabled in case hetzner_token is specified.

Returned: when full_info=true, or hetzner_token is specified

Sample: true

stats

dictionary

added in community.hrobot 2.5.0

Information on disk usage.

Returned: when hetzner_token is specified and storageboxes[].status is not initializing

size

integer

Current disk usage in bytes.

Returned: success

Sample: 0

size_data

integer

Current disk usage for data in bytes.

Returned: success

Sample: 0

size_snapshots

integer

Current disk usage for snapshots in bytes.

Returned: success

Sample: 0

status

string

added in community.hrobot 2.5.0

Status of the storage box.

Returned: when hetzner_token is specified

Can only return:

  • "active"

  • "initializing"

  • "locked"

Sample: "active"

storage_box_type

dictionary

added in community.hrobot 2.5.0

Information on the storage box’s type.

Returned: when hetzner_token is specified

automatic_snapshot_limit

integer

Maximum number of snapshots created automatically by a snapshot plan.

Returned: success

Sample: 10

deprecation

dictionary

Set to none (JSON null) if the storage box’s type is not deprecated.

If set to a dictionary, this storage box’s type is deprecated.

Returned: success

announced

string

ISO 8601 timestamp when the deprecation was announced.

Returned: success

Sample: "2023-06-01T00:00:00+00:00"

unavailable_after

string

ISO 8601 timestamp when the resource will be removed.

Returned: success

Sample: "2023-09-01T00:00:00+00:00"

description

string

Description of the storage box’s type.

Returned: success

Sample: "BX11"

name

string

Identifier of the storage box’s type.

Returned: success

Sample: "bx11"

prices

list / elements=dictionary

Price per location.

Returned: success

location

string

Name of the location.

Returned: success

Sample: "fsn1"

price_hourly

dictionary

The hourly rate.

Returned: success

gross

string

Hourly price (with VAT).

Returned: success

Sample: "1.1900"

net

string

Hourly price (without VAT).

Returned: success

Sample: "1.0000"

price_monthly

dictionary

The monthly rate.

Returned: success

gross

string

Monthly price (with VAT).

Returned: success

Sample: "1.1900"

net

string

Monthly price (without VAT).

Returned: success

Sample: "1.0000"

setup_fee

dictionary

The setup fee.

Returned: success

gross

string

Setup fee (with VAT).

Returned: success

Sample: "1.1900"

net

string

Setup fee (without VAT).

Returned: success

Sample: "1.0000"

size

integer

Available storage in bytes.

Returned: success

Sample: 1073741824

snapshot_limit

integer

Maximum number of allowed manual snapshots.

Returned: success

Sample: 10

subaccounts_limit

integer

Maximum number of allowed subaccounts.

Returned: success

Sample: 200

system

string

added in community.hrobot 2.5.0

Identifier of the storage box’s host.

Returned: when hetzner_token is specified and storageboxes[].status is not initializing

Sample: "FSN1-BX355"

username

string

added in community.hrobot 2.5.0

The storage box’s login name.

Returned: success if hetzner_token is specified.

Sample: "u12345"

webdav

boolean

Whether WebDAV is active.

Note that this is copied from storageboxes[].access_settings.webdav_enabled in case hetzner_token is specified.

Returned: when full_info=true, or hetzner_token is specified

Sample: true

zfs

boolean

Shows whether the ZFS directory is visible.

Note that this is copied from storageboxes[].access_settings.zfs_enabled in case hetzner_token is specified.

Returned: when full_info=true, or hetzner_token is specified

Sample: false

Authors

  • Felix Fontein (@felixfontein)