Пример #1
0
env = Environment(connection=conn)

# get list of all applications or those just loaded
all_applications = env.list_applications()
loaded_applications = env.list_loaded_applications()

# get application with a given name
app = Application(connection=conn, name="MicroStrategy Tutorial")
# idle/resume an application on a given node(s) (name(s) of existing node(s)
# should be used)
app.idle(on_nodes=["node1"])
app.resume(on_nodes="node1")
# unload/load an application from/to a given node(s) (name(s) of existing
# node(s) should be used)
app.unload(on_nodes="node1")
app.load(on_nodes="node1")

# get settings of an application as a dataframe
app_settings_df = app.settings.to_dataframe

# create an application and store it in variable to have immediate access to it
new_app = env.create_application(name="Demo Application 1",
                                 description="some description")
# change description of a newly created application
new_app.alter(
    description=
    "This application is used to present creation of an application as a demo")

# compare settings of 2 applications (only differences will be stored into
# a DataFrame)
app1 = Application(connection=conn, name="Consolidated Education Project")
Пример #2
0
# names of service or nodes)
clstr.stop(service='Apache-Kafka',
           nodes=['env-xxxxxxlaio1use1', 'env-xxxxxxlaio2use1'])
clstr.start(service='Apache-Kafka',
            nodes=['env-xxxxxxlaio1use1', 'env-xxxxxxlaio2use1'])

env = Environment(connection=conn)
# list all applications available for the given connection (it is possible via
# class Cluster or Environment)
apps = env.list_applications()
apps = clstr.list_applications()

# load or unload chosen application (it is possible via class Cluster or
# Application)
app = Application(connection=conn, name='MicroStrategy Tutorial')
app.load()
app.unload()

# via Cluster can we also specify on which node(s) application will be loaded
# or unloaded
clstr.load_application(application_name='MicroStrategy Tutorial',
                       on_nodes=['env-xxxxxxlaio1use1', 'env-xxxxxxlaio2use1'])
clstr.unload_application(
    application_name='MicroStrategy Tutorial',
    on_nodes=['env-xxxxxxlaio1use1', 'env-xxxxxxlaio2use1'])

# get settings of a server as a dataframe
server_settings_df = env.server_settings.to_dataframe

# save/load settings of a server to/from a file (format can be 'csv', 'json' or
# 'pickle')