Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cterasdk/cio/core/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def from_snapshot(snapshot):
@staticmethod
def from_cursor(cursor):
"""
Create Path Object from 'ResourceActionCursor' Class Object.
Create Path Object from :class:`cterasdk.cio.core.types.ResourceActionCursor`.

:param object cursor: Resource Action Cursor Object
"""
Expand Down Expand Up @@ -110,7 +110,7 @@ def resolve(path, namespace=None):
Resolve Path

:param object path: Path
:param cterasdk.cio.core.types.PortalPath,optional namespace: Path Object
:param namespace: :class:`cterasdk.cio.core.types.ServicesPortalPath` or :class:`cterasdk.cio.core.types.GlobalAdminPath` (optional)
"""
if isinstance(path, PortalPath):
return path
Expand All @@ -133,7 +133,7 @@ def create_generator(paths, namespace=None):
Create Path Object Generator Object.

:param object paths: List or a tuple
:param cterasdk.cio.core.types.PortalPath,optional namespace: Path Object
:param namespace: :class:`cterasdk.cio.core.types.ServicesPortalPath` or :class:`cterasdk.cio.core.types.GlobalAdminPath` (optional)
"""
def wrapper():
for path in paths:
Expand Down Expand Up @@ -335,7 +335,7 @@ class PreviousVersion(Object):
Class Representing a Previous Version

:ivar bool current: Current
:ivar cterasdk.cio.types.PortalPath path: Path Object
:ivar path: :class:`cterasdk.cio.types.ServicesPortalPath` or :class:`cterasdk.cio.types.GlobalAdminPath`
:ivar datetime.datetime start_time: Snapshot start time
:ivar datetime.datetime end_time: Snapshot end time
"""
Expand Down Expand Up @@ -370,7 +370,7 @@ class PortalResource(BaseResource):

:ivar int,optional id: Resource ID, defaults to ``None`` if not exists
:ivar str name: Resource name
:ivar cterasdk.cio.types.PortalPath path: Path Object
:ivar path: :class:`cterasdk.cio.types.ServicesPortalPath` or :class:`cterasdk.cio.types.GlobalAdminPath`
:ivar bool is_dir: ``True`` if directory, ``False`` otherwise
:ivar bool deleted: ``True`` if deleted, ``False`` otherwise
:ivar int size: Size
Expand Down
2 changes: 1 addition & 1 deletion cterasdk/core/admins.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def list_admins(self, include=None):

:param list[str] include: List of fields to retrieve, defaults to ['name']
:return: Iterator for local administrators
:rtype: cterasdk.lib.iterator.Iterator
:rtype: cterasdk.lib.iterator.QueryIterator
"""
include = union(include or [], Administrators.default)
param = query.QueryParamBuilder().include(include).build()
Expand Down
5 changes: 2 additions & 3 deletions cterasdk/core/buckets.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ def modify(self, current_name, new_name=None, read_only=None, dedicated_to=None,

def list_buckets(self, include=None):
"""
List Buckets.\n
To retrieve buckets, you must first browse the Global Administration Portal, using: `GlobalAdmin.portals.browse_global_admin()`

List Buckets.
Restricted to the Global Administration Portal. Browse it using :py:func:`cterasdk.core.portals.browse_global_admin`.
:param list[str],optional include: List of fields to retrieve, defaults to ``['name']``
"""
include = union(include or [], Buckets.default)
Expand Down
6 changes: 3 additions & 3 deletions cterasdk/core/cloudfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ def all(self, filters=None):
:param list[],optional filters: List of additional filters, defaults to None

:return: Iterator for all Zones
:rtype: cterasdk.lib.iterator.Iterator
:rtype: cterasdk.lib.iterator.QueryIterator
"""
builder = query.QueryParamBuilder().include_classname().startFrom(0).countLimit(25)
filters = filters or []
Expand All @@ -532,7 +532,7 @@ def search(self, name):
:param str name: Search query

:return: Iterator for all matching Zones
:rtype: cterasdk.lib.iterator.Iterator
:rtype: cterasdk.lib.iterator.QueryIterator
"""
filters = [query.FilterBuilder(Zones.name_attr).like(name)]
return self.all(filters)
Expand All @@ -543,7 +543,7 @@ def add(self, name, policy_type=PolicyType.SELECT, description=None):

:param str name: The name of the new zone
:param cterasdk.core.enum.PolicyType,optional policy_type:
Policy type of the new zone, defaults to cterasdk.core.enum.PolicyType.SELECT
Policy type of the new zone, defaults to :py:attr:`cterasdk.core.enum.PolicyType.SELECT`
:param str,optional description: The description of the new zone
"""
param = self._zone_param(name, policy_type, description)
Expand Down
14 changes: 7 additions & 7 deletions cterasdk/core/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def device(self, device_name, tenant=None, include=None):
:param list[str],optional include: List of fields to retrieve, defaults to ['name', 'portal', 'deviceType']

:return: Managed Device
:rtype: cterasdk.objects.synchronous.Edge or cterasdk.objects.synchronous.Drive
:rtype: cterasdk.objects.synchronous.edge.Edge or cterasdk.objects.synchronous.drive.Drive
"""
include = union(include or [], Devices.default)
include = ['/' + attr for attr in include]
Expand All @@ -53,7 +53,7 @@ def filers(self, include=None, allPortals=False, deviceTypes=None):
:param list[cterasdk.core.enum.DeviceType.Gateways] deviceTypes: Types of Filers, defaults to all Filer types

:return: Iterator for all matching Filers
:rtype: cterasdk.lib.iterator.Iterator[cterasdk.object.Gateway.Gateway]
:rtype: cterasdk.lib.iterator.QueryIterator[cterasdk.objects.synchronous.edge.Edge]
"""
if deviceTypes:
deviceTypes = [deviceType for deviceType in deviceTypes if deviceType in DeviceType.Gateways]
Expand All @@ -71,7 +71,7 @@ def agents(self, include=None, allPortals=False):
:param bool,optional allPortals: Search in all portals, defaults to False

:return: Iterator for all matching Agents
:rtype: cterasdk.lib.iterator.Iterator[cterasdk.object.Agent.Agent]
:rtype: cterasdk.lib.iterator.QueryIterator[cterasdk.objects.synchronous.drive.Drive]
"""
filters = [query.FilterBuilder(Devices.type_attr).like('Agent')]
return self.devices(include, allPortals, filters)
Expand All @@ -84,7 +84,7 @@ def desktops(self, include=None, allPortals=False):
:param bool,optional allPortals: Search in all portals, defaults to False

:return: Iterator for all matching Desktops
:rtype: cterasdk.lib.iterator.Iterator
:rtype: cterasdk.lib.iterator.QueryIterator
"""
filters = [query.FilterBuilder(Devices.type_attr).eq(DeviceType.WorkstationAgent)]
return self.devices(include, allPortals, filters)
Expand All @@ -97,7 +97,7 @@ def servers(self, include=None, allPortals=False):
:param bool,optional allPortals: Search in all portals, defaults to False

:return: Iterator for all matching Servers
:rtype: cterasdk.lib.iterator.Iterator
:rtype: cterasdk.lib.iterator.QueryIterator
"""
filters = [query.FilterBuilder(Devices.type_attr).eq(DeviceType.ServerAgent)]
return self.devices(include, allPortals, filters)
Expand All @@ -110,7 +110,7 @@ def by_name(self, names, include=None):
:param list[str],optional include: List of fields to retrieve, defaults to ['name', 'portal', 'deviceType']

:return: Iterator for all matching Devices
:rtype: cterasdk.lib.iterator.Iterator
:rtype: cterasdk.lib.iterator.QueryIterator
"""
filters = [query.FilterBuilder('name').eq(name) for name in names]
return self.devices(include, False, filters)
Expand All @@ -125,7 +125,7 @@ def devices(self, include=None, allPortals=False, filters=None, user=None):
:param cterasdk.core.types.UserAccount user: User account of the device owner

:return: Iterator for all matching Devices
:rtype: cterasdk.lib.iterator.Iterator
:rtype: cterasdk.lib.iterator.QueryIterator
"""
include = union(include or [], Devices.default)
builder = query.QueryParamBuilder().include(include).allPortals(allPortals)
Expand Down
2 changes: 1 addition & 1 deletion cterasdk/core/directoryservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def connect(self, domain, username, password, directory=DirectoryServiceType.Mic
:param str username: The user name to use when connecting to the active directory services
:param str password: The password to use when connecting to the active directory services
:param str,optional ou: The OU path to use when connecting to the active directory services, defaults to `None`
:param cterasdk.core.enum.DirectoryServiceType,optional directory: The directory service type, deafults to `'ActiveDirectory'`
:param cterasdk.core.enum.DirectoryServiceType,optional directory: The directory service type, defaults to ``ActiveDirectory``
:param cterasdk.core.types.DomainControllers,optional domain_controllers:
Connect to a primary and a secondary domain controllers, defaults to `None`
:param bool,optional ssl: Connect using SSL, defaults to `False`
Expand Down
4 changes: 2 additions & 2 deletions cterasdk/core/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def list_local_groups(self, include=None):

:param list[str] include: List of fields to retrieve, defaults to ['name']
:return: Iterator for all local groups
:rtype: cterasdk.lib.iterator.Iterator
:rtype: cterasdk.lib.iterator.QueryIterator
"""
include = union(include or [], Groups.default)
param = query.QueryParamBuilder().include(include).build()
Expand All @@ -65,7 +65,7 @@ def list_domain_groups(self, domain, include=None):
:param str domain: Domain name
:param list[str] include: List of fields to retrieve, defaults to ['name']
:return: Iterator for all the domain groups
:rtype: cterasdk.lib.iterator.Iterator
:rtype: cterasdk.lib.iterator.QueryIterator
"""
include = union(include or [], Groups.default)
param = query.QueryParamBuilder().include(include).build()
Expand Down
10 changes: 5 additions & 5 deletions cterasdk/core/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ def device(self,
Get device logs from the Portal

:param str name: Name of a device
:param cterasdk.core.enum.LogTopic,optional topic: Log topic to get, defaults to cterasdk.core.enum.LogTopic.System
:param cterasdk.core.enum.LogTopic,optional topic: Log topic to get, defaults to :py:attr:`cterasdk.core.enum.LogTopic.System`
:param cterasdk.core.enum.Severity,optional min_severity:
Minimun severity of logs to get, defaults to cterasdk.core.enum.Severity.INFO
Minimun severity of logs to get, defaults to :py:attr:`cterasdk.core.enum.Severity.INFO`
:param str,optional before: Get logs before this date (in format "%m/%d/%Y %H:%M:%S"), defaults to None
:param str,optional after: Get logs after this date (in format "%m/%d/%Y %H:%M:%S"), defaults to None
:param list[cterasdk.core.query.FilterBuilder],optional filters: List of additional filters, defaults to None

:return: Iterator for all matching logs
:rtype: cterasdk.lib.iterator.Iterator[cterasdk.object.Object]
:rtype: cterasdk.lib.iterator.QueryIterator[cterasdk.common.object.Object]
"""
return self.get(topic, min_severity, enum.OriginType.Device, name, before, after, filters)

Expand All @@ -54,14 +54,14 @@ def get(self, topic=enum.LogTopic.System, min_severity=enum.Severity.INFO, origi
:param cterasdk.core.enum.Severity,optional min_severity:
Minimun severity of logs to get, defaults to cterasdk.core.enum.Severity.INFO
:param cterasdk.core.enum.OriginType,optional origin_type:
Origin type of the logs to get, defaults to cterasdk.core.enum.OriginType.Portal
Origin type of the logs to get, defaults to :py:attr:`cterasdk.core.enum.OriginType.Portal`
:param str,optional origin: Log origin (e.g. device name, Portal server name), defaults to None
:param str,optional before: Get logs before this date (in format "%m/%d/%Y %H:%M:%S"), defaults to None
:param str,optional after: Get logs after this date (in format "%m/%d/%Y %H:%M:%S"), defaults to None
:param list[cterasdk.core.query.FilterBuilder],optional filters: List of additional filters, defaults to None

:return: Iterator for all matching logs
:rtype: cterasdk.lib.iterator.Iterator[cterasdk.object.Object]
:rtype: cterasdk.lib.iterator.QueryIterator[cterasdk.common.object.Object]
"""
builder = query.QueryParamBuilder().put('topic', topic).put('minSeverity', min_severity)

Expand Down
4 changes: 2 additions & 2 deletions cterasdk/core/plans.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def by_name(self, names, include=None):
:param list[cterasdk.core.query.FilterBuilder],optional filters: List of additional filters, defaults to None

:return: Iterator for all matching Plans
:rtype: cterasdk.lib.iterator.Iterator
:rtype: cterasdk.lib.iterator.QueryIterator
"""
filters = [query.FilterBuilder('name').eq(name) for name in names]
return self.list_plans(include, filters)
Expand All @@ -56,7 +56,7 @@ def list_plans(self, include=None, filters=None):
:param list[],optional filters: List of additional filters, defaults to None

:return: Iterator for all matching Plans
:rtype: cterasdk.lib.iterator.Iterator
:rtype: cterasdk.lib.iterator.QueryIterator
"""
include = union(include or [], Plans.default)
builder = query.QueryParamBuilder().include(include)
Expand Down
9 changes: 4 additions & 5 deletions cterasdk/core/portals.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ def get(self, name, include=None):

def list_tenants(self, include=None, portal_type=None):
"""
List tenants.\n
To retrieve tenants, you must first browse the Global Administration Portal, using: `GlobalAdmin.portals.browse_global_admin()`

List tenants.
Restricted to the Global Administration Portal. Browse it using :py:func:`cterasdk.core.portals.browse_global_admin`.
:param list[str],optional include: List of fields to retrieve, defaults to ['name']
:param cterasdk.core.enum.PortalType portal_type: The Portal type
:param cterasdk.core.enum.PortalType portal_type: Portal type
"""
# browse administration
include = union(include or [], Portals.default)
Expand Down Expand Up @@ -147,7 +146,7 @@ def apply_changes(self, wait=False):

:param bool,optional wait: Wait for all changes to apply
:returns: Task status object, or an awaitable task object
:rtype: cterasdk.common.object.Object or :class:`cterasdk.lib.tasks.AwaitablePortalTask`
:rtype: :py:attr:`cterasdk.common.object.Object` or :class:`cterasdk.lib.tasks.AwaitablePortalTask`
"""
param = Object()
param.objectId = None
Expand Down
14 changes: 5 additions & 9 deletions cterasdk/core/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,33 @@ class Reports(BaseCommand):
"""
def storage(self):
"""
Retrieve the portals statistics report.\n
To retrieve this report, you must first browse the Global Administration Portal, using: `GlobalAdmin.portals.browse_global_admin()`
Storage Statistics Report.
"""
return self._get_report(enum.Reports.Storage)

def portals(self):
"""
Retrieve the storage statistics report.\n
To retrieve this report, you must first browse the Global Administration Portal, using: `GlobalAdmin.portals.browse_global_admin()`
Portal Statistics Report.
"""
return self._get_report(enum.Reports.Portals)

def folders(self):
"""
Retrieve the cloud folders statistics report.\n
To retrieve this report, you must first browse the Virtual Portal that contains the report, using: `GlobalAdmin.portals.browse()`
Cloud Drive Folders Statistics Report.
"""
return self._get_report(enum.Reports.Folders)

def folder_groups(self):
"""
Retrieve the folder groups statistics report.\n
To retrieve this report, you must first browse the Virtual Portal that contains the report, using: `GlobalAdmin.portals.browse()`
Folder Groups Statistics Report.
"""
return self._get_report(enum.Reports.FolderGroups)

def generate(self, name):
"""
Generate a CTERA Portal Report

:param cterasdk.core.enum.reports report: Report
:param cterasdk.core.enum.Reports report: Report
"""
options = {v: k for k, v in enum.Reports.__dict__.items() if not k.startswith('_')}
if options.get(name, None) is None:
Expand Down
5 changes: 2 additions & 3 deletions cterasdk/core/servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ def get(self, name, include=None):

def list_servers(self, include=None):
"""
Retrieve the servers that comprise CTERA Portal.\n
To retrieve servers, you must first browse the Global Administration Portal, using: `GlobalAdmin.portals.browse_global_admin()`

Retrieve the servers that comprise CTERA Portal.
Restricted to the Global Administration Portal. Browse it using :py:func:`cterasdk.core.portals.browse_global_admin`.
:param list[str],optional include: List of fields to retrieve, defaults to ['name']
"""
# browse administration
Expand Down
2 changes: 1 addition & 1 deletion cterasdk/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def update(self, settings=None):
"""
Update Portal Settings

:param cterasdk.common.object.Objcet settings: Settings, defaults to using the global settings.
:param cterasdk.common.object.Object settings: Settings, defaults to using the global settings.
"""
if not self.session().in_tenant_context():
self._core.api.put('/settings/defaultPortalSettings', settings)
Expand Down
4 changes: 2 additions & 2 deletions cterasdk/core/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def list_local_users(self, include=None):

:param list[str] include: List of fields to retrieve, defaults to ['name']
:return: Iterator for all local users
:rtype: cterasdk.lib.iterator.Iterator
:rtype: cterasdk.lib.iterator.QueryIterator
"""
include = union(include or [], Users.default)
param = query.QueryParamBuilder().include(include).build()
Expand All @@ -69,7 +69,7 @@ def list_domain_users(self, domain, include=None):
:param str domain: Domain name
:param list[str] include: List of fields to retrieve, defaults to ['name']
:return: Iterator for all the domain users
:rtype: cterasdk.lib.iterator.Iterator
:rtype: cterasdk.lib.iterator.QueryIterator
"""
include = union(include or [], Users.default)
param = query.QueryParamBuilder().include(include).build()
Expand Down
Loading