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>
enum ampapi.enums.TwoFactoryModeState(value)[source]

Related to Node: Core.Security.TwoFactorMode

Valid values are as follows:

optional = <TwoFactoryModeState.optional: 0>
required = <TwoFactoryModeState.required: 1>

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: str

is_complex_type: bool

parameters: APISpecEndpointParameters

return_type_name: str

returns: str

class ampapi.types.APISpecEndpointParameters

description: str

name: str

option: bool

param_enum_values: str

type_name: str

class ampapi.types.BukkitCategories

id: int

name: str

class ampapi.types.Consumes

description: str

input_type: str

name: str

value_type: str

enum_values: NotRequired[str]

class ampapi.types.MethodsData

id: str

name: str

description: str

consumes: list[Consumes]

class ampapi.types.ParameterMapping

user: NotRequired[str]

reason: NotRequired[str]

class ampapi.types.PermissionNode

name: str

node: str

display_name: str

description: str

children: list[PermissionNode]

class ampapi.types.ScheduleDataData

available_methods: list[MethodsData]

available_triggers: list[TriggersData]

populated_triggers: list[TriggersData]

class ampapi.types.TriggersData

id: str

description: str

emits: list[str]

enabled_state: int

tasks: list[TriggerTasksData]

type: str

trigger_type: str

last_execute_error: NotRequired[bool]

last_error_reason: NotRequired[str]

class ampapi.types.TriggerTasksData

id: str

task_method_name: str

parameter_mapping: ParameterMapping

enabled_state: int

locked: bool

created_by: str

order: int

class ampapi.types.MCUserData

name: str

uuid: 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().

Parameters:

data (dict[str, Any]) – The data or object to remove private attributes from as keys.

Returns:

The private attributes removed.

Return type:

dict[str, Any]

ampapi.dataclass.timestamp_converter(data: str) datetime[source]

Convert either the C# date str into a Python datetime object 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 datetime object..

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.

status

If the API call was successful.

Type:

bool

reason

If status is False this will typically have a str response.

Type:

Union[str, None]

result

If status is True this will contain data related to the API call.

Type:

Union[str, None]

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.

country

The country code; similar to the ISO 3166-1 Alpha-2 format.

Type:

str

display_session_time

The current display’s session time per country.

Type:

str

session_count

The current number of sessions per country.

Type:

int

session_time_percent

UNK

Type:

float

total_session_time

The total session time per country.

Type:

float

unique_player_count

The unique player count per country.

Type:

int

unique_player_percent

The unique player percent out of all countries.

Type:

int

session_percent

The percent of total sessions related to this country.

Type:

int

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 the filter_

Note

Simply create this class and fill out either username, user_id and or country.

Note

The country must be in ISO 3166-1 Alpha-2 format

country

The country to filter by.

Type:

str

first_session

Whether or not to filter by first session only, defaults to None.

Type:

Union[bool, None]

meta

UNK

Type:

Union[Any, None]

username

The username to filter by, defaults to None.

Type:

Union[str , None]

user_id

The user_id to filter by, currently using the username attribute, defaults to None.

Type:

Union[str, 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:

str

description

The description of AnalyticsStats.name that is being tracked!

Type:

str

current

Represents the actual value; similar to display_value but in a raw representation. - Could be seconds, minutes or a count value depending on the description.

Type:

Union[int, float]

display_value

The value being displayed on the Analytics Summary Page after formatting.

Type:

Union[int, str, float]

difference

Has values such as “Infinity”, 0, and 0.0.

Type:

Union[int, str, float]

previous

UNK

Type:

Union[int, str, float]

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().

busiest_time

UNK, default is a list.

Type:

dict[str, Union[int, str]]

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.

Type:

list[dict[str, Union[int, str]]]

is_demo

UNK, default is False.

Type:

bool

quietest_time

UNK, default is a dict.

Type:

dict[str, Union[int, str]]

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.

display_session_time

Display the session time.

Type:

str

percent

The percent of how much this value in comparison to total_session_time.

Type:

float

total_session_time

The total amount of session time the user has for the day.

Type:

float

username

The name of the session user. Like an IGN.

Type:

str

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 url must 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.

url

The URL to access the Web GUI panel home page/login page.

Type:

str

user

The AMP User name to login to the Web Panel.

Type:

str

password

The AMP User password to login to the Web Panel.

Type:

str

use_2fa

To use TOTP 2 Factor Authentication, default is False.

Type:

bool

token

The 2 Factor Authentication Token Code to generate a TOTP code, default is “”

Type:

str

class ampapi.dataclass.APISession(id: str, ttl: datetime)[source]

Stores the Session ID and the TTL usage for APIParams._session.

id

The SESSIONID dict key from the JSON response of Login().

Type:

str

ttl

The time to live of the id. This can be adjusted by :Base.session_ttl value.

Type:

datetime

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.

author

The author of the application/template.

Type:

str

container_reason

The reason the application is using a container, if any.

Type:

str

container_support

UNK - Unsure what this value is for.

Type:

int

description

A brief description of what the application is.

Type:

str

display_image_source

The url for the application image. Typically what you see as the Instance Banner.

Type:

str

extra_setup_steps_uri

UNK

Type:

str

friendly_name

A formatted version of the name.

Type:

str

id

A unique ID for the application.

Type:

str

is_service_spec

UNK.

Type:

bool

module_name

The type of Module this application uses. (eg. “Minecraft”, “Generic”)

Type:

str

no_commercial_usage

As the attribute implies; if it’s for commercial usage or not.

Type:

bool

supported_platforms

UNK

Type:

int

settings

A dict of Instance specific settings to apply for this application.

Type:

dict[str, Any]

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()

acknowledged

UNK

Type:

bool

category

The type of log entry.

Type:

str

event_type

The type of event that occurred.

Type:

int

id

UNK

Type:

int

message

The message tied to the log entry.

Type:

str

source

UNK

Type:

str

user

The AMP Username tied to the log entry.

Type:

str

timestamp

The timestamp comes in as ISO format and AuditLogEntry.__post_init__() converts it into a datetime object.

Type:

str | datetime

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().

created_automatically

If the backup was created by a Scheduled Task.

Type:

bool

description

The description for the backup, if any.

Type:

str

id

The backup GUID.

Type:

str

module_name

What type of Instance that created the backup. eg. Minecraft, ADS, Generic

Type:

str

name

The name of the backup.

Type:

str

source_os

Unsure. I believe there is an ENUM correlation for which int value is which type of OS

Type:

int

sticky

If the Backup is Sticky.

Type:

bool

stored_locally

If the backup is local or not.

Type:

bool

stored_remotely

If the backup is stored in S3/Cloud or similar.

Type:

bool

taken_by

Who created the backup.

Type:

str

total_size_bytes

The total size of the backup is bytes.

Type:

int

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.

Type:

dict[str, int]

downloads

The number of downloads the plugin has had.

Type:

int

file

UNK

Type:

dict[str, Union[str, int]]

id

The ID of the plugin.

Type:

int

likes

The number of likes the plugin has had.

Type:

int

The links related to the plugin. Unsure of data structure.

Type:

dict[str, str]

name

The name of the plugin.

Type:

str

tag

The tag related to the plugin.

Type:

str

version

The version information of the plugin.

Type:

dict[str , Union[int, str]]

icon

The icon name and url in a dict key, value pair.

Type:

dict[str, str]

tested_version

The tested versions of the plugin, default is a list

Type:

list[str]

update_date

The timestamp of when it was updated, default is None

Type:

Union[int, None]

release_date

The timestamp of when it was released, default is None

Type:

Union[int, None]

rating

The rating, default is a dict.

Type:

dict[str, Union[float, int]]

external

If the plugin is external or not, default is None

Type:

Union[bool, None]

existence_status

UNK, default is None

Type:

Union[int, None]

installed_version

The plugin version currently installed, default is None.

Type:

Union[int, None]

versions

The plugins alternate versions, if any, default is None.

Type:

Union[list[int], None]

premium

If the plugin is premium or not, default is None.

Type:

Union[bool, None]

The URL to the source code, default is “”.

Type:

str

supported_languages

The languages this plugin supports, default is “”.

Type:

str

contributors

The contributors to the source code/plugin, default is “”.

Type:

str

The URL to donate/support the plugin, default is “”.

Type:

str

class ampapi.dataclass.ConsoleEntries(contents: str, source: str, type: str, timestamp: str)[source]

Represents the JSON response data from Updates.console_entries.

contents

The contents of the console entry.

Type:

str

source

The source of the console entry. eg “Server thread/INFO, …”

Type:

str

type

The type of message. eg “Console, Chat, Error, …

Type:

str

timestamp

The timestamp comes in as ISO format and __post_init__() converts it into a datetime object.

Type:

str | datetime

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. aka ADS01.

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 the AMPControllerInstance.instances attribute.

id

UNK

Type:

int

disabled

If the Controller is Disabled or not.

Type:

bool

is_remote

If the Controller is remote or not.

Type:

bool

platform

Platform information related to the Instance.

Type:

PlatformInfo

datastores

The Datastores that the Controller has access to.

Type:

list[dict[str, Union[str, int]]]

creates_in_containers

The Controller will create the Instances in containers.

Type:

bool

can_create

If the Controller can create Instances or not.

Type:

bool

available_instances

A list of AMP Instances the Controller/ADS has permissions to see.

Type:

list[Instance]

available_ips

The list of available IPs the Controller/Instance has.

Type:

list[str]

tags

The tags related to the Controller/Instance.

Type:

list[str]

url

The URL for the Controller/Instance.

Type:

str

last_updated

The last_updated comes in as ISO format and Controller`__post_init__() converts it into a datetime object.

Type:

Union[str, datetime]

instance_id

The Controller/Instance ID tied to the Instance, default is “0”.

Type:

str

state

The state the Controller/Instance is in. See enum AMPInstanceState, default is AMPInstanceState.UNDEFINED.

Type:

AMPInstanceState

fitness

UNK.

Type:

Union[Fitness, None]

friendly_name

The Controller/Instance friendly name, default is “None”.

Type:

str

state_reason

UNK, default is “”.

Type:

str

description

Controller/Instance description, default is “”.

Type:

str

tags_list

The list of tags related to the Controller/Instance if any, default is None.

Type:

Union[list[str]]

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_info attribute.

Original Author: p0t4t0sandwich CPUInfo : https://github.com/p0t4t0sandwich/ampapi-py/blob/7a28af9b640efab329cf9ca2bf39c4112a13b287/ampapi/types.py#L151

sockets

The number of CPU sockets the AMP Instance has access to.

Type:

int

cores

The number of cores the AMP Instance has access to.

Type:

int

threads

The number of threads the AMP Instance has access to.

Type:

int

vendor

The vendor of the CPU.

Type:

str

model_name

The model name of the CPU.

Type:

str

total_cores

The number of total cores the AMP Instance has access to.

Type:

int

total_threads

The number of total threads the AMP Instance has access to.

Type:

int

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_number respects port ranges of the ADS or not.

target_ads_instance

The Target instance ID to tie this Instance to.

Type:

str

friendly_name

The Instance friendly name, this is what you see in the web GUI.

Type:

str

module

The Instance module it will use.

Type:

str

new_instance_id

UNK

Type:

str

instance_name

The name for the Instance, similar to friendly_name.

Type:

str

ip_binding

The IP to assign to the Instance. See Controller.available_ips.

Type:

str

port_number

The Port to assign to the Instance.

Type:

int

admin_username

UNK

Type:

str

admin_password

The password for the admin_username.

Type:

str

provision_settings

UNK

Type:

dict[str, str]

auto_configure

When enabled, all settings other than the module, target and friendly_name are ignored and replaced with automatically generated values

Type:

bool

post_create

The action to take after creating the instance, defaults to do_nothing

Type:

PostCreateActionsState

start_on_boot

If the instance starts on boot or not, default is False.

Type:

bool

display_image_source

If the instance has a banner to display, you can define it here, default is “”.

Type:

str

target_datastore
The Datastore ID to create this Instance on.
Type:

int

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.

description

The description of the consumes method.

Type:

str

input_type

The type of var that is provided by the User.

Type:

str

name

The name of the method.

Type:

str

value_type

The type of the value when provided.

Type:

str

enum_values

The values to be used for “input_type” if Any, default is “”.

Type:

str | dict, optional

class ampapi.dataclass.DCParameterMapping(user: str = '', reason: str = '', title: str = '', subtitle: str = '')[source]

Represents the JSON response data for parameter_mapping

user

UNK, default is “”.

Type:

str

reason

UNK, default is “”.

Type:

str

title

UNK, default is “”.

Type:

str

subtitle

UNK, default is “”.

Type:

str

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().

application_name

The Instance application name.

Type:

str

application_version

The Instance application version.

Type:

str

build_date

The date of the AMP Instance build.

Type:

str

build_spec

Similar to Diagnostics.release_stream.

Type:

str

cpu_layout

Number of Sockets, Cores and Threads eg 1S/2C/10T

Type:

str

cpu_model

The name of the CPU.

Type:

str

codename

The release/build code name.

Type:

str

installed_ram

The amount of installed ram on the system.

Type:

int

instance_id

The Instance GUID

Type:

str

last_arguments

The last used arguments when running the Instance.

Type:

str

last_executable

The last used file executable for the Instance.

Type:

str

last_process_id

The last used process ID.

Type:

int

loaded_plugins

The AMP loaded plugin’s for the Instance.

Type:

str

module

The Instance module. eg ADSModule, Minecraft, Generic

Type:

str

module_application

The Instance application.

Type:

str

network_mode

UNK

Type:

Any

platform

The machine full name of the Operating System.

Type:

str

release_stream

Mainline, Developer, etc

Type:

str

system_type

The bit type of the Instance Operating System.

Type:

str

tools_version

The version of the build tools for the Instance.

Type:

str

virtualization

If the system is using a VM or not. eg VMware

Type:

str

os

The machine Operating System.

Type:

str

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()

is_directory

If the path is a directory.

Type:

bool

is_virtual_directory

If the path is a virtual directory.

Type:

bool

filename

The name of the file or directory.

Type:

str

size_bytes

The size of the file/directory in bytes.

Type:

int

is_downloadable

If the file can be downloaded.

Type:

bool

is_editable

If the file can be edited.

Type:

bool

is_archive

If the file is an archive.

Type:

bool

is_excluded_from_backups

If the file is excluded from backups.

Type:

bool

created

The time the file/directory was created.

Type:

str | datetime

modified

The time the file/directory was last modified.

Type:

str | datetime

class ampapi.dataclass.Endpoints(display_name: str, endpoint: str, uri: str)[source]

Represents the JSON response data from ADSModule.get_application_endpoints()

display_name

The name of the endpoint.

Type:

str

endpoint

The name of the endpoint.

Type:

str

uri

The URI of the endpoint.

Type:

str

class ampapi.dataclass.FileChunk(base_64_data: str, bytes_length: int)[source]

Represents the JSON response data from FileManagerPlugin.get_file_chunk()

base_64_data

The base64 encoded string of the file chunk.

Type:

str

bytes_length

The length of the file chunk in bytes.

Type:

int

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.fitness attribute.

available

If the Instance is available to create more services or not.

Type:

bool

total_services

The total number of services running on the Instance.

Type:

int

free_ram_mb

The amount of free RAM on the Instance.

Type:

int

free_disk_mb

The amount of free disk space on the Instance.

Type:

int

cpu_service_ratio

The ratio of CPU usage to the number of services running on the Instance.

Type:

float

thread_queue_length

The length of the thread queue on the Instance.

Type:

int

load_avg

The load average on the Instance.

Type:

float

remaining_instance_slots

The number of remaining Instance slots on the License.

Type:

int

score

The score of the Instance.

Type:

float

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:

str

score_zero_factors

A list of factors that determine the score of the Instance.

Type:

list[Any]

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().

instance_id

The Instance GUID.

Type:

str

friendly_name

The friendly name of the Instance.

Type:

str

description

The description of the Instance.

Type:

str

suspended

If the Instance is suspended.

Type:

bool

exclude_from_firewall

If the Instance should be excluded from the firewall.

Type:

bool

run_in_container

If the Instance should be run in a container.

Type:

bool

container_memory

The amount of memory allocated to the container in MB.

Type:

int

container_max_cpu

The maximum amount of CPU cores allocated to the container.

Type:

str

container_image

The container/docker image to use.

Type:

str

memory_policy

The memory policy of the Instance, default is ContainerMemoryPolicyState.reserve.

Type:

ContainerMemoryPolicyState

start_on_boot

If the Instance should start on boot, default is False.

Type:

bool

welcome_message

The welcome message of the Instance, default is None.

Type:

str

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 from ADSModule.get_instances().

application_endpoints

The list of application endpoints for the Instance.

Type:

list[dict[str, str]]

app_state

The state of the application.

Type:

AMPInstanceState

container_memory_mb

The amount of memory allocated to the container in MB.

Type:

int

container_memory_policy

The memory policy of the Instance.

Type:

ContainerMemoryPolicyState

daemon

If the Instance is a daemon.

Type:

bool

daemon_autostart

If the Instance should be autostart on boot.

Type:

bool

deployment_args

The deployment arguments of the Instance.

Type:

dict[str, str]

disk_usage_mb

The disk usage of the Instance in MB.

Type:

int

exclude_from_firewall

If the Instance should be excluded from the firewall.

Type:

bool

friendly_name

The friendly name of the Instance.

Type:

str

ip

The IP address of the Instance.

Type:

str

instance_id

The Instance GUID.

Type:

str

instance_name

The Instance name.

Type:

str

is_container_instance

If the Instance is a container instance.

Type:

bool

is_https

If the Instance is using HTTPS.

Type:

bool

management_mode

The management mode of the Instance.

Type:

int

module

The module of the Instance.

Type:

str

port

The port of the Instance.

Type:

str

release_stream

The release stream of the Instance.

Type:

int

running

If the Instance is running.

Type:

bool

suspended

If the Instance is suspended.

Type:

bool

target_id

The target ID of the Instance.

Type:

str

amp_version

The version of the AMP, default is None.

Type:

Union[str, dict, AMPVersionInfo, None]

container_cpus

The amount of CPU cores allocated to the container, default is 0.0.

Type:

float

tags

The list of tags of the Instance, default is None.

Type:

Union[None, list]

module_display_name

The display name of the module, default is “”.

Type:

str

metrics

The metrics of the Instance, default is None.

Type:

Union[Metric, None]

display_image_source

The source of the display image, default is “”.

Type:

str

description

The description of the Instance, default is “”.

Type:

str

static online(func: Callable[Concatenate[D, T], Coroutine[None, None, F]]) Callable[Concatenate[D, T], Coroutine[None, None, F]][source]

Checks the running property and raises ConnectionError if 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().

instance_id

The Instance ID.

Type:

str

running

Whether the Instance is running.

Type:

bool

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.

success

Whether the login was successful.

Type:

bool

result

The result code.

Type:

int

permissions

A list of permissions, defaults to [].

Type:

list[str], optional

result_reason

The result reason, defaults to “”.

Type:

str, optional

session_id

The session ID, defaults to “”.

Type:

str, optional

remember_me_token

The remember me token, defaults to “”.

Type:

str, optional

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 LoginResults along with representing the JSON response from the function :meth`~Core.get_amp_users_summary`

id

The user ID.

Type:

str

username

The username.

Type:

str

is_two_factor_enabled

If the user has 2FA enabled.

Type:

bool

disabled

If the user is disabled.

Type:

bool

gravatar_hash

The gravatar hash.

Type:

str

is_ldap_user

If the user is a LDAP user.

Type:

bool

last_login

The last login date.

Type:

datetime

email_address

The email address, defaults to “” if not set.

Type:

str, optional

class ampapi.dataclass.MCUser(name: str, uuid: str)[source]

Represents the JSON response data from MinecraftModule.mc_get_whitelist().

name

The username.

Type:

str

uuid

The Minecraft UUID.

Type:

str

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

age_minutes

The age of the message in minutes.

Type:

int

expired

Whether the message has expired.

Type:

bool

id

The message ID.

Type:

str

message

The message.

Type:

str

source

The source of the message.

Type:

str

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.

id

The method ID.

Type:

str

name

The method name.

Type:

str

description

The method description.

Type:

str

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.metrics and Instance.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.

raw_value

The raw value.

Type:

int

max_value

The max value.

Type:

int

percent

The percent.

Type:

int

units

The unit of measurement.

Type:

str

color

Color number 1 if applicable..

Type:

Union[None, str]

color2

Color number 2 if applicable.

Type:

Union[None, str]

color3

Color number 3 if applicable.

Type:

Union[None, str]

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()

amp_build

The AMP build.

Type:

str

amp_version

The AMP version.

Type:

str

api_version

The API version.

Type:

str

allow_remember_me

Whether remember me is allowed.

Type:

bool

analytics

Whether analytics is enabled.

Type:

bool

app_name

The app name.

Type:

str

author

The author.

Type:

str

base_port

The base port.

Type:

int

branding

The branding data.

Type:

dict

build_spec

The build spec.

Type:

str

display_base_uri

The display base uri.

Type:

str

end_point_ur

The end point uri.

Type:

str

feature_set

The feature set.

Type:

list

friendly_name

The friendly name.

Type:

str

instance_id

The instance id.

Type:

str

instance_name

The instance name.

Type:

str

is_remote_instance

Whether the instance is remote.

Type:

bool

loaded_plugins

A list of loaded plugins.

Type:

list[str]

module_name

The module name.

Type:

str

name

The full name.

Type:

str

primary_endpoint

The primary endpoint.

Type:

str

requires_full_load

Whether the instance requires full load.

Type:

bool

supports_sleep

Whether the instance supports sleep.

Type:

bool

timestamp

The current timestamp.

Type:

str

tools_version

The tools version.

Type:

str

version_codename

The version codename.

Type:

str

class ampapi.dataclass.OPList(level: int, name: str, uuid: str)[source]

Represents the JSON response data from MinecraftModule.get_op_whitelist().

level

The level of the operator user.

Type:

int

name

The name of the user.

Type:

str

uuid

The UUID of the user.

Type:

str

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.

cpu_info

The CPU information.

Type:

CPUInfo

installed_ram_mb

The installed RAM in MB of the system.

Type:

int

os

The system operating system.

Type:

int

platform_name

The platform name.

Type:

str

system_type

The system type.

Type:

int

virtualization

The virtualization.

Type:

int

is_shared_setup

Whether the instance is shared setup.

Type:

bool

admin_rights

The admin rights level.

Type:

int

hardware_platform_name

The hardware platform name.

Type:

str

installed_glibc_version

The installed glibc version.

Type:

str

class ampapi.dataclass.Player(uuid: str = '', name: str = '')[source]

Represents a single player connected to a server.

uuid

The UUID of the player.

Type:

str

name

The name of the player.

Type:

str

uuid: str

Alias for field number 0

name: str

Alias for field number 1

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.

sorted

A sorted list of Player objects by name.

Type:

list[Player]

get_player(name_or_uuid: str) list[Player][source]

Search for a player by their name or UUID.

Parameters:

name_or_uuid (str) – The players name or UUID.

Returns:

A list of Player objects matching the search string.

Return type:

list[Player]

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.ports and the JSON response data from Core.get_port_summaries().

listening

Whether the port is listening.

Type:

bool

name

The name of the port.

Type:

str

port

The port number.

Type:

int

protocol

The protocol number.

Type:

int

required

Whether the port is required.

Type:

bool

is_delayed_open

Whether the port is delayed open.

Type:

bool

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().

available

Whether the instance is available.

Type:

bool

cpu_service_ratio

The CPU service ratio.

Type:

float

free_disk_mb

The free disk in MB.

Type:

int

free_ram_mb

The free RAM in MB.

Type:

int

load_avg

The load average.

Type:

float

remaining_instance_slots

The remaining instance slots.

Type:

int

score

The score.

Type:

float

thread_queue_length

The thread queue length.

Type:

int

total_services

The total services.

Type:

int

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().

default_value

The default value.

Type:

str

description

The description.

Type:

str

endpoint_name

The endpoint name.

Type:

str

node

The node.

Type:

str

type

The type.

Type:

str

value_range

The value range.

Type:

Union[int, str]

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().

description

The description.

Type:

str

us_user_defined

Whether the port is user defined.

Type:

bool

port_number

The port number.

Type:

int

protocol

The protocol number.

Type:

int

provision_node_name

The provision node name.

Type:

str

range

The range.

Type:

int

verified

Whether the port is verified.

Type:

bool

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:

PlatformInfo

datastores

The datastores.

Type:

list[InstanceDatastore]

deploys_in_containers
Type:

bool

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().

id

The ID of the AMP role.

Type:

str

is_default

If the AMP role is the default role or not.

Type:

bool

name

The name of the AMP role.

Type:

str

description

The description of the AMP role.

Type:

str

hidden

If the AMP role is hidden or not.

Type:

bool

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]

is_instance_specific

If the AMP role is only for a specific instance or not.

Type:

bool

is_common_role

If the AMP role is common or not.

Type:

bool

disable_edits

If the AMP role can be edited by users with the role or not.

Type:

bool

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.

is_primary_task

If the task is the primary task or not.

Type:

bool

start_time

The start time of the task.

Type:

str

id

The ID of the task.

Type:

str

name

The name of the task.

Type:

str

description

The description of the task.

Type:

str

hide_from_ui

If the task is hidden from the UI or not.

Type:

bool

fast_dismiss

If the task is fast dismiss or not.

Type:

bool

last_update_pushed

The last update pushed of the task.

Type:

str

progress_percent

The progress percent of the task.

Type:

float

is_cancellable

If the task is cancellable or not.

Type:

bool

origin

The origin of the task.

Type:

str

is_indeterminate

If the task is indeterminate or not.

Type:

bool

state

The state of the task.

Type:

int

status

The status of the task.

Type:

str

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().

available_methods

The available methods.

Type:

list[Methods]

available_triggers

The available triggers.

Type:

list[Triggers]

populated_triggers

The populated triggers.

Type:

list[Triggers]

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().

source

The source of the session.

Type:

str

session_id

The ID of the session.

Type:

str

username

The username the session belongs to.

Type:

str

session_type

The type of the session.

Type:

str

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() or Core.get_configs().

These represent a single setting field in the Instance configuration UI.

category

Which category the setting will appear under in the Instance configuration UI.

Type:

str

actions

The list of actions related to the setting, defaults to an empty list.

Type:

list[SettingSpecAction]

always_allow_read

If the setting should always allow read or not.

Type:

bool

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 “”.

Type:

Union[list, str, bool, int, dict, SettingSpecTableAliases]

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

enum_values_are_deferred

UNK, default is False.

Type:

bool

input_type

The type of input to expect for the setting field, default is None.

Type:

str, optional

is_provision_spec

if the setting is also a provision spec, default is False.

Type:

bool

keywords

UNK, default is “”.

Type:

str

max_length

UNK, all fields are 0 in data, default is 0.

Type:

int

min_value

UNK, all fields are null in data, default is None.

Type:

None

meta

UNK, all fields are “”, default is “”.

Type:

str

name

The name of the setting.

Type:

str

node

The node required to have to edit this setting, default is “”.

Type:

str

order

The order in which this setting will appear in the UI, default is 1.

Type:

int

placeholder

The placeholder text for the setting field, default is “”.

Type:

str

read_only

If the setting is read only or not, default is False.

Type:

bool

read_only_provision

UNK, all fields are False in data, default is False.

Type:

bool

required

If the setting is required or not, default is False.

Type:

bool

requires_restart

If the setting requires the Instance or Server to be restarted, default is False.

Type:

bool

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:

str

suffix

The suffix applied to the string current_value, default is “”.

Type:

str

tag

What the setting is related to, similar to a Server Config property or file, default is “”.

Type:

str

val_type

What the type is of the current_value, default is “”.

Type:

str

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.

argument

The argument of the action.

Type:

str

caption

The caption of the action.

Type:

str

is_client_side

If the action is client side or not.

Type:

bool

method

The method of the action, these relate to API Endpoints when combined with the module.

Type:

str

module

The module the action belongs to.

Type:

str

type_id

The type id of the action.

Type:

str

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.

key_name

The name of the key.

Type:

str

key_placeholder

The placeholder text for the key.

Type:

str

type_id

The type id of the key.

Type:

str

value_name

The name of the value.

Type:

str

value_placeholder

The placeholder text for the value.

Type:

str

read_only_keys

If the key is read only or not.

Type:

bool

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.

deferred

If the selection source is deferred or not.

Type:

bool

must_validate

If the selection source must validate or not.

Type:

bool

type_id

The type id of the selection source.

Type:

str

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

uptime

The up time of the Instance, in Days, Hours, Minutes, Seconds format. 00:00:00:00

Type:

str

metrics

The Metrics data related to the Instance if any, default is None.

Type:

Union[Metric, None]

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:

int

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_username is 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_username is 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

extra_provision_settings

A dictionary of setting nodes and values to create the new instance with. Identical in function to the provisioning arguments in the template itself. Default is None.

Type:

Union[dict[str, str], None]

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().

description

The description of the trigger, this is shown in the UI.

Type:

str

enabled_state

If the Timed Trigger is enabled or not.

Type:

bool

id

The ID of the Timed Trigger, these are unique per Instance.

Type:

str

match_days

The days of the week to match, starting at 0 for Monday.

Type:

list[int]

match_days_of_month

The days of the month to match.

Type:

list[int]

match_hours

The hours of the day to match.

Type:

list[int]

match_minutes

The minutes of the hour to match.

Type:

list[int]

match_months

The months to match.

Type:

list[int]

name

The name of the Timed Trigger, this is shown in the UI.

Type:

str

order

The order in which this trigger will appear in the Event list.

Type:

int

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_triggers and ScheduleData.populated_triggers.

Note

The Triggers.id is unique per Instance.

enabled_state

If the trigger is enabled or not.

Type:

int

tasks

The list of tasks associated with this trigger, default is an empty list.

Type:

list[TriggerTasks], optional

id

The ID of the trigger, these are unique per Instance.

Type:

str

type

The type of trigger, typically a TimeIntervalTrigger or EventTrigger.

Type:

str

description

The description of the trigger.

Type:

str

trigger_type

The same as Triggers.type.

Type:

str

emits

The parameters the trigger emits to the Event allowing usage in the trigger, default is an empty list.

Type:

list[str], optional

last_execute_error

If the last execution of the trigger resulted in an error or not, default is False.

Type:

bool, optional

last_error_reason

The reason the last execution of the trigger resulted in an error, default is “”.

Type:

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.

id

The ID of the task, these are unique per Instance.

Type:

str

task_method_name

The name of the task method.

Type:

str

parameter_mapping

The parameter mapping for the task.

Type:

DCParameterMapping

enabled_state

If the task is enabled or not.

Type:

int

locked

If the task is locked or not.

Type:

bool

created_by

The user that created the task.

Type:

str

order

The order in which this task will appear in the list of tasks.

Type:

int

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().

update_available

If an update is available or not.

Type:

bool

release_notes_url

The URL to the release notes for the update.

Type:

str

build

The build of the update.

Type:

str

version

The version of the update.

Type:

str

tools_version

The tools version of the update, default is None.

Type:

str

patch_only

If the update is a patch only update or not, default is None

Type:

bool

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]

status

The status of the Server.

Type:

Status

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() or Core.get_amp_user_info()

cannot_change_password

If the user cannot change their password or not.

Type:

bool

disable

If the user is disabled or not.

Type:

bool

gravatar_hash

The gravatar hash of the user.

Type:

str

id

The ID of the user.

Type:

str

is_ldap_user

If the user is an LDAP user or not.

Type:

bool

is_super_user

If the user has the Super User role or not.

Type:

bool

is_two_factor_enabled

If the user has 2FA enabled or not.

Type:

bool

must_change_password

If the user must change their password or not when they log in next.

Type:

bool

name

The name of the user.

Type:

str

password_expires

If the user password expires or not when they log in next.

Type:

bool

permissions

The list of permissions the user has.

Type:

list[str]

roles

The list of AMP roles the user has.

Type:

list[str]

email_address

The email address of the user.

Type:

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.build

Note

  • Currently has a converter function v2.6.0.0

  • __repr__ has been overridden to display in a joined string with build at the end.

major

The major version number of the AMP build.

Type:

int

minor

The minor version number of the AMP build.

Type:

int

revision

The revision number of the AMP build.

Type:

int

minor_revision

The minor revision number of the AMP build.

Type:

int

build

The build number, defaults to None.

Type:

Union[int, None]

classmethod to_dataclass(data: str, sep: str = '.') str | VersionInfo[source]

Parse a string type of the Version into a dataclass.

Note

Assumes structure is "2.6.0.0"

Parameters:
  • data (str) – The string type of the Version to parse.

  • sep (str) – The separator to split the string by.

Returns:

Returns the built dataclass if it succeeds. Otherwise you will get the data passed in back.

Return type:

str | AMPVersionInfo

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_role to the users of this template.

Type:

bool

description

The description of the deployment template.

Type:

str

id

The ID of the deployment template.

Type:

int

module

The AMP Instance module type. eg. “Generic”, “Minecraft”

Type:

str

name

The deployment template name.

Type:

str

template_base_app

The application that is template is used for.

Type:

str

template_instance

UNK

Type:

Any

template_role

The template role name, similar to the AMP User Roles.

Type:

str

match_datastore_tags

To force match the datastore tags; if any.

Type:

bool

settings_mappings

A dictionary of setting mappings.

Type:

dict[str, str]

start_on_boot

If the Instance should start on ADS01/Controller boot or not, default is False.

Type:

bool

tags

The list of tags to assign to the template or that belong to the template.

Type:

list[str]

zip_overlay_path

To zip the overlay path.

Type:

bool

to_dict() dict[str, Any][source]

As the function name implies; converts the class to a dict.

Returns:

Returns the class attributes in a key, value paired dict.

Return type:

dict[str, Any]

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 AMPInstance Trigger ID will be returned.