### RgReplica.sync() Source: https://infinisdk.readthedocs.io/en/latest/api.html Starts a sync job. ```APIDOC ## RgReplica.sync() ### Description Starts a sync job. ### Method POST ### Endpoint N/A (SDK method) ### Parameters None ### Returns None ``` -------------------------------- ### Install InfiniSDK with pip Source: https://infinisdk.readthedocs.io/en/latest/_sources/getting_started.rst.txt Install the InfiniSDK package using pip. Depending on your Python installation, this command might require root privileges. ```bash $ pip install infinisdk ``` -------------------------------- ### Create three filesystems for bulk update Source: https://infinisdk.readthedocs.io/en/latest/_sources/filesystems.rst.txt Creates three filesystems (f1, f2, f3) to be used in a bulk update example. ```python >>> f1 = system.filesystems.create(pool=pool) >>> f2 = system.filesystems.create(pool=pool) >>> f3 = system.filesystems.create(pool=pool) ``` -------------------------------- ### Get management and core services Source: https://infinisdk.readthedocs.io/en/latest/_sources/components.rst.txt Shows how to get specific service types: management and core. ```python >>> s = node.get_management_service() >>> s = node.get_core_service() ``` -------------------------------- ### Inefficient and efficient volume size fetching loops Source: https://infinisdk.readthedocs.io/en/latest/_sources/faq.rst.txt Slow example repeatedly fetches the same volume inside the loop, causing cache misses. Efficient version gets the object once and reuses it inside the loop to avoid unnecessary fetches. ```python for i in range(10): v = system.volumes.get(name='vol1') v.get_size() # <-- this always fetches a new value ``` ```python v = system.volumes.get(name='vol1') for i in range(10): v.get_size() # <-- reuses the cache value when possible ``` -------------------------------- ### sync Source: https://infinisdk.readthedocs.io/en/latest/api.html Starts a sync job. ```APIDOC ## sync() ### Description Starts a sync job. ### Method POST ### Endpoint infinibox.replicas.sync ### Returns - None ``` -------------------------------- ### Get all internal datasets or volumes with pagination Source: https://infinisdk.readthedocs.io/en/latest/snapshots.html Pass `page` and `page_size` parameters to `get_all_internals()` to paginate results. The example shows retrieving internal datasets and volumes with page=1 and page_size=20. ```python >>> all_internal_datasets = system.datasets.get_all_internals(page=1, page_size=20) >>> all_internal_volumes = system.volumes.get_all_internals(page=1, page_size=20) ``` -------------------------------- ### Efficient volume-to-host mapping Source: https://infinisdk.readthedocs.io/en/latest/faq.html This example shows a more efficient version of the volume-to-host mapping, fetching each object type as few times as possible by iterating over hosts and using a dictionary to group volumes by host. ```python volumes_by_host = {} for host in system.hosts: for lu in host.get_luns(): volumes_by_host.setdefault(lu.get_volume().id, []).append(host.get_name()) for volume_id, host_names in volumes_by_host.items(): for host_name in host_names: print(volume_id, 'is mapped to', host_name) ``` -------------------------------- ### Set up logging with Logbook Source: https://infinisdk.readthedocs.io/en/latest/_sources/getting_started.rst.txt InfiniSDK uses Logbook for logging, and by default all logs are emitted to stderr. This example sets up a NestedSetup to only emit INFO logs to the console. ```python >>> import logbook >>> import sys >>> with logbook.NestedSetup([ ... logbook.NullHandler(), ... logbook.StreamHandler(sys.stderr, level=logbook.INFO)]): ... pass # your code here ``` -------------------------------- ### Node.get_service('mgmt') Source: https://infinisdk.readthedocs.io/en/latest/_sources/components.rst.txt Gets a service by its name. ```APIDOC ## Node.get_service('mgmt') ### Description Gets a service by its name. ### Method get_service() ### Endpoint Node.get_service() ### Parameters #### Path Parameters - **service_name** (str) - Required - The name of the service to retrieve. ### Request Example ```python node.get_service('mgmt') ``` ### Response #### Success Response - **service** (Service) - The service object. #### Response Example ```python <...:Service id=system:0_rack:1_node:3_service:mgmt> ``` ``` -------------------------------- ### HostBinder.safe_get Source: https://infinisdk.readthedocs.io/en/latest/api.html Like get(), only returns None if no objects were found. ```APIDOC ## HostBinder.safe_get ### Description Like get(), only returns None if no objects were found. ### Method safe_get ### Parameters - **predicates** (*) - Optional - Predicates to filter the query. - **kw** (*) - Optional - Keyword arguments for filtering. ### Returns The matching host object or None. ``` -------------------------------- ### Promote a snapshot with Volume.promote_snapshot() Source: https://infinisdk.readthedocs.io/en/latest/snapshots.html Promote a snapshot to a standalone dataset using `Volume.promote_snapshot()`. The example shows that the snapshot type changes from 'SNAPSHOT' to 'MASTER' after promotion. ```python >>> snapshot = volume.create_snapshot() >>> snapshot.get_type() 'SNAPSHOT' >>> promoted_snapshot = snapshot.promote_snapshot() >>> promoted_snapshot.get_type() 'MASTER' ``` -------------------------------- ### Create a filesystem with the create method Source: https://infinisdk.readthedocs.io/en/latest/_sources/filesystems.rst.txt Creates a filesystem with a specified pool, name, and size. If size is not provided, a default of 1 GiB is used. ```python >>> from capacity import GiB, GB >>> my_fs = system.filesystems.create(pool=pool, name='my_fs', size=GiB) ``` -------------------------------- ### Get system model name Source: https://infinisdk.readthedocs.io/en/latest/_sources/system_object.rst.txt Calls get_model_name() to retrieve the model information as reported by the system. The example checks that the return value is a string. ```python >>> isinstance(system.get_model_name(), str) True ``` -------------------------------- ### Inspect snapshot creation time with get_creation_time() Source: https://infinisdk.readthedocs.io/en/latest/snapshots.html Use `snap.get_creation_time()` to get the creation time as an Arrow object. The example calculates the age of the snapshot in days. ```python >>> creation_time = snap.get_creation_time() >>> delta = current_time - creation_time >>> delta.days 15 ``` -------------------------------- ### Create a filesystem with security style Source: https://infinisdk.readthedocs.io/en/latest/filesystems.html Optionally specify the `security_style` parameter in the `create` method. ```python >>> fs = system.filesystems.create(pool=pool, security_style="WINDOWS") ``` -------------------------------- ### Get linked system from link object Source: https://infinisdk.readthedocs.io/en/latest/_sources/replication.rst.txt Retrieves the remote system from a link object using get_linked_system(). This is part of the initial setup for vVol replication. ```python >>> link.get_linked_system() # doctest: +SKIP ``` -------------------------------- ### Get all internal datasets or volumes with get_all_internals() Source: https://infinisdk.readthedocs.io/en/latest/snapshots.html Use `system.datasets.get_all_internals()` and `system.volumes.get_all_internals()` to retrieve internal datasets and volumes. The example shows filtering by `internal_type` ('master' or 'snapshot'). ```python >>> all_internal_datasets = system.datasets.get_all_internals() >>> all_internal_volumes_type_master = system.volumes.get_all_internals(internal_type='master') >>> all_internal_volumes_type_snapshot = system.volumes.get_all_internals(internal_type='snapshot') ``` -------------------------------- ### Create InfiniBox instances and a locations dictionary Source: https://infinisdk.readthedocs.io/en/latest/_sources/extending.rst.txt Shows how to instantiate two InfiniBox objects with authentication and log in to each. A dictionary maps each system to a location string, which will be used by the custom method. ```python >>> s1 = InfiniBox(system1_address, auth = (username, password)) >>> s2 = InfiniBox(system2_address, auth = (username, password)) >>> _ = s1.login() >>> _ = s2.login() >>> locations = {s1: "upper floor", s2: "lower floor"} ``` -------------------------------- ### Get internal volumes of a specific volume with pagination Source: https://infinisdk.readthedocs.io/en/latest/snapshots.html Pass `page` and `page_size` parameters to `Volume.get_all_internals()` to paginate results. The example shows retrieving internal volumes with page=1 and page_size=20. ```python >>> volume_internal_volumes = volume.get_all_internals(page=1, page_size=20) ``` -------------------------------- ### Find volumes by equality predicate Source: https://infinisdk.readthedocs.io/en/latest/api.html These are usage examples from the find method of InfiniBoxSystemComponents. The first demonstrates querying by direct keyword arguments for equality. The second demonstrates querying using complex predicates with comparators (e.g., '>' and '!=') via the system.volumes.fields and Q objects. ```python system.volumes.find(size=GiB) ``` ```python system.volumes.find(system.volumes.fields.size > GiB) system.volumes.find(Q.name != 'some_name') ``` -------------------------------- ### Iterating Over Host Mappings with Host.get_luns Source: https://infinisdk.readthedocs.io/en/latest/_sources/mappings.rst.txt Maps a volume to a LUN and then iterates over all mappings of the host. The example shows the output format of the get_luns method and the mapping iteration. ```python >>> lu = host.map_volume(volume, lun=5) >>> host.get_luns() # doctest: +ELLIPSIS -><...:Volume id=...>>]> >>> for lun in host.get_luns(): ... print("{} is mapped to {}".format(lun, lun.volume)) # doctest: +ELLIPSIS -><...:Volume id=...>> is mapped to <...:Volume id=...> ``` -------------------------------- ### system.get_smb_server_capabilities() Source: https://infinisdk.readthedocs.io/en/latest/_sources/smb_server_capabilities.rst.txt Retrieves the current SMB server capabilities for the tenant. Returns the default tenant configuration with fields: min_smb_protocol, max_smb_protocol, smb_signing, and smb_encryption. ```APIDOC ## system.get_smb_server_capabilities() ### Description Retrieves the current SMB server capabilities for the tenant. Returns the default tenant configuration. ### Method GET ### Endpoint system.get_smb_server_capabilities() ### Parameters None ### Request Example ```python system.get_smb_server_capabilities() ``` ### Response #### Success Response (200) - **min_smb_protocol** (string) - Minimum SMB protocol version supported. - **max_smb_protocol** (string) - Maximum SMB protocol version supported. - **smb_signing** (string) - SMB signing setting. - **smb_encryption** (string) - SMB encryption setting. #### Response Example ```json { "min_smb_protocol": "SMB2", "max_smb_protocol": "SMB3", "smb_signing": "required", "smb_encryption": "enabled" } ``` ``` -------------------------------- ### Create a Share with Filesystem.add_share Source: https://infinisdk.readthedocs.io/en/latest/_sources/filesystems.rst.txt Creates a filesystem with Windows security style and then adds a share using add_share(). The new share appears in the filesystem's get_shares() list. ```python >>> fs = system.filesystems.create( ... pool=pool, ... security_style="WINDOWS" ... ) >>> share = fs.add_share() >>> share in fs.get_shares() True ``` -------------------------------- ### Update and get object name using direct setters/getters Source: https://infinisdk.readthedocs.io/en/latest/_sources/getting_started.rst.txt Shows how to use direct setters and getters for common attributes. The example updates the name and then verifies the getter returns the new value. ```python >>> pool.update_name('new_name') >>> pool.get_name() == 'new_name' True ``` -------------------------------- ### Naive volume-to-host mapping Source: https://infinisdk.readthedocs.io/en/latest/faq.html This example shows a naive approach to determining which volume is mapped to each host. It is slow because get_logical_units() fetches a non-cached field and get_host().get_name() re-fetches the host multiple times. ```python for v in system.volumes: for lu in v.get_logical_units(): print(v, 'is mapped to', lu.get_host().get_name()) ``` -------------------------------- ### Create a filesystem with default size Source: https://infinisdk.readthedocs.io/en/latest/filesystems.html When size is not specified, a default of 1 GiB is used. You can also provide the size explicitly. ```python >>> fs = system.filesystems.create(pool=pool, size=1*GiB) ``` -------------------------------- ### Set network space properties during creation and update Source: https://infinisdk.readthedocs.io/en/latest/_sources/networking.rst.txt Shows how to specify properties during network space creation and update them later using update_properties. The example uses 'is_async_only' as a property. ```python netspace = system.network_spaces.create(..., properties: {'is_async_only': True}) ... netspace.update_properties({ 'is_async_only': False, }) ``` -------------------------------- ### Example loop with API logging output Source: https://infinisdk.readthedocs.io/en/latest/_sources/efficient_querying.rst.txt Shows a loop that prints volume names and sizes, followed by the logged REST API request and output. The request URL retrieves all volumes and snapshots. ```python for vol in system.volumes: print(f"Volume: {vol.get_name()} is {vol.get_size()}") ``` ```text Requst: http://systemname:443/api/rest/volumes Volume: vol1 is 1 GB ``` -------------------------------- ### Get a single object with get Source: https://infinisdk.readthedocs.io/en/latest/_sources/querying.rst.txt Uses the get shortcut to retrieve a single object by field value. Fails if zero or multiple objects are returned. ```python >>> v = system.volumes.get(name='vol0') >>> v # doctest: +ELLIPSIS <...:Volume id=...> ``` -------------------------------- ### Create S3 bucket with optional parameters Source: https://infinisdk.readthedocs.io/en/latest/_sources/s3_bucket.rst.txt Creates an S3 bucket with optional parameters ``compression_enabled`` and ``ssd_enabled``. The example sets compression to True and SSD to False. ```python >>> bucket = system.s3_buckets.create( ... account=account, ... name="logs", ... compression_enabled=True, ... ssd_enabled=False, ... ) ``` -------------------------------- ### API.get(path, **kwargs) Source: https://infinisdk.readthedocs.io/en/latest/api.html Shortcut for `.request('get')`. Sends an HTTP GET request to the specified path. ```APIDOC ## get(path, **kwargs) ### Description Shortcut for `.request('get')`. Sends an HTTP GET request to the specified path. ### Method GET ### Endpoint API.get(path, **kwargs) ### Parameters #### Path Parameters - **path** (string) - Required - The API endpoint path. #### Additional Parameters - **kwargs** - Optional - Additional keyword arguments passed to the request. ``` -------------------------------- ### Create a filesystem with security_style Source: https://infinisdk.readthedocs.io/en/latest/_sources/filesystems.rst.txt Creates a filesystem with the security_style set to "WINDOWS". ```python >>> fs = system.filesystems.create(pool=pool, security_style="WINDOWS") ``` -------------------------------- ### get() failure cases Source: https://infinisdk.readthedocs.io/en/latest/querying.html Shows the exceptions raised when get() returns zero or multiple objects: TooManyObjectsFound and ObjectNotFound. ```python >>> system.volumes.get() Traceback (most recent call last): ... TooManyObjectsFound >>> system.volumes.get(name='nonexistent') Traceback (most recent call last): ... ObjectNotFound ``` -------------------------------- ### Get metadata value with get_metadata_value Source: https://infinisdk.readthedocs.io/en/latest/_sources/metadata.rst.txt Gets and prints the value of a metadata key. Demonstrates the simple usage of get_metadata_value when the key exists. ```python >>> print(volume.get_metadata_value('metadata_key')) value! ``` -------------------------------- ### Compute data sizes with capacity module (floor division by GiB) Source: https://infinisdk.readthedocs.io/en/latest/getting_started.html Shows how InfiniSDK uses the capacity module for size computations (multiplication, floor division by GiB). The output demonstrates that sizes are printed with units; multiplying by 2 yields 2 TB, and floor division by GiB gives 931 (unformatted) for a 1 TB capacity. ```python >>> from capacity import GiB >>> size = pool.get_virtual_capacity() >>> print(size) 1 TB >>> print(size * 2) 2 TB >>> print(size // GiB) 931 ``` -------------------------------- ### get failure cases: TooManyObjectsFound and ObjectNotFound Source: https://infinisdk.readthedocs.io/en/latest/_sources/querying.rst.txt Shows that get raises TooManyObjectsFound when multiple objects match and ObjectNotFound when none match. ```python >>> system.volumes.get() # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ... TooManyObjectsFound >>> system.volumes.get(name='nonexistent') # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ... ObjectNotFound ``` -------------------------------- ### Retrieve a single volume by name with get() Source: https://infinisdk.readthedocs.io/en/latest/_sources/efficient_querying.rst.txt Use get() to retrieve a single object by name. The REST URL shows the name filter. ```python system.volumes.get(Q.name=='my-volume-name') ``` ```text Request: https://systemname:443/api/rest/volumes?name=eq%3Amy-volume-name ``` -------------------------------- ### Work with storage capacities using capacity module Source: https://infinisdk.readthedocs.io/en/latest/_sources/getting_started.rst.txt Shows how to use the capacity module to handle data sizes, including unit conversion and arithmetic operations. ```python >>> from capacity import GiB >>> size = pool.get_virtual_capacity() >>> print(size) 1 TB >>> print(size * 2) 2 TB >>> print(size // GiB) 931 ``` -------------------------------- ### Querying Host by a Defined Port with get_host_by_initiator_address and has_registered_initiator_address Source: https://infinisdk.readthedocs.io/en/latest/_sources/mappings.rst.txt Checks whether an initiator address is registered and retrieves the host associated with it. The example shows that after adding the port, the host is found correctly. ```python >>> system.hosts.has_registered_initiator_address(address) False >>> host.add_port(address) >>> system.hosts.get_host_by_initiator_address(address) == host True ``` -------------------------------- ### replica_remote_pairs example for multi-target consistency group add_member Source: https://infinisdk.readthedocs.io/en/latest/api.html Example structure for the `replica_remote_pairs` parameter of `add_member` for a multi-target consistency group. Each inner pair associates a local replica with its corresponding remote dataset entity. ```python replica_remote_pairs = [ [replica1, remote_entity1], [replica2, remote_entity2], [replica3, remote_entity3], # Add more pairs as needed ] ``` -------------------------------- ### Find volumes by field value Source: https://infinisdk.readthedocs.io/en/latest/querying.html Demonstrates querying by a specific field value using find(). The example finds a volume named 'vol0' and prints the resulting object. ```python >>> [v] = system.volumes.find(name='vol0') >>> v <...:Volume id=...> ``` -------------------------------- ### Configure credentials via .ini file Source: https://infinisdk.readthedocs.io/en/latest/getting_started.html Shows the structure of the ~/.infinidat/infinisdk.ini file for default credentials. When this file exists, constructing an InfiniBox object uses these credentials by default. ```ini [infinibox] username=admin password=password ``` -------------------------------- ### Create .ini file for authentication Source: https://infinisdk.readthedocs.io/en/latest/_sources/getting_started.rst.txt Create a file named ~/.infinidat/infinisdk.ini with the following structure. Constructing an InfiniBox object will use these credentials by default. ```ini [infinibox] username=admin password=password ``` -------------------------------- ### S3Credential.get_fields Source: https://infinisdk.readthedocs.io/en/latest/api.html Gets a set of fields from the system. ```APIDOC ## S3Credential.get_fields ### Description Gets a set of fields from the system. ### Method get_fields ### Parameters - **field_names** (tuple) - Optional - A tuple of field names to retrieve. - **from_cache** (bool) - Optional - Attempt to fetch the fields from the cache. - **fetch_if_not_cached** (bool) - Optional - Pass as False to force only from cache. - **raw_value** (bool) - Optional - If True, return raw values. ### Returns A dictionary of field names to their values. ``` -------------------------------- ### Create user Source: https://infinisdk.readthedocs.io/en/latest/_sources/users.rst.txt Creates a new user with a name and password. ```python >>> user = system.users.create(name='testuser', password='testpassword') ``` -------------------------------- ### S3User.get_fields Source: https://infinisdk.readthedocs.io/en/latest/api.html Gets a set of fields from the system. ```APIDOC ## S3User.get_fields ### Description Gets a set of fields from the system. ### Method get_fields ### Parameters - **field_names** (tuple) - Optional - The names of the fields to retrieve. - **from_cache** - Optional - Attempt to fetch the fields from the cache. - **fetch_if_not_cached** (bool) - Optional - Pass as False to force only from cache. - **raw_value** (bool) - Optional - Whether to return raw values. ### Returns - a dictionary of field names to their values ``` -------------------------------- ### HostBinder.sample Source: https://infinisdk.readthedocs.io/en/latest/api.html Chooses a random sample out of those returned. Raises ValueError if there are not enough items. ```APIDOC ## HostBinder.sample ### Description Chooses a random sample out of those returned. Raises ValueError if there are not enough items. ### Method sample ### Parameters - **predicates** (*) - Optional - Predicates to filter the query. - **kw** (*) - Optional - Keyword arguments for filtering. ### Returns A random sample of host objects. ### Raises - `ValueError` - If there are not enough items. ``` -------------------------------- ### Create a pool with defaults Source: https://infinisdk.readthedocs.io/en/latest/_sources/getting_started.rst.txt Creates a pool using the system.pools.create() shortcut, which is a thin wrapper around the Pool.create method that automatically assigns the system. ```python >>> pool = system.pools.create() ``` -------------------------------- ### S3Bucket.get_fields Source: https://infinisdk.readthedocs.io/en/latest/api.html Gets a set of fields from the system. ```APIDOC ## S3Bucket.get_fields ### Description Gets a set of fields from the system. ### Method get_fields ### Parameters - **field_names** (tuple) - Optional - A tuple of field names to retrieve. - **from_cache** (bool) - Optional - Attempt to fetch the fields from the cache. - **fetch_if_not_cached** (bool) - Optional - Pass as False to force only from cache. - **raw_value** (bool) - Optional - If True, return raw values. ### Returns A dictionary of field names to their values. ``` -------------------------------- ### Efficient volume-to-host mapping with host.get_luns() Source: https://infinisdk.readthedocs.io/en/latest/_sources/faq.rst.txt Naive mapping fetches logical units and host names repeatedly for each volume. Efficient version iterates hosts and groups volumes by host, minimizing fetches of volume and host data. ```python for v in system.volumes: for lu in v.get_logical_units(): print(v, 'is mapped to', lu.get_host().get_name()) ``` ```python volumes_by_host = {} for host in system.hosts: for lu in host.get_luns(): volumes_by_host.setdefault(lu.get_volume().id, []).append(host.get_name()) for volume_id, host_names in volumes_by_host.items(): for host_name in host_names: print(volume_id, 'is mapped to', host_name) ``` -------------------------------- ### Pool.get_fields() Source: https://infinisdk.readthedocs.io/en/latest/api.html Gets a set of fields from the system. ```APIDOC ## Pool.get_fields() ### Description Gets a set of fields from the system. ### Method GET ### Endpoint pool.get_fields(field_names=(), from_cache=DONT_CARE, fetch_if_not_cached=True, raw_value=False) ### Parameters #### Query Parameters - **field_names** (tuple) - Optional - The names of the fields to retrieve. - **from_cache** (bool) - Optional - Attempt to fetch the fields from the cache. - **fetch_if_not_cached** (bool) - Optional - Pass as False to force only from cache. - **raw_value** (bool) - Optional - If True, return raw values. ### Response #### Success Response - **fields** (dict) - A dictionary of field names to their values. #### Response Example ```json { "fields": { "name": "pool1", "id": 1 } } ``` ``` -------------------------------- ### get_fields Source: https://infinisdk.readthedocs.io/en/latest/api.html Gets a set of fields from the system. ```APIDOC ## get_fields(_field_names=()_, _from_cache=_, _fetch_if_not_cached=True_, _raw_value=False_) ### Description Gets a set of fields from the system. ### Parameters - **field_names** (tuple) - Optional - A tuple of field names to retrieve. - **from_cache** (bool) - Optional - Attempt to fetch the fields from the cache. - **fetch_if_not_cached** (bool) - Optional - Pass as False to force only from cache. - **raw_value** (bool) - Optional - If True, return raw values without processing. ### Returns A dictionary of field names to their values. ``` -------------------------------- ### HostBinder.create Source: https://infinisdk.readthedocs.io/en/latest/api.html Creates a new host object on the system. ```APIDOC ## HostBinder.create ### Description Creates a new host object on the system. ### Method create ### Parameters - **args** (*) - Optional - Positional arguments for creation. - **kwargs** (*) - Optional - Keyword arguments for creation. ### Returns The created host object. ``` -------------------------------- ### Node.get_core_service() Source: https://infinisdk.readthedocs.io/en/latest/_sources/components.rst.txt Gets the core service of the node. ```APIDOC ## Node.get_core_service() ### Description Gets the core service of the node. ### Method get_core_service() ### Endpoint Node.get_core_service() ### Parameters None ### Request Example ```python s = node.get_core_service() ``` ### Response #### Success Response - **service** (Service) - The core service object. #### Response Example ```python <...:Service id=system:0_rack:1_node:3_service:core> ``` ``` -------------------------------- ### system.users.create(name, password) Source: https://infinisdk.readthedocs.io/en/latest/_sources/users.rst.txt Creates a new user with the specified name and password. ```APIDOC ## system.users.create(name, password) ### Description Creates a new user with the specified name and password. ### Method POST ### Endpoint system.users.create(name, password) ### Parameters #### Request Body - **name** (string) - Required - The name of the new user. - **password** (string) - Required - The password for the new user. ### Request Example ```python user = system.users.create(name='testuser', password='testpassword') ``` ### Response #### Success Response - **user** (User) - The created User object. #### Response Example ```python ``` ``` -------------------------------- ### Node.get_management_service() Source: https://infinisdk.readthedocs.io/en/latest/_sources/components.rst.txt Gets the management service of the node. ```APIDOC ## Node.get_management_service() ### Description Gets the management service of the node. ### Method get_management_service() ### Endpoint Node.get_management_service() ### Parameters None ### Request Example ```python s = node.get_management_service() ``` ### Response #### Success Response - **service** (Service) - The management service object. #### Response Example ```python <...:Service id=system:0_rack:1_node:3_service:mgmt> ``` ``` -------------------------------- ### get_started_at Source: https://infinisdk.readthedocs.io/en/latest/api.html Obtains the value of the 'started_at' field. ```APIDOC ## get_started_at(**kwargs) ### Description Obtains the value of the 'started_at' field. ### Method GET ### Endpoint N/A (SDK method) ### Parameters #### Keyword Arguments - **kwargs** - Optional - Additional keyword arguments. ### Returns - **Arrow** - The value of the 'started_at' field. ``` -------------------------------- ### get_all Source: https://infinisdk.readthedocs.io/en/latest/_sources/qos.rst.txt Retrieves all QoS policies in the system. ```APIDOC ## get_all ### Description Returns a query object representing all QoS policies in the system. ### Method get_all ### Parameters None ### Request Example ```python system.qos_policies.get_all() ``` ### Response Returns a Query object. ``` -------------------------------- ### S3Credential.get_field Source: https://infinisdk.readthedocs.io/en/latest/api.html Gets the value of a single field from the system. ```APIDOC ## S3Credential.get_field ### Description Gets the value of a single field from the system. ### Method get_field ### Parameters - **field_name** (str) - Required - The name of the field to retrieve. - **from_cache** (bool) - Optional - Attempt to use the last cached version of the field value. - **fetch_if_not_cached** (bool) - Optional - Pass `False` to force only from cache. - **raw_value** (bool) - Optional - If True, return the raw value. ### Returns The value of the field. ``` -------------------------------- ### Manage Share Permissions with share.permissions Source: https://infinisdk.readthedocs.io/en/latest/_sources/filesystems.rst.txt Shows how to create, update, verify, and delete a share permission using the permissions field. The example creates a permission with access NONE, updates it to FULLCONTROL, and checks its presence before and after deletion. ```python >>> perm = share.permissions.create(sid="S-1-1-1", access="NONE") # doctest: +SKIP >>> perm.update_access("FULLCONTROL") # doctest: +SKIP >>> perm.get_access() # doctest: +SKIP FULLCONTROL >>> share.permissions.get(sid="S-1-1-1") == perm # doctest: +SKIP True >>> perm in share.permissions.to_list() # doctest: +SKIP True >>> perm.delete() # doctest: +SKIP >>> perm in share.permissions.to_list() # doctest: +SKIP False ``` -------------------------------- ### S3User.get_field Source: https://infinisdk.readthedocs.io/en/latest/api.html Gets the value of a single field from the system. ```APIDOC ## S3User.get_field ### Description Gets the value of a single field from the system. ### Method get_field ### Parameters - **field_name** - Required - The name of the field to retrieve. - **from_cache** - Optional - Attempt to use the last cached version of the field value. - **fetch_if_not_cached** (bool) - Optional - Pass `False` to force only from cache. - **raw_value** (bool) - Optional - Whether to return the raw value. ``` -------------------------------- ### create Source: https://infinisdk.readthedocs.io/en/latest/_sources/qos.rst.txt Creates a new QoS policy with specified type, max_ops, and name. ```APIDOC ## create ### Description Creates a new QoS policy with the specified type, maximum operations per second, and name. ### Method create ### Parameters - **type** (string) - Required - Must be one of: 'volume', 'pool_volume'. - **max_ops** (integer) - Required - Maximum operations per second. - **name** (string) - Required - Name of the policy. ### Request Example ```python qos_policy = system.qos_policies.create(type='volume', max_ops=1000, name='my_policy') ``` ### Response Returns a QosPolicy object. ``` -------------------------------- ### Retrieve all QoS policies Source: https://infinisdk.readthedocs.io/en/latest/_sources/qos.rst.txt List all existing QoS policies in the system. ```python >>> system.qos_policies.get_all() ``` -------------------------------- ### S3Bucket.get_field Source: https://infinisdk.readthedocs.io/en/latest/api.html Gets the value of a single field from the system. ```APIDOC ## S3Bucket.get_field ### Description Gets the value of a single field from the system. ### Method get_field ### Parameters - **field_name** (str) - Required - The name of the field to retrieve. - **from_cache** (bool) - Optional - Attempt to use the last cached version of the field value. - **fetch_if_not_cached** (bool) - Optional - Pass `False` to force only from cache. - **raw_value** (bool) - Optional - If True, return the raw value without processing. ``` -------------------------------- ### Node.get_service Source: https://infinisdk.readthedocs.io/en/latest/api.html Get a service object by its type name. ```APIDOC ## Node.get_service ### Description Get a service object by its type name. ### Method get_service ### Parameters - **service_name** (str) - Required - The service name (mgmt/core/etc.) ### Returns Service object ``` -------------------------------- ### Create a filesystem export Source: https://infinisdk.readthedocs.io/en/latest/_sources/filesystems.rst.txt Creates an export for a filesystem with default settings. ```python >>> export = fs.add_export() ``` -------------------------------- ### system.smb_users.create() Source: https://infinisdk.readthedocs.io/en/latest/_sources/smb_users_and_groups.rst.txt Creates a new SMB user. Returns a user object that can be used for further operations. ```APIDOC ## system.smb_users.create() ### Description Creates a new SMB user. ### Method create ### Endpoint system.smb_users.create() ### Parameters None ### Request Example python user = system.smb_users.create() ### Response #### Success Response - **user** (object) - The newly created user object. #### Response Example python user = system.smb_users.create() ``` -------------------------------- ### Pool.get_field() Source: https://infinisdk.readthedocs.io/en/latest/api.html Gets the value of a single field from the system. ```APIDOC ## Pool.get_field() ### Description Gets the value of a single field from the system. ### Method GET ### Endpoint pool.get_field(field_name, from_cache=DONT_CARE, fetch_if_not_cached=True, raw_value=False) ### Parameters #### Query Parameters - **field_name** (str) - Required - The name of the field to retrieve. - **from_cache** (bool) - Optional - Attempt to use the last cached version of the field value. - **fetch_if_not_cached** (bool) - Optional - Pass `False` to force only from cache. - **raw_value** (bool) - Optional - If True, return the raw value. ### Response #### Success Response - **value** (any) - The value of the requested field. #### Response Example ```json { "value": "pool1" } ``` ``` -------------------------------- ### get_field Source: https://infinisdk.readthedocs.io/en/latest/api.html Gets the value of a single field from the system. ```APIDOC ## get_field(_field_name_, _from_cache=_, _fetch_if_not_cached=True_, _raw_value=False_) ### Description Gets the value of a single field from the system. ### Parameters - **field_name** (str) - Required - The name of the field to retrieve. - **from_cache** (bool) - Optional - Attempt to use the last cached version of the field value. - **fetch_if_not_cached** (bool) - Optional - Pass `False` to force only from cache. - **raw_value** (bool) - Optional - If True, return the raw value without any processing. ### Returns The value of the specified field. ``` -------------------------------- ### Get all users Source: https://infinisdk.readthedocs.io/en/latest/_sources/users.rst.txt Retrieves a list of all users in the system. ```python >>> users = system.users.to_list() ``` -------------------------------- ### Create cluster and map volume Source: https://infinisdk.readthedocs.io/en/latest/mappings.html Create a host cluster, add a host, map a volume to the cluster, and verify the host sees it as a clustered LUN. The `host_lu` is the LUN obtained from the host. ```python >>> cluster = system.host_clusters.create() >>> cluster.add_host(host) >>> lu = cluster.map_volume(volume) >>> host.invalidate_cache() >>> [host_lu] = host.get_luns() >>> host_lu -><...:Volume id=...>> >>> host_lu.is_clustered() True ``` -------------------------------- ### S3Credential.get_metadata_value Source: https://infinisdk.readthedocs.io/en/latest/api.html Gets a metadata value, optionally specifying a default. ```APIDOC ## S3Credential.get_metadata_value ### Description Gets a metadata value, optionally specifying a default. ### Method get_metadata_value ### Parameters - **key** (str) - Required - The metadata key to retrieve. - **default** (any) - Optional - If specified, the value to retrieve if the metadata key doesn't exist. If not specified and the key does not exist, the operation will raise an exception. ### Returns The metadata value. ``` -------------------------------- ### Create an S3 user with optional parameters Source: https://infinisdk.readthedocs.io/en/latest/_sources/s3_user.rst.txt Creates a user with root, description, uid, and gid parameters. The root parameter sets the user as an admin. ```python >>> user = system.s3_users.create( ... account=account, ... name="bob", ... root=True, ... description="Admin user for account", ... uid=1001, ... gid=1001, ... ) ``` -------------------------------- ### Basic volume enumeration with InfiniSDK Source: https://infinisdk.readthedocs.io/en/latest/_sources/efficient_querying.rst.txt Shows a basic loop over system.volumes that triggers a REST API request returning all data for all volumes and snapshots. Use this as a baseline to understand the inefficiency that the improvements address. ```python from infinisdk import InfiniBox,Q system = InfiniBox("systemname", auth=("user", "password")) system.login() for vol in system.volumes: print("Volume: {} is {}".format(vol.get_name(),vol.get_size())) ``` -------------------------------- ### S3User.get_metadata_value Source: https://infinisdk.readthedocs.io/en/latest/api.html Gets a metadata value, optionally specifying a default. ```APIDOC ## S3User.get_metadata_value ### Description Gets a metadata value, optionally specifying a default. ### Method get_metadata_value ### Parameters - **key** - Required - The metadata key to retrieve. - **default** - Optional - If specified, the value to retrieve if the metadata key doesn't exist. If not specified, and the key does not exist, the operation will raise an exception. ``` -------------------------------- ### Query volumes count and list Source: https://infinisdk.readthedocs.io/en/latest/_sources/getting_started.rst.txt Shows how to query all volumes on a system using the collection proxy's count and to_list methods. ```python >>> system.volumes.count() 0 >>> system.volumes.to_list() [] ``` -------------------------------- ### S3Bucket.get_metadata_value Source: https://infinisdk.readthedocs.io/en/latest/api.html Gets a metadata value, optionally specifying a default. ```APIDOC ## S3Bucket.get_metadata_value ### Description Gets a metadata value, optionally specifying a default. ### Method get_metadata_value ### Parameters - **key** (str) - Required - The metadata key to retrieve. - **default** (object) - Optional - If specified, the value to retrieve if the metadata key doesn't exist. If not specified, and the key does not exist, the operation will raise an exception. ``` -------------------------------- ### Link.get_remote_link Source: https://infinisdk.readthedocs.io/en/latest/api.html Get the corresponding link object in the remote machine. ```APIDOC ## Link.get_remote_link(safe=False) ### Description Get the corresponding link object in the remote machine. ``` -------------------------------- ### Create an S3 user with system.s3_users.create Source: https://infinisdk.readthedocs.io/en/latest/_sources/s3_user.rst.txt Creates a user under a specific S3 account. The account must already exist. Optional parameters include root, description, uid, gid, and status. ```python >>> account = system.s3_accounts.create(pool=pool, name="my_account") >>> user = system.s3_users.create(account=account, name="alice") ``` -------------------------------- ### Create a snapshot policy with system.snapshot_policies.create() Source: https://infinisdk.readthedocs.io/en/latest/_sources/snapshot_policies.rst.txt Creates a new snapshot policy object. Optionally pass 'name' and 'suffix' parameters to set the policy name and a suffix added to snapshot names. ```python >>> policy1 = system.snapshot_policies.create() ``` -------------------------------- ### Pool.get_metadata_value() Source: https://infinisdk.readthedocs.io/en/latest/api.html Gets a metadata value, optionally specifying a default. ```APIDOC ## Pool.get_metadata_value() ### Description Gets a metadata value, optionally specifying a default. ### Method GET ### Endpoint pool.get_metadata_value(key, default=NOTHING) ### Parameters #### Query Parameters - **key** (str) - Required - The metadata key to retrieve. - **default** (any) - Optional - The value to retrieve if the metadata key doesn't exist. If not specified and the key does not exist, the operation will raise an exception. ### Response #### Success Response - **value** (any) - The metadata value. #### Response Example ```json { "value": "some_value" } ``` ``` -------------------------------- ### Create InfiniBox object Source: https://infinisdk.readthedocs.io/en/latest/_sources/getting_started.rst.txt Import the InfiniBox class and initialize it with your system address. SYSTEM_ADDRESS can be a hostname or IP address. By default, constructing a system does not send any traffic or API calls. ```python >>> from infinisdk import InfiniBox >>> system = InfiniBox(SYSTEM_ADDRESS) ``` -------------------------------- ### get_metadata_value Source: https://infinisdk.readthedocs.io/en/latest/api.html Gets a metadata value, optionally specifying a default. ```APIDOC ## get_metadata_value(_key_, _default=_) ### Description Gets a metadata value, optionally specifying a default. ### Parameters - **default** (object) - Optional - If specified, the value to retrieve if the metadata key doesn't exist. If not specified, and the key does not exist, the operation will raise an exception. ### Returns The metadata value. ``` -------------------------------- ### get_metadata_value Source: https://infinisdk.readthedocs.io/en/latest/api.html Gets a metadata value, optionally specifying a default. ```APIDOC ## get_metadata_value(_key_, _default=_) ### Description Gets a metadata value, optionally specifying a default. ### Parameters - **key** (str) - Required - The metadata key to retrieve. - **default** (object) - Optional - If specified, the value to retrieve if the metadata key doesn't exist. If not specified, and the key does not exist, the operation will raise an exception. ### Returns The metadata value. ``` -------------------------------- ### Filesystem.add_share() Source: https://infinisdk.readthedocs.io/en/latest/filesystems.html Creates a share on the filesystem. ```APIDOC ## Filesystem.add_share() ### Description Creates a share on the filesystem. ### Method add_share ### Endpoint Filesystem.add_share() ### Parameters None ### Request Example ```python share = fs.add_share() ``` ### Response #### Success Response - **share** (Share) - The newly created share. #### Response Example ```python >>> share in fs.get_shares() True ``` ``` -------------------------------- ### is_pending Source: https://infinisdk.readthedocs.io/en/latest/api.html Returns whether or not this replication is waiting to start initializing. ```APIDOC ## is_pending(**kwargs) ### Description Returns whether or not this replication is waiting to start initializing. ### Method GET ### Endpoint infinibox.replicas.is_pending ### Parameters #### Keyword Arguments - **kwargs** - Additional keyword arguments (not specified). ### Returns - **bool** - True if pending, False otherwise. ``` -------------------------------- ### create Source: https://infinisdk.readthedocs.io/en/latest/api.html Joins an Active Directory domain with the specified parameters. Returns a dictionary containing the domain configuration. ```APIDOC ## create ### Description Join an active directory domain. ### Method create ### Parameters - **domain** (str) - Required - The domain to join - **org_unit** (str) - Optional - The organization unit - **preferred_ips** (list[str] or None) - Optional - Optional list of IP addresses and/or domain names to prefer when joining. Can be None, an empty list, a list of IPs, a list of domain names, or a mix of both. - **username** (str) - Required - The username for the domain - **password** (str) - Required - The password for the domain - **tenant** (infinisdk.infinibox.tenant.Tenant) - Optional - The tenant object - **unix_services_enabled** (bool) - Optional - Indicates if RFC2307 Unix Services are to be used when joined to Active Directory - **uid_attribute_name** (str) - Optional - The name of the AD attribute that provides the numeric UID of a user principal - **gid_attribute_name** (str) - Optional - The name of the AD attribute that provides the numeric GID of a user principal - **max_translated_groups** (int) - Optional - The maximum number of groups translated per user via RFC2307 Unix Services ### Returns Dictionary with fields: "tenant_id", "domain", "org_unit", "preferred_ips", "unix_services_enabled", "uid_attribute_name", "gid_attribute_name", "max_translated_groups" ### Return Type dict ``` -------------------------------- ### Link.get_linked_system Source: https://infinisdk.readthedocs.io/en/latest/api.html Get the corresponding system object at the remote end of the link. ```APIDOC ## Link.get_linked_system(safe=False, from_cache=) ### Description Get the corresponding system object at the remote and of the link. For this to work, the SDK user should call the register_related_system method of the Infinibox object when a link to a remote system is constructed for the first time. ``` -------------------------------- ### Create a TreeQ with fs.treeqs.create Source: https://infinisdk.readthedocs.io/en/latest/_sources/filesystems.rst.txt Creates a TreeQ on a filesystem with path, soft_capacity, and hard_inodes. After creation, get_capacity_state() returns 'BELOW_SOFT'. ```python >>> fs.treeqs.to_list() [] >>> treeq1 = fs.treeqs.create(path='/path1', soft_capacity=GB, hard_inodes=200) >>> print(treeq1.get_capacity_state()) BELOW_SOFT ``` -------------------------------- ### Get assigned entities with get_assigned_entities() Source: https://infinisdk.readthedocs.io/en/latest/_sources/snapshot_policies.rst.txt Retrieves all entities assigned to a policy. ```python >>> policy1_entities = policy1.get_assigned_entities() ``` -------------------------------- ### FcPort.get_field('wwpn') Source: https://infinisdk.readthedocs.io/en/latest/_sources/components.rst.txt Gets the value of a field from the FC port, such as 'wwpn'. ```APIDOC ## FcPort.get_field('wwpn') ### Description Gets the value of a field from the FC port, such as 'wwpn'. ### Method get_field() ### Endpoint FcPort.get_field() ### Parameters #### Path Parameters - **field_name** (str) - Required - The name of the field to retrieve. ### Request Example ```python fc_port.get_field('wwpn') ``` ### Response #### Success Response - **field_value** (any) - The value of the requested field. #### Response Example ```python '5000000000000000' ``` ``` -------------------------------- ### Create S3 bucket with system.s3_buckets.create Source: https://infinisdk.readthedocs.io/en/latest/_sources/s3_bucket.rst.txt Creates an S3 bucket under a specific S3 account. Requires an existing pool and account; the account is created first with system.s3_accounts.create. ```python >>> account = system.s3_accounts.create(pool=pool, name="my_account") >>> bucket = system.s3_buckets.create(account=account, name="my-bucket") ```