System
- class matterapi.endpoints.async_api.SystemApi(client: matterapi.client.base.BaseClient, skip_response_parsing: bool = False)
General endpoints for interacting with the server, such as configuration and logging.
- async check_integrity() List[matterapi.models.IntegrityCheckResult]
Perform a database integrity check
Performs a database integrity check.
- Minimum Server Version:
5.28.0
- Local Mode Only:
This endpoint is only available through [local mode](https://docs.mattermost.com/administration/mmctl-cli- tool.html#local-mode).
Warning
This check may temporarily harm system performance.
- Api Reference:
- async clear_server_busy() matterapi.models.StatusOK
Clears the server busy (high load) flag
Marks the server as not having high load which re-enables non-critical services such as search, statuses and typing notifications.
- Permissions:
Must have manage_system permission.
- Minimum Server Version:
5.20
- Api Reference:
- async database_recycle() matterapi.models.StatusOK
Recycle database connections
Recycle database connections by closing and reconnecting all connections to master and read replica databases.
- Permissions:
Must have manage_system permission.
- Api Reference:
- async generate_support_packet() None
Download a zip file which contains helpful and useful information for troubleshooting your mattermost instance.
Download a zip file which contains helpful and useful information for troubleshooting your mattermost instance. ##### License Requires either a E10 or E20 license.
- Permissions:
Must have any of the system console read permissions.
- Minimum Server Version:
5.32
- Api Reference:
- async get_analytics_old(*, name: Optional[str] = 'standard', team_id: Optional[str] = None) None
Get analytics
Get some analytics data about the system. This endpoint uses the old format, the /analytics route is reserved for the new format when it gets implemented.
The returned JSON changes based on the name query parameter but is always key/value pairs.
- Permissions:
Must have manage_system permission.
- Minimum Server Version:
4.0
- Api Reference:
- async get_audits(*, page: Optional[int] = 0, per_page: Optional[int] = 60) List[matterapi.models.Audit]
Get audits
Get a page of audits for all users on the system, selected with page and per_page query parameters.
- Permissions:
Must have manage_system permission.
- Api Reference:
- async get_client_config(*, format: str) None
Get client configuration
Get a subset of the server configuration needed by the client.
- Permissions:
No permission required.
- Api Reference:
- async get_client_license(*, format: str) None
Get client license
Get a subset of the server license needed by the client.
- Permissions:
No permission required but having the manage_system permission returns more information.
- Api Reference:
- async get_config() matterapi.models.Config
Get configuration
Retrieve the current server configuration
- Permissions:
Must have manage_system permission.
- Api Reference:
- async get_environment_config() matterapi.models.EnvironmentConfig
Get configuration made through environment variables
Retrieve a json object mirroring the server configuration where fields are set to true if the corresponding config setting is set through an environment variable. Settings that haven’t been set through environment variables will be missing from the object.
- Permissions:
Must have manage_system permission.
- Minimum Server Version:
4.10
- Api Reference:
- async get_image_by_url() None
Get an image by url
Fetches an image via Mattermost image proxy.
- Permissions:
Must be logged in.
- Minimum Server Version:
3.10
- Api Reference:
- async get_logs(*, page: Optional[int] = 0, logs_per_page: Optional[str] = '10000') List[str]
Get logs
Get a page of server logs, selected with page and logs_per_page query parameters.
- Permissions:
Must have manage_system permission.
- Api Reference:
- async get_notices(teamId: str, *, clientVersion: str, locale: Optional[str] = None, client: str) List[matterapi.models.Notice]
Get notices for logged in user in specified team
Will return appropriate product notices for current user in the team specified by teamId parameter.
- Permissions:
Must be logged in.
- Minimum Server Version:
5.26
- Api Reference:
- async get_ping(*, get_server_status: Optional[bool] = None, device_id: Optional[str] = None) matterapi.models.SystemStatusResponse
Check system health
Check if the server is up and healthy based on the configuration setting GoRoutineHealthThreshold. If GoRoutineHealthThreshold and the number of goroutines on the server exceeds that threshold the server is considered unhealthy. If GoRoutineHealthThreshold is not set or the number of goroutines is below the threshold the server is considered healthy. If a “device_id” is passed in the query, it will test the Push Notification Proxy in order to discover whether the device is able to receive notifications. The response will have a “CanReceiveNotifications” property with one of the following values: - true: It can receive notifications - false: It cannot receive notifications - unknown: There has been an unknown error, and it is not certain whether it can
receive notifications.
- Permissions:
None.
- Minimum Server Version:
3.10
- Api Reference:
- async get_prev_trial_license() None
Get last trial license used
Get the last trial license used on the sevrer
- Permissions:
Must have manage_systems permissions.
- Minimum Server Version:
5.36
- Api Reference:
- async get_redirect_location(*, url: str) None
Get redirect location
- Permissions:
Must be logged in.
- Minimum Server Version:
3.10
- Api Reference:
- async get_server_busy_expires() matterapi.models.Server_Busy
Get server busy expiry time.
Gets the timestamp corresponding to when the server busy flag will be automatically cleared.
- Permissions:
Must have manage_system permission.
- Minimum Server Version:
5.20
- Api Reference:
- async get_supported_timezone() List[str]
Retrieve a list of supported timezones
- Permissions:
Must be logged in.
- Minimum Server Version:
3.10
- Api Reference:
- async get_warn_metrics_status() matterapi.models.StatusOK
Get the warn metrics status (enabled or disabled)
Get the status of a set of metrics (enabled or disabled) from the Systems table.
The returned JSON contains the metrics that we need to warn the admin on with regard to their status (we return the ones whose status is “true”, which means that they are in a “warnable” state - e.g. a threshold has been crossed or some other condition has been fulfilled).
- Permissions:
Must have manage_system permission.
- Minimum Server Version:
5.26
- Api Reference:
- async invalidate_caches() matterapi.models.StatusOK
Invalidate all the caches
Purge all the in-memory caches for the Mattermost server. This can have a temporary negative effect on performance while the caches are re- populated.
- Permissions:
Must have manage_system permission.
- Api Reference:
- async mark_notices_viewed(*, json_body: Union[List[str], Dict]) matterapi.models.StatusOK
Update notices as ‘viewed’
Will mark the specified notices as ‘viewed’ by the logged in user.
- Permissions:
Must be logged in.
- Minimum Server Version:
5.26
- Api Reference:
- async patch_config(*, json_body: Union[matterapi.models.Config, Dict]) matterapi.models.Config
Patch configuration
Submit configuration to patch. As of server version 4.8, the PluginSettings.EnableUploads setting cannot be modified by this endpoint.
- Permissions:
Must have manage_system permission.
- Minimum Server Version:
5.20
- Api Reference:
- async post_log(*, json_body: Union[matterapi.models.PostLogJsonBody, Dict]) matterapi.models.PostLogResponse200
Add log message
Add log messages to the server logs. Logged in users can log ERROR or DEBUG messages when ServiceSettings.EnableDeveloper is true or just DEBUG messages when false. Non-logged in users can log ERROR or DEBUG messages when ServiceSettings.EnableDeveloper is true and cannot log when false.
- Permissions:
Users with manage_system permission can log ERROR or DEBUG messages.
- Api Reference:
- async reload_config() matterapi.models.StatusOK
Reload configuration
Reload the configuration file to pick up on any changes made to it.
- Permissions:
Must have manage_system permission.
- Api Reference:
- async remove_license_file() None
Remove license file
Remove the license file from the server. This will disable all enterprise features.
- Permissions:
Must have manage_system permission.
- Minimum Server Version:
4.0
- Api Reference:
- async request_license_renewal_link() matterapi.models.LicenseRenewalLink
Request the license renewal link
Request the renewal link that would be used to start the license renewal process
- Permissions:
Must have sysconsole_write_about permission.
- Minimum Server Version:
5.32
- Api Reference:
- async request_trial_license(*, json_body: Union[matterapi.models.RequestTrialLicenseJsonBody, Dict]) None
Request and install a trial license for your server
Request and install a trial license for your server
- Permissions:
Must have manage_system permission.
- Minimum Server Version:
5.25
- Api Reference:
- async restart_server() matterapi.models.StatusOK
Restart the system after an upgrade from Team Edition to Enterprise Edition
It restarts the current running mattermost instance to execute the new Enterprise binary.
- Permissions:
Must have manage_system permission.
- Minimum Server Version:
5.27
- Api Reference:
- async send_trial_license_warn_metric_ack(warn_metric_id: str) matterapi.models.StatusOK
Request trial license and acknowledge a warning of a metric status
Request a trial license and acknowledge a warning for the warn_metric_id metric crossing a threshold (or some similar condition being fulfilled) - sets the “ack” status for all the warn metrics in the system.
- Permissions:
Must have manage_system permission.
- Minimum Server Version:
5.28
- Api Reference:
- async send_warn_metric_ack(warn_metric_id: str, *, json_body: Union[matterapi.models.SendWarnMetricAckJsonBody, Dict]) matterapi.models.StatusOK
Acknowledge a warning of a metric status
Acknowledge a warning for the warn_metric_id metric crossing a threshold (or some similar condition being fulfilled) - attempts to send an ack email to acknowledge@mattermost.com and sets the “ack” status for all the warn metrics in the system.
- Permissions:
Must have manage_system permission.
- Minimum Server Version:
5.26
- Api Reference:
- async set_server_busy(*, seconds: Optional[str] = '3600') matterapi.models.StatusOK
Set the server busy (high load) flag
Marks the server as currently having high load which disables non- critical services such as search, statuses and typing notifications.
- Permissions:
Must have manage_system permission.
- Minimum Server Version:
5.20
- Api Reference:
- async test_email(*, json_body: Union[matterapi.models.Config, Dict]) matterapi.models.StatusOK
Send a test email
Send a test email to make sure you have your email settings configured correctly. Optionally provide a configuration in the request body to test. If no valid configuration is present in the request body the current server configuration will be tested.
- Permissions:
Must have manage_system permission.
- Api Reference:
- async test_s3_connection(*, json_body: Union[matterapi.models.Config, Dict]) matterapi.models.StatusOK
Test AWS S3 connection
Send a test to validate if can connect to AWS S3. Optionally provide a configuration in the request body to test. If no valid configuration is present in the request body the current server configuration will be tested.
- Permissions:
Must have manage_system permission.
- Minimum Server Version:
4.8
- Api Reference:
- async test_site_url(*, json_body: Union[matterapi.models.TestSiteURLJsonBody, Dict]) matterapi.models.StatusOK
Checks the validity of a Site URL
Sends a Ping request to the mattermost server using the specified Site URL.
- Permissions:
Must have manage_system permission.
- Minimum Server Version:
5.16
- Api Reference:
- async update_config(*, json_body: Union[matterapi.models.Config, Dict]) matterapi.models.Config
Update configuration
Submit a new configuration for the server to use. As of server version 4.8, the PluginSettings.EnableUploads setting cannot be modified by this endpoint.
- Permissions:
Must have manage_system permission.
- Api Reference:
- async update_marketplace_visited_by_admin(*, json_body: Union[matterapi.models.System, Dict]) matterapi.models.StatusOK
Stores that the Plugin Marketplace has been visited by at least an admin.
Stores the system-level status that specifies that at least an admin has visited the in-product Plugin Marketplace.
- Permissions:
Must have manage_system permissions.
- Minimum Server Version:
5.33
- Api Reference:
- async upgrade_to_enterprise() matterapi.models.PushNotification
Executes an inplace upgrade from Team Edition to Enterprise Edition
It downloads the Mattermost Enterprise Edition of your current version and replace your current version with it. After the upgrade you need to restart the Mattermost server.
- Permissions:
Must have manage_system permission.
- Minimum Server Version:
5.27
- Api Reference:
- async upgrade_to_enterprise_status() matterapi.models.UpgradeToEnterpriseStatusResponse200
Get the current status for the inplace upgrade from Team Edition to Enterprise Edition
It returns the percentage of completion of the current upgrade or the error if there is any.
- Permissions:
Must have manage_system permission.
- Minimum Server Version:
5.27
- Api Reference:
- async upload_license_file(*, multipart_data: Union[matterapi.models.UploadLicenseFileMultipartData, Dict]) matterapi.models.StatusOK
Upload license file
Upload a license to enable enterprise features.
- Permissions:
Must have manage_system permission.
- Minimum Server Version:
4.0
- Api Reference: