Nested class for atlasapi.atlas::Atlas¶
Atlas._Clusters¶
-
class
Atlas.
_Clusters
(atlas)¶ Bases:
object
Clusters API
see: https://docs.atlas.mongodb.com/reference/api/clusters/
Constructor
Parameters: atlas (Atlas) – Atlas instance -
create_basic_rs
(name: str, size: atlasapi.clusters.InstanceSizeName = <InstanceSizeName.M10: 'M10'>, disk_size: int = 10, provider: atlasapi.lib.ProviderName = <ProviderName.AWS: 'Amazon Web Services'>, region: str = 'US_WEST_2', version: atlasapi.lib.MongoDBMajorVersion = <MongoDBMajorVersion.v4_0: '4.0'>) → atlasapi.clusters.AtlasBasicReplicaSet¶ Simplified method for creating a basic replica set with basic options.
Return type: Parameters: - name (
str
) – The name for the cluster - size (
InstanceSizeName
) – The Atlas Instance size, found in The InstanceSizeName enum - disk_size (
int
) – The size in GB for disk - provider (
ProviderName
) – The cloud provider, found in ProviderName enum - region (
str
) – The provider region to place the cluster. - version (
MongoDBMajorVersion
) – The mongodb major version (enum)
Returns: AtlasBasicReplicaSet
- name (
-
create_cluster
(cluster: atlasapi.clusters.ClusterConfig) → dict¶ Create a cluster
url: POST /api/atlas/v1.0/groups/{GROUP-ID}/clusters
Parameters: cluster (ClusterConfig) – A Cluster Config Object Returns: Response payload Return type: dict
-
delete_cluster
(cluster: str, areYouSure: bool = False)¶ Delete a Cluster
url: https://docs.atlas.mongodb.com/reference/api/clusters-delete-one/
Parameters: cluster (
str
:param cluster: Cluster name :param areYouSure: safe flag to don’t delete a cluster by mistake) – Cluster nameKeyword Arguments: areYouSure (bool) – safe flag to don’t delete a cluster by mistake
Returns: Response payload
Return type: dict
Raises: ErrConfirmationRequested
– Need a confirmation to delete the cluster- type areYouSure: bool
-
get_all_clusters
(pageNum=1, itemsPerPage=1000, iterable=False)¶ Get All Clusters
url: https://docs.atlas.mongodb.com/reference/api/clusters-get-all/
Keyword Arguments: - pageNum (int) – Page number
- itemsPerPage (int) – Number of Users per Page
- iterable (bool) – To return an iterable high level object instead of a low level API response
Returns: Iterable object representing this function OR Response payload
Return type: AtlasPagination or dict
Raises: ErrPaginationLimits
– Out of limits
-
get_single_cluster
(cluster: str) → dict¶ Get a Single Cluster
url: https://docs.atlas.mongodb.com/reference/api/clusters-get-one/
Parameters: cluster (str) – The cluster name Returns: Response payload Return type: dict
-
get_single_cluster_advanced_options
(cluster: str, as_obj: bool = True) → Union[dict, atlasapi.clusters.AdvancedOptions]¶ Retrieves advanced options from a cluster, either as a obj, or optionally as a dict.
GET /groups/{GROUP-ID}/clusters/{CLUSTER-NAME}/processArgs
Parameters: - cluster (
str
) – - as_obj (
bool
) – True to return, AdvancedOptions, false for a dict
Returns: AdvancedOptions object or dict
- cluster (
-
get_single_cluster_as_obj
(cluster) → Union[atlasapi.clusters.ClusterConfig, atlasapi.clusters.ShardedClusterConfig]¶ Get a Single Cluster as data
url: https://docs.atlas.mongodb.com/reference/api/clusters-get-one/
Parameters: cluster (str) – The cluster name Returns: Response payload Return type: ClusterConfig
-
is_existing_cluster
(cluster) → bool¶ Check if the cluster exists
Not part of Atlas api but provided to simplify some code
Parameters: cluster (str) – The cluster name Returns: The cluster exists or not Return type: bool
-
modify_cluster
(cluster: str, cluster_config: Union[atlasapi.clusters.ClusterConfig, dict]) → dict¶ Modify a Cluster
Modifies an existing cluster in the project. Either from a full ClusterConfig object, or from a simple dict which contains the elements desired.
url: https://docs.atlas.mongodb.com/reference/api/clusters-modify-one/
Return type: dict
Parameters: - cluster (
str
) – The name of the cluster to modify - cluster_config – A ClusterConfig object containing the new configuration, or a dict containing fragment.
Returns: dict: A dictionary of the new cluster config
- cluster (
-
modify_cluster_advanced_options
(cluster: str, advanced_options: atlasapi.clusters.AdvancedOptions, as_obj: bool = True) → Union[atlasapi.clusters.AdvancedOptions, dict]¶ Modifies cluster advanced options using a AdvancedOptions object.
PATCH /groups/{GROUP-ID}/clusters/{CLUSTER-NAME}/processArgs
Parameters: - cluster (
str
) – The clutster name - advanced_options (
AdvancedOptions
) – An AdvancedOptions object with the options to be set. - as_obj (
bool
) – Return the new AdvancedOptions as an object.
Returns: - cluster (
-
modify_cluster_instance_size
(cluster: str, new_cluster_size: atlasapi.clusters.InstanceSizeName) → dict¶ Modifies existing cluster by changing only the instance size.
Helper function using modify_cluster :rtype:
dict
:type new_cluster_size:InstanceSizeName
:type cluster:str
:param cluster: The cluster name :param new_cluster_size: InstanceSizeName: The new size to use. :return: dict: the new cluster configuration dict
-
modify_cluster_tls
(cluster: str, TLS_protocol: atlasapi.clusters.TLSProtocols, as_obj: bool = True) → atlasapi.clusters.TLSProtocols¶ Modifies cluster TLS settings.
-
pause_cluster
(cluster: str, toggle_if_paused: bool = False) → dict¶ Pauses/Unpauses a cluster.
If you wish to unpause, set the toggle_if_paused param to True. :rtype: dict :type toggle_if_paused:
bool
:type cluster:str
:param cluster: The name of the cluster :param toggle_if_paused: Set to true to unpause a paused clsuter. :return: dict: The updated config
-
test_failover
(cluster: str) → Optional[dict]¶ Triggers a primary failover for a cluster
Used for testing cluster resiliency.
Return type: dict Parameters: cluster ( str
) –Returns: And empty dict
-
Atlas._DatabaseUsers¶
-
class
Atlas.
_DatabaseUsers
(atlas)¶ Bases:
object
Database Users API
see: https://docs.atlas.mongodb.com/reference/api/database-users/
Constructor
Parameters: atlas (Atlas) – Atlas instance -
create_a_database_user
(permissions) → dict¶ Create a Database User
url: https://docs.atlas.mongodb.com/reference/api/database-users-create-a-user/
Parameters: permissions (DatabaseUsersPermissionsSpec) – Permissions to apply Returns: Response payload Return type: dict
-
delete_a_database_user
(user: str) → dict¶ Delete a Database User
url: https://docs.atlas.mongodb.com/reference/api/database-users-delete-a-user/
Parameters: user (str) – User to delete Returns: Response payload Return type: dict
-
get_a_single_database_user
(user: str) → dict¶ Get a Database User
url: https://docs.atlas.mongodb.com/reference/api/database-users-get-single-user/
Parameters: user (str) – User Returns: Response payload Return type: dict
-
get_all_database_users
(pageNum: int = 1, itemsPerPage: int = 1000, iterable: bool = False)¶ Get All Database Users
url: https://docs.atlas.mongodb.com/reference/api/database-users-get-all-users/
Keyword Arguments: - pageNum (int) – Page number
- itemsPerPage (int) – Number of Users per Page
- iterable (bool) – To return an iterable high level object instead of a low level API response
Returns: Iterable object representing this function OR Response payload
Return type: AtlasPagination or dict
Raises: ErrPaginationLimits
– Out of limits
-
update_a_database_user
(user: str, permissions: atlasapi.specs.DatabaseUsersUpdatePermissionsSpecs) → dict¶ Update a Database User
url: https://docs.atlas.mongodb.com/reference/api/database-users-update-a-user/
Parameters: - user (str) – User
- permissions (DatabaseUsersUpdatePermissionsSpecs) – Permissions to apply
Returns: Response payload
Return type: dict
-
Atlas._Alerts¶
-
class
Atlas.
_Alerts
(atlas)¶ Bases:
object
Alerts API
see: https://docs.atlas.mongodb.com/reference/api/alerts/
Constructor
Parameters: atlas (Atlas) – Atlas instance -
acknowledge_an_alert
(alert, until, comment=None)¶ Acknowledge an Alert
url: https://docs.atlas.mongodb.com/reference/api/alerts-acknowledge-alert/
Parameters: - alert (str) – The alert id
- until (datetime) – Acknowledge until
Keyword Arguments: comment (str) – The acknowledge comment
Returns: Response payload :param comment:
Return type: dict
-
acknowledge_an_alert_forever
(alert, comment=None)¶ Acknowledge an Alert forever
url: https://docs.atlas.mongodb.com/reference/api/alerts-acknowledge-alert/
Parameters: alert (str) – The alert id Keyword Arguments: comment (str) – The acknowledge comment Returns: Response payload Return type: dict
-
get_all_alerts
(status=None, pageNum=1, itemsPerPage=1000, iterable=False)¶ Get All Alerts
url: https://docs.atlas.mongodb.com/reference/api/alerts-get-all-alerts/
Keyword Arguments: - status (AlertStatusSpec) – filter on alerts status
- pageNum (int) – Page number
- itemsPerPage (int) – Number of Users per Page
- iterable (bool) – To return an iterable high level object instead of a low level API response
Returns: Iterable object representing this function OR Response payload
Return type: AtlasPagination or dict
Raises: ErrPaginationLimits
– Out of limits
-
get_an_alert
(alert: str) → atlasapi.alerts.Alert¶ Get an Alert
url: https://docs.atlas.mongodb.com/reference/api/alerts-get-alert/
Parameters: alert (str) – The alert id Returns: Response payload Return type: dict
-
unacknowledge_an_alert
(alert)¶ Acknowledge an Alert
url: https://docs.atlas.mongodb.com/reference/api/alerts-acknowledge-alert/
Parameters: alert (str) – The alert id Returns: Response payload Return type: dict
-
Atlas._MaintenanceWindows¶
-
class
Atlas.
_MaintenanceWindows
(atlas)¶ Bases:
object
Maintenance Windows API
see: https://docs.atlas.mongodb.com/reference/api/maintenance-windows/
- The maintenanceWindow resource provides access to retrieve or update the current Atlas project maintenance
- window. To learn more about Maintenance Windows, see the Set Preferred Cluster Maintenance Start Time setting on the View/Modify Project Settings page.
Parameters: atlas (Atlas) – Atlas instance -
current_config
() → atlasapi.maintenance_window.MaintenanceWindow¶ The current Maintainable Window configuration.
Returns: MaintainableWindow object
-
defer
() → dict¶ Defers the currently scheduled maintenance window.
Returns: bool:
-
set_config
(new_config: atlasapi.maintenance_window.MaintenanceWindow) → bool¶ Sets the maint configuration to the values in the passed MaintWindow Object
Will only set those values which are not none in the MaintWindow Object. Currently you can not use this method to set a value as null. (This is not supported by the API anyway)
Parameters: new_config – A MaintainenceWindow Object Returns: bool: True is success
Atlas._Hosts¶
-
class
Atlas.
_Hosts
(atlas)¶ Bases:
object
Hosts API
see: https://docs.atlas.mongodb.com/reference/api/monitoring-and-logs/#monitoring-and-logs
Constructor
Parameters: atlas (Atlas) – Atlas instance -
cluster_list
¶ Returns a list of clusters found in the hosts for this group.
Returns: A set of cluster names Return type: Set[str}
-
fill_host_list
(for_cluster: Optional[str] = None) → List[atlasapi.specs.Host]¶ Fills the self.hostname property with the current hosts for the project/group.
Optionally, one can specify the for_cluster parameter to fill the host list with hosts only from the specified cluster.
Parameters: for_cluster (str) – The name of the cluster for filter the host list. Returns: A lost of Host objects Return type: List[Host]
-
get_log_for_host
(host_obj: atlasapi.specs.Host, log_name: atlasapi.lib.AtlasLogNames = <AtlasLogNames.MONGODB: 'mongodb.gz'>, date_from: datetime.datetime = None, date_to: datetime.datetime = None) → BinaryIO¶ Retrieves the designated logfile archive of designated log_name and for the designated dates, and returns a binary file like object.
Parameters: - host_obj (Host) – And atlas Host object to retrieve logs for
- log_name (AtlasLogNames) – an AtlasLogNames type
- date_from (datetime.datetime) – The datetime to start from
- date_to (datetime.datetime) – The datetime to gather till
Returns: A BinaryIO object containing the gzipped log file.
Return type: BinaryIO
-
get_loglines_for_host
(host_obj: atlasapi.specs.Host, log_name: atlasapi.lib.AtlasLogNames = <AtlasLogNames.MONGODB: 'mongodb.gz'>, date_from: datetime.datetime = None, date_to: datetime.datetime = None) → Iterable[atlasapi.lib.LogLine]¶ Gathers the designated log file from Atlas, and then returns the lines therein contained.
Does so by downloading the gzip file into memory, ungzipping and then unpacking each log line as a LogLine Object.
Parameters: - host_obj (Host) – An atlas Host object to retrive logs for
- log_name (str) – an AtlasLogNames type
- date_from (datetime) – The datetime to start from
- date_to (datetime) – The datetime to gather till
Returns: Yeilds LogLine objects, one for each logline found in the file.
Return type: Iterable[LogLine]
-
get_logs_for_cluster
(cluster_name: str, log_name: atlasapi.lib.AtlasLogNames = <AtlasLogNames.MONGODB: 'mongodb.gz'>, date_from: datetime.datetime = None, date_to: datetime.datetime = None) → Iterable[atlasapi.specs.Host]¶ Yields A Host object per Host in the passed cluster with a File-like objects containing the gzipped log file requested for each host in the project using the same date filters and log_name (type) in the log_files property.
Currently the log_file property (List) is usually with only one item. :param log_name: The type of log to be retrieved :type log_name: AtlasLogNames :param date_from: Start of log entries :type date_from: datetime :param date_to: End of log entries :type date_to: datetime
Returns: Yields Host objects, with full host information as well as the logfile in the log_files property. Return type: Iterable[Host]
-
get_logs_for_project
(log_name: atlasapi.lib.AtlasLogNames = <AtlasLogNames.MONGODB: 'mongodb.gz'>, date_from: datetime.datetime = None, date_to: datetime.datetime = None) → Iterable[atlasapi.specs.Host]¶ Yields A Host object per Host in the project with a File-like objects containing the gzipped log file requested for each host in the project using the same date filters and log_name (type) in the log_files property.
Currently the log_file property (List) is usually with only one item. :param log_name: The type of log to be retrieved :type log_name: AtlasLogNames :param date_from: Start of log entries :type date_from: datetime :param date_to: End of log entries :type date_to: datetime
Returns: Yields Host objects, with full host information as well as the logfile in the log_files property. Return type: Iterable[Host]
-
get_measurement_for_hosts
(granularity: Optional[atlasapi.lib.AtlasGranularities] = None, period: Optional[atlasapi.lib.AtlasPeriods] = None, measurement: Optional[atlasapi.specs.AtlasMeasurementTypes] = None, return_data: bool = False)¶ Get measurement(s) for all hosts in the host_list
Populates all hosts in the host_list with the requested metric.
Multiple calls will append additional metrics to the same host object.
Please note that using the return_data param will also return the updated host objects, which may unnecessarily consume memory.
Keyword Arguments: - granularity (AtlasGranularities) – the desired granularity
- period (AtlasPeriods) – The desired period
- measurement (AtlasMeasurementTypes) – The desired measurement or Measurement class
-
host_list_by_cluster
(cluster_name: str) → Iterable[atlasapi.specs.Host]¶ Returns hosts belonging to the named cluster. :param cluster_name: :type cluster_name: str
Returns: An interator of Host Objects. Return type: Iterable[Host]
-
host_list_primaries
¶ Yields only hosts which are currently primary.
-
host_list_secondaries
¶ Yields only hosts which are currently secondaries.
-
host_names
¶ Returns a simple list of host names without port
Return type: Iterator[str]
-
update_host_list
(host_obj: atlasapi.specs.Host) → None¶ Places a host into the host_list property.
Parameters: host_obj – Host: A host object with measurements. Returns: Return type: None
-
Atlas._Events¶
-
class
Atlas.
_Events
(atlas)¶ Bases:
object
Events API
see: https://docs.atlas.mongodb.com/reference/api/events/
Constructor
Parameters: atlas (Atlas) – Atlas instance -
all
¶ Returns all events for the current project/group.
Returns: A list of event objects. Return type: ListOfEvents
-
since
(since_datetime: datetime.datetime) → NewType.<locals>.new_type¶ Returns all events since the passed datetime. (UTC)
Returns: Return type: ListOfEvents
-
Atlas._Whitelist¶
-
class
Atlas.
_Whitelist
(atlas)¶ Bases:
object
Whitelist API
see: https://docs.atlas.mongodb.com/reference/api/whitelist/
Constructor
Parameters: atlas (Atlas) – Atlas instance -
create_whitelist_entry
(ip_address: str, comment: str) → List[atlasapi.whitelist.WhitelistEntry]¶ Create a whitelist entry
url: https://docs.atlas.mongodb.com/reference/api/whitelist-add-one/
Parameters: - ip_address (str) – ip address to add to whitelist
- comment (str) – comment describing the whitelist entry
Returns: Response payload
Return type: List[WhitelistEntry]
-
delete_a_whitelist_entry
(ip_address: str) → dict¶ Delete a whitelist entry
url: https://docs.atlas.mongodb.com/reference/api/whitelist-delete-one/
Parameters: ip_address (str) – ip address to delete from whitelist Returns: Response payload Return type: dict
-
get_all_whitelist_entries
(pageNum: int = 1, itemsPerPage: int = 1000, iterable: bool = False) → Iterable[atlasapi.whitelist.WhitelistEntry]¶ Get All whitelist entries
url: https://docs.atlas.mongodb.com/reference/api/whitelist-get-all/
Keyword Arguments: - pageNum (int) – Page number
- itemsPerPage (int) – Number of Users per Page
- iterable (bool) – To return an iterable high level object instead of a low level API response
Returns: Iterable object representing this function OR Response payload
Return type: AtlasPagination or dict
Raises: ErrPaginationLimits
– Out of limits
-
get_whitelist_entry
(ip_address: str) → atlasapi.whitelist.WhitelistEntry¶ Get a whitelist entry
url: https://docs.atlas.mongodb.com/reference/api/whitelist-get-one-entry/
Parameters: ip_address (str) – ip address to fetch from whitelist Returns: Response payload Return type: WhitelistEntry
-
Atlas._CloudBackups¶
-
class
Atlas.
_CloudBackups
(atlas)¶ Bases:
object
Cloud Backup API
see: https://docs.atlas.mongodb.com/reference/api/cloud-backup/backup/backups/
The CloudBackups resource provides access to retrieve the Cloud provider backup snapshots.
Parameters: atlas (Atlas) – Atlas instance -
cancel_snapshot_restore_request
(cluster_name: str, restore_id: str)¶ Cancels a current backup restore request by restore_id.
Calls: https://docs.atlas.mongodb.com/reference/api/cloud-backup/restore/delete-one-restore-job/
Parameters: - cluster_name – The name of the source cluster.
- restore_id – The id of the (jobId) of the restore job.
-
create_snapshot_for_cluster
(cluster_name: str, retention_days: int = 7, description: str = None, as_obj: bool = True) → Union[atlasapi.cloud_backup.CloudBackupSnapshot, dict]¶ Creates and on demand snapshot for the passed cluster
Parameters: - as_obj –
- cluster_name –
- retention_days –
- description –
-
get_backup_snapshot_for_cluster
(cluster_name: str, snapshot_id: str, as_obj: bool = True) → Union[Iterable[atlasapi.cloud_backup.CloudBackupSnapshot], Iterable[dict]]¶ Get singe backup snapshot for a cluster.
Retrieves url: https://docs.atlas.mongodb.com/reference/api/cloud-backup/backup/backups/
Keyword Arguments: cluster_name (str) – The cluster name to fetch Returns: Iterable object representing this function OR Response payload Return type: AtlasPagination or dict
-
get_backup_snapshots_for_cluster
(cluster_name: str, as_obj: bool = True) → Union[Iterable[atlasapi.cloud_backup.CloudBackupSnapshot], Iterable[dict]]¶ Get backup snapshots for a cluster.
Retrieves url: https://docs.atlas.mongodb.com/reference/api/cloud-backup/backup/backups/
Keyword Arguments: cluster_name (str) – The cluster name to fetch Returns: Iterable object representing this function OR Response payload Return type: AtlasPagination or dict
-
get_snapshot_restore_requests
(cluster_name: str, restore_id: str = None, as_obj: bool = True) → Union[List[Union[dict, atlasapi.cloud_backup.SnapshotRestoreResponse]], atlasapi.cloud_backup.SnapshotRestoreResponse, dict]¶
-
is_existing_snapshot
(cluster_name: str, snapshot_id: str) → bool¶
-
request_snapshot_restore
(source_cluster_name: str, snapshot_id: str, target_cluster_name: str, delivery_type: atlasapi.cloud_backup.DeliveryType = <DeliveryType.automated: 'Automated restore to Atlas cluster'>, allow_same: bool = False) → atlasapi.cloud_backup.SnapshotRestoreResponse¶
-
request_snapshot_restore_to_group
(source_cluster_name: str, snapshot_id: str, target_cluster_name: str, target_group_obj, delivery_type: atlasapi.cloud_backup.DeliveryType = <DeliveryType.automated: 'Automated restore to Atlas cluster'>) → atlasapi.cloud_backup.SnapshotRestoreResponse¶ Requests a snapshot restore to another group/project.
Uses the passed target_group_obj, which is an Atlas object, to restore a snapshot from one group/project to another.
This method does not check if the source and destination clusters have the same name, since this would not be dangerous when these are in two groups.
Parameters: - source_cluster_name – the text name of the source cluster
- snapshot_id – the uuid id of the snapshot to be restored
- target_cluster_name – the txt name of the destination cluster
- target_group_obj – Atlas: An Atlas object connected to the destination group.
- delivery_type – DeliveryType: IF you want to download, or automatically restore on Atlas.
Returns:
-
Atlas._Projects¶
-
class
Atlas.
_Projects
(atlas)¶ Bases:
object
Atlas Projects
see: https://www.mongodb.com/docs/atlas/reference/api/projects/
The groups resource provides access to retrieve or create Atlas projects.
Parameters: atlas (Atlas) – Atlas instance -
get_project_teams
(group_id: str = None) → Iterable[atlasapi.teams.TeamRoles]¶ Retrieves all teams assigned to the passed project/group
Returns each team assigned to the project, along with the roles which are assigned.
Returns (Iterable[TeamRoles]): Yields TeamRole Objects.
-
get_project_users
(group_id: str = None, flatten_teams: Optional[bool] = None, include_org_users: Optional[bool] = None) → Iterable[atlasapi.atlas_users.AtlasUser]¶ Yields all users (AtlasUser objects) associated with the group_id.
Parameters: - group_id (str) – The group id to search, will use the configured group for the Atlas instance if instantiated in this way.
- flatten_teams (bool) – Flag that indicates whether the returned list should include users who belong to a team that is assigned a role in this project. You might not have assigned the individual users a role in this project.
- include_org_users (bool) – Flag that indicates whether the returned list should include users with implicit access to the project through the Organization Owner or Organization Read Only role. You might not have assigned the individual users a role in this project.
Returns (Iterable[AtlasUser]: An iterable of AtlasUser objects.
-
project_by_id
(project_id: str) → atlasapi.projects.Project¶ Return project by name
Parameters: project_id (str) – The project id (group_id) to return Returns (Project): A single Project
-
project_by_name
(project_name: str) → atlasapi.projects.Project¶ Return project by name
Parameters: project_name (str) – The project name to return Returns (Project): A single Project
-
projects
¶ All Projects accessible by the current authed user/key Gets all projects for which the authed key has access.
Returns (Iterable[Project]): Yields Project Objects.
-
settings
¶
-
user_count
(group_id: str = None, flatten_teams: Optional[bool] = None, include_org_users: Optional[bool] = None) → int¶ Returns count of users added to this project
Parameters: - group_id (str) – The group id to search, will use the configured group for the Atlas instance if
- in this way. (instantiated) –
- flatten_teams (bool) – Flag that indicates whether the returned list should include users who belong to a team that is assigned a role in this project. You might not have assigned the individual users a role in this project.
- include_org_users (bool) –
Flag that indicates whether the returned list should include users with implicit access to the project through the Organization Owner or Organization Read Only role. You
might not have assigned the individual users a role in this project.
Returns (int): Count of users.
-
Atlas._Organizations¶
-
class
Atlas.
_Organizations
(atlas)¶ Bases:
object
Atlas Organizations
see: https://www.mongodb.com/docs/atlas/reference/api/organizations/
TThe orgs resource provides access to manage Atlas organizations.
Parameters: atlas (Atlas) – Atlas instance -
count
¶ Count of Organizations accessible by the authed user/key.
Returns (int):
-
organization_by_id
(org_id: str) → atlasapi.organizations.Organization¶ Single organization searched by org_id.
Parameters: org_id (str) – Returns (Organization): a single Organization object.
-
organization_by_name
(org_name: str) → atlasapi.organizations.Organization¶ Singe organization searched by name.
Parameters: org_name – Organization name with which to filter the returned list. Performs a case-insensitive search for organizations which exactly match the specified name. Returns (Organization): a single Organization object.
-
organizations
¶ All Organizations accessible by the current authed user/key Gets all Organizations for which the authed key has access.
Returns (Iterable[Organization]): Yields Organization Objects.
-