Enums¶
- enum ampapi.enums.AccessModeState(value)[source]¶
Related to Node: ADSModule.Network.AccessMode
Valid values are as follows:
- via_target = <AccessModeState.via_target: 0>¶
- direct_controller = <AccessModeState.direct_controller: 10>¶
- bypass_controller = <AccessModeState.bypass_controller: 20>¶
- enum ampapi.enums.ADSModeState(value)[source]¶
Related to Node: ADSModule.ADS.Mode
Valid values are as follows:
- not_set = <ADSModeState.not_set: 0>¶
- controller = <ADSModeState.controller: 10>¶
- hybrid = <ADSModeState.hybrid: 20>¶
- target = <ADSModeState.target: 30>¶
- stand_alone = <ADSModeState.stand_alone: 100>¶
- enum ampapi.enums.AMPDownloadMirrorState(value)[source]¶
Related to Node: ADSModule.ADS.DownloadMirror
Valid values are as follows:
- us_central = <AMPDownloadMirrorState.us_central: '[Automatic]'>¶
- eu_west = <AMPDownloadMirrorState.eu_west: ''>¶
- us_central_texas = <AMPDownloadMirrorState.us_central_texas: 'US Central - Texas'>¶
- enum ampapi.enums.AMPInstanceState(value)[source]¶
Represents the state of an Instance and or Application inside an Instance.
Valid values are as follows:
- undefined = <AMPInstanceState.undefined: -1>¶
- stopped = <AMPInstanceState.stopped: 0>¶
- pre_start = <AMPInstanceState.pre_start: 5>¶
- configuring = <AMPInstanceState.configuring: 7>¶
- starting = <AMPInstanceState.starting: 10>¶
- ready = <AMPInstanceState.ready: 20>¶
- restarting = <AMPInstanceState.restarting: 30>¶
- stopping = <AMPInstanceState.stopping: 40>¶
- preparing_for_sleep = <AMPInstanceState.preparing_for_sleep: 45>¶
- sleeping = <AMPInstanceState.sleeping: 50>¶
- waiting = <AMPInstanceState.waiting: 60>¶
- installing = <AMPInstanceState.installing: 70>¶
- updating = <AMPInstanceState.updating: 75>¶
- awaiting_user_input = <AMPInstanceState.awaiting_user_input: 80>¶
- failed = <AMPInstanceState.failed: 100>¶
- suspended = <AMPInstanceState.suspended: 200>¶
- maintenance = <AMPInstanceState.maintenance: 250>¶
- indeterminate = <AMPInstanceState.indeterminate: 999>¶
- enum ampapi.enums.AMPTheme(value)[source]¶
Related to Node: Core.AMP.Theme
Valid values are as follows:
- aura = <AMPTheme.aura: 'Aura'>¶
- black = <AMPTheme.black: 'Black'>¶
- tenth_anniversary = <AMPTheme.tenth_anniversary: 'TenthAnniversary'>¶
- to_boldly_go = <AMPTheme.to_boldly_go: 'ToBoldlyGo'>¶
- default = <AMPTheme.default: 'default'>¶
- enum ampapi.enums.ApplicationUpdatesState(value)[source]¶
Related to Node: steamcmdplugin.SteamUpdateSettings.UpdateCheckMethod
Valid values are as follows:
- by_timestamp = <ApplicationUpdatesState.by_timestamp: 0>¶
- by_build_id = <ApplicationUpdatesState.by_build_id: 1>¶
- enum ampapi.enums.AppStartupModeState(value)[source]¶
Related to Node: Core.AMP.AppStartupMode
Valid values are as follows:
- do_nothing = <AppStartupModeState.do_nothing: 0>¶
- update = <AppStartupModeState.update: 1>¶
- start = <AppStartupModeState.start: 2>¶
- update_and_start = <AppStartupModeState.update_and_start: 3>¶
- unk = <AppStartupModeState.unk: 16>¶
- unk2 = <AppStartupModeState.unk2: 32>¶
- enum ampapi.enums.ContainerMemoryPolicyState(value)[source]¶
An enumeration.
Valid values are as follows:
- not_specified = <ContainerMemoryPolicyState.not_specified: 0>¶
- reserve = <ContainerMemoryPolicyState.reserve: 100>¶
- restrict = <ContainerMemoryPolicyState.restrict: 200>¶
- enum ampapi.enums.DefaultIPBindingState(value)[source]¶
Related to Node: ADSModule.Network.DockerExternalIPBinding, ADSModule.Network.DefaultAppIPBinding, ADSModule.Network.DefaultIPBinding
Valid values are as follows:
- ipv4_loopback = <DefaultIPBindingState.ipv4_loopback: '127.0.0.1'>¶
- enp42s0 = <DefaultIPBindingState.enp42s0: '192.168.4.50'>¶
- any_ipv4_address = <DefaultIPBindingState.any_ipv4_address: '0.0.0.0'>¶
- any_ipv6_address = <DefaultIPBindingState.any_ipv6_address: '::'>¶
- enum ampapi.enums.LoggingLevelState(value)[source]¶
Related to Node: Core.Monitoring.LogLevel
Valid values are as follows:
- debug = <LoggingLevelState.debug: 0>¶
- info = <LoggingLevelState.info: 10>¶
- chat = <LoggingLevelState.chat: 11>¶
- notice = <LoggingLevelState.notice: 20>¶
- warning = <LoggingLevelState.warning: 30>¶
- error = <LoggingLevelState.error: 40>¶
- activity = <LoggingLevelState.activity: 5>¶
- fatal = <LoggingLevelState.fatal: 50>¶
- event = <LoggingLevelState.event: 7>¶
- audit = <LoggingLevelState.audit: 8>¶
- enum ampapi.enums.PortAssignmentState(value)[source]¶
Related to Node: ADSModule.Network.PortAssignment
Valid values are as follows:
- include_allowed_ports_only = <PortAssignmentState.include_allowed_ports_only: 0>¶
- allow_all_except_excluded = <PortAssignmentState.allow_all_except_excluded: 1>¶
- enum ampapi.enums.PostCreateActionsState(value)[source]¶
The action the Instance will take after creation. Used in dataclass parameters.
Valid values are as follows:
- do_nothing = <PostCreateActionsState.do_nothing: 0>¶
- start_instance = <PostCreateActionsState.start_instance: 1>¶
- start_and_update = <PostCreateActionsState.start_and_update: 2>¶
- full_startup = <PostCreateActionsState.full_startup: 3>¶
- every_time = <PostCreateActionsState.every_time: 16>¶
- enum ampapi.enums.PostCreateState(value)[source]¶
Represents the state of the API call ADSModule/DeployTemplate Related to Node: ADSModule.Defaults.DefaultPostCreate
Valid values are as follows:
- do_nothing = <PostCreateState.do_nothing: 0>¶
- update_once = <PostCreateState.update_once: 1>¶
- update_always = <PostCreateState.update_always: 2>¶
- update_and_start_once = <PostCreateState.update_and_start_once: 3>¶
- update_and_start_always = <PostCreateState.update_and_start_always: 4>¶
- start_always = <PostCreateState.start_always: 5>¶
- enum ampapi.enums.ReleaseStreamState(value)[source]¶
Related to Node: ADSModule.Defaults.DefaultReleaseStream
Valid values are as follows:
- lts = <ReleaseStreamState.lts: 5>¶
- mainline = <ReleaseStreamState.mainline: 10>¶
- preview = <ReleaseStreamState.preview: 15>¶
- development = <ReleaseStreamState.development: 20>¶
Types¶
These are all TypedDicts
- class ampapi.types.ActionSpec¶
ads_module: dict[
str, Any]file_manager_plugin: dict[
str, Any]email_sender_plugin: dict[
str, Any]common_core_plugin: dict[
str, Any]core: dict[
str, Any]
- class ampapi.types.APISpec¶
analytics_plugin: dict[
str,APISPecEndpointData]common_core_plugin: dict[
str,APISPecEndpointData]email_sender_plugin: dict[
str,APISPecEndpointData]file_manager_plugin: dict[
str,APISPecEndpointData]local_file_backup_plugin: dict[
str,APISPecEndpointData]minecraft_module: dict[
str,APISPecEndpointData]
- class ampapi.types.APISPecEndpointData¶
description:
stris_complex_type:
boolparameters:
APISpecEndpointParametersreturn_type_name:
strreturns:
str
- class ampapi.types.APISpecEndpointParameters¶
description:
strname:
stroption:
boolparam_enum_values:
strtype_name:
str
- class ampapi.types.Consumes¶
description:
strinput_type:
strname:
strvalue_type:
strenum_values: NotRequired[
str]
- class ampapi.types.PermissionNode¶
name:
strnode:
strdisplay_name:
strdescription:
strchildren: list[
PermissionNode]
- class ampapi.types.ScheduleDataData¶
available_methods: list[
MethodsData]available_triggers: list[
TriggersData]populated_triggers: list[
TriggersData]
- class ampapi.types.TriggersData¶
id:
strdescription:
stremits: list[
str]enabled_state:
inttasks: list[
TriggerTasksData]type:
strtrigger_type:
strlast_execute_error: NotRequired[
bool]last_error_reason: NotRequired[
str]
Dataclasses¶
- ampapi.dataclass.attribute_converter(data: dict[str, Any]) dict[str, Any][source]¶
Removes private attributes (aka
_attribute) designation from the dict key values.Note
Typically after calling
vars().
- ampapi.dataclass.timestamp_converter(data: str) datetime[source]¶
Convert either the
C#date str into a Pythondatetimeobject or the ISO format.Note
This is for older than 2.6.0.0 AMP Installs.
- Parameters:
data (
str) – The date string to convert.- Returns:
The converted string as a
datetimeobject..- Return type:
datetime
- class ampapi.dataclass.ActionResult(status: bool, reason: str | None = None, result: str | None = None)[source]¶
Represents the JSON response data from most API Endpoints.
- class ampapi.dataclass.AnalyticsCountryData(country: str, display_session_time: str, session_count: int, session_time_percent: float, total_session_time: float, unique_player_count: int, unique_player_percent: float, session_percent: float = <factory>)[source]¶
Represents the JSON response data from
country_data.
- class ampapi.dataclass.AnalyticsFilter(country: str, first_session: bool | None = None, meta: Any | None = None, username: str | None = None, user_id: str | None = None)[source]¶
A dataclass to handle filtering for
get_analytics_summary(), pass this dataclass in as thefilter_Note
The
countrymust be in ISO 3166-1 Alpha-2 format- first_session¶
Whether or not to filter by first session only, defaults to None.
- Type:
Union[
bool, None]
- meta¶
UNK
- Type:
Union[Any, None]
- class ampapi.dataclass.AnalyticsStats(name: str, description: str, current: int | str | float, display_value: int | str | float, difference: int | str | float, previous: int | str | float)[source]¶
Represents the JSON response data from
AnalyticsSummary.stats.Note
[“Total Sessions”, “Unique Users”, “New Users”, “Total Session Time”, “Bounce Rate”, “Session Duration”, “Sessions Per User”, “Longest Session”]
Bounce Rate = “Sessions where the user joined and then quickly left again.”
- name¶
The Name of the current
AnalyticsStats- Type:
- description¶
The description of
AnalyticsStats.namethat is being tracked!- Type:
- current¶
Represents the actual value; similar to
display_valuebut in a raw representation. - Could be seconds, minutes or a count value depending on thedescription.- Type:
Union[
int, float]
- display_value¶
The value being displayed on the Analytics Summary Page after formatting.
- class ampapi.dataclass.AnalyticsSummary(busiest_time: dict[str, int | str] = <factory>, country_data: list[~ampapi.dataclass.AnalyticsCountryData] = <factory>, graph_data: list[dict[str, int | str]] = <factory>, is_demo: bool = False, quietest_time: dict[str, int | str] = <factory>, stats: list[~ampapi.dataclass.AnalyticsStats] = <factory>, top_players: list[~ampapi.dataclass.AnalyticsTopPlayers] = <factory>)[source]¶
Represents the JSON response data from
get_analytics_summary().- country_data¶
The Country information for the summary, default is a list.
- Type:
list[
AnalyticsCountryData]
- graph_data¶
The Data displayed on the Web UI panel Analytics Menu, default is a list.
- stats¶
The Analytics Stats of the summary, default is a list.
- Type:
list[
AnalyticsStats]
- top_players¶
The TOP players from the summary, default is a list.
- Type:
list[
AnalyticsTopPlayers]
- class ampapi.dataclass.AnalyticsTopPlayers(display_session_time: str, percent: float, total_session_time: float, username: str)[source]¶
Represents the JSON Response data from
top_players.- percent¶
The percent of how much this value in comparison to
total_session_time.- Type:
- class ampapi.dataclass.APIParams(url: str, user: str, password: str, use_2fa: bool = False, token: str = '')[source]¶
A class to hold Login information for the AMP API.
Note
The
urlmust be relative to the machine running the API and the machine must be able to connect to AMP.Warning
**DO NOT SET OR UPDATE**->APIParams._sessions.
- class ampapi.dataclass.APISession(id: str, ttl: datetime)[source]¶
Stores the Session ID and the TTL usage for
APIParams._session.
- class ampapi.dataclass.Application(author: str, container_reason: str, container_support: int, description: str, display_image_source: str, extra_setup_steps_uri: str, friendly_name: str, id: str, is_service_spec: bool, module_name: str, no_commercial_usage: bool, supported_platforms: int, settings: dict = <factory>)[source]¶
Represents the JSON response data from
MinecraftModule.get_supported_applications().Note
Shows Template/App information. Similar to the all the applications in a repo lists.
- display_image_source¶
The url for the application image. Typically what you see as the Instance Banner.
- Type:
- class ampapi.dataclass.AuditLogEntry(acknowledged: bool, category: str, event_type: int, id: int, message: str, source: str, user: str, timestamp: str)[source]¶
Represents the JSON response data from
Core.get_audit_log_entries()
- class ampapi.dataclass.Backup(created_automatically: bool, description: str, id: str, module_name: str, name: str, source_os: int, sticky: bool, stored_locally: bool, stored_remotely: bool, taken_by: str, total_size_bytes: int, timestamp: str)[source]¶
Represents the JSON response data from
ADSModule.get_backups().- source_os¶
Unsure. I believe there is an ENUM correlation for which int value is which type of OS
- Type:
- timestamp¶
The timestamp comes in as ISO format and converts it into a datetime object.
- Type:
datetime
- class ampapi.dataclass.BukkitPlugin(author: dict[str, int], category: dict[str, int], downloads: int, file: dict[str, str | int], id: int, likes: int, links: dict[str, str], name: str, tag: str, version: dict[str, int | str], icon: dict[str, str], tested_versions: list[str] = <factory>, update_date: int | None = None, release_date: int | None = None, rating: dict[str, float | int] = <factory>, external: bool | None = None, existence_status: int | None = None, installed_version: int | None = None, versions: list[int] | None = None, premium: bool | None = None, source_code_link: str = '', supported_languages: str = '', contributors: str = '', donation_link: str = '')[source]¶
Represents the JSON response data from any Bukkit function call. Related to
MinecraftModule.- author¶
The author’s name and ID tied to the author as a dict key, value pair.
- Type:
dict:class:[`str, :class:`int]
- category¶
The category name and ID tied to the category as a dict key, value pair.
If the plugin is premium or not, default is None.
- Type:
Union[
bool, None]
- class ampapi.dataclass.ConsoleEntries(contents: str, source: str, type: str, timestamp: str)[source]¶
Represents the JSON response data from
Updates.console_entries.
- class ampapi.dataclass.Controller(id: int, disabled: bool, is_remote: bool, platform: PlatformInfo, datastores: list[dict[str, str | int]], creates_in_containers: bool, can_create: bool, available_instances: list[Instance], available_ips: list[str], tags: list[str], url: str, last_updated: str, instance_id: str = '0', state: AMPInstanceState = AMPInstanceState.undefined, fitness: Fitness | None = None, friendly_name: str = 'None', state_reason: str = '', description: str = '', tags_list: list[str] | None = None)[source]¶
Represents the JSON response data for an AMP Controller Instance.
Note
See
ADSModule.get_instances(include_self = True)()making the first instance “typically” the Controller Instance. akaADS01.Note
Similar to what you see when you log into AMP web GUI and see the Instances list. This attribute is cached and will require calling
get_instances()to access the API converted class objects. * See theAMPControllerInstance.instancesattribute.- platform¶
Platform information related to the Instance.
- Type:
- datastores¶
The Datastores that the Controller has access to.
- available_instances¶
A list of AMP Instances the Controller/ADS has permissions to see.
- Type:
list[
Instance]
- last_updated¶
The last_updated comes in as ISO format and
Controller`__post_init__()converts it into a datetime object.- Type:
Union[
str,datetime]
- state¶
The state the Controller/Instance is in. See enum
AMPInstanceState, default isAMPInstanceState.UNDEFINED.- Type:
AMPInstanceState
- class ampapi.dataclass.CPUInfo(sockets: int, cores: int, threads: int, vendor: str, model_name: str, total_cores: int, total_threads: int)[source]¶
Represents the JSON response data from
cpu_infoattribute.Original Author: p0t4t0sandwich
CPUInfo: https://github.com/p0t4t0sandwich/ampapi-py/blob/7a28af9b640efab329cf9ca2bf39c4112a13b287/ampapi/types.py#L151
- class ampapi.dataclass.CreateInstance(target_ads_instance: str, friendly_name: str, module: str, new_instance_id: str = '', instance_name: str = '', ip_binding: str = '192.168.0.1', port_number: int = 8001, admin_username: str = '', admin_password: str = '', provision_settings: dict[str, str] = <factory>, auto_configure: bool = False, post_create: ~ampapi.enums.PostCreateActionsState = PostCreateActionsState.do_nothing, start_on_boot: bool = False, display_image_source: str = '', target_datastore: int = 0)[source]¶
Represents the JSON response data from
ADSModule.create_instance()function call.Note
Unsure if this
port_numberrespects port ranges of the ADS or not.- instance_name¶
The name for the Instance, similar to
friendly_name.- Type:
- ip_binding¶
The IP to assign to the Instance. See
Controller.available_ips.- Type:
- admin_password¶
The password for the
admin_username.- Type:
- auto_configure¶
When enabled, all settings other than the module, target and friendly_name are ignored and replaced with automatically generated values
- Type:
- post_create¶
The action to take after creating the instance, defaults to
do_nothing- Type:
PostCreateActionsState
- display_image_source¶
If the instance has a banner to display, you can define it here, default is “”.
- Type:
- target_datastore¶
- The Datastore ID to create this Instance on.
See
Controller.datastoresID values.
- Type:
- class ampapi.dataclass.DCConsumes(description: str, input_type: str, name: str, value_type: str, enum_values: str | dict = '')[source]¶
Represents the JSON response data from
consumes.
- class ampapi.dataclass.DCParameterMapping(user: str = '', reason: str = '', title: str = '', subtitle: str = '')[source]¶
Represents the JSON response data for
parameter_mapping
- class ampapi.dataclass.Diagnostics(application_name: str, application_version: str | VersionInfo, build_date: str, build_spec: str, cpu_layout: str, cpu_model: str, codename: str, installed_ram: int, instance_id: str, last_arguments: str, last_executable: str, last_process_id: int, loaded_plugins: str, module: str, module_application: str, network_mode: Any, platform: str, release_stream: str, system_type: str, tools_version: str, virtualization: str, os: str)[source]¶
Represents the JSON response data from
Core.get_diagnostics_info().- build_spec¶
Similar to
Diagnostics.release_stream.- Type:
- network_mode¶
UNK
- Type:
Any
- class ampapi.dataclass.Directory(is_directory: bool, is_virtual_directory: bool, filename: str, size_bytes: int, is_downloadable: bool, is_editable: bool, is_archive: bool, is_excluded_from_backups: bool, created: str, modified: str)[source]¶
Represents the JSON response data from
FileManagerPlugin.get_directory_listing()
- class ampapi.dataclass.Endpoints(display_name: str, endpoint: str, uri: str)[source]¶
Represents the JSON response data from
ADSModule.get_application_endpoints()
- class ampapi.dataclass.FileChunk(base_64_data: str, bytes_length: int)[source]¶
Represents the JSON response data from
FileManagerPlugin.get_file_chunk()
- class ampapi.dataclass.Fitness(available: bool, total_services: int, free_ram_mb: int, free_disk_mb: int, cpu_service_ratio: float, thread_queue_length: int, load_avg: float, remaining_instance_slots: int, score: float, score_description: str, score_zero_factors: list[Any])[source]¶
Represents the JSON response data for
Instance.fitnessattribute.- cpu_service_ratio¶
The ratio of CPU usage to the number of services running on the Instance.
- Type:
- score_description¶
A summary of the “remaining slots” aka the number of Instances you have left to create. * Includes the amount of “Free Ram” and “CPU Ratio”.
- Type:
- class ampapi.dataclass.InstanceDatastore(id: int, friendly_name: str, description: str, directory: str, soft_limit_mb: int, priority: int, tags: list[str], is_internal: bool, instance_limit: str = '0', active: bool = True, current_usage_mb: int = -1, sanitized_name: str = 'None')[source]¶
Represents a the class object to be used in
ADSModule.add_datastore()Warning
AMP must have read/write/execute access to the directory specified in the Directory parameter.
Note
This class is also used in
ADSModule.update_datastore(),ADSModule.get_datastores(),ADSModule.get_datastore()- Parameters:
id (
int) – The ID of the datastore.friendly_name (
str) – The friendly name of the datastore.description (
str) – The description of the datastore.directory (
str) – The on-disk location where instances will be stored. Changing this will not affect existing instances, only newly created ones.soft_limit_mb (
int) – Datastores that reach or exceed this limit in total size will not be considered as deployment targets. This is only a soft limit and does not prevent instances on this datastore from using more space.priority (
int) – Instances with a lower priority number are preferred over those with a higher number, all other factors being equal.tags (list[
str]) – A list of tags to apply to the datastore.is_internal (
bool) – If the datastore is internal.instance_limit (str) – The maximum number of instances that can be provisioned on this datastore, defaults to 0 for unlimited.
active (bool) – Deactivating a datastore prevents new instances from being provisioned to it, defaults to True.
current_usage_mb (
int) – The current usage of the datastore in megabytes, defaults to -1.sanitized_name (
str) – The sanitized name of the datastore, defaults to “None”.
- class ampapi.dataclass.InstanceInfo(instance_id: str, friendly_name: str, description: str, suspended: bool, exclude_from_firewall: bool, run_in_container: bool, container_memory: int, container_max_cpu: str, container_image: str, memory_policy: ContainerMemoryPolicyState = ContainerMemoryPolicyState.reserve, start_on_boot: bool = False, welcome_message: str | None = None)[source]¶
Represents the JSON response data for
ADSModule.update_instance_info().- memory_policy¶
The memory policy of the Instance, default is
ContainerMemoryPolicyState.reserve.- Type:
ContainerMemoryPolicyState
- class ampapi.dataclass.Instance(application_endpoints: list[dict[str, str]], app_state: AMPInstanceState, container_memory_mb: int, container_memory_policy: ContainerMemoryPolicyState, daemon: bool, daemon_autostart: bool, deployment_args: dict[str, str], disk_usage_mb: int, exclude_from_firewall: bool, friendly_name: str, ip: str, instance_id: str, instance_name: str, is_container_instance: bool, is_https: bool, management_mode: int, module: str, port: str, release_stream: int, running: bool, suspended: bool, target_id: str, amp_version: str | dict | VersionInfo | None = None, container_cpus: float = 0.0, tags: None | list = None, module_display_name: str = '', metrics: Metric | None = None, display_image_source: str = '', description: str = '', _instance_offline: str = 'The requested instance is not available at this time.')[source]¶
Represents the JSON response data for
ADSModule.get_instance()or a list of these fromADSModule.get_instances().- application_endpoints¶
The list of application endpoints for the Instance.
- app_state¶
The state of the application.
- Type:
AMPInstanceState
- container_memory_policy¶
The memory policy of the Instance.
- Type:
ContainerMemoryPolicyState
- static online(func: Callable[Concatenate[D, T], Coroutine[None, None, F]]) Callable[Concatenate[D, T], Coroutine[None, None, F]][source]¶
Checks the
runningproperty and raisesConnectionErrorif the attribute is equal to “False”.- Raises:
ConnectionError – The requested instance is not currently running at this time.
- class ampapi.dataclass.InstanceStatus(instance_id: str, running: bool)[source]¶
Represents the JSON response data from
ADSModule.get_instance_statuses().
- class ampapi.dataclass.LoginResults(success: bool, result: int, permissions: list[str] = <factory>, result_reason: str = '', session_id: str = '', remember_me_token: str = '', user_info: ~ampapi.dataclass.LoginUserInfo | None = None)[source]¶
Represents the JSON response data from the AMP Login response.
- user_info¶
The user information, defaults to None.
- Type:
LoginUserInfo, optional
- class ampapi.dataclass.LoginUserInfo(id: str, username: str, is_two_factor_enabled: bool, disabled: bool, gravatar_hash: str, is_ldap_user: bool, last_login: str, email_address: str = '')[source]¶
Represents an AMP users information, tied to
LoginResultsalong with representing the JSON response from the function :meth`~Core.get_amp_users_summary`- last_login¶
The last login date.
- Type:
datetime
- class ampapi.dataclass.MCUser(name: str, uuid: str)[source]¶
Represents the JSON response data from
MinecraftModule.mc_get_whitelist().
- class ampapi.dataclass.Messages(age_minutes: int, expired: bool, id: str, message: str, source: str)[source]¶
Represents a Message from the dataclass attribute
Updates.messages
- class ampapi.dataclass.Methods(id: str = '', name: str = '', description: str = '', consumes: list[~ampapi.dataclass.DCConsumes] = <factory>)[source]¶
Tied to
ScheduleData.available_methods.Hold’s information regarding Methods/Events that are available to the Instance. Varies depending on instance type.
- consumes¶
A list of parameters the method consumes.
- Type:
list[
DCConsumes]
- class ampapi.dataclass.Metric(active_users: None | MetricsData = None, cpu_usage: None | MetricsData = None, memory_usage: None | MetricsData = None)[source]¶
Represents the JSON response data for
AppStatus.metricsandInstance.metrics.- active_users¶
The active users data.
- Type:
Union[None,
MetricsData]
- cpu_usage¶
The cpu usage data.
- Type:
Union[None,
MetricsData]
- memory_usage¶
The memory usage data.
- Type:
Union[None,
MetricsData]
- class ampapi.dataclass.MetricsData(raw_value: int, max_value: int, percent: int, units: str, color: str | None = None, color2: str | None = None, color3: str | None = None)[source]¶
Represents the JSON response data for each of the attributes of
Metrics.
- class ampapi.dataclass.Module(amp_build: str, amp_version: str, api_version: str, allow_remember_me: bool, analytics: bool, app_name: str, author: str, base_port: int, branding: dict, build_spec: str, display_base_uri: str, end_point_ur: str, feature_set: list, friendly_name: str, instance_id: str, instance_name: str, is_remote_instance: bool, loaded_plugins: list[str], module_name: str, name: str, primary_endpoint: str, requires_full_load: bool, supports_sleep: bool, timestamp: str, tools_version: str, version_codename: str)[source]¶
Represents the JSON response data from
Core.get_module_info()
- class ampapi.dataclass.OPList(level: int, name: str, uuid: str)[source]¶
Represents the JSON response data from
MinecraftModule.get_op_whitelist().
- class ampapi.dataclass.OPWhitelist(op_list: list[MCUserData] = <factory>, whitelist: list[MCUserData] = <factory>)[source]¶
Represents the JSON response data from
MinecraftModule.get_op_whitelist().- op_list¶
The list of operator users.
- Type:
list[
MCUserData]
- whitelist¶
The list of whitelisted users.
- Type:
list[
MCUserData]
- class ampapi.dataclass.PlatformInfo(cpu_info: CPUInfo, installed_ram_mb: int, os: int, platform_name: str, system_type: int, virtualization: int, is_shared_setup: bool = False, admin_rights: int = 0, hardware_platform_name: str = '', installed_glibc_version: str = '')[source]¶
Represents the data from the attribute
RemoteTargetInfo.platform_info.Whether the instance is shared setup.
- Type:
- class ampapi.dataclass.Player(uuid: str = '', name: str = '')[source]¶
Represents a single player connected to a server.
- class ampapi.dataclass.Players(data: dict[str, str])[source]¶
Represents the JSON response data from
get_user_list().Note
The print out of this dataclass can be long depending on the number of players connected due to separation by newline.
- class ampapi.dataclass.Port(listening: bool, name: str, port: int, protocol: int, required: bool | None = None, is_delayed_open: bool | None = None)[source]¶
Current Port of the related AMP Instance. Tied to
Updates.portsand the JSON response data fromCore.get_port_summaries().
- class ampapi.dataclass.Provision(available: bool, cpu_service_ratio: float, free_disk_mb: int, free_ram_mb: int, load_avg: float, remaining_instance_slots: int, score: float, thread_queue_length: int, total_services: int)[source]¶
Represents the JSON response data from
ADSModule.get_provision_fitness().
- class ampapi.dataclass.ProvisionSettingInfo(default_value: str, description: str, endpoint_name: str, node: str, type: str, value_range: int | str)[source]¶
Represents the JSON response data from
ADSModule.get_provision_arguments().
- class ampapi.dataclass.PortInfo(description: str, us_user_defined: bool, port_number: int, protocol: int, provision_node_name: str, range: int, verified: bool)[source]¶
Represents the JSON response data from
ADSModule.get_instance_network_info().
- class ampapi.dataclass.RemoteTargetInfo(ip_address_list: list[str], platform_info: PlatformInfo, datastores: list[InstanceDatastore], deploys_in_containers: bool)[source]¶
Represents the JSON response data from
ADSModule.get_target_info().- ip_address_list¶
The IP address list.
- Type:
list[str]
- platform_info¶
The platform info.
- Type:
- datastores¶
The datastores.
- Type:
list[
InstanceDatastore]
- class ampapi.dataclass.Role(id: str, is_default: bool, name: str, description: str, hidden: bool, permissions: list[str], members: list[str], is_instance_specific: bool, is_common_role: bool, disable_edits: bool)[source]¶
Represents the JSON response data from
Core.get_role().If the AMP role is hidden or not.
- Type:
- permissions¶
The list of permissions the AMP role has.
- Type:
list[str]
- members¶
The list of AMP users who have the role.
- Type:
list[str]
- class ampapi.dataclass.RunningTask(is_primary_task: bool, start_time: str, id: str, name: str, description: str, hide_from_ui: bool, fast_dismiss: bool, last_update_pushed: str, progress_percent: float, is_cancellable: bool, origin: str, is_indeterminate: bool, state: int, status: str)[source]¶
Represents the JSON response data from functions that return RunningTask.
- class ampapi.dataclass.ScheduleData(available_methods: list[~ampapi.dataclass.Methods] = <factory>, available_triggers: list[~ampapi.dataclass.Triggers] = <factory>, populated_triggers: list[~ampapi.dataclass.Triggers] = <factory>)[source]¶
Represents the JSON response data from
Core.get_schedule_data().
- class ampapi.dataclass.Session(source: str, session_id: str, username: str, session_type: str, start_time: str, last_activity: str)[source]¶
Represents the JSON response data from
Core.get_active_amp_sessions().- start_time¶
The start time of the session.
- Type:
datetime
- last_activity¶
The last time the session was active.
- Type:
datetime
- class ampapi.dataclass.SettingSpec(category: str, actions: list[~ampapi.dataclass.SettingSpecAction] = <factory>, always_allow_read: bool = False, attributes: ~ampapi.dataclass.SettingsSpecAttribute | None = None, current_value: list | str | bool | int | dict | ~ampapi.enums.AccessModeState | ~ampapi.enums.PostCreateState | ~ampapi.enums.ApplicationUpdatesState | ~ampapi.enums.LoggingLevelState | ~ampapi.enums.AMPTheme | ~ampapi.enums.AppStartupModeState | ~ampapi.enums.TwoFactoryModeState | ~ampapi.enums.PortAssignmentState | ~ampapi.enums.DefaultIPBindingState | ~ampapi.enums.AMPDownloadMirrorState | ~ampapi.enums.ADSModeState | ~ampapi.enums.ReleaseStreamState = '', description: str = '', enum_values: None | dict[str, ~typing.Any] = None, enum_values_are_deferred: bool = False, input_type: str | None = None, is_provision_spec: bool = False, keywords: str = '', max_length: int = 0, max_value: None = None, min_value: None = None, meta: str = '', name: str = '', node: str = '', order: int = 1, placeholder: str = '', read_only: bool = False, read_only_provision: bool = False, required: bool = False, requires_restart: bool = False, selection_source: ~ampapi.dataclass.SettingSpecSelectionSource | None = None, subcategory: str = '', suffix: str = '', tag: str = '', val_type: str = '')[source]¶
Represents the JSON response data from
Core.get_config()orCore.get_configs().These represent a single setting field in the Instance configuration UI.
- actions¶
The list of actions related to the setting, defaults to an empty list.
- Type:
list[
SettingSpecAction]
- attributes¶
The attributes that are set/prompted for when changing this setting.
- Type:
SettingsSpecAttribute, optional
- current_value¶
The current value of the setting, default is “”.
- description¶
The text description below the setting name in the UI, default is “”.
- Type:
str, optional
- enum_values¶
A dictionary representing the possible enum values for the setting, default is None.
- Type:
dict, optional
- min_value¶
UNK, all fields are null in data, default is None.
- Type:
None
- requires_restart¶
If the setting requires the Instance or Server to be restarted, default is False.
- Type:
- selection_source¶
UNK, most fields are null in data, default is None.
- Type:
Union[
SettingSpecSelectionSource, None]
- subcategory¶
The subcategory the setting will appear under in the Instance configuration UI, default is “”.
- Type:
- tag¶
What the setting is related to, similar to a Server Config property or file, default is “”.
- Type:
- class ampapi.dataclass.SettingSpecAction(argument: str, caption: str, is_client_side: bool, method: str, module: str, type_id: str)[source]¶
Represents the JSON response data from
SettingSpec.actions.- method¶
The method of the action, these relate to API Endpoints when combined with the module.
- Type:
- class ampapi.dataclass.SettingsSpecAttribute(key_name: str, key_placeholder: str, type_id: str, value_name: str, value_placeholder: str, read_only_keys: bool = False)[source]¶
Represents the JSON response data from
SettingSpec.attributes.
- class ampapi.dataclass.SettingsSpecParent(branding: list[~ampapi.dataclass.SettingSpec] = <factory>, external_services: list[~ampapi.dataclass.SettingSpec] = <factory>, file_manager: list[~ampapi.dataclass.SettingSpec] = <factory>, instance_deployment: list[~ampapi.dataclass.SettingSpec] = <factory>, login: list[~ampapi.dataclass.SettingSpec] = <factory>, security_and_privacy: list[~ampapi.dataclass.SettingSpec] = <factory>, system_settings: list[~ampapi.dataclass.SettingSpec] = <factory>, updates: list[~ampapi.dataclass.SettingSpec] = <factory>)[source]¶
Represents the JSON response data from
Core.get_setting_spec().- branding¶
The list of branding settings in the UI, default is an empty list.
- Type:
list[
SettingSpec]
- external_services¶
The list of external services settings in the UI, default is an empty list.
- Type:
list[
SettingSpec]
- file_manager¶
The list of file manager settings in the UI, default is an empty list.
- Type:
list[
SettingSpec]
- instance_deployment¶
The list of instance deployment settings in the UI, default is an empty list.
- Type:
list[
SettingSpec]
- login¶
The list of login settings in the UI, default is an empty list.
- Type:
list[
SettingSpec]
- security_and_privacy¶
The list of security and privacy settings in the UI, default is an empty list.
- Type:
list[
SettingSpec]
- system_settings¶
The list of system settings in the UI, default is an empty list.
- Type:
list[
SettingSpec]
- updates¶
The list of update settings in the UI, default is an empty list.
- Type:
list[
SettingSpec]
- class ampapi.dataclass.SettingSpecSelectionSource(deferred: bool, must_validate: bool, type_id: str)[source]¶
Represents the JSON response data from
SettingSpec.selection_source.
- class ampapi.dataclass.Status(state: AMPInstanceState, uptime: str, metrics: Metric | None = None)[source]¶
Represents the JSON response data from
Core.get_updates()- state¶
The state of the AMP Instance.
- Type:
AMPInstanceState
- class ampapi.dataclass.Template(template_id: int, new_username: str | None = None, new_password: str | None = None, new_email: str | None = None, required_tags: list[str] | None = None, tag: str | None = None, friendly_name: str | None = None, secret: str | None = None, post_create: PostCreateActionsState = PostCreateActionsState.do_nothing, extra_provision_settings: dict[str, str] | None = None)[source]¶
A placeholder class for all the parameters to deploy or create a template.
ADSModule.deploy_template()
- template_id¶
The ID of the template to be deployed, as per the Template Management UI in AMP itself.
- Type:
- new_username¶
If specified, AMP will create a new user with this name for this instance. Default is None. * Must be unique, If this user already exists, this will be ignored but the new instance will be assigned to this user.
- Type:
Union[
str, None] , optional
- new_password¶
If
new_usernameis specified and the user doesn’t already exist, the password will be assigned to this user. Default is None.- Type:
Union[
str, None] , optional
- new_email¶
If
new_usernameis specified and the user doesn’t already exist, the email address will be assigned to this user. Default is None.- Type:
Union[
str, None] , optional
- required_tags¶
If specified, AMP will only deploy this template to targets that have every single ‘tag’ specified in their target configuration. You can adjust this via the controller by clicking ‘Edit’ on the target settings. Default is None.
- Type:
Union[list[
str], None] , optional
- tag¶
Unrelated to required_tags. This is to uniquely identify this instance to your own systems. It may be something like an order ID or service ID so you can find the associated instance again at a later time. Default is None.
- Type:
Union[
str, None] , optional
- friendly_name¶
A friendly name for this instance. If left blank, AMP will generate one for you. Defaults is None.
- Type:
Union[
str, None] , optional
- secret¶
Must be a non-empty strong in order to get a callback on deployment state change. This secret will be passed back to you in the callback so you can verify the request. Default is None.
- Type:
Union[
str, None] , optional
- post_create¶
The action to take after the Instance is created, default is
PostCreateActionState.do_nothing.- Type:
PostCreateActionState, optional
- class ampapi.dataclass.TimedTrigger(description: str, enabled_state: bool, id: str, match_days: list[int], match_days_of_month: list[int], match_hours: list[int], match_minutes: list[int], match_months: list[int], name: str, order: int, tasks: TriggerTasks)[source]¶
Represents the data of
Core.get_time_interval_trigger().- tasks¶
The list of tasks associated with this Timed Trigger.
- Type:
list[TriggerTasks]
- class ampapi.dataclass.Triggers(enabled_state: int, tasks: list[~ampapi.dataclass.TriggerTasks] = <factory>, id: str = '', type: str = '', description: str = '', trigger_type: str = '', emits: list[str] = <factory>, last_execute_error: bool = False, last_error_reason: str = '')[source]¶
Represents the JSON reponse data for attributes
ScheduleData.available_triggersandScheduleData.populated_triggers.Note
The
Triggers.idis unique per Instance.- tasks¶
The list of tasks associated with this trigger, default is an empty list.
- Type:
list[TriggerTasks], optional
- trigger_type¶
The same as
Triggers.type.- Type:
- emits¶
The parameters the trigger emits to the Event allowing usage in the trigger, default is an empty list.
- Type:
list[str], optional
- class ampapi.dataclass.TriggerTasks(id: str, task_method_name: str, parameter_mapping: DCParameterMapping, enabled_state: int, locked: bool, created_by: str, order: int)[source]¶
Represents the JSON response for the attribute
Triggers.tasks.Hold’s information regarding AMP Tasks and their status.
- parameter_mapping¶
The parameter mapping for the task.
- Type:
- class ampapi.dataclass.UpdateInfo(update_available: bool, release_notes_url: str, build: str, version: str, tools_version: str | None = None, patch_only: bool | None = None)[source]¶
Represents the JSON response data from
Core.get_update_info().
- class ampapi.dataclass.Updates(console_entries: list[~ampapi.dataclass.ConsoleEntries], status: ~ampapi.dataclass.Status, messages: list[~ampapi.dataclass.Messages], ports: list[~ampapi.dataclass.Port] = <factory>, tasks: list[~ampapi.dataclass.RunningTask] = <factory>)[source]¶
Represents the JSON response data from
Core.get_updates().- console_entries¶
The list of entries in the console.
- Type:
list[ConsoleEntries]
- messages¶
The list of messages the Instance or Server has.
- Type:
list[Messages]
- ports¶
The list of ports the Server is listening/using, default is an empty list.
- Type:
list[Port], optional
- tasks¶
The list of tasks the Server is running, default is an empty list.
- Type:
list[RunningTask], optional
- class ampapi.dataclass.User(cannot_change_password: bool, disable: bool, gravatar_hash: str, id: str, is_ldap_user: bool, is_super_user: bool, is_two_factor_enabled: bool, must_change_password: bool, name: str, password_expires: bool, permissions: list[str], roles: list[str], email_address: str, last_login: str)[source]¶
Represents the JSON response data from the function
Core.get_all_amp_user_info()orCore.get_amp_user_info()- must_change_password¶
If the user must change their password or not when they log in next.
- Type:
- permissions¶
The list of permissions the user has.
- Type:
list[str]
- roles¶
The list of AMP roles the user has.
- Type:
list[str]
- last_login¶
The last login date of the user.
- Type:
datetime
- class ampapi.dataclass.VersionInfo(major: int, minor: int, revision: int, minor_revision: int = 0, major_revision: int | None = None, build: int | None = None)[source]¶
Tied to the class attribute for
UpdateInfo.buildNote
Currently has a converter function
v2.6.0.0__repr__has been overridden to display in a joined string with build at the end.
Data Modules¶
- class ampapi.modules.DeploymentTemplate(id: int, name: str, description: str, module: str, template_instance: Any, template_role: str, template_base_app: str, clone_role_into_user: bool, zip_overlay_path: str, match_datastore_tags: bool, settings_mappings: dict[str, str], tags: list[str], start_on_boot: bool = False)[source]¶
Used for
ADSModule.update_deployment_template()function call.Note
Your pre-created data structure to be parsed for the required API parameters.
- clone_role_into_user¶
Clone the
template_roleto the users of this template.- Type:
- template_instance¶
UNK
- Type:
Any
- start_on_boot¶
If the Instance should start on ADS01/Controller boot or not, default is False.
- Type:
- class ampapi.modules.UserApplicationData(id: str, user_session_id: str, name: str, join_time: str, uid: str, ip_address: str, port: int, time_logged_in: str, session_id: str | None = None, tags: str | None = None)[source]¶
- class ampapi.modules.TriggerID(data: list[TriggersData])[source]¶
Used for a multitude of functions all related to Triggers and their IDs.
Simply access the respective attribute and the unique GUID for that
AMPInstanceTrigger ID will be returned.